2578 lines
2.8 MiB
2578 lines
2.8 MiB
var mZ=Object.defineProperty;var vZ=(e,t,r)=>t in e?mZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var yn=(e,t,r)=>vZ(e,typeof t!="symbol"?t+"":t,r);function yZ(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const o in n)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(n,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>n[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();var h1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function un(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kj={exports:{}},oy={},_j={exports:{}},Wr={};/**
|
||
* @license React
|
||
* react.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var NO;function xZ(){if(NO)return Wr;NO=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.iterator;function h(B){return B===null||typeof B!="object"?null:(B=f&&B[f]||B["@@iterator"],typeof B=="function"?B:null)}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,m={};function x(B,M,$){this.props=B,this.context=M,this.refs=m,this.updater=$||p}x.prototype.isReactComponent={},x.prototype.setState=function(B,M){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,M,"setState")},x.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function b(){}b.prototype=x.prototype;function w(B,M,$){this.props=B,this.context=M,this.refs=m,this.updater=$||p}var k=w.prototype=new b;k.constructor=w,y(k,x.prototype),k.isPureReactComponent=!0;var S=Array.isArray,_=Object.prototype.hasOwnProperty,P={current:null},O={key:!0,ref:!0,__self:!0,__source:!0};function T(B,M,$){var q,Y={},K=null,G=null;if(M!=null)for(q in M.ref!==void 0&&(G=M.ref),M.key!==void 0&&(K=""+M.key),M)_.call(M,q)&&!O.hasOwnProperty(q)&&(Y[q]=M[q]);var re=arguments.length-2;if(re===1)Y.children=$;else if(1<re){for(var J=Array(re),ae=0;ae<re;ae++)J[ae]=arguments[ae+2];Y.children=J}if(B&&B.defaultProps)for(q in re=B.defaultProps,re)Y[q]===void 0&&(Y[q]=re[q]);return{$$typeof:e,type:B,key:K,ref:G,props:Y,_owner:P.current}}function R(B,M){return{$$typeof:e,type:B.type,key:M,ref:B.ref,props:B.props,_owner:B._owner}}function I(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function E(B){var M={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function($){return M[$]})}var A=/\/+/g;function F(B,M){return typeof B=="object"&&B!==null&&B.key!=null?E(""+B.key):M.toString(36)}function L(B,M,$,q,Y){var K=typeof B;(K==="undefined"||K==="boolean")&&(B=null);var G=!1;if(B===null)G=!0;else switch(K){case"string":case"number":G=!0;break;case"object":switch(B.$$typeof){case e:case t:G=!0}}if(G)return G=B,Y=Y(G),B=q===""?"."+F(G,0):q,S(Y)?($="",B!=null&&($=B.replace(A,"$&/")+"/"),L(Y,M,$,"",function(ae){return ae})):Y!=null&&(I(Y)&&(Y=R(Y,$+(!Y.key||G&&G.key===Y.key?"":(""+Y.key).replace(A,"$&/")+"/")+B)),M.push(Y)),1;if(G=0,q=q===""?".":q+":",S(B))for(var re=0;re<B.length;re++){K=B[re];var J=q+F(K,re);G+=L(K,M,$,J,Y)}else if(J=h(B),typeof J=="function")for(B=J.call(B),re=0;!(K=B.next()).done;)K=K.value,J=q+F(K,re++),G+=L(K,M,$,J,Y);else if(K==="object")throw M=String(B),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.");return G}function z(B,M,$){if(B==null)return B;var q=[],Y=0;return L(B,q,"","",function(K){return M.call($,K,Y++)}),q}function V(B){if(B._status===-1){var M=B._result;M=M(),M.then(function($){(B._status===0||B._status===-1)&&(B._status=1,B._result=$)},function($){(B._status===0||B._status===-1)&&(B._status=2,B._result=$)}),B._status===-1&&(B._status=0,B._result=M)}if(B._status===1)return B._result.default;throw B._result}var Q={current:null},U={transition:null},ee={ReactCurrentDispatcher:Q,ReactCurrentBatchConfig:U,ReactCurrentOwner:P};function H(){throw Error("act(...) is not supported in production builds of React.")}return Wr.Children={map:z,forEach:function(B,M,$){z(B,function(){M.apply(this,arguments)},$)},count:function(B){var M=0;return z(B,function(){M++}),M},toArray:function(B){return z(B,function(M){return M})||[]},only:function(B){if(!I(B))throw Error("React.Children.only expected to receive a single React element child.");return B}},Wr.Component=x,Wr.Fragment=r,Wr.Profiler=o,Wr.PureComponent=w,Wr.StrictMode=n,Wr.Suspense=c,Wr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,Wr.act=H,Wr.cloneElement=function(B,M,$){if(B==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+B+".");var q=y({},B.props),Y=B.key,K=B.ref,G=B._owner;if(M!=null){if(M.ref!==void 0&&(K=M.ref,G=P.current),M.key!==void 0&&(Y=""+M.key),B.type&&B.type.defaultProps)var re=B.type.defaultProps;for(J in M)_.call(M,J)&&!O.hasOwnProperty(J)&&(q[J]=M[J]===void 0&&re!==void 0?re[J]:M[J])}var J=arguments.length-2;if(J===1)q.children=$;else if(1<J){re=Array(J);for(var ae=0;ae<J;ae++)re[ae]=arguments[ae+2];q.children=re}return{$$typeof:e,type:B.type,key:Y,ref:K,props:q,_owner:G}},Wr.createContext=function(B){return B={$$typeof:s,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},B.Provider={$$typeof:a,_context:B},B.Consumer=B},Wr.createElement=T,Wr.createFactory=function(B){var M=T.bind(null,B);return M.type=B,M},Wr.createRef=function(){return{current:null}},Wr.forwardRef=function(B){return{$$typeof:l,render:B}},Wr.isValidElement=I,Wr.lazy=function(B){return{$$typeof:d,_payload:{_status:-1,_result:B},_init:V}},Wr.memo=function(B,M){return{$$typeof:u,type:B,compare:M===void 0?null:M}},Wr.startTransition=function(B){var M=U.transition;U.transition={};try{B()}finally{U.transition=M}},Wr.unstable_act=H,Wr.useCallback=function(B,M){return Q.current.useCallback(B,M)},Wr.useContext=function(B){return Q.current.useContext(B)},Wr.useDebugValue=function(){},Wr.useDeferredValue=function(B){return Q.current.useDeferredValue(B)},Wr.useEffect=function(B,M){return Q.current.useEffect(B,M)},Wr.useId=function(){return Q.current.useId()},Wr.useImperativeHandle=function(B,M,$){return Q.current.useImperativeHandle(B,M,$)},Wr.useInsertionEffect=function(B,M){return Q.current.useInsertionEffect(B,M)},Wr.useLayoutEffect=function(B,M){return Q.current.useLayoutEffect(B,M)},Wr.useMemo=function(B,M){return Q.current.useMemo(B,M)},Wr.useReducer=function(B,M,$){return Q.current.useReducer(B,M,$)},Wr.useRef=function(B){return Q.current.useRef(B)},Wr.useState=function(B){return Q.current.useState(B)},Wr.useSyncExternalStore=function(B,M,$){return Q.current.useSyncExternalStore(B,M,$)},Wr.useTransition=function(){return Q.current.useTransition()},Wr.version="18.3.1",Wr}var RO;function _w(){return RO||(RO=1,_j.exports=xZ()),_j.exports}/**
|
||
* @license React
|
||
* react-jsx-runtime.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var LO;function bZ(){if(LO)return oy;LO=1;var e=_w(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(l,c,u){var d,f={},h=null,p=null;u!==void 0&&(h=""+u),c.key!==void 0&&(h=""+c.key),c.ref!==void 0&&(p=c.ref);for(d in c)n.call(c,d)&&!a.hasOwnProperty(d)&&(f[d]=c[d]);if(l&&l.defaultProps)for(d in c=l.defaultProps,c)f[d]===void 0&&(f[d]=c[d]);return{$$typeof:t,type:l,key:h,ref:p,props:f,_owner:o.current}}return oy.Fragment=r,oy.jsx=s,oy.jsxs=s,oy}var FO;function wZ(){return FO||(FO=1,kj.exports=bZ()),kj.exports}var i=wZ(),g1={},Cj={exports:{}},ns={},Ej={exports:{}},Aj={};/**
|
||
* @license React
|
||
* scheduler.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var MO;function SZ(){return MO||(MO=1,(function(e){function t(U,ee){var H=U.length;U.push(ee);e:for(;0<H;){var B=H-1>>>1,M=U[B];if(0<o(M,ee))U[B]=ee,U[H]=M,H=B;else break e}}function r(U){return U.length===0?null:U[0]}function n(U){if(U.length===0)return null;var ee=U[0],H=U.pop();if(H!==ee){U[0]=H;e:for(var B=0,M=U.length,$=M>>>1;B<$;){var q=2*(B+1)-1,Y=U[q],K=q+1,G=U[K];if(0>o(Y,H))K<M&&0>o(G,Y)?(U[B]=G,U[K]=H,B=K):(U[B]=Y,U[q]=H,B=q);else if(K<M&&0>o(G,H))U[B]=G,U[K]=H,B=K;else break e}}return ee}function o(U,ee){var H=U.sortIndex-ee.sortIndex;return H!==0?H:U.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,y=!1,m=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(U){for(var ee=r(u);ee!==null;){if(ee.callback===null)n(u);else if(ee.startTime<=U)n(u),ee.sortIndex=ee.expirationTime,t(c,ee);else break;ee=r(u)}}function S(U){if(m=!1,k(U),!y)if(r(c)!==null)y=!0,V(_);else{var ee=r(u);ee!==null&&Q(S,ee.startTime-U)}}function _(U,ee){y=!1,m&&(m=!1,b(T),T=-1),p=!0;var H=h;try{for(k(ee),f=r(c);f!==null&&(!(f.expirationTime>ee)||U&&!E());){var B=f.callback;if(typeof B=="function"){f.callback=null,h=f.priorityLevel;var M=B(f.expirationTime<=ee);ee=e.unstable_now(),typeof M=="function"?f.callback=M:f===r(c)&&n(c),k(ee)}else n(c);f=r(c)}if(f!==null)var $=!0;else{var q=r(u);q!==null&&Q(S,q.startTime-ee),$=!1}return $}finally{f=null,h=H,p=!1}}var P=!1,O=null,T=-1,R=5,I=-1;function E(){return!(e.unstable_now()-I<R)}function A(){if(O!==null){var U=e.unstable_now();I=U;var ee=!0;try{ee=O(!0,U)}finally{ee?F():(P=!1,O=null)}}else P=!1}var F;if(typeof w=="function")F=function(){w(A)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,z=L.port2;L.port1.onmessage=A,F=function(){z.postMessage(null)}}else F=function(){x(A,0)};function V(U){O=U,P||(P=!0,F())}function Q(U,ee){T=x(function(){U(e.unstable_now())},ee)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(U){U.callback=null},e.unstable_continueExecution=function(){y||p||(y=!0,V(_))},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(U){switch(h){case 1:case 2:case 3:var ee=3;break;default:ee=h}var H=h;h=ee;try{return U()}finally{h=H}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(U,ee){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var H=h;h=U;try{return ee()}finally{h=H}},e.unstable_scheduleCallback=function(U,ee,H){var B=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?B+H:B):H=B,U){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=H+M,U={id:d++,callback:ee,priorityLevel:U,startTime:H,expirationTime:M,sortIndex:-1},H>B?(U.sortIndex=H,t(u,U),r(c)===null&&U===r(u)&&(m?(b(T),T=-1):m=!0,Q(S,H-B))):(U.sortIndex=M,t(c,U),y||p||(y=!0,V(_))),U},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(U){var ee=h;return function(){var H=h;h=ee;try{return U.apply(this,arguments)}finally{h=H}}}})(Aj)),Aj}var DO;function jZ(){return DO||(DO=1,Ej.exports=SZ()),Ej.exports}/**
|
||
* @license React
|
||
* react-dom.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var zO;function kZ(){if(zO)return ns;zO=1;var e=_w(),t=jZ();function r(g){for(var v="https://reactjs.org/docs/error-decoder.html?invariant="+g,C=1;C<arguments.length;C++)v+="&args[]="+encodeURIComponent(arguments[C]);return"Minified React error #"+g+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,o={};function a(g,v){s(g,v),s(g+"Capture",v)}function s(g,v){for(o[g]=v,g=0;g<v.length;g++)n.add(v[g])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,u=/^[: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]*$/,d={},f={};function h(g){return c.call(f,g)?!0:c.call(d,g)?!1:u.test(g)?f[g]=!0:(d[g]=!0,!1)}function p(g,v,C,D){if(C!==null&&C.type===0)return!1;switch(typeof v){case"function":case"symbol":return!0;case"boolean":return D?!1:C!==null?!C.acceptsBooleans:(g=g.toLowerCase().slice(0,5),g!=="data-"&&g!=="aria-");default:return!1}}function y(g,v,C,D){if(v===null||typeof v>"u"||p(g,v,C,D))return!0;if(D)return!1;if(C!==null)switch(C.type){case 3:return!v;case 4:return v===!1;case 5:return isNaN(v);case 6:return isNaN(v)||1>v}return!1}function m(g,v,C,D,Z,ne,he){this.acceptsBooleans=v===2||v===3||v===4,this.attributeName=D,this.attributeNamespace=Z,this.mustUseProperty=C,this.propertyName=g,this.type=v,this.sanitizeURL=ne,this.removeEmptyString=he}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(g){x[g]=new m(g,0,!1,g,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(g){var v=g[0];x[v]=new m(v,1,!1,g[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(g){x[g]=new m(g,2,!1,g.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(g){x[g]=new m(g,2,!1,g,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(g){x[g]=new m(g,3,!1,g.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(g){x[g]=new m(g,3,!0,g,null,!1,!1)}),["capture","download"].forEach(function(g){x[g]=new m(g,4,!1,g,null,!1,!1)}),["cols","rows","size","span"].forEach(function(g){x[g]=new m(g,6,!1,g,null,!1,!1)}),["rowSpan","start"].forEach(function(g){x[g]=new m(g,5,!1,g.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function w(g){return g[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(g){var v=g.replace(b,w);x[v]=new m(v,1,!1,g,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(g){var v=g.replace(b,w);x[v]=new m(v,1,!1,g,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(g){var v=g.replace(b,w);x[v]=new m(v,1,!1,g,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(g){x[g]=new m(g,1,!1,g.toLowerCase(),null,!1,!1)}),x.xlinkHref=new m("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(g){x[g]=new m(g,1,!1,g.toLowerCase(),null,!0,!0)});function k(g,v,C,D){var Z=x.hasOwnProperty(v)?x[v]:null;(Z!==null?Z.type!==0:D||!(2<v.length)||v[0]!=="o"&&v[0]!=="O"||v[1]!=="n"&&v[1]!=="N")&&(y(v,C,Z,D)&&(C=null),D||Z===null?h(v)&&(C===null?g.removeAttribute(v):g.setAttribute(v,""+C)):Z.mustUseProperty?g[Z.propertyName]=C===null?Z.type===3?!1:"":C:(v=Z.attributeName,D=Z.attributeNamespace,C===null?g.removeAttribute(v):(Z=Z.type,C=Z===3||Z===4&&C===!0?"":""+C,D?g.setAttributeNS(D,v,C):g.setAttribute(v,C))))}var S=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_=Symbol.for("react.element"),P=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),E=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),Q=Symbol.for("react.offscreen"),U=Symbol.iterator;function ee(g){return g===null||typeof g!="object"?null:(g=U&&g[U]||g["@@iterator"],typeof g=="function"?g:null)}var H=Object.assign,B;function M(g){if(B===void 0)try{throw Error()}catch(C){var v=C.stack.trim().match(/\n( *(at )?)/);B=v&&v[1]||""}return`
|
||
`+B+g}var $=!1;function q(g,v){if(!g||$)return"";$=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(v)if(v=function(){throw Error()},Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[])}catch(ut){var D=ut}Reflect.construct(g,[],v)}else{try{v.call()}catch(ut){D=ut}g.call(v.prototype)}else{try{throw Error()}catch(ut){D=ut}g()}}catch(ut){if(ut&&D&&typeof ut.stack=="string"){for(var Z=ut.stack.split(`
|
||
`),ne=D.stack.split(`
|
||
`),he=Z.length-1,Re=ne.length-1;1<=he&&0<=Re&&Z[he]!==ne[Re];)Re--;for(;1<=he&&0<=Re;he--,Re--)if(Z[he]!==ne[Re]){if(he!==1||Re!==1)do if(he--,Re--,0>Re||Z[he]!==ne[Re]){var Ue=`
|
||
`+Z[he].replace(" at new "," at ");return g.displayName&&Ue.includes("<anonymous>")&&(Ue=Ue.replace("<anonymous>",g.displayName)),Ue}while(1<=he&&0<=Re);break}}}finally{$=!1,Error.prepareStackTrace=C}return(g=g?g.displayName||g.name:"")?M(g):""}function Y(g){switch(g.tag){case 5:return M(g.type);case 16:return M("Lazy");case 13:return M("Suspense");case 19:return M("SuspenseList");case 0:case 2:case 15:return g=q(g.type,!1),g;case 11:return g=q(g.type.render,!1),g;case 1:return g=q(g.type,!0),g;default:return""}}function K(g){if(g==null)return null;if(typeof g=="function")return g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case O:return"Fragment";case P:return"Portal";case R:return"Profiler";case T:return"StrictMode";case F:return"Suspense";case L:return"SuspenseList"}if(typeof g=="object")switch(g.$$typeof){case E:return(g.displayName||"Context")+".Consumer";case I:return(g._context.displayName||"Context")+".Provider";case A:var v=g.render;return g=g.displayName,g||(g=v.displayName||v.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case z:return v=g.displayName||null,v!==null?v:K(g.type)||"Memo";case V:v=g._payload,g=g._init;try{return K(g(v))}catch{}}return null}function G(g){var v=g.type;switch(g.tag){case 24:return"Cache";case 9:return(v.displayName||"Context")+".Consumer";case 10:return(v._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return g=v.render,g=g.displayName||g.name||"",v.displayName||(g!==""?"ForwardRef("+g+")":"ForwardRef");case 7:return"Fragment";case 5:return v;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return K(v);case 8:return v===T?"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 v=="function")return v.displayName||v.name||null;if(typeof v=="string")return v}return null}function re(g){switch(typeof g){case"boolean":case"number":case"string":case"undefined":return g;case"object":return g;default:return""}}function J(g){var v=g.type;return(g=g.nodeName)&&g.toLowerCase()==="input"&&(v==="checkbox"||v==="radio")}function ae(g){var v=J(g)?"checked":"value",C=Object.getOwnPropertyDescriptor(g.constructor.prototype,v),D=""+g[v];if(!g.hasOwnProperty(v)&&typeof C<"u"&&typeof C.get=="function"&&typeof C.set=="function"){var Z=C.get,ne=C.set;return Object.defineProperty(g,v,{configurable:!0,get:function(){return Z.call(this)},set:function(he){D=""+he,ne.call(this,he)}}),Object.defineProperty(g,v,{enumerable:C.enumerable}),{getValue:function(){return D},setValue:function(he){D=""+he},stopTracking:function(){g._valueTracker=null,delete g[v]}}}}function le(g){g._valueTracker||(g._valueTracker=ae(g))}function me(g){if(!g)return!1;var v=g._valueTracker;if(!v)return!0;var C=v.getValue(),D="";return g&&(D=J(g)?g.checked?"true":"false":g.value),g=D,g!==C?(v.setValue(g),!0):!1}function Oe(g){if(g=g||(typeof document<"u"?document:void 0),typeof g>"u")return null;try{return g.activeElement||g.body}catch{return g.body}}function we(g,v){var C=v.checked;return H({},v,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:C??g._wrapperState.initialChecked})}function ie(g,v){var C=v.defaultValue==null?"":v.defaultValue,D=v.checked!=null?v.checked:v.defaultChecked;C=re(v.value!=null?v.value:C),g._wrapperState={initialChecked:D,initialValue:C,controlled:v.type==="checkbox"||v.type==="radio"?v.checked!=null:v.value!=null}}function Me(g,v){v=v.checked,v!=null&&k(g,"checked",v,!1)}function ke(g,v){Me(g,v);var C=re(v.value),D=v.type;if(C!=null)D==="number"?(C===0&&g.value===""||g.value!=C)&&(g.value=""+C):g.value!==""+C&&(g.value=""+C);else if(D==="submit"||D==="reset"){g.removeAttribute("value");return}v.hasOwnProperty("value")?fe(g,v.type,C):v.hasOwnProperty("defaultValue")&&fe(g,v.type,re(v.defaultValue)),v.checked==null&&v.defaultChecked!=null&&(g.defaultChecked=!!v.defaultChecked)}function se(g,v,C){if(v.hasOwnProperty("value")||v.hasOwnProperty("defaultValue")){var D=v.type;if(!(D!=="submit"&&D!=="reset"||v.value!==void 0&&v.value!==null))return;v=""+g._wrapperState.initialValue,C||v===g.value||(g.value=v),g.defaultValue=v}C=g.name,C!==""&&(g.name=""),g.defaultChecked=!!g._wrapperState.initialChecked,C!==""&&(g.name=C)}function fe(g,v,C){(v!=="number"||Oe(g.ownerDocument)!==g)&&(C==null?g.defaultValue=""+g._wrapperState.initialValue:g.defaultValue!==""+C&&(g.defaultValue=""+C))}var Ie=Array.isArray;function ce(g,v,C,D){if(g=g.options,v){v={};for(var Z=0;Z<C.length;Z++)v["$"+C[Z]]=!0;for(C=0;C<g.length;C++)Z=v.hasOwnProperty("$"+g[C].value),g[C].selected!==Z&&(g[C].selected=Z),Z&&D&&(g[C].defaultSelected=!0)}else{for(C=""+re(C),v=null,Z=0;Z<g.length;Z++){if(g[Z].value===C){g[Z].selected=!0,D&&(g[Z].defaultSelected=!0);return}v!==null||g[Z].disabled||(v=g[Z])}v!==null&&(v.selected=!0)}}function je(g,v){if(v.dangerouslySetInnerHTML!=null)throw Error(r(91));return H({},v,{value:void 0,defaultValue:void 0,children:""+g._wrapperState.initialValue})}function qe(g,v){var C=v.value;if(C==null){if(C=v.children,v=v.defaultValue,C!=null){if(v!=null)throw Error(r(92));if(Ie(C)){if(1<C.length)throw Error(r(93));C=C[0]}v=C}v==null&&(v=""),C=v}g._wrapperState={initialValue:re(C)}}function Ne(g,v){var C=re(v.value),D=re(v.defaultValue);C!=null&&(C=""+C,C!==g.value&&(g.value=C),v.defaultValue==null&&g.defaultValue!==C&&(g.defaultValue=C)),D!=null&&(g.defaultValue=""+D)}function Je(g){var v=g.textContent;v===g._wrapperState.initialValue&&v!==""&&v!==null&&(g.value=v)}function vt(g){switch(g){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 Ge(g,v){return g==null||g==="http://www.w3.org/1999/xhtml"?vt(v):g==="http://www.w3.org/2000/svg"&&v==="foreignObject"?"http://www.w3.org/1999/xhtml":g}var Ot,nt=(function(g){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(v,C,D,Z){MSApp.execUnsafeLocalFunction(function(){return g(v,C,D,Z)})}:g})(function(g,v){if(g.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in g)g.innerHTML=v;else{for(Ot=Ot||document.createElement("div"),Ot.innerHTML="<svg>"+v.valueOf().toString()+"</svg>",v=Ot.firstChild;g.firstChild;)g.removeChild(g.firstChild);for(;v.firstChild;)g.appendChild(v.firstChild)}});function Ae(g,v){if(v){var C=g.firstChild;if(C&&C===g.lastChild&&C.nodeType===3){C.nodeValue=v;return}}g.textContent=v}var Te={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},wt=["Webkit","ms","Moz","O"];Object.keys(Te).forEach(function(g){wt.forEach(function(v){v=v+g.charAt(0).toUpperCase()+g.substring(1),Te[v]=Te[g]})});function ft(g,v,C){return v==null||typeof v=="boolean"||v===""?"":C||typeof v!="number"||v===0||Te.hasOwnProperty(g)&&Te[g]?(""+v).trim():v+"px"}function Pt(g,v){g=g.style;for(var C in v)if(v.hasOwnProperty(C)){var D=C.indexOf("--")===0,Z=ft(C,v[C],D);C==="float"&&(C="cssFloat"),D?g.setProperty(C,Z):g[C]=Z}}var At=H({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 Ht(g,v){if(v){if(At[g]&&(v.children!=null||v.dangerouslySetInnerHTML!=null))throw Error(r(137,g));if(v.dangerouslySetInnerHTML!=null){if(v.children!=null)throw Error(r(60));if(typeof v.dangerouslySetInnerHTML!="object"||!("__html"in v.dangerouslySetInnerHTML))throw Error(r(61))}if(v.style!=null&&typeof v.style!="object")throw Error(r(62))}}function Se(g,v){if(g.indexOf("-")===-1)return typeof v.is=="string";switch(g){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 ct=null;function gt(g){return g=g.target||g.srcElement||window,g.correspondingUseElement&&(g=g.correspondingUseElement),g.nodeType===3?g.parentNode:g}var We=null,Pe=null,rt=null;function Ze(g){if(g=Vd(g)){if(typeof We!="function")throw Error(r(280));var v=g.stateNode;v&&(v=fp(v),We(g.stateNode,g.type,v))}}function pe(g){Pe?rt?rt.push(g):rt=[g]:Pe=g}function xe(){if(Pe){var g=Pe,v=rt;if(rt=Pe=null,Ze(g),v)for(g=0;g<v.length;g++)Ze(v[g])}}function De(g,v){return g(v)}function tt(){}var Le=!1;function Ke(g,v,C){if(Le)return g(v,C);Le=!0;try{return De(g,v,C)}finally{Le=!1,(Pe!==null||rt!==null)&&(tt(),xe())}}function Fe(g,v){var C=g.stateNode;if(C===null)return null;var D=fp(C);if(D===null)return null;C=D[v];e:switch(v){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(D=!D.disabled)||(g=g.type,D=!(g==="button"||g==="input"||g==="select"||g==="textarea")),g=!D;break e;default:g=!1}if(g)return null;if(C&&typeof C!="function")throw Error(r(231,v,typeof C));return C}var Ve=!1;if(l)try{var xt={};Object.defineProperty(xt,"passive",{get:function(){Ve=!0}}),window.addEventListener("test",xt,xt),window.removeEventListener("test",xt,xt)}catch{Ve=!1}function dt(g,v,C,D,Z,ne,he,Re,Ue){var ut=Array.prototype.slice.call(arguments,3);try{v.apply(C,ut)}catch(Rt){this.onError(Rt)}}var Tt=!1,Mt=null,fr=!1,hr=null,Qr={onError:function(g){Tt=!0,Mt=g}};function Rn(g,v,C,D,Z,ne,he,Re,Ue){Tt=!1,Mt=null,dt.apply(Qr,arguments)}function to(g,v,C,D,Z,ne,he,Re,Ue){if(Rn.apply(this,arguments),Tt){if(Tt){var ut=Mt;Tt=!1,Mt=null}else throw Error(r(198));fr||(fr=!0,hr=ut)}}function Ln(g){var v=g,C=g;if(g.alternate)for(;v.return;)v=v.return;else{g=v;do v=g,(v.flags&4098)!==0&&(C=v.return),g=v.return;while(g)}return v.tag===3?C:null}function vo(g){if(g.tag===13){var v=g.memoizedState;if(v===null&&(g=g.alternate,g!==null&&(v=g.memoizedState)),v!==null)return v.dehydrated}return null}function ro(g){if(Ln(g)!==g)throw Error(r(188))}function ys(g){var v=g.alternate;if(!v){if(v=Ln(g),v===null)throw Error(r(188));return v!==g?null:g}for(var C=g,D=v;;){var Z=C.return;if(Z===null)break;var ne=Z.alternate;if(ne===null){if(D=Z.return,D!==null){C=D;continue}break}if(Z.child===ne.child){for(ne=Z.child;ne;){if(ne===C)return ro(Z),g;if(ne===D)return ro(Z),v;ne=ne.sibling}throw Error(r(188))}if(C.return!==D.return)C=Z,D=ne;else{for(var he=!1,Re=Z.child;Re;){if(Re===C){he=!0,C=Z,D=ne;break}if(Re===D){he=!0,D=Z,C=ne;break}Re=Re.sibling}if(!he){for(Re=ne.child;Re;){if(Re===C){he=!0,C=ne,D=Z;break}if(Re===D){he=!0,D=ne,C=Z;break}Re=Re.sibling}if(!he)throw Error(r(189))}}if(C.alternate!==D)throw Error(r(190))}if(C.tag!==3)throw Error(r(188));return C.stateNode.current===C?g:v}function zo(g){return g=ys(g),g!==null?$a(g):null}function $a(g){if(g.tag===5||g.tag===6)return g;for(g=g.child;g!==null;){var v=$a(g);if(v!==null)return v;g=g.sibling}return null}var xa=t.unstable_scheduleCallback,zt=t.unstable_cancelCallback,yr=t.unstable_shouldYield,Xn=t.unstable_requestPaint,Gr=t.unstable_now,Ut=t.unstable_getCurrentPriorityLevel,$i=t.unstable_ImmediatePriority,yo=t.unstable_UserBlockingPriority,oi=t.unstable_NormalPriority,xc=t.unstable_LowPriority,Ed=t.unstable_IdlePriority,uu=null,ba=null;function $h(g){if(ba&&typeof ba.onCommitFiberRoot=="function")try{ba.onCommitFiberRoot(uu,g,void 0,(g.current.flags&128)===128)}catch{}}var yi=Math.clz32?Math.clz32:xi,Ad=Math.log,Tv=Math.LN2;function xi(g){return g>>>=0,g===0?32:31-(Ad(g)/Tv|0)|0}var du=64,wa=4194304;function el(g){switch(g&-g){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 g&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return g&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return g}}function bc(g,v){var C=g.pendingLanes;if(C===0)return 0;var D=0,Z=g.suspendedLanes,ne=g.pingedLanes,he=C&268435455;if(he!==0){var Re=he&~Z;Re!==0?D=el(Re):(ne&=he,ne!==0&&(D=el(ne)))}else he=C&~Z,he!==0?D=el(he):ne!==0&&(D=el(ne));if(D===0)return 0;if(v!==0&&v!==D&&(v&Z)===0&&(Z=D&-D,ne=v&-v,Z>=ne||Z===16&&(ne&4194240)!==0))return v;if((D&4)!==0&&(D|=C&16),v=g.entangledLanes,v!==0)for(g=g.entanglements,v&=D;0<v;)C=31-yi(v),Z=1<<C,D|=g[C],v&=~Z;return D}function Sa(g,v){switch(g){case 1:case 2:case 4:return v+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 v+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 Td(g,v){for(var C=g.suspendedLanes,D=g.pingedLanes,Z=g.expirationTimes,ne=g.pendingLanes;0<ne;){var he=31-yi(ne),Re=1<<he,Ue=Z[he];Ue===-1?((Re&C)===0||(Re&D)!==0)&&(Z[he]=Sa(Re,v)):Ue<=v&&(g.expiredLanes|=Re),ne&=~Re}}function xs(g){return g=g.pendingLanes&-1073741825,g!==0?g:g&1073741824?1073741824:0}function Ui(){var g=du;return du<<=1,(du&4194240)===0&&(du=64),g}function Pd(g){for(var v=[],C=0;31>C;C++)v.push(g);return v}function fu(g,v,C){g.pendingLanes|=v,v!==536870912&&(g.suspendedLanes=0,g.pingedLanes=0),g=g.eventTimes,v=31-yi(v),g[v]=C}function Pv(g,v){var C=g.pendingLanes&~v;g.pendingLanes=v,g.suspendedLanes=0,g.pingedLanes=0,g.expiredLanes&=v,g.mutableReadLanes&=v,g.entangledLanes&=v,v=g.entanglements;var D=g.eventTimes;for(g=g.expirationTimes;0<C;){var Z=31-yi(C),ne=1<<Z;v[Z]=0,D[Z]=-1,g[Z]=-1,C&=~ne}}function Xf(g,v){var C=g.entangledLanes|=v;for(g=g.entanglements;C;){var D=31-yi(C),Z=1<<D;Z&v|g[D]&v&&(g[D]|=v),C&=~Z}}var Fr=0;function Zf(g){return g&=-g,1<g?4<g?(g&268435455)!==0?16:536870912:4:1}var pu,wc,Od,Uh,Hh,Jf=!1,bs=[],ws=null,Bo=null,tl=null,Ss=new Map,pr=new Map,rl=[],Ov="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 Vh(g,v){switch(g){case"focusin":case"focusout":ws=null;break;case"dragenter":case"dragleave":Bo=null;break;case"mouseover":case"mouseout":tl=null;break;case"pointerover":case"pointerout":Ss.delete(v.pointerId);break;case"gotpointercapture":case"lostpointercapture":pr.delete(v.pointerId)}}function hu(g,v,C,D,Z,ne){return g===null||g.nativeEvent!==ne?(g={blockedOn:v,domEventName:C,eventSystemFlags:D,nativeEvent:ne,targetContainers:[Z]},v!==null&&(v=Vd(v),v!==null&&wc(v)),g):(g.eventSystemFlags|=D,v=g.targetContainers,Z!==null&&v.indexOf(Z)===-1&&v.push(Z),g)}function Iv(g,v,C,D,Z){switch(v){case"focusin":return ws=hu(ws,g,v,C,D,Z),!0;case"dragenter":return Bo=hu(Bo,g,v,C,D,Z),!0;case"mouseover":return tl=hu(tl,g,v,C,D,Z),!0;case"pointerover":var ne=Z.pointerId;return Ss.set(ne,hu(Ss.get(ne)||null,g,v,C,D,Z)),!0;case"gotpointercapture":return ne=Z.pointerId,pr.set(ne,hu(pr.get(ne)||null,g,v,C,D,Z)),!0}return!1}function nl(g){var v=Oc(g.target);if(v!==null){var C=Ln(v);if(C!==null){if(v=C.tag,v===13){if(v=vo(C),v!==null){g.blockedOn=v,Hh(g.priority,function(){Od(C)});return}}else if(v===3&&C.stateNode.current.memoizedState.isDehydrated){g.blockedOn=C.tag===3?C.stateNode.containerInfo:null;return}}}g.blockedOn=null}function Ua(g){if(g.blockedOn!==null)return!1;for(var v=g.targetContainers;0<v.length;){var C=mu(g.domEventName,g.eventSystemFlags,v[0],g.nativeEvent);if(C===null){C=g.nativeEvent;var D=new C.constructor(C.type,C);ct=D,C.target.dispatchEvent(D),ct=null}else return v=Vd(C),v!==null&&wc(v),g.blockedOn=C,!1;v.shift()}return!0}function Yh(g,v,C){Ua(g)&&C.delete(v)}function Nv(){Jf=!1,ws!==null&&Ua(ws)&&(ws=null),Bo!==null&&Ua(Bo)&&(Bo=null),tl!==null&&Ua(tl)&&(tl=null),Ss.forEach(Yh),pr.forEach(Yh)}function il(g,v){g.blockedOn===v&&(g.blockedOn=null,Jf||(Jf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Nv)))}function Ll(g){function v(Z){return il(Z,g)}if(0<bs.length){il(bs[0],g);for(var C=1;C<bs.length;C++){var D=bs[C];D.blockedOn===g&&(D.blockedOn=null)}}for(ws!==null&&il(ws,g),Bo!==null&&il(Bo,g),tl!==null&&il(tl,g),Ss.forEach(v),pr.forEach(v),C=0;C<rl.length;C++)D=rl[C],D.blockedOn===g&&(D.blockedOn=null);for(;0<rl.length&&(C=rl[0],C.blockedOn===null);)nl(C),C.blockedOn===null&&rl.shift()}var Wo=S.ReactCurrentBatchConfig,Id=!0;function Nd(g,v,C,D){var Z=Fr,ne=Wo.transition;Wo.transition=null;try{Fr=1,gu(g,v,C,D)}finally{Fr=Z,Wo.transition=ne}}function Rv(g,v,C,D){var Z=Fr,ne=Wo.transition;Wo.transition=null;try{Fr=4,gu(g,v,C,D)}finally{Fr=Z,Wo.transition=ne}}function gu(g,v,C,D){if(Id){var Z=mu(g,v,C,D);if(Z===null)cp(g,v,D,js,C),Vh(g,D);else if(Iv(Z,g,v,C,D))D.stopPropagation();else if(Vh(g,D),v&4&&-1<Ov.indexOf(g)){for(;Z!==null;){var ne=Vd(Z);if(ne!==null&&pu(ne),ne=mu(g,v,C,D),ne===null&&cp(g,v,D,js,C),ne===Z)break;Z=ne}Z!==null&&D.stopPropagation()}else cp(g,v,D,null,C)}}var js=null;function mu(g,v,C,D){if(js=null,g=gt(D),g=Oc(g),g!==null)if(v=Ln(g),v===null)g=null;else if(C=v.tag,C===13){if(g=vo(v),g!==null)return g;g=null}else if(C===3){if(v.stateNode.current.memoizedState.isDehydrated)return v.tag===3?v.stateNode.containerInfo:null;g=null}else v!==g&&(g=null);return js=g,null}function Sc(g){switch(g){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(Ut()){case $i:return 1;case yo:return 4;case oi:case xc:return 16;case Ed:return 536870912;default:return 16}default:return 16}}var Ha=null,jc=null,kc=null;function vu(){if(kc)return kc;var g,v=jc,C=v.length,D,Z="value"in Ha?Ha.value:Ha.textContent,ne=Z.length;for(g=0;g<C&&v[g]===Z[g];g++);var he=C-g;for(D=1;D<=he&&v[C-D]===Z[ne-D];D++);return kc=Z.slice(g,1<D?1-D:void 0)}function yu(g){var v=g.keyCode;return"charCode"in g?(g=g.charCode,g===0&&v===13&&(g=13)):g=v,g===10&&(g=13),32<=g||g===13?g:0}function Va(){return!0}function ol(){return!1}function xo(g){function v(C,D,Z,ne,he){this._reactName=C,this._targetInst=Z,this.type=D,this.nativeEvent=ne,this.target=he,this.currentTarget=null;for(var Re in g)g.hasOwnProperty(Re)&&(C=g[Re],this[Re]=C?C(ne):ne[Re]);return this.isDefaultPrevented=(ne.defaultPrevented!=null?ne.defaultPrevented:ne.returnValue===!1)?Va:ol,this.isPropagationStopped=ol,this}return H(v.prototype,{preventDefault:function(){this.defaultPrevented=!0;var C=this.nativeEvent;C&&(C.preventDefault?C.preventDefault():typeof C.returnValue!="unknown"&&(C.returnValue=!1),this.isDefaultPrevented=Va)},stopPropagation:function(){var C=this.nativeEvent;C&&(C.stopPropagation?C.stopPropagation():typeof C.cancelBubble!="unknown"&&(C.cancelBubble=!0),this.isPropagationStopped=Va)},persist:function(){},isPersistent:Va}),v}var Fl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(g){return g.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Rd=xo(Fl),ks=H({},Fl,{view:0,detail:0}),Gh=xo(ks),X,ue,_e,Be=H({},ks,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_s,button:0,buttons:0,relatedTarget:function(g){return g.relatedTarget===void 0?g.fromElement===g.srcElement?g.toElement:g.fromElement:g.relatedTarget},movementX:function(g){return"movementX"in g?g.movementX:(g!==_e&&(_e&&g.type==="mousemove"?(X=g.screenX-_e.screenX,ue=g.screenY-_e.screenY):ue=X=0,_e=g),X)},movementY:function(g){return"movementY"in g?g.movementY:ue}}),Qe=xo(Be),bt=H({},Be,{dataTransfer:0}),It=xo(bt),tr=H({},ks,{relatedTarget:0}),Kt=xo(tr),_r=H({},Fl,{animationName:0,elapsedTime:0,pseudoElement:0}),Tr=xo(_r),Kr=H({},Fl,{clipboardData:function(g){return"clipboardData"in g?g.clipboardData:window.clipboardData}}),bi=xo(Kr),jn=H({},Fl,{data:0}),dn=xo(jn),Fn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zn={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"},Jn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bo(g){var v=this.nativeEvent;return v.getModifierState?v.getModifierState(g):(g=Jn[g])?!!v[g]:!1}function _s(){return bo}var ep=H({},ks,{key:function(g){if(g.key){var v=Fn[g.key]||g.key;if(v!=="Unidentified")return v}return g.type==="keypress"?(g=yu(g),g===13?"Enter":String.fromCharCode(g)):g.type==="keydown"||g.type==="keyup"?Zn[g.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_s,charCode:function(g){return g.type==="keypress"?yu(g):0},keyCode:function(g){return g.type==="keydown"||g.type==="keyup"?g.keyCode:0},which:function(g){return g.type==="keypress"?yu(g):g.type==="keydown"||g.type==="keyup"?g.keyCode:0}}),xu=xo(ep),bu=H({},Be,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ml=xo(bu),wu=H({},ks,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_s}),Ld=xo(wu),Fd=H({},Fl,{propertyName:0,elapsedTime:0,pseudoElement:0}),wo=xo(Fd),Su=H({},Be,{deltaX:function(g){return"deltaX"in g?g.deltaX:"wheelDeltaX"in g?-g.wheelDeltaX:0},deltaY:function(g){return"deltaY"in g?g.deltaY:"wheelDeltaY"in g?-g.wheelDeltaY:"wheelDelta"in g?-g.wheelDelta:0},deltaZ:0,deltaMode:0}),ju=xo(Su),tp=[9,13,27,32],Ya=l&&"CompositionEvent"in window,Ni=null;l&&"documentMode"in document&&(Ni=document.documentMode);var Kh=l&&"TextEvent"in window&&!Ni,ku=l&&(!Ya||Ni&&8<Ni&&11>=Ni),rp=" ",ja=!1;function _c(g,v){switch(g){case"keyup":return tp.indexOf(v.keyCode)!==-1;case"keydown":return v.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Md(g){return g=g.detail,typeof g=="object"&&"data"in g?g.data:null}var Cs=!1;function _u(g,v){switch(g){case"compositionend":return Md(v);case"keypress":return v.which!==32?null:(ja=!0,rp);case"textInput":return g=v.data,g===rp&&ja?null:g;default:return null}}function np(g,v){if(Cs)return g==="compositionend"||!Ya&&_c(g,v)?(g=vu(),kc=jc=Ha=null,Cs=!1,g):null;switch(g){case"paste":return null;case"keypress":if(!(v.ctrlKey||v.altKey||v.metaKey)||v.ctrlKey&&v.altKey){if(v.char&&1<v.char.length)return v.char;if(v.which)return String.fromCharCode(v.which)}return null;case"compositionend":return ku&&v.locale!=="ko"?null:v.data;default:return null}}var qo={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 $o(g){var v=g&&g.nodeName&&g.nodeName.toLowerCase();return v==="input"?!!qo[g.type]:v==="textarea"}function Cu(g,v,C,D){pe(D),v=eg(v,"onChange"),0<v.length&&(C=new Rd("onChange","change",null,C,D),g.push({event:C,listeners:v}))}var Ga=null,Ka=null;function Dd(g){sp(g,0)}function al(g){var v=Ru(g);if(me(v))return g}function wi(g,v){if(g==="change")return v}var Qh=!1;if(l){var Qa;if(l){var ka="oninput"in document;if(!ka){var Cc=document.createElement("div");Cc.setAttribute("oninput","return;"),ka=typeof Cc.oninput=="function"}Qa=ka}else Qa=!1;Qh=Qa&&(!document.documentMode||9<document.documentMode)}function zd(){Ga&&(Ga.detachEvent("onpropertychange",Bd),Ka=Ga=null)}function Bd(g){if(g.propertyName==="value"&&al(Ka)){var v=[];Cu(v,Ka,g,gt(g)),Ke(Dd,v)}}function Wd(g,v,C){g==="focusin"?(zd(),Ga=v,Ka=C,Ga.attachEvent("onpropertychange",Bd)):g==="focusout"&&zd()}function Eu(g){if(g==="selectionchange"||g==="keyup"||g==="keydown")return al(Ka)}function Au(g,v){if(g==="click")return al(v)}function Ec(g,v){if(g==="input"||g==="change")return al(v)}function Dl(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var Hi=typeof Object.is=="function"?Object.is:Dl;function sl(g,v){if(Hi(g,v))return!0;if(typeof g!="object"||g===null||typeof v!="object"||v===null)return!1;var C=Object.keys(g),D=Object.keys(v);if(C.length!==D.length)return!1;for(D=0;D<C.length;D++){var Z=C[D];if(!c.call(v,Z)||!Hi(g[Z],v[Z]))return!1}return!0}function no(g){for(;g&&g.firstChild;)g=g.firstChild;return g}function Es(g,v){var C=no(g);g=0;for(var D;C;){if(C.nodeType===3){if(D=g+C.textContent.length,g<=v&&D>=v)return{node:C,offset:v-g};g=D}e:{for(;C;){if(C.nextSibling){C=C.nextSibling;break e}C=C.parentNode}C=void 0}C=no(C)}}function kn(g,v){return g&&v?g===v?!0:g&&g.nodeType===3?!1:v&&v.nodeType===3?kn(g,v.parentNode):"contains"in g?g.contains(v):g.compareDocumentPosition?!!(g.compareDocumentPosition(v)&16):!1:!1}function _n(){for(var g=window,v=Oe();v instanceof g.HTMLIFrameElement;){try{var C=typeof v.contentWindow.location.href=="string"}catch{C=!1}if(C)g=v.contentWindow;else break;v=Oe(g.document)}return v}function ei(g){var v=g&&g.nodeName&&g.nodeName.toLowerCase();return v&&(v==="input"&&(g.type==="text"||g.type==="search"||g.type==="tel"||g.type==="url"||g.type==="password")||v==="textarea"||g.contentEditable==="true")}function Ri(g){var v=_n(),C=g.focusedElem,D=g.selectionRange;if(v!==C&&C&&C.ownerDocument&&kn(C.ownerDocument.documentElement,C)){if(D!==null&&ei(C)){if(v=D.start,g=D.end,g===void 0&&(g=v),"selectionStart"in C)C.selectionStart=v,C.selectionEnd=Math.min(g,C.value.length);else if(g=(v=C.ownerDocument||document)&&v.defaultView||window,g.getSelection){g=g.getSelection();var Z=C.textContent.length,ne=Math.min(D.start,Z);D=D.end===void 0?ne:Math.min(D.end,Z),!g.extend&&ne>D&&(Z=D,D=ne,ne=Z),Z=Es(C,ne);var he=Es(C,D);Z&&he&&(g.rangeCount!==1||g.anchorNode!==Z.node||g.anchorOffset!==Z.offset||g.focusNode!==he.node||g.focusOffset!==he.offset)&&(v=v.createRange(),v.setStart(Z.node,Z.offset),g.removeAllRanges(),ne>D?(g.addRange(v),g.extend(he.node,he.offset)):(v.setEnd(he.node,he.offset),g.addRange(v)))}}for(v=[],g=C;g=g.parentNode;)g.nodeType===1&&v.push({element:g,left:g.scrollLeft,top:g.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<v.length;C++)g=v[C],g.element.scrollLeft=g.left,g.element.scrollTop=g.top}}var zl=l&&"documentMode"in document&&11>=document.documentMode,ll=null,Ac=null,Tc=null,Xh=!1;function Lv(g,v,C){var D=C.window===C?C.document:C.nodeType===9?C:C.ownerDocument;Xh||ll==null||ll!==Oe(D)||(D=ll,"selectionStart"in D&&ei(D)?D={start:D.selectionStart,end:D.selectionEnd}:(D=(D.ownerDocument&&D.ownerDocument.defaultView||window).getSelection(),D={anchorNode:D.anchorNode,anchorOffset:D.anchorOffset,focusNode:D.focusNode,focusOffset:D.focusOffset}),Tc&&sl(Tc,D)||(Tc=D,D=eg(Ac,"onSelect"),0<D.length&&(v=new Rd("onSelect","select",null,v,C),g.push({event:v,listeners:D}),v.target=ll)))}function ip(g,v){var C={};return C[g.toLowerCase()]=v.toLowerCase(),C["Webkit"+g]="webkit"+v,C["Moz"+g]="moz"+v,C}var Tu={animationend:ip("Animation","AnimationEnd"),animationiteration:ip("Animation","AnimationIteration"),animationstart:ip("Animation","AnimationStart"),transitionend:ip("Transition","TransitionEnd")},Pu={},Fv={};l&&(Fv=document.createElement("div").style,"AnimationEvent"in window||(delete Tu.animationend.animation,delete Tu.animationiteration.animation,delete Tu.animationstart.animation),"TransitionEvent"in window||delete Tu.transitionend.transition);function op(g){if(Pu[g])return Pu[g];if(!Tu[g])return g;var v=Tu[g],C;for(C in v)if(v.hasOwnProperty(C)&&C in Fv)return Pu[g]=v[C];return g}var Mv=op("animationend"),Dv=op("animationiteration"),zv=op("animationstart"),Bv=op("transitionend"),Wv=new Map,qv="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 cl(g,v){Wv.set(g,v),a(v,[g])}for(var qd=0;qd<qv.length;qd++){var Uo=qv[qd],Xa=Uo.toLowerCase(),Zh=Uo[0].toUpperCase()+Uo.slice(1);cl(Xa,"on"+Zh)}cl(Mv,"onAnimationEnd"),cl(Dv,"onAnimationIteration"),cl(zv,"onAnimationStart"),cl("dblclick","onDoubleClick"),cl("focusin","onFocus"),cl("focusout","onBlur"),cl(Bv,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pc="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(" "),Rb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Pc));function ap(g,v,C){var D=g.type||"unknown-event";g.currentTarget=C,to(D,v,void 0,g),g.currentTarget=null}function sp(g,v){v=(v&4)!==0;for(var C=0;C<g.length;C++){var D=g[C],Z=D.event;D=D.listeners;e:{var ne=void 0;if(v)for(var he=D.length-1;0<=he;he--){var Re=D[he],Ue=Re.instance,ut=Re.currentTarget;if(Re=Re.listener,Ue!==ne&&Z.isPropagationStopped())break e;ap(Z,Re,ut),ne=Ue}else for(he=0;he<D.length;he++){if(Re=D[he],Ue=Re.instance,ut=Re.currentTarget,Re=Re.listener,Ue!==ne&&Z.isPropagationStopped())break e;ap(Z,Re,ut),ne=Ue}}}if(fr)throw g=hr,fr=!1,hr=null,g}function Cn(g,v){var C=v[ea];C===void 0&&(C=v[ea]=new Set);var D=g+"__bubble";C.has(D)||(lp(v,g,2,!1),C.add(D))}function Jh(g,v,C){var D=0;v&&(D|=4),lp(C,g,D,v)}var $d="_reactListening"+Math.random().toString(36).slice(2);function Ou(g){if(!g[$d]){g[$d]=!0,n.forEach(function(C){C!=="selectionchange"&&(Rb.has(C)||Jh(C,!1,g),Jh(C,!0,g))});var v=g.nodeType===9?g:g.ownerDocument;v===null||v[$d]||(v[$d]=!0,Jh("selectionchange",!1,v))}}function lp(g,v,C,D){switch(Sc(v)){case 1:var Z=Nd;break;case 4:Z=Rv;break;default:Z=gu}C=Z.bind(null,v,C,g),Z=void 0,!Ve||v!=="touchstart"&&v!=="touchmove"&&v!=="wheel"||(Z=!0),D?Z!==void 0?g.addEventListener(v,C,{capture:!0,passive:Z}):g.addEventListener(v,C,!0):Z!==void 0?g.addEventListener(v,C,{passive:Z}):g.addEventListener(v,C,!1)}function cp(g,v,C,D,Z){var ne=D;if((v&1)===0&&(v&2)===0&&D!==null)e:for(;;){if(D===null)return;var he=D.tag;if(he===3||he===4){var Re=D.stateNode.containerInfo;if(Re===Z||Re.nodeType===8&&Re.parentNode===Z)break;if(he===4)for(he=D.return;he!==null;){var Ue=he.tag;if((Ue===3||Ue===4)&&(Ue=he.stateNode.containerInfo,Ue===Z||Ue.nodeType===8&&Ue.parentNode===Z))return;he=he.return}for(;Re!==null;){if(he=Oc(Re),he===null)return;if(Ue=he.tag,Ue===5||Ue===6){D=ne=he;continue e}Re=Re.parentNode}}D=D.return}Ke(function(){var ut=ne,Rt=gt(C),Ft=[];e:{var Nt=Wv.get(g);if(Nt!==void 0){var Vt=Rd,rr=g;switch(g){case"keypress":if(yu(C)===0)break e;case"keydown":case"keyup":Vt=xu;break;case"focusin":rr="focus",Vt=Kt;break;case"focusout":rr="blur",Vt=Kt;break;case"beforeblur":case"afterblur":Vt=Kt;break;case"click":if(C.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Vt=Qe;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Vt=It;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Vt=Ld;break;case Mv:case Dv:case zv:Vt=Tr;break;case Bv:Vt=wo;break;case"scroll":Vt=Gh;break;case"wheel":Vt=ju;break;case"copy":case"cut":case"paste":Vt=bi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Vt=Ml}var ar=(v&4)!==0,Mi=!ar&&g==="scroll",ot=ar?Nt!==null?Nt+"Capture":null:Nt;ar=[];for(var Ye=ut,st;Ye!==null;){st=Ye;var Dt=st.stateNode;if(st.tag===5&&Dt!==null&&(st=Dt,ot!==null&&(Dt=Fe(Ye,ot),Dt!=null&&ar.push(up(Ye,Dt,st)))),Mi)break;Ye=Ye.return}0<ar.length&&(Nt=new Vt(Nt,rr,null,C,Rt),Ft.push({event:Nt,listeners:ar}))}}if((v&7)===0){e:{if(Nt=g==="mouseover"||g==="pointerover",Vt=g==="mouseout"||g==="pointerout",Nt&&C!==ct&&(rr=C.relatedTarget||C.fromElement)&&(Oc(rr)||rr[So]))break e;if((Vt||Nt)&&(Nt=Rt.window===Rt?Rt:(Nt=Rt.ownerDocument)?Nt.defaultView||Nt.parentWindow:window,Vt?(rr=C.relatedTarget||C.toElement,Vt=ut,rr=rr?Oc(rr):null,rr!==null&&(Mi=Ln(rr),rr!==Mi||rr.tag!==5&&rr.tag!==6)&&(rr=null)):(Vt=null,rr=ut),Vt!==rr)){if(ar=Qe,Dt="onMouseLeave",ot="onMouseEnter",Ye="mouse",(g==="pointerout"||g==="pointerover")&&(ar=Ml,Dt="onPointerLeave",ot="onPointerEnter",Ye="pointer"),Mi=Vt==null?Nt:Ru(Vt),st=rr==null?Nt:Ru(rr),Nt=new ar(Dt,Ye+"leave",Vt,C,Rt),Nt.target=Mi,Nt.relatedTarget=st,Dt=null,Oc(Rt)===ut&&(ar=new ar(ot,Ye+"enter",rr,C,Rt),ar.target=st,ar.relatedTarget=Mi,Dt=ar),Mi=Dt,Vt&&rr)t:{for(ar=Vt,ot=rr,Ye=0,st=ar;st;st=Iu(st))Ye++;for(st=0,Dt=ot;Dt;Dt=Iu(Dt))st++;for(;0<Ye-st;)ar=Iu(ar),Ye--;for(;0<st-Ye;)ot=Iu(ot),st--;for(;Ye--;){if(ar===ot||ot!==null&&ar===ot.alternate)break t;ar=Iu(ar),ot=Iu(ot)}ar=null}else ar=null;Vt!==null&&Lb(Ft,Nt,Vt,ar,!1),rr!==null&&Mi!==null&&Lb(Ft,Mi,rr,ar,!0)}}e:{if(Nt=ut?Ru(ut):window,Vt=Nt.nodeName&&Nt.nodeName.toLowerCase(),Vt==="select"||Vt==="input"&&Nt.type==="file")var cr=wi;else if($o(Nt))if(Qh)cr=Ec;else{cr=Eu;var gr=Wd}else(Vt=Nt.nodeName)&&Vt.toLowerCase()==="input"&&(Nt.type==="checkbox"||Nt.type==="radio")&&(cr=Au);if(cr&&(cr=cr(g,ut))){Cu(Ft,cr,C,Rt);break e}gr&&gr(g,Nt,ut),g==="focusout"&&(gr=Nt._wrapperState)&&gr.controlled&&Nt.type==="number"&&fe(Nt,"number",Nt.value)}switch(gr=ut?Ru(ut):window,g){case"focusin":($o(gr)||gr.contentEditable==="true")&&(ll=gr,Ac=ut,Tc=null);break;case"focusout":Tc=Ac=ll=null;break;case"mousedown":Xh=!0;break;case"contextmenu":case"mouseup":case"dragend":Xh=!1,Lv(Ft,C,Rt);break;case"selectionchange":if(zl)break;case"keydown":case"keyup":Lv(Ft,C,Rt)}var mr;if(Ya)e:{switch(g){case"compositionstart":var Cr="onCompositionStart";break e;case"compositionend":Cr="onCompositionEnd";break e;case"compositionupdate":Cr="onCompositionUpdate";break e}Cr=void 0}else Cs?_c(g,C)&&(Cr="onCompositionEnd"):g==="keydown"&&C.keyCode===229&&(Cr="onCompositionStart");Cr&&(ku&&C.locale!=="ko"&&(Cs||Cr!=="onCompositionStart"?Cr==="onCompositionEnd"&&Cs&&(mr=vu()):(Ha=Rt,jc="value"in Ha?Ha.value:Ha.textContent,Cs=!0)),gr=eg(ut,Cr),0<gr.length&&(Cr=new dn(Cr,g,null,C,Rt),Ft.push({event:Cr,listeners:gr}),mr?Cr.data=mr:(mr=Md(C),mr!==null&&(Cr.data=mr)))),(mr=Kh?_u(g,C):np(g,C))&&(ut=eg(ut,"onBeforeInput"),0<ut.length&&(Rt=new dn("onBeforeInput","beforeinput",null,C,Rt),Ft.push({event:Rt,listeners:ut}),Rt.data=mr))}sp(Ft,v)})}function up(g,v,C){return{instance:g,listener:v,currentTarget:C}}function eg(g,v){for(var C=v+"Capture",D=[];g!==null;){var Z=g,ne=Z.stateNode;Z.tag===5&&ne!==null&&(Z=ne,ne=Fe(g,C),ne!=null&&D.unshift(up(g,ne,Z)),ne=Fe(g,v),ne!=null&&D.push(up(g,ne,Z))),g=g.return}return D}function Iu(g){if(g===null)return null;do g=g.return;while(g&&g.tag!==5);return g||null}function Lb(g,v,C,D,Z){for(var ne=v._reactName,he=[];C!==null&&C!==D;){var Re=C,Ue=Re.alternate,ut=Re.stateNode;if(Ue!==null&&Ue===D)break;Re.tag===5&&ut!==null&&(Re=ut,Z?(Ue=Fe(C,ne),Ue!=null&&he.unshift(up(C,Ue,Re))):Z||(Ue=Fe(C,ne),Ue!=null&&he.push(up(C,Ue,Re)))),C=C.return}he.length!==0&&g.push({event:v,listeners:he})}var DS=/\r\n?/g,zS=/\u0000|\uFFFD/g;function Fb(g){return(typeof g=="string"?g:""+g).replace(DS,`
|
||
`).replace(zS,"")}function tg(g,v,C){if(v=Fb(v),Fb(g)!==v&&C)throw Error(r(425))}function Ud(){}var dp=null,Nu=null;function $v(g,v){return g==="textarea"||g==="noscript"||typeof v.children=="string"||typeof v.children=="number"||typeof v.dangerouslySetInnerHTML=="object"&&v.dangerouslySetInnerHTML!==null&&v.dangerouslySetInnerHTML.__html!=null}var Uv=typeof setTimeout=="function"?setTimeout:void 0,Mb=typeof clearTimeout=="function"?clearTimeout:void 0,Db=typeof Promise=="function"?Promise:void 0,BS=typeof queueMicrotask=="function"?queueMicrotask:typeof Db<"u"?function(g){return Db.resolve(null).then(g).catch(WS)}:Uv;function WS(g){setTimeout(function(){throw g})}function Hv(g,v){var C=v,D=0;do{var Z=C.nextSibling;if(g.removeChild(C),Z&&Z.nodeType===8)if(C=Z.data,C==="/$"){if(D===0){g.removeChild(Z),Ll(v);return}D--}else C!=="$"&&C!=="$?"&&C!=="$!"||D++;C=Z}while(C);Ll(v)}function Ho(g){for(;g!=null;g=g.nextSibling){var v=g.nodeType;if(v===1||v===3)break;if(v===8){if(v=g.data,v==="$"||v==="$!"||v==="$?")break;if(v==="/$")return null}}return g}function Za(g){g=g.previousSibling;for(var v=0;g;){if(g.nodeType===8){var C=g.data;if(C==="$"||C==="$!"||C==="$?"){if(v===0)return g;v--}else C==="/$"&&v++}g=g.previousSibling}return null}var Jo=Math.random().toString(36).slice(2),ul="__reactFiber$"+Jo,Hd="__reactProps$"+Jo,So="__reactContainer$"+Jo,ea="__reactEvents$"+Jo,qS="__reactListeners$"+Jo,$S="__reactHandles$"+Jo;function Oc(g){var v=g[ul];if(v)return v;for(var C=g.parentNode;C;){if(v=C[So]||C[ul]){if(C=v.alternate,v.child!==null||C!==null&&C.child!==null)for(g=Za(g);g!==null;){if(C=g[ul])return C;g=Za(g)}return v}g=C,C=g.parentNode}return null}function Vd(g){return g=g[ul]||g[So],!g||g.tag!==5&&g.tag!==6&&g.tag!==13&&g.tag!==3?null:g}function Ru(g){if(g.tag===5||g.tag===6)return g.stateNode;throw Error(r(33))}function fp(g){return g[Hd]||null}var Vv=[],Bl=-1;function As(g){return{current:g}}function fn(g){0>Bl||(g.current=Vv[Bl],Vv[Bl]=null,Bl--)}function mn(g,v){Bl++,Vv[Bl]=g.current,g.current=v}var Ic={},io=As(Ic),ta=As(!1),Lu=Ic;function Yd(g,v){var C=g.type.contextTypes;if(!C)return Ic;var D=g.stateNode;if(D&&D.__reactInternalMemoizedUnmaskedChildContext===v)return D.__reactInternalMemoizedMaskedChildContext;var Z={},ne;for(ne in C)Z[ne]=v[ne];return D&&(g=g.stateNode,g.__reactInternalMemoizedUnmaskedChildContext=v,g.__reactInternalMemoizedMaskedChildContext=Z),Z}function ra(g){return g=g.childContextTypes,g!=null}function rg(){fn(ta),fn(io)}function zb(g,v,C){if(io.current!==Ic)throw Error(r(168));mn(io,v),mn(ta,C)}function Yv(g,v,C){var D=g.stateNode;if(v=v.childContextTypes,typeof D.getChildContext!="function")return C;D=D.getChildContext();for(var Z in D)if(!(Z in v))throw Error(r(108,G(g)||"Unknown",Z));return H({},C,D)}function Fu(g){return g=(g=g.stateNode)&&g.__reactInternalMemoizedMergedChildContext||Ic,Lu=io.current,mn(io,g),mn(ta,ta.current),!0}function Bb(g,v,C){var D=g.stateNode;if(!D)throw Error(r(169));C?(g=Yv(g,v,Lu),D.__reactInternalMemoizedMergedChildContext=g,fn(ta),fn(io),mn(io,g)):fn(ta),mn(ta,C)}var Wl=null,pp=!1,N=!1;function W(g){Wl===null?Wl=[g]:Wl.push(g)}function te(g){pp=!0,W(g)}function oe(){if(!N&&Wl!==null){N=!0;var g=0,v=Fr;try{var C=Wl;for(Fr=1;g<C.length;g++){var D=C[g];do D=D(!0);while(D!==null)}Wl=null,pp=!1}catch(Z){throw Wl!==null&&(Wl=Wl.slice(g+1)),xa($i,oe),Z}finally{Fr=v,N=!1}}return null}var de=[],ge=0,ve=null,ye=0,be=[],Ce=0,$e=null,it=1,Ee="";function He(g,v){de[ge++]=ye,de[ge++]=ve,ve=g,ye=v}function et(g,v,C){be[Ce++]=it,be[Ce++]=Ee,be[Ce++]=$e,$e=g;var D=it;g=Ee;var Z=32-yi(D)-1;D&=~(1<<Z),C+=1;var ne=32-yi(v)+Z;if(30<ne){var he=Z-Z%5;ne=(D&(1<<he)-1).toString(32),D>>=he,Z-=he,it=1<<32-yi(v)+Z|C<<Z|D,Ee=ne+g}else it=1<<ne|C<<Z|D,Ee=g}function yt(g){g.return!==null&&(He(g,1),et(g,1,0))}function at(g){for(;g===ve;)ve=de[--ge],de[ge]=null,ye=de[--ge],de[ge]=null;for(;g===$e;)$e=be[--Ce],be[Ce]=null,Ee=be[--Ce],be[Ce]=null,it=be[--Ce],be[Ce]=null}var ht=null,mt=null,jt=!1,Et=null;function sr(g,v){var C=gl(5,null,null,0);C.elementType="DELETED",C.stateNode=v,C.return=g,v=g.deletions,v===null?(g.deletions=[C],g.flags|=16):v.push(C)}function Yt(g,v){switch(g.tag){case 5:var C=g.type;return v=v.nodeType!==1||C.toLowerCase()!==v.nodeName.toLowerCase()?null:v,v!==null?(g.stateNode=v,ht=g,mt=Ho(v.firstChild),!0):!1;case 6:return v=g.pendingProps===""||v.nodeType!==3?null:v,v!==null?(g.stateNode=v,ht=g,mt=null,!0):!1;case 13:return v=v.nodeType!==8?null:v,v!==null?(C=$e!==null?{id:it,overflow:Ee}:null,g.memoizedState={dehydrated:v,treeContext:C,retryLane:1073741824},C=gl(18,null,null,0),C.stateNode=v,C.return=g,g.child=C,ht=g,mt=null,!0):!1;default:return!1}}function Pr(g){return(g.mode&1)!==0&&(g.flags&128)===0}function Jt(g){if(jt){var v=mt;if(v){var C=v;if(!Yt(g,v)){if(Pr(g))throw Error(r(418));v=Ho(C.nextSibling);var D=ht;v&&Yt(g,v)?sr(D,C):(g.flags=g.flags&-4097|2,jt=!1,ht=g)}}else{if(Pr(g))throw Error(r(418));g.flags=g.flags&-4097|2,jt=!1,ht=g}}}function Br(g){for(g=g.return;g!==null&&g.tag!==5&&g.tag!==3&&g.tag!==13;)g=g.return;ht=g}function ai(g){if(g!==ht)return!1;if(!jt)return Br(g),jt=!0,!1;var v;if((v=g.tag!==3)&&!(v=g.tag!==5)&&(v=g.type,v=v!=="head"&&v!=="body"&&!$v(g.type,g.memoizedProps)),v&&(v=mt)){if(Pr(g))throw Or(),Error(r(418));for(;v;)sr(g,v),v=Ho(v.nextSibling)}if(Br(g),g.tag===13){if(g=g.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(r(317));e:{for(g=g.nextSibling,v=0;g;){if(g.nodeType===8){var C=g.data;if(C==="/$"){if(v===0){mt=Ho(g.nextSibling);break e}v--}else C!=="$"&&C!=="$!"&&C!=="$?"||v++}g=g.nextSibling}mt=null}}else mt=ht?Ho(g.stateNode.nextSibling):null;return!0}function Or(){for(var g=mt;g;)g=Ho(g.nextSibling)}function Gt(){mt=ht=null,jt=!1}function qt(g){Et===null?Et=[g]:Et.push(g)}var di=S.ReactCurrentBatchConfig;function br(g,v,C){if(g=C.ref,g!==null&&typeof g!="function"&&typeof g!="object"){if(C._owner){if(C=C._owner,C){if(C.tag!==1)throw Error(r(309));var D=C.stateNode}if(!D)throw Error(r(147,g));var Z=D,ne=""+g;return v!==null&&v.ref!==null&&typeof v.ref=="function"&&v.ref._stringRef===ne?v.ref:(v=function(he){var Re=Z.refs;he===null?delete Re[ne]:Re[ne]=he},v._stringRef=ne,v)}if(typeof g!="string")throw Error(r(284));if(!C._owner)throw Error(r(290,g))}return g}function Mr(g,v){throw g=Object.prototype.toString.call(v),Error(r(31,g==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":g))}function In(g){var v=g._init;return v(g._payload)}function Vi(g){function v(ot,Ye){if(g){var st=ot.deletions;st===null?(ot.deletions=[Ye],ot.flags|=16):st.push(Ye)}}function C(ot,Ye){if(!g)return null;for(;Ye!==null;)v(ot,Ye),Ye=Ye.sibling;return null}function D(ot,Ye){for(ot=new Map;Ye!==null;)Ye.key!==null?ot.set(Ye.key,Ye):ot.set(Ye.index,Ye),Ye=Ye.sibling;return ot}function Z(ot,Ye){return ot=nf(ot,Ye),ot.index=0,ot.sibling=null,ot}function ne(ot,Ye,st){return ot.index=st,g?(st=ot.alternate,st!==null?(st=st.index,st<Ye?(ot.flags|=2,Ye):st):(ot.flags|=2,Ye)):(ot.flags|=1048576,Ye)}function he(ot){return g&&ot.alternate===null&&(ot.flags|=2),ot}function Re(ot,Ye,st,Dt){return Ye===null||Ye.tag!==6?(Ye=yj(st,ot.mode,Dt),Ye.return=ot,Ye):(Ye=Z(Ye,st),Ye.return=ot,Ye)}function Ue(ot,Ye,st,Dt){var cr=st.type;return cr===O?Rt(ot,Ye,st.props.children,Dt,st.key):Ye!==null&&(Ye.elementType===cr||typeof cr=="object"&&cr!==null&&cr.$$typeof===V&&In(cr)===Ye.type)?(Dt=Z(Ye,st.props),Dt.ref=br(ot,Ye,st),Dt.return=ot,Dt):(Dt=a1(st.type,st.key,st.props,null,ot.mode,Dt),Dt.ref=br(ot,Ye,st),Dt.return=ot,Dt)}function ut(ot,Ye,st,Dt){return Ye===null||Ye.tag!==4||Ye.stateNode.containerInfo!==st.containerInfo||Ye.stateNode.implementation!==st.implementation?(Ye=xj(st,ot.mode,Dt),Ye.return=ot,Ye):(Ye=Z(Ye,st.children||[]),Ye.return=ot,Ye)}function Rt(ot,Ye,st,Dt,cr){return Ye===null||Ye.tag!==7?(Ye=wp(st,ot.mode,Dt,cr),Ye.return=ot,Ye):(Ye=Z(Ye,st),Ye.return=ot,Ye)}function Ft(ot,Ye,st){if(typeof Ye=="string"&&Ye!==""||typeof Ye=="number")return Ye=yj(""+Ye,ot.mode,st),Ye.return=ot,Ye;if(typeof Ye=="object"&&Ye!==null){switch(Ye.$$typeof){case _:return st=a1(Ye.type,Ye.key,Ye.props,null,ot.mode,st),st.ref=br(ot,null,Ye),st.return=ot,st;case P:return Ye=xj(Ye,ot.mode,st),Ye.return=ot,Ye;case V:var Dt=Ye._init;return Ft(ot,Dt(Ye._payload),st)}if(Ie(Ye)||ee(Ye))return Ye=wp(Ye,ot.mode,st,null),Ye.return=ot,Ye;Mr(ot,Ye)}return null}function Nt(ot,Ye,st,Dt){var cr=Ye!==null?Ye.key:null;if(typeof st=="string"&&st!==""||typeof st=="number")return cr!==null?null:Re(ot,Ye,""+st,Dt);if(typeof st=="object"&&st!==null){switch(st.$$typeof){case _:return st.key===cr?Ue(ot,Ye,st,Dt):null;case P:return st.key===cr?ut(ot,Ye,st,Dt):null;case V:return cr=st._init,Nt(ot,Ye,cr(st._payload),Dt)}if(Ie(st)||ee(st))return cr!==null?null:Rt(ot,Ye,st,Dt,null);Mr(ot,st)}return null}function Vt(ot,Ye,st,Dt,cr){if(typeof Dt=="string"&&Dt!==""||typeof Dt=="number")return ot=ot.get(st)||null,Re(Ye,ot,""+Dt,cr);if(typeof Dt=="object"&&Dt!==null){switch(Dt.$$typeof){case _:return ot=ot.get(Dt.key===null?st:Dt.key)||null,Ue(Ye,ot,Dt,cr);case P:return ot=ot.get(Dt.key===null?st:Dt.key)||null,ut(Ye,ot,Dt,cr);case V:var gr=Dt._init;return Vt(ot,Ye,st,gr(Dt._payload),cr)}if(Ie(Dt)||ee(Dt))return ot=ot.get(st)||null,Rt(Ye,ot,Dt,cr,null);Mr(Ye,Dt)}return null}function rr(ot,Ye,st,Dt){for(var cr=null,gr=null,mr=Ye,Cr=Ye=0,Eo=null;mr!==null&&Cr<st.length;Cr++){mr.index>Cr?(Eo=mr,mr=null):Eo=mr.sibling;var on=Nt(ot,mr,st[Cr],Dt);if(on===null){mr===null&&(mr=Eo);break}g&&mr&&on.alternate===null&&v(ot,mr),Ye=ne(on,Ye,Cr),gr===null?cr=on:gr.sibling=on,gr=on,mr=Eo}if(Cr===st.length)return C(ot,mr),jt&&He(ot,Cr),cr;if(mr===null){for(;Cr<st.length;Cr++)mr=Ft(ot,st[Cr],Dt),mr!==null&&(Ye=ne(mr,Ye,Cr),gr===null?cr=mr:gr.sibling=mr,gr=mr);return jt&&He(ot,Cr),cr}for(mr=D(ot,mr);Cr<st.length;Cr++)Eo=Vt(mr,ot,Cr,st[Cr],Dt),Eo!==null&&(g&&Eo.alternate!==null&&mr.delete(Eo.key===null?Cr:Eo.key),Ye=ne(Eo,Ye,Cr),gr===null?cr=Eo:gr.sibling=Eo,gr=Eo);return g&&mr.forEach(function(of){return v(ot,of)}),jt&&He(ot,Cr),cr}function ar(ot,Ye,st,Dt){var cr=ee(st);if(typeof cr!="function")throw Error(r(150));if(st=cr.call(st),st==null)throw Error(r(151));for(var gr=cr=null,mr=Ye,Cr=Ye=0,Eo=null,on=st.next();mr!==null&&!on.done;Cr++,on=st.next()){mr.index>Cr?(Eo=mr,mr=null):Eo=mr.sibling;var of=Nt(ot,mr,on.value,Dt);if(of===null){mr===null&&(mr=Eo);break}g&&mr&&of.alternate===null&&v(ot,mr),Ye=ne(of,Ye,Cr),gr===null?cr=of:gr.sibling=of,gr=of,mr=Eo}if(on.done)return C(ot,mr),jt&&He(ot,Cr),cr;if(mr===null){for(;!on.done;Cr++,on=st.next())on=Ft(ot,on.value,Dt),on!==null&&(Ye=ne(on,Ye,Cr),gr===null?cr=on:gr.sibling=on,gr=on);return jt&&He(ot,Cr),cr}for(mr=D(ot,mr);!on.done;Cr++,on=st.next())on=Vt(mr,ot,Cr,on.value,Dt),on!==null&&(g&&on.alternate!==null&&mr.delete(on.key===null?Cr:on.key),Ye=ne(on,Ye,Cr),gr===null?cr=on:gr.sibling=on,gr=on);return g&&mr.forEach(function(gZ){return v(ot,gZ)}),jt&&He(ot,Cr),cr}function Mi(ot,Ye,st,Dt){if(typeof st=="object"&&st!==null&&st.type===O&&st.key===null&&(st=st.props.children),typeof st=="object"&&st!==null){switch(st.$$typeof){case _:e:{for(var cr=st.key,gr=Ye;gr!==null;){if(gr.key===cr){if(cr=st.type,cr===O){if(gr.tag===7){C(ot,gr.sibling),Ye=Z(gr,st.props.children),Ye.return=ot,ot=Ye;break e}}else if(gr.elementType===cr||typeof cr=="object"&&cr!==null&&cr.$$typeof===V&&In(cr)===gr.type){C(ot,gr.sibling),Ye=Z(gr,st.props),Ye.ref=br(ot,gr,st),Ye.return=ot,ot=Ye;break e}C(ot,gr);break}else v(ot,gr);gr=gr.sibling}st.type===O?(Ye=wp(st.props.children,ot.mode,Dt,st.key),Ye.return=ot,ot=Ye):(Dt=a1(st.type,st.key,st.props,null,ot.mode,Dt),Dt.ref=br(ot,Ye,st),Dt.return=ot,ot=Dt)}return he(ot);case P:e:{for(gr=st.key;Ye!==null;){if(Ye.key===gr)if(Ye.tag===4&&Ye.stateNode.containerInfo===st.containerInfo&&Ye.stateNode.implementation===st.implementation){C(ot,Ye.sibling),Ye=Z(Ye,st.children||[]),Ye.return=ot,ot=Ye;break e}else{C(ot,Ye);break}else v(ot,Ye);Ye=Ye.sibling}Ye=xj(st,ot.mode,Dt),Ye.return=ot,ot=Ye}return he(ot);case V:return gr=st._init,Mi(ot,Ye,gr(st._payload),Dt)}if(Ie(st))return rr(ot,Ye,st,Dt);if(ee(st))return ar(ot,Ye,st,Dt);Mr(ot,st)}return typeof st=="string"&&st!==""||typeof st=="number"?(st=""+st,Ye!==null&&Ye.tag===6?(C(ot,Ye.sibling),Ye=Z(Ye,st),Ye.return=ot,ot=Ye):(C(ot,Ye),Ye=yj(st,ot.mode,Dt),Ye.return=ot,ot=Ye),he(ot)):C(ot,Ye)}return Mi}var Si=Vi(!0),ti=Vi(!1),Li=As(null),Yi=null,qn=null,Hr=null;function en(){Hr=qn=Yi=null}function $n(g){var v=Li.current;fn(Li),g._currentValue=v}function tn(g,v,C){for(;g!==null;){var D=g.alternate;if((g.childLanes&v)!==v?(g.childLanes|=v,D!==null&&(D.childLanes|=v)):D!==null&&(D.childLanes&v)!==v&&(D.childLanes|=v),g===C)break;g=g.return}}function si(g,v){Yi=g,Hr=qn=null,g=g.dependencies,g!==null&&g.firstContext!==null&&((g.lanes&v)!==0&&(es=!0),g.firstContext=null)}function li(g){var v=g._currentValue;if(Hr!==g)if(g={context:g,memoizedValue:v,next:null},qn===null){if(Yi===null)throw Error(r(308));qn=g,Yi.dependencies={lanes:0,firstContext:g}}else qn=qn.next=g;return v}var En=null;function jo(g){En===null?En=[g]:En.push(g)}function vn(g,v,C,D){var Z=v.interleaved;return Z===null?(C.next=C,jo(v)):(C.next=Z.next,Z.next=C),v.interleaved=C,An(g,D)}function An(g,v){g.lanes|=v;var C=g.alternate;for(C!==null&&(C.lanes|=v),C=g,g=g.return;g!==null;)g.childLanes|=v,C=g.alternate,C!==null&&(C.childLanes|=v),C=g,g=g.return;return C.tag===3?C.stateNode:null}var ji=!1;function oo(g){g.updateQueue={baseState:g.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function na(g,v){g=g.updateQueue,v.updateQueue===g&&(v.updateQueue={baseState:g.baseState,firstBaseUpdate:g.firstBaseUpdate,lastBaseUpdate:g.lastBaseUpdate,shared:g.shared,effects:g.effects})}function fi(g,v){return{eventTime:g,lane:v,tag:0,payload:null,callback:null,next:null}}function pi(g,v,C){var D=g.updateQueue;if(D===null)return null;if(D=D.shared,(rn&2)!==0){var Z=D.pending;return Z===null?v.next=v:(v.next=Z.next,Z.next=v),D.pending=v,An(g,C)}return Z=D.interleaved,Z===null?(v.next=v,jo(D)):(v.next=Z.next,Z.next=v),D.interleaved=v,An(g,C)}function ko(g,v,C){if(v=v.updateQueue,v!==null&&(v=v.shared,(C&4194240)!==0)){var D=v.lanes;D&=g.pendingLanes,C|=D,v.lanes=C,Xf(g,C)}}function Tn(g,v){var C=g.updateQueue,D=g.alternate;if(D!==null&&(D=D.updateQueue,C===D)){var Z=null,ne=null;if(C=C.firstBaseUpdate,C!==null){do{var he={eventTime:C.eventTime,lane:C.lane,tag:C.tag,payload:C.payload,callback:C.callback,next:null};ne===null?Z=ne=he:ne=ne.next=he,C=C.next}while(C!==null);ne===null?Z=ne=v:ne=ne.next=v}else Z=ne=v;C={baseState:D.baseState,firstBaseUpdate:Z,lastBaseUpdate:ne,shared:D.shared,effects:D.effects},g.updateQueue=C;return}g=C.lastBaseUpdate,g===null?C.firstBaseUpdate=v:g.next=v,C.lastBaseUpdate=v}function _o(g,v,C,D){var Z=g.updateQueue;ji=!1;var ne=Z.firstBaseUpdate,he=Z.lastBaseUpdate,Re=Z.shared.pending;if(Re!==null){Z.shared.pending=null;var Ue=Re,ut=Ue.next;Ue.next=null,he===null?ne=ut:he.next=ut,he=Ue;var Rt=g.alternate;Rt!==null&&(Rt=Rt.updateQueue,Re=Rt.lastBaseUpdate,Re!==he&&(Re===null?Rt.firstBaseUpdate=ut:Re.next=ut,Rt.lastBaseUpdate=Ue))}if(ne!==null){var Ft=Z.baseState;he=0,Rt=ut=Ue=null,Re=ne;do{var Nt=Re.lane,Vt=Re.eventTime;if((D&Nt)===Nt){Rt!==null&&(Rt=Rt.next={eventTime:Vt,lane:0,tag:Re.tag,payload:Re.payload,callback:Re.callback,next:null});e:{var rr=g,ar=Re;switch(Nt=v,Vt=C,ar.tag){case 1:if(rr=ar.payload,typeof rr=="function"){Ft=rr.call(Vt,Ft,Nt);break e}Ft=rr;break e;case 3:rr.flags=rr.flags&-65537|128;case 0:if(rr=ar.payload,Nt=typeof rr=="function"?rr.call(Vt,Ft,Nt):rr,Nt==null)break e;Ft=H({},Ft,Nt);break e;case 2:ji=!0}}Re.callback!==null&&Re.lane!==0&&(g.flags|=64,Nt=Z.effects,Nt===null?Z.effects=[Re]:Nt.push(Re))}else Vt={eventTime:Vt,lane:Nt,tag:Re.tag,payload:Re.payload,callback:Re.callback,next:null},Rt===null?(ut=Rt=Vt,Ue=Ft):Rt=Rt.next=Vt,he|=Nt;if(Re=Re.next,Re===null){if(Re=Z.shared.pending,Re===null)break;Nt=Re,Re=Nt.next,Nt.next=null,Z.lastBaseUpdate=Nt,Z.shared.pending=null}}while(!0);if(Rt===null&&(Ue=Ft),Z.baseState=Ue,Z.firstBaseUpdate=ut,Z.lastBaseUpdate=Rt,v=Z.shared.interleaved,v!==null){Z=v;do he|=Z.lane,Z=Z.next;while(Z!==v)}else ne===null&&(Z.shared.lanes=0);vp|=he,g.lanes=he,g.memoizedState=Ft}}function Ja(g,v,C){if(g=v.effects,v.effects=null,g!==null)for(v=0;v<g.length;v++){var D=g[v],Z=D.callback;if(Z!==null){if(D.callback=null,D=C,typeof Z!="function")throw Error(r(191,Z));Z.call(D)}}}var Ts={},Gi=As(Ts),hi=As(Ts),Nc=As(Ts);function ql(g){if(g===Ts)throw Error(r(174));return g}function Gd(g,v){switch(mn(Nc,v),mn(hi,g),mn(Gi,Ts),g=v.nodeType,g){case 9:case 11:v=(v=v.documentElement)?v.namespaceURI:Ge(null,"");break;default:g=g===8?v.parentNode:v,v=g.namespaceURI||null,g=g.tagName,v=Ge(v,g)}fn(Gi),mn(Gi,v)}function dl(){fn(Gi),fn(hi),fn(Nc)}function Wb(g){ql(Nc.current);var v=ql(Gi.current),C=Ge(v,g.type);v!==C&&(mn(hi,g),mn(Gi,C))}function Gv(g){hi.current===g&&(fn(Gi),fn(hi))}var Mn=As(0);function Ps(g){for(var v=g;v!==null;){if(v.tag===13){var C=v.memoizedState;if(C!==null&&(C=C.dehydrated,C===null||C.data==="$?"||C.data==="$!"))return v}else if(v.tag===19&&v.memoizedProps.revealOrder!==void 0){if((v.flags&128)!==0)return v}else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===g)break;for(;v.sibling===null;){if(v.return===null||v.return===g)return null;v=v.return}v.sibling.return=v.return,v=v.sibling}return null}var Kv=[];function Qv(){for(var g=0;g<Kv.length;g++)Kv[g]._workInProgressVersionPrimary=null;Kv.length=0}var ng=S.ReactCurrentDispatcher,ig=S.ReactCurrentBatchConfig,fl=0,Un=null,ki=null,gi=null,Kd=!1,$l=!1,Qd=0,US=0;function Fi(){throw Error(r(321))}function og(g,v){if(v===null)return!1;for(var C=0;C<v.length&&C<g.length;C++)if(!Hi(g[C],v[C]))return!1;return!0}function hp(g,v,C,D,Z,ne){if(fl=ne,Un=v,v.memoizedState=null,v.updateQueue=null,v.lanes=0,ng.current=g===null||g.memoizedState===null?WX:qX,g=C(D,Z),$l){ne=0;do{if($l=!1,Qd=0,25<=ne)throw Error(r(301));ne+=1,gi=ki=null,v.updateQueue=null,ng.current=$X,g=C(D,Z)}while($l)}if(ng.current=Vb,v=ki!==null&&ki.next!==null,fl=0,gi=ki=Un=null,Kd=!1,v)throw Error(r(300));return g}function pl(){var g=Qd!==0;return Qd=0,g}function Os(){var g={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gi===null?Un.memoizedState=gi=g:gi=gi.next=g,gi}function _a(){if(ki===null){var g=Un.alternate;g=g!==null?g.memoizedState:null}else g=ki.next;var v=gi===null?Un.memoizedState:gi.next;if(v!==null)gi=v,ki=g;else{if(g===null)throw Error(r(310));ki=g,g={memoizedState:ki.memoizedState,baseState:ki.baseState,baseQueue:ki.baseQueue,queue:ki.queue,next:null},gi===null?Un.memoizedState=gi=g:gi=gi.next=g}return gi}function gp(g,v){return typeof v=="function"?v(g):v}function ag(g){var v=_a(),C=v.queue;if(C===null)throw Error(r(311));C.lastRenderedReducer=g;var D=ki,Z=D.baseQueue,ne=C.pending;if(ne!==null){if(Z!==null){var he=Z.next;Z.next=ne.next,ne.next=he}D.baseQueue=Z=ne,C.pending=null}if(Z!==null){ne=Z.next,D=D.baseState;var Re=he=null,Ue=null,ut=ne;do{var Rt=ut.lane;if((fl&Rt)===Rt)Ue!==null&&(Ue=Ue.next={lane:0,action:ut.action,hasEagerState:ut.hasEagerState,eagerState:ut.eagerState,next:null}),D=ut.hasEagerState?ut.eagerState:g(D,ut.action);else{var Ft={lane:Rt,action:ut.action,hasEagerState:ut.hasEagerState,eagerState:ut.eagerState,next:null};Ue===null?(Re=Ue=Ft,he=D):Ue=Ue.next=Ft,Un.lanes|=Rt,vp|=Rt}ut=ut.next}while(ut!==null&&ut!==ne);Ue===null?he=D:Ue.next=Re,Hi(D,v.memoizedState)||(es=!0),v.memoizedState=D,v.baseState=he,v.baseQueue=Ue,C.lastRenderedState=D}if(g=C.interleaved,g!==null){Z=g;do ne=Z.lane,Un.lanes|=ne,vp|=ne,Z=Z.next;while(Z!==g)}else Z===null&&(C.lanes=0);return[v.memoizedState,C.dispatch]}function Rc(g){var v=_a(),C=v.queue;if(C===null)throw Error(r(311));C.lastRenderedReducer=g;var D=C.dispatch,Z=C.pending,ne=v.memoizedState;if(Z!==null){C.pending=null;var he=Z=Z.next;do ne=g(ne,he.action),he=he.next;while(he!==Z);Hi(ne,v.memoizedState)||(es=!0),v.memoizedState=ne,v.baseQueue===null&&(v.baseState=ne),C.lastRenderedState=ne}return[ne,D]}function qb(){}function Xv(g,v){var C=Un,D=_a(),Z=v(),ne=!Hi(D.memoizedState,Z);if(ne&&(D.memoizedState=Z,es=!0),D=D.queue,cg(Ub.bind(null,C,D,g),[g]),D.getSnapshot!==v||ne||gi!==null&&gi.memoizedState.tag&1){if(C.flags|=2048,Ca(9,Zv.bind(null,C,D,Z,v),void 0,null),Co===null)throw Error(r(349));(fl&30)!==0||$b(C,v,Z)}return Z}function $b(g,v,C){g.flags|=16384,g={getSnapshot:v,value:C},v=Un.updateQueue,v===null?(v={lastEffect:null,stores:null},Un.updateQueue=v,v.stores=[g]):(C=v.stores,C===null?v.stores=[g]:C.push(g))}function Zv(g,v,C,D){v.value=C,v.getSnapshot=D,Xd(v)&&sg(g)}function Ub(g,v,C){return C(function(){Xd(v)&&sg(g)})}function Xd(g){var v=g.getSnapshot;g=g.value;try{var C=v();return!Hi(g,C)}catch{return!0}}function sg(g){var v=An(g,1);v!==null&&Gl(v,g,1,-1)}function mp(g){var v=Os();return typeof g=="function"&&(g=g()),v.memoizedState=v.baseState=g,g={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:gp,lastRenderedState:g},v.queue=g,g=g.dispatch=BX.bind(null,Un,g),[v.memoizedState,g]}function Ca(g,v,C,D){return g={tag:g,create:v,destroy:C,deps:D,next:null},v=Un.updateQueue,v===null?(v={lastEffect:null,stores:null},Un.updateQueue=v,v.lastEffect=g.next=g):(C=v.lastEffect,C===null?v.lastEffect=g.next=g:(D=C.next,C.next=g,g.next=D,v.lastEffect=g)),g}function Ul(){return _a().memoizedState}function Is(g,v,C,D){var Z=Os();Un.flags|=g,Z.memoizedState=Ca(1|v,C,void 0,D===void 0?null:D)}function Mu(g,v,C,D){var Z=_a();D=D===void 0?null:D;var ne=void 0;if(ki!==null){var he=ki.memoizedState;if(ne=he.destroy,D!==null&&og(D,he.deps)){Z.memoizedState=Ca(v,C,ne,D);return}}Un.flags|=g,Z.memoizedState=Ca(1|v,C,ne,D)}function lg(g,v){return Is(8390656,8,g,v)}function cg(g,v){return Mu(2048,8,g,v)}function Hb(g,v){return Mu(4,2,g,v)}function ug(g,v){return Mu(4,4,g,v)}function dg(g,v){if(typeof v=="function")return g=g(),v(g),function(){v(null)};if(v!=null)return g=g(),v.current=g,function(){v.current=null}}function O8(g,v,C){return C=C!=null?C.concat([g]):null,Mu(4,4,dg.bind(null,v,g),C)}function HS(){}function I8(g,v){var C=_a();v=v===void 0?null:v;var D=C.memoizedState;return D!==null&&v!==null&&og(v,D[1])?D[0]:(C.memoizedState=[g,v],g)}function N8(g,v){var C=_a();v=v===void 0?null:v;var D=C.memoizedState;return D!==null&&v!==null&&og(v,D[1])?D[0]:(g=g(),C.memoizedState=[g,v],g)}function R8(g,v,C){return(fl&21)===0?(g.baseState&&(g.baseState=!1,es=!0),g.memoizedState=C):(Hi(C,v)||(C=Ui(),Un.lanes|=C,vp|=C,g.baseState=!0),v)}function DX(g,v){var C=Fr;Fr=C!==0&&4>C?C:4,g(!0);var D=ig.transition;ig.transition={};try{g(!1),v()}finally{Fr=C,ig.transition=D}}function L8(){return _a().memoizedState}function zX(g,v,C){var D=tf(g);if(C={lane:D,action:C,hasEagerState:!1,eagerState:null,next:null},F8(g))M8(v,C);else if(C=vn(g,v,C,D),C!==null){var Z=Aa();Gl(C,g,D,Z),D8(C,v,D)}}function BX(g,v,C){var D=tf(g),Z={lane:D,action:C,hasEagerState:!1,eagerState:null,next:null};if(F8(g))M8(v,Z);else{var ne=g.alternate;if(g.lanes===0&&(ne===null||ne.lanes===0)&&(ne=v.lastRenderedReducer,ne!==null))try{var he=v.lastRenderedState,Re=ne(he,C);if(Z.hasEagerState=!0,Z.eagerState=Re,Hi(Re,he)){var Ue=v.interleaved;Ue===null?(Z.next=Z,jo(v)):(Z.next=Ue.next,Ue.next=Z),v.interleaved=Z;return}}catch{}finally{}C=vn(g,v,Z,D),C!==null&&(Z=Aa(),Gl(C,g,D,Z),D8(C,v,D))}}function F8(g){var v=g.alternate;return g===Un||v!==null&&v===Un}function M8(g,v){$l=Kd=!0;var C=g.pending;C===null?v.next=v:(v.next=C.next,C.next=v),g.pending=v}function D8(g,v,C){if((C&4194240)!==0){var D=v.lanes;D&=g.pendingLanes,C|=D,v.lanes=C,Xf(g,C)}}var Vb={readContext:li,useCallback:Fi,useContext:Fi,useEffect:Fi,useImperativeHandle:Fi,useInsertionEffect:Fi,useLayoutEffect:Fi,useMemo:Fi,useReducer:Fi,useRef:Fi,useState:Fi,useDebugValue:Fi,useDeferredValue:Fi,useTransition:Fi,useMutableSource:Fi,useSyncExternalStore:Fi,useId:Fi,unstable_isNewReconciler:!1},WX={readContext:li,useCallback:function(g,v){return Os().memoizedState=[g,v===void 0?null:v],g},useContext:li,useEffect:lg,useImperativeHandle:function(g,v,C){return C=C!=null?C.concat([g]):null,Is(4194308,4,dg.bind(null,v,g),C)},useLayoutEffect:function(g,v){return Is(4194308,4,g,v)},useInsertionEffect:function(g,v){return Is(4,2,g,v)},useMemo:function(g,v){var C=Os();return v=v===void 0?null:v,g=g(),C.memoizedState=[g,v],g},useReducer:function(g,v,C){var D=Os();return v=C!==void 0?C(v):v,D.memoizedState=D.baseState=v,g={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:g,lastRenderedState:v},D.queue=g,g=g.dispatch=zX.bind(null,Un,g),[D.memoizedState,g]},useRef:function(g){var v=Os();return g={current:g},v.memoizedState=g},useState:mp,useDebugValue:HS,useDeferredValue:function(g){return Os().memoizedState=g},useTransition:function(){var g=mp(!1),v=g[0];return g=DX.bind(null,g[1]),Os().memoizedState=g,[v,g]},useMutableSource:function(){},useSyncExternalStore:function(g,v,C){var D=Un,Z=Os();if(jt){if(C===void 0)throw Error(r(407));C=C()}else{if(C=v(),Co===null)throw Error(r(349));(fl&30)!==0||$b(D,v,C)}Z.memoizedState=C;var ne={value:C,getSnapshot:v};return Z.queue=ne,lg(Ub.bind(null,D,ne,g),[g]),D.flags|=2048,Ca(9,Zv.bind(null,D,ne,C,v),void 0,null),C},useId:function(){var g=Os(),v=Co.identifierPrefix;if(jt){var C=Ee,D=it;C=(D&~(1<<32-yi(D)-1)).toString(32)+C,v=":"+v+"R"+C,C=Qd++,0<C&&(v+="H"+C.toString(32)),v+=":"}else C=US++,v=":"+v+"r"+C.toString(32)+":";return g.memoizedState=v},unstable_isNewReconciler:!1},qX={readContext:li,useCallback:I8,useContext:li,useEffect:cg,useImperativeHandle:O8,useInsertionEffect:Hb,useLayoutEffect:ug,useMemo:N8,useReducer:ag,useRef:Ul,useState:function(){return ag(gp)},useDebugValue:HS,useDeferredValue:function(g){var v=_a();return R8(v,ki.memoizedState,g)},useTransition:function(){var g=ag(gp)[0],v=_a().memoizedState;return[g,v]},useMutableSource:qb,useSyncExternalStore:Xv,useId:L8,unstable_isNewReconciler:!1},$X={readContext:li,useCallback:I8,useContext:li,useEffect:cg,useImperativeHandle:O8,useInsertionEffect:Hb,useLayoutEffect:ug,useMemo:N8,useReducer:Rc,useRef:Ul,useState:function(){return Rc(gp)},useDebugValue:HS,useDeferredValue:function(g){var v=_a();return ki===null?v.memoizedState=g:R8(v,ki.memoizedState,g)},useTransition:function(){var g=Rc(gp)[0],v=_a().memoizedState;return[g,v]},useMutableSource:qb,useSyncExternalStore:Xv,useId:L8,unstable_isNewReconciler:!1};function Hl(g,v){if(g&&g.defaultProps){v=H({},v),g=g.defaultProps;for(var C in g)v[C]===void 0&&(v[C]=g[C]);return v}return v}function VS(g,v,C,D){v=g.memoizedState,C=C(D,v),C=C==null?v:H({},v,C),g.memoizedState=C,g.lanes===0&&(g.updateQueue.baseState=C)}var Yb={isMounted:function(g){return(g=g._reactInternals)?Ln(g)===g:!1},enqueueSetState:function(g,v,C){g=g._reactInternals;var D=Aa(),Z=tf(g),ne=fi(D,Z);ne.payload=v,C!=null&&(ne.callback=C),v=pi(g,ne,Z),v!==null&&(Gl(v,g,Z,D),ko(v,g,Z))},enqueueReplaceState:function(g,v,C){g=g._reactInternals;var D=Aa(),Z=tf(g),ne=fi(D,Z);ne.tag=1,ne.payload=v,C!=null&&(ne.callback=C),v=pi(g,ne,Z),v!==null&&(Gl(v,g,Z,D),ko(v,g,Z))},enqueueForceUpdate:function(g,v){g=g._reactInternals;var C=Aa(),D=tf(g),Z=fi(C,D);Z.tag=2,v!=null&&(Z.callback=v),v=pi(g,Z,D),v!==null&&(Gl(v,g,D,C),ko(v,g,D))}};function z8(g,v,C,D,Z,ne,he){return g=g.stateNode,typeof g.shouldComponentUpdate=="function"?g.shouldComponentUpdate(D,ne,he):v.prototype&&v.prototype.isPureReactComponent?!sl(C,D)||!sl(Z,ne):!0}function B8(g,v,C){var D=!1,Z=Ic,ne=v.contextType;return typeof ne=="object"&&ne!==null?ne=li(ne):(Z=ra(v)?Lu:io.current,D=v.contextTypes,ne=(D=D!=null)?Yd(g,Z):Ic),v=new v(C,ne),g.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Yb,g.stateNode=v,v._reactInternals=g,D&&(g=g.stateNode,g.__reactInternalMemoizedUnmaskedChildContext=Z,g.__reactInternalMemoizedMaskedChildContext=ne),v}function W8(g,v,C,D){g=v.state,typeof v.componentWillReceiveProps=="function"&&v.componentWillReceiveProps(C,D),typeof v.UNSAFE_componentWillReceiveProps=="function"&&v.UNSAFE_componentWillReceiveProps(C,D),v.state!==g&&Yb.enqueueReplaceState(v,v.state,null)}function YS(g,v,C,D){var Z=g.stateNode;Z.props=C,Z.state=g.memoizedState,Z.refs={},oo(g);var ne=v.contextType;typeof ne=="object"&&ne!==null?Z.context=li(ne):(ne=ra(v)?Lu:io.current,Z.context=Yd(g,ne)),Z.state=g.memoizedState,ne=v.getDerivedStateFromProps,typeof ne=="function"&&(VS(g,v,ne,C),Z.state=g.memoizedState),typeof v.getDerivedStateFromProps=="function"||typeof Z.getSnapshotBeforeUpdate=="function"||typeof Z.UNSAFE_componentWillMount!="function"&&typeof Z.componentWillMount!="function"||(v=Z.state,typeof Z.componentWillMount=="function"&&Z.componentWillMount(),typeof Z.UNSAFE_componentWillMount=="function"&&Z.UNSAFE_componentWillMount(),v!==Z.state&&Yb.enqueueReplaceState(Z,Z.state,null),_o(g,C,Z,D),Z.state=g.memoizedState),typeof Z.componentDidMount=="function"&&(g.flags|=4194308)}function fg(g,v){try{var C="",D=v;do C+=Y(D),D=D.return;while(D);var Z=C}catch(ne){Z=`
|
||
Error generating stack: `+ne.message+`
|
||
`+ne.stack}return{value:g,source:v,stack:Z,digest:null}}function GS(g,v,C){return{value:g,source:null,stack:C??null,digest:v??null}}function KS(g,v){try{console.error(v.value)}catch(C){setTimeout(function(){throw C})}}var UX=typeof WeakMap=="function"?WeakMap:Map;function q8(g,v,C){C=fi(-1,C),C.tag=3,C.payload={element:null};var D=v.value;return C.callback=function(){e1||(e1=!0,uj=D),KS(g,v)},C}function $8(g,v,C){C=fi(-1,C),C.tag=3;var D=g.type.getDerivedStateFromError;if(typeof D=="function"){var Z=v.value;C.payload=function(){return D(Z)},C.callback=function(){KS(g,v)}}var ne=g.stateNode;return ne!==null&&typeof ne.componentDidCatch=="function"&&(C.callback=function(){KS(g,v),typeof D!="function"&&(Jd===null?Jd=new Set([this]):Jd.add(this));var he=v.stack;this.componentDidCatch(v.value,{componentStack:he!==null?he:""})}),C}function U8(g,v,C){var D=g.pingCache;if(D===null){D=g.pingCache=new UX;var Z=new Set;D.set(v,Z)}else Z=D.get(v),Z===void 0&&(Z=new Set,D.set(v,Z));Z.has(C)||(Z.add(C),g=iZ.bind(null,g,v,C),v.then(g,g))}function H8(g){do{var v;if((v=g.tag===13)&&(v=g.memoizedState,v=v!==null?v.dehydrated!==null:!0),v)return g;g=g.return}while(g!==null);return null}function V8(g,v,C,D,Z){return(g.mode&1)===0?(g===v?g.flags|=65536:(g.flags|=128,C.flags|=131072,C.flags&=-52805,C.tag===1&&(C.alternate===null?C.tag=17:(v=fi(-1,1),v.tag=2,pi(C,v,1))),C.lanes|=1),g):(g.flags|=65536,g.lanes=Z,g)}var HX=S.ReactCurrentOwner,es=!1;function Ea(g,v,C,D){v.child=g===null?ti(v,null,C,D):Si(v,g.child,C,D)}function Y8(g,v,C,D,Z){C=C.render;var ne=v.ref;return si(v,Z),D=hp(g,v,C,D,ne,Z),C=pl(),g!==null&&!es?(v.updateQueue=g.updateQueue,v.flags&=-2053,g.lanes&=~Z,Du(g,v,Z)):(jt&&C&&yt(v),v.flags|=1,Ea(g,v,D,Z),v.child)}function G8(g,v,C,D,Z){if(g===null){var ne=C.type;return typeof ne=="function"&&!vj(ne)&&ne.defaultProps===void 0&&C.compare===null&&C.defaultProps===void 0?(v.tag=15,v.type=ne,K8(g,v,ne,D,Z)):(g=a1(C.type,null,D,v,v.mode,Z),g.ref=v.ref,g.return=v,v.child=g)}if(ne=g.child,(g.lanes&Z)===0){var he=ne.memoizedProps;if(C=C.compare,C=C!==null?C:sl,C(he,D)&&g.ref===v.ref)return Du(g,v,Z)}return v.flags|=1,g=nf(ne,D),g.ref=v.ref,g.return=v,v.child=g}function K8(g,v,C,D,Z){if(g!==null){var ne=g.memoizedProps;if(sl(ne,D)&&g.ref===v.ref)if(es=!1,v.pendingProps=D=ne,(g.lanes&Z)!==0)(g.flags&131072)!==0&&(es=!0);else return v.lanes=g.lanes,Du(g,v,Z)}return QS(g,v,C,D,Z)}function Q8(g,v,C){var D=v.pendingProps,Z=D.children,ne=g!==null?g.memoizedState:null;if(D.mode==="hidden")if((v.mode&1)===0)v.memoizedState={baseLanes:0,cachePool:null,transitions:null},mn(hg,Ns),Ns|=C;else{if((C&1073741824)===0)return g=ne!==null?ne.baseLanes|C:C,v.lanes=v.childLanes=1073741824,v.memoizedState={baseLanes:g,cachePool:null,transitions:null},v.updateQueue=null,mn(hg,Ns),Ns|=g,null;v.memoizedState={baseLanes:0,cachePool:null,transitions:null},D=ne!==null?ne.baseLanes:C,mn(hg,Ns),Ns|=D}else ne!==null?(D=ne.baseLanes|C,v.memoizedState=null):D=C,mn(hg,Ns),Ns|=D;return Ea(g,v,Z,C),v.child}function X8(g,v){var C=v.ref;(g===null&&C!==null||g!==null&&g.ref!==C)&&(v.flags|=512,v.flags|=2097152)}function QS(g,v,C,D,Z){var ne=ra(C)?Lu:io.current;return ne=Yd(v,ne),si(v,Z),C=hp(g,v,C,D,ne,Z),D=pl(),g!==null&&!es?(v.updateQueue=g.updateQueue,v.flags&=-2053,g.lanes&=~Z,Du(g,v,Z)):(jt&&D&&yt(v),v.flags|=1,Ea(g,v,C,Z),v.child)}function Z8(g,v,C,D,Z){if(ra(C)){var ne=!0;Fu(v)}else ne=!1;if(si(v,Z),v.stateNode===null)Kb(g,v),B8(v,C,D),YS(v,C,D,Z),D=!0;else if(g===null){var he=v.stateNode,Re=v.memoizedProps;he.props=Re;var Ue=he.context,ut=C.contextType;typeof ut=="object"&&ut!==null?ut=li(ut):(ut=ra(C)?Lu:io.current,ut=Yd(v,ut));var Rt=C.getDerivedStateFromProps,Ft=typeof Rt=="function"||typeof he.getSnapshotBeforeUpdate=="function";Ft||typeof he.UNSAFE_componentWillReceiveProps!="function"&&typeof he.componentWillReceiveProps!="function"||(Re!==D||Ue!==ut)&&W8(v,he,D,ut),ji=!1;var Nt=v.memoizedState;he.state=Nt,_o(v,D,he,Z),Ue=v.memoizedState,Re!==D||Nt!==Ue||ta.current||ji?(typeof Rt=="function"&&(VS(v,C,Rt,D),Ue=v.memoizedState),(Re=ji||z8(v,C,Re,D,Nt,Ue,ut))?(Ft||typeof he.UNSAFE_componentWillMount!="function"&&typeof he.componentWillMount!="function"||(typeof he.componentWillMount=="function"&&he.componentWillMount(),typeof he.UNSAFE_componentWillMount=="function"&&he.UNSAFE_componentWillMount()),typeof he.componentDidMount=="function"&&(v.flags|=4194308)):(typeof he.componentDidMount=="function"&&(v.flags|=4194308),v.memoizedProps=D,v.memoizedState=Ue),he.props=D,he.state=Ue,he.context=ut,D=Re):(typeof he.componentDidMount=="function"&&(v.flags|=4194308),D=!1)}else{he=v.stateNode,na(g,v),Re=v.memoizedProps,ut=v.type===v.elementType?Re:Hl(v.type,Re),he.props=ut,Ft=v.pendingProps,Nt=he.context,Ue=C.contextType,typeof Ue=="object"&&Ue!==null?Ue=li(Ue):(Ue=ra(C)?Lu:io.current,Ue=Yd(v,Ue));var Vt=C.getDerivedStateFromProps;(Rt=typeof Vt=="function"||typeof he.getSnapshotBeforeUpdate=="function")||typeof he.UNSAFE_componentWillReceiveProps!="function"&&typeof he.componentWillReceiveProps!="function"||(Re!==Ft||Nt!==Ue)&&W8(v,he,D,Ue),ji=!1,Nt=v.memoizedState,he.state=Nt,_o(v,D,he,Z);var rr=v.memoizedState;Re!==Ft||Nt!==rr||ta.current||ji?(typeof Vt=="function"&&(VS(v,C,Vt,D),rr=v.memoizedState),(ut=ji||z8(v,C,ut,D,Nt,rr,Ue)||!1)?(Rt||typeof he.UNSAFE_componentWillUpdate!="function"&&typeof he.componentWillUpdate!="function"||(typeof he.componentWillUpdate=="function"&&he.componentWillUpdate(D,rr,Ue),typeof he.UNSAFE_componentWillUpdate=="function"&&he.UNSAFE_componentWillUpdate(D,rr,Ue)),typeof he.componentDidUpdate=="function"&&(v.flags|=4),typeof he.getSnapshotBeforeUpdate=="function"&&(v.flags|=1024)):(typeof he.componentDidUpdate!="function"||Re===g.memoizedProps&&Nt===g.memoizedState||(v.flags|=4),typeof he.getSnapshotBeforeUpdate!="function"||Re===g.memoizedProps&&Nt===g.memoizedState||(v.flags|=1024),v.memoizedProps=D,v.memoizedState=rr),he.props=D,he.state=rr,he.context=Ue,D=ut):(typeof he.componentDidUpdate!="function"||Re===g.memoizedProps&&Nt===g.memoizedState||(v.flags|=4),typeof he.getSnapshotBeforeUpdate!="function"||Re===g.memoizedProps&&Nt===g.memoizedState||(v.flags|=1024),D=!1)}return XS(g,v,C,D,ne,Z)}function XS(g,v,C,D,Z,ne){X8(g,v);var he=(v.flags&128)!==0;if(!D&&!he)return Z&&Bb(v,C,!1),Du(g,v,ne);D=v.stateNode,HX.current=v;var Re=he&&typeof C.getDerivedStateFromError!="function"?null:D.render();return v.flags|=1,g!==null&&he?(v.child=Si(v,g.child,null,ne),v.child=Si(v,null,Re,ne)):Ea(g,v,Re,ne),v.memoizedState=D.state,Z&&Bb(v,C,!0),v.child}function J8(g){var v=g.stateNode;v.pendingContext?zb(g,v.pendingContext,v.pendingContext!==v.context):v.context&&zb(g,v.context,!1),Gd(g,v.containerInfo)}function eO(g,v,C,D,Z){return Gt(),qt(Z),v.flags|=256,Ea(g,v,C,D),v.child}var ZS={dehydrated:null,treeContext:null,retryLane:0};function JS(g){return{baseLanes:g,cachePool:null,transitions:null}}function tO(g,v,C){var D=v.pendingProps,Z=Mn.current,ne=!1,he=(v.flags&128)!==0,Re;if((Re=he)||(Re=g!==null&&g.memoizedState===null?!1:(Z&2)!==0),Re?(ne=!0,v.flags&=-129):(g===null||g.memoizedState!==null)&&(Z|=1),mn(Mn,Z&1),g===null)return Jt(v),g=v.memoizedState,g!==null&&(g=g.dehydrated,g!==null)?((v.mode&1)===0?v.lanes=1:g.data==="$!"?v.lanes=8:v.lanes=1073741824,null):(he=D.children,g=D.fallback,ne?(D=v.mode,ne=v.child,he={mode:"hidden",children:he},(D&1)===0&&ne!==null?(ne.childLanes=0,ne.pendingProps=he):ne=s1(he,D,0,null),g=wp(g,D,C,null),ne.return=v,g.return=v,ne.sibling=g,v.child=ne,v.child.memoizedState=JS(C),v.memoizedState=ZS,g):ej(v,he));if(Z=g.memoizedState,Z!==null&&(Re=Z.dehydrated,Re!==null))return VX(g,v,he,D,Re,Z,C);if(ne){ne=D.fallback,he=v.mode,Z=g.child,Re=Z.sibling;var Ue={mode:"hidden",children:D.children};return(he&1)===0&&v.child!==Z?(D=v.child,D.childLanes=0,D.pendingProps=Ue,v.deletions=null):(D=nf(Z,Ue),D.subtreeFlags=Z.subtreeFlags&14680064),Re!==null?ne=nf(Re,ne):(ne=wp(ne,he,C,null),ne.flags|=2),ne.return=v,D.return=v,D.sibling=ne,v.child=D,D=ne,ne=v.child,he=g.child.memoizedState,he=he===null?JS(C):{baseLanes:he.baseLanes|C,cachePool:null,transitions:he.transitions},ne.memoizedState=he,ne.childLanes=g.childLanes&~C,v.memoizedState=ZS,D}return ne=g.child,g=ne.sibling,D=nf(ne,{mode:"visible",children:D.children}),(v.mode&1)===0&&(D.lanes=C),D.return=v,D.sibling=null,g!==null&&(C=v.deletions,C===null?(v.deletions=[g],v.flags|=16):C.push(g)),v.child=D,v.memoizedState=null,D}function ej(g,v){return v=s1({mode:"visible",children:v},g.mode,0,null),v.return=g,g.child=v}function Gb(g,v,C,D){return D!==null&&qt(D),Si(v,g.child,null,C),g=ej(v,v.pendingProps.children),g.flags|=2,v.memoizedState=null,g}function VX(g,v,C,D,Z,ne,he){if(C)return v.flags&256?(v.flags&=-257,D=GS(Error(r(422))),Gb(g,v,he,D)):v.memoizedState!==null?(v.child=g.child,v.flags|=128,null):(ne=D.fallback,Z=v.mode,D=s1({mode:"visible",children:D.children},Z,0,null),ne=wp(ne,Z,he,null),ne.flags|=2,D.return=v,ne.return=v,D.sibling=ne,v.child=D,(v.mode&1)!==0&&Si(v,g.child,null,he),v.child.memoizedState=JS(he),v.memoizedState=ZS,ne);if((v.mode&1)===0)return Gb(g,v,he,null);if(Z.data==="$!"){if(D=Z.nextSibling&&Z.nextSibling.dataset,D)var Re=D.dgst;return D=Re,ne=Error(r(419)),D=GS(ne,D,void 0),Gb(g,v,he,D)}if(Re=(he&g.childLanes)!==0,es||Re){if(D=Co,D!==null){switch(he&-he){case 4:Z=2;break;case 16:Z=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:Z=32;break;case 536870912:Z=268435456;break;default:Z=0}Z=(Z&(D.suspendedLanes|he))!==0?0:Z,Z!==0&&Z!==ne.retryLane&&(ne.retryLane=Z,An(g,Z),Gl(D,g,Z,-1))}return mj(),D=GS(Error(r(421))),Gb(g,v,he,D)}return Z.data==="$?"?(v.flags|=128,v.child=g.child,v=oZ.bind(null,g),Z._reactRetry=v,null):(g=ne.treeContext,mt=Ho(Z.nextSibling),ht=v,jt=!0,Et=null,g!==null&&(be[Ce++]=it,be[Ce++]=Ee,be[Ce++]=$e,it=g.id,Ee=g.overflow,$e=v),v=ej(v,D.children),v.flags|=4096,v)}function rO(g,v,C){g.lanes|=v;var D=g.alternate;D!==null&&(D.lanes|=v),tn(g.return,v,C)}function tj(g,v,C,D,Z){var ne=g.memoizedState;ne===null?g.memoizedState={isBackwards:v,rendering:null,renderingStartTime:0,last:D,tail:C,tailMode:Z}:(ne.isBackwards=v,ne.rendering=null,ne.renderingStartTime=0,ne.last=D,ne.tail=C,ne.tailMode=Z)}function nO(g,v,C){var D=v.pendingProps,Z=D.revealOrder,ne=D.tail;if(Ea(g,v,D.children,C),D=Mn.current,(D&2)!==0)D=D&1|2,v.flags|=128;else{if(g!==null&&(g.flags&128)!==0)e:for(g=v.child;g!==null;){if(g.tag===13)g.memoizedState!==null&&rO(g,C,v);else if(g.tag===19)rO(g,C,v);else if(g.child!==null){g.child.return=g,g=g.child;continue}if(g===v)break e;for(;g.sibling===null;){if(g.return===null||g.return===v)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}D&=1}if(mn(Mn,D),(v.mode&1)===0)v.memoizedState=null;else switch(Z){case"forwards":for(C=v.child,Z=null;C!==null;)g=C.alternate,g!==null&&Ps(g)===null&&(Z=C),C=C.sibling;C=Z,C===null?(Z=v.child,v.child=null):(Z=C.sibling,C.sibling=null),tj(v,!1,Z,C,ne);break;case"backwards":for(C=null,Z=v.child,v.child=null;Z!==null;){if(g=Z.alternate,g!==null&&Ps(g)===null){v.child=Z;break}g=Z.sibling,Z.sibling=C,C=Z,Z=g}tj(v,!0,C,null,ne);break;case"together":tj(v,!1,null,null,void 0);break;default:v.memoizedState=null}return v.child}function Kb(g,v){(v.mode&1)===0&&g!==null&&(g.alternate=null,v.alternate=null,v.flags|=2)}function Du(g,v,C){if(g!==null&&(v.dependencies=g.dependencies),vp|=v.lanes,(C&v.childLanes)===0)return null;if(g!==null&&v.child!==g.child)throw Error(r(153));if(v.child!==null){for(g=v.child,C=nf(g,g.pendingProps),v.child=C,C.return=v;g.sibling!==null;)g=g.sibling,C=C.sibling=nf(g,g.pendingProps),C.return=v;C.sibling=null}return v.child}function YX(g,v,C){switch(v.tag){case 3:J8(v),Gt();break;case 5:Wb(v);break;case 1:ra(v.type)&&Fu(v);break;case 4:Gd(v,v.stateNode.containerInfo);break;case 10:var D=v.type._context,Z=v.memoizedProps.value;mn(Li,D._currentValue),D._currentValue=Z;break;case 13:if(D=v.memoizedState,D!==null)return D.dehydrated!==null?(mn(Mn,Mn.current&1),v.flags|=128,null):(C&v.child.childLanes)!==0?tO(g,v,C):(mn(Mn,Mn.current&1),g=Du(g,v,C),g!==null?g.sibling:null);mn(Mn,Mn.current&1);break;case 19:if(D=(C&v.childLanes)!==0,(g.flags&128)!==0){if(D)return nO(g,v,C);v.flags|=128}if(Z=v.memoizedState,Z!==null&&(Z.rendering=null,Z.tail=null,Z.lastEffect=null),mn(Mn,Mn.current),D)break;return null;case 22:case 23:return v.lanes=0,Q8(g,v,C)}return Du(g,v,C)}var iO,rj,oO,aO;iO=function(g,v){for(var C=v.child;C!==null;){if(C.tag===5||C.tag===6)g.appendChild(C.stateNode);else if(C.tag!==4&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===v)break;for(;C.sibling===null;){if(C.return===null||C.return===v)return;C=C.return}C.sibling.return=C.return,C=C.sibling}},rj=function(){},oO=function(g,v,C,D){var Z=g.memoizedProps;if(Z!==D){g=v.stateNode,ql(Gi.current);var ne=null;switch(C){case"input":Z=we(g,Z),D=we(g,D),ne=[];break;case"select":Z=H({},Z,{value:void 0}),D=H({},D,{value:void 0}),ne=[];break;case"textarea":Z=je(g,Z),D=je(g,D),ne=[];break;default:typeof Z.onClick!="function"&&typeof D.onClick=="function"&&(g.onclick=Ud)}Ht(C,D);var he;C=null;for(ut in Z)if(!D.hasOwnProperty(ut)&&Z.hasOwnProperty(ut)&&Z[ut]!=null)if(ut==="style"){var Re=Z[ut];for(he in Re)Re.hasOwnProperty(he)&&(C||(C={}),C[he]="")}else ut!=="dangerouslySetInnerHTML"&&ut!=="children"&&ut!=="suppressContentEditableWarning"&&ut!=="suppressHydrationWarning"&&ut!=="autoFocus"&&(o.hasOwnProperty(ut)?ne||(ne=[]):(ne=ne||[]).push(ut,null));for(ut in D){var Ue=D[ut];if(Re=Z!=null?Z[ut]:void 0,D.hasOwnProperty(ut)&&Ue!==Re&&(Ue!=null||Re!=null))if(ut==="style")if(Re){for(he in Re)!Re.hasOwnProperty(he)||Ue&&Ue.hasOwnProperty(he)||(C||(C={}),C[he]="");for(he in Ue)Ue.hasOwnProperty(he)&&Re[he]!==Ue[he]&&(C||(C={}),C[he]=Ue[he])}else C||(ne||(ne=[]),ne.push(ut,C)),C=Ue;else ut==="dangerouslySetInnerHTML"?(Ue=Ue?Ue.__html:void 0,Re=Re?Re.__html:void 0,Ue!=null&&Re!==Ue&&(ne=ne||[]).push(ut,Ue)):ut==="children"?typeof Ue!="string"&&typeof Ue!="number"||(ne=ne||[]).push(ut,""+Ue):ut!=="suppressContentEditableWarning"&&ut!=="suppressHydrationWarning"&&(o.hasOwnProperty(ut)?(Ue!=null&&ut==="onScroll"&&Cn("scroll",g),ne||Re===Ue||(ne=[])):(ne=ne||[]).push(ut,Ue))}C&&(ne=ne||[]).push("style",C);var ut=ne;(v.updateQueue=ut)&&(v.flags|=4)}},aO=function(g,v,C,D){C!==D&&(v.flags|=4)};function Jv(g,v){if(!jt)switch(g.tailMode){case"hidden":v=g.tail;for(var C=null;v!==null;)v.alternate!==null&&(C=v),v=v.sibling;C===null?g.tail=null:C.sibling=null;break;case"collapsed":C=g.tail;for(var D=null;C!==null;)C.alternate!==null&&(D=C),C=C.sibling;D===null?v||g.tail===null?g.tail=null:g.tail.sibling=null:D.sibling=null}}function ia(g){var v=g.alternate!==null&&g.alternate.child===g.child,C=0,D=0;if(v)for(var Z=g.child;Z!==null;)C|=Z.lanes|Z.childLanes,D|=Z.subtreeFlags&14680064,D|=Z.flags&14680064,Z.return=g,Z=Z.sibling;else for(Z=g.child;Z!==null;)C|=Z.lanes|Z.childLanes,D|=Z.subtreeFlags,D|=Z.flags,Z.return=g,Z=Z.sibling;return g.subtreeFlags|=D,g.childLanes=C,v}function GX(g,v,C){var D=v.pendingProps;switch(at(v),v.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ia(v),null;case 1:return ra(v.type)&&rg(),ia(v),null;case 3:return D=v.stateNode,dl(),fn(ta),fn(io),Qv(),D.pendingContext&&(D.context=D.pendingContext,D.pendingContext=null),(g===null||g.child===null)&&(ai(v)?v.flags|=4:g===null||g.memoizedState.isDehydrated&&(v.flags&256)===0||(v.flags|=1024,Et!==null&&(pj(Et),Et=null))),rj(g,v),ia(v),null;case 5:Gv(v);var Z=ql(Nc.current);if(C=v.type,g!==null&&v.stateNode!=null)oO(g,v,C,D,Z),g.ref!==v.ref&&(v.flags|=512,v.flags|=2097152);else{if(!D){if(v.stateNode===null)throw Error(r(166));return ia(v),null}if(g=ql(Gi.current),ai(v)){D=v.stateNode,C=v.type;var ne=v.memoizedProps;switch(D[ul]=v,D[Hd]=ne,g=(v.mode&1)!==0,C){case"dialog":Cn("cancel",D),Cn("close",D);break;case"iframe":case"object":case"embed":Cn("load",D);break;case"video":case"audio":for(Z=0;Z<Pc.length;Z++)Cn(Pc[Z],D);break;case"source":Cn("error",D);break;case"img":case"image":case"link":Cn("error",D),Cn("load",D);break;case"details":Cn("toggle",D);break;case"input":ie(D,ne),Cn("invalid",D);break;case"select":D._wrapperState={wasMultiple:!!ne.multiple},Cn("invalid",D);break;case"textarea":qe(D,ne),Cn("invalid",D)}Ht(C,ne),Z=null;for(var he in ne)if(ne.hasOwnProperty(he)){var Re=ne[he];he==="children"?typeof Re=="string"?D.textContent!==Re&&(ne.suppressHydrationWarning!==!0&&tg(D.textContent,Re,g),Z=["children",Re]):typeof Re=="number"&&D.textContent!==""+Re&&(ne.suppressHydrationWarning!==!0&&tg(D.textContent,Re,g),Z=["children",""+Re]):o.hasOwnProperty(he)&&Re!=null&&he==="onScroll"&&Cn("scroll",D)}switch(C){case"input":le(D),se(D,ne,!0);break;case"textarea":le(D),Je(D);break;case"select":case"option":break;default:typeof ne.onClick=="function"&&(D.onclick=Ud)}D=Z,v.updateQueue=D,D!==null&&(v.flags|=4)}else{he=Z.nodeType===9?Z:Z.ownerDocument,g==="http://www.w3.org/1999/xhtml"&&(g=vt(C)),g==="http://www.w3.org/1999/xhtml"?C==="script"?(g=he.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild)):typeof D.is=="string"?g=he.createElement(C,{is:D.is}):(g=he.createElement(C),C==="select"&&(he=g,D.multiple?he.multiple=!0:D.size&&(he.size=D.size))):g=he.createElementNS(g,C),g[ul]=v,g[Hd]=D,iO(g,v,!1,!1),v.stateNode=g;e:{switch(he=Se(C,D),C){case"dialog":Cn("cancel",g),Cn("close",g),Z=D;break;case"iframe":case"object":case"embed":Cn("load",g),Z=D;break;case"video":case"audio":for(Z=0;Z<Pc.length;Z++)Cn(Pc[Z],g);Z=D;break;case"source":Cn("error",g),Z=D;break;case"img":case"image":case"link":Cn("error",g),Cn("load",g),Z=D;break;case"details":Cn("toggle",g),Z=D;break;case"input":ie(g,D),Z=we(g,D),Cn("invalid",g);break;case"option":Z=D;break;case"select":g._wrapperState={wasMultiple:!!D.multiple},Z=H({},D,{value:void 0}),Cn("invalid",g);break;case"textarea":qe(g,D),Z=je(g,D),Cn("invalid",g);break;default:Z=D}Ht(C,Z),Re=Z;for(ne in Re)if(Re.hasOwnProperty(ne)){var Ue=Re[ne];ne==="style"?Pt(g,Ue):ne==="dangerouslySetInnerHTML"?(Ue=Ue?Ue.__html:void 0,Ue!=null&&nt(g,Ue)):ne==="children"?typeof Ue=="string"?(C!=="textarea"||Ue!=="")&&Ae(g,Ue):typeof Ue=="number"&&Ae(g,""+Ue):ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&ne!=="autoFocus"&&(o.hasOwnProperty(ne)?Ue!=null&&ne==="onScroll"&&Cn("scroll",g):Ue!=null&&k(g,ne,Ue,he))}switch(C){case"input":le(g),se(g,D,!1);break;case"textarea":le(g),Je(g);break;case"option":D.value!=null&&g.setAttribute("value",""+re(D.value));break;case"select":g.multiple=!!D.multiple,ne=D.value,ne!=null?ce(g,!!D.multiple,ne,!1):D.defaultValue!=null&&ce(g,!!D.multiple,D.defaultValue,!0);break;default:typeof Z.onClick=="function"&&(g.onclick=Ud)}switch(C){case"button":case"input":case"select":case"textarea":D=!!D.autoFocus;break e;case"img":D=!0;break e;default:D=!1}}D&&(v.flags|=4)}v.ref!==null&&(v.flags|=512,v.flags|=2097152)}return ia(v),null;case 6:if(g&&v.stateNode!=null)aO(g,v,g.memoizedProps,D);else{if(typeof D!="string"&&v.stateNode===null)throw Error(r(166));if(C=ql(Nc.current),ql(Gi.current),ai(v)){if(D=v.stateNode,C=v.memoizedProps,D[ul]=v,(ne=D.nodeValue!==C)&&(g=ht,g!==null))switch(g.tag){case 3:tg(D.nodeValue,C,(g.mode&1)!==0);break;case 5:g.memoizedProps.suppressHydrationWarning!==!0&&tg(D.nodeValue,C,(g.mode&1)!==0)}ne&&(v.flags|=4)}else D=(C.nodeType===9?C:C.ownerDocument).createTextNode(D),D[ul]=v,v.stateNode=D}return ia(v),null;case 13:if(fn(Mn),D=v.memoizedState,g===null||g.memoizedState!==null&&g.memoizedState.dehydrated!==null){if(jt&&mt!==null&&(v.mode&1)!==0&&(v.flags&128)===0)Or(),Gt(),v.flags|=98560,ne=!1;else if(ne=ai(v),D!==null&&D.dehydrated!==null){if(g===null){if(!ne)throw Error(r(318));if(ne=v.memoizedState,ne=ne!==null?ne.dehydrated:null,!ne)throw Error(r(317));ne[ul]=v}else Gt(),(v.flags&128)===0&&(v.memoizedState=null),v.flags|=4;ia(v),ne=!1}else Et!==null&&(pj(Et),Et=null),ne=!0;if(!ne)return v.flags&65536?v:null}return(v.flags&128)!==0?(v.lanes=C,v):(D=D!==null,D!==(g!==null&&g.memoizedState!==null)&&D&&(v.child.flags|=8192,(v.mode&1)!==0&&(g===null||(Mn.current&1)!==0?ao===0&&(ao=3):mj())),v.updateQueue!==null&&(v.flags|=4),ia(v),null);case 4:return dl(),rj(g,v),g===null&&Ou(v.stateNode.containerInfo),ia(v),null;case 10:return $n(v.type._context),ia(v),null;case 17:return ra(v.type)&&rg(),ia(v),null;case 19:if(fn(Mn),ne=v.memoizedState,ne===null)return ia(v),null;if(D=(v.flags&128)!==0,he=ne.rendering,he===null)if(D)Jv(ne,!1);else{if(ao!==0||g!==null&&(g.flags&128)!==0)for(g=v.child;g!==null;){if(he=Ps(g),he!==null){for(v.flags|=128,Jv(ne,!1),D=he.updateQueue,D!==null&&(v.updateQueue=D,v.flags|=4),v.subtreeFlags=0,D=C,C=v.child;C!==null;)ne=C,g=D,ne.flags&=14680066,he=ne.alternate,he===null?(ne.childLanes=0,ne.lanes=g,ne.child=null,ne.subtreeFlags=0,ne.memoizedProps=null,ne.memoizedState=null,ne.updateQueue=null,ne.dependencies=null,ne.stateNode=null):(ne.childLanes=he.childLanes,ne.lanes=he.lanes,ne.child=he.child,ne.subtreeFlags=0,ne.deletions=null,ne.memoizedProps=he.memoizedProps,ne.memoizedState=he.memoizedState,ne.updateQueue=he.updateQueue,ne.type=he.type,g=he.dependencies,ne.dependencies=g===null?null:{lanes:g.lanes,firstContext:g.firstContext}),C=C.sibling;return mn(Mn,Mn.current&1|2),v.child}g=g.sibling}ne.tail!==null&&Gr()>gg&&(v.flags|=128,D=!0,Jv(ne,!1),v.lanes=4194304)}else{if(!D)if(g=Ps(he),g!==null){if(v.flags|=128,D=!0,C=g.updateQueue,C!==null&&(v.updateQueue=C,v.flags|=4),Jv(ne,!0),ne.tail===null&&ne.tailMode==="hidden"&&!he.alternate&&!jt)return ia(v),null}else 2*Gr()-ne.renderingStartTime>gg&&C!==1073741824&&(v.flags|=128,D=!0,Jv(ne,!1),v.lanes=4194304);ne.isBackwards?(he.sibling=v.child,v.child=he):(C=ne.last,C!==null?C.sibling=he:v.child=he,ne.last=he)}return ne.tail!==null?(v=ne.tail,ne.rendering=v,ne.tail=v.sibling,ne.renderingStartTime=Gr(),v.sibling=null,C=Mn.current,mn(Mn,D?C&1|2:C&1),v):(ia(v),null);case 22:case 23:return gj(),D=v.memoizedState!==null,g!==null&&g.memoizedState!==null!==D&&(v.flags|=8192),D&&(v.mode&1)!==0?(Ns&1073741824)!==0&&(ia(v),v.subtreeFlags&6&&(v.flags|=8192)):ia(v),null;case 24:return null;case 25:return null}throw Error(r(156,v.tag))}function KX(g,v){switch(at(v),v.tag){case 1:return ra(v.type)&&rg(),g=v.flags,g&65536?(v.flags=g&-65537|128,v):null;case 3:return dl(),fn(ta),fn(io),Qv(),g=v.flags,(g&65536)!==0&&(g&128)===0?(v.flags=g&-65537|128,v):null;case 5:return Gv(v),null;case 13:if(fn(Mn),g=v.memoizedState,g!==null&&g.dehydrated!==null){if(v.alternate===null)throw Error(r(340));Gt()}return g=v.flags,g&65536?(v.flags=g&-65537|128,v):null;case 19:return fn(Mn),null;case 4:return dl(),null;case 10:return $n(v.type._context),null;case 22:case 23:return gj(),null;case 24:return null;default:return null}}var Qb=!1,oa=!1,QX=typeof WeakSet=="function"?WeakSet:Set,Xt=null;function pg(g,v){var C=g.ref;if(C!==null)if(typeof C=="function")try{C(null)}catch(D){_i(g,v,D)}else C.current=null}function nj(g,v,C){try{C()}catch(D){_i(g,v,D)}}var sO=!1;function XX(g,v){if(dp=Id,g=_n(),ei(g)){if("selectionStart"in g)var C={start:g.selectionStart,end:g.selectionEnd};else e:{C=(C=g.ownerDocument)&&C.defaultView||window;var D=C.getSelection&&C.getSelection();if(D&&D.rangeCount!==0){C=D.anchorNode;var Z=D.anchorOffset,ne=D.focusNode;D=D.focusOffset;try{C.nodeType,ne.nodeType}catch{C=null;break e}var he=0,Re=-1,Ue=-1,ut=0,Rt=0,Ft=g,Nt=null;t:for(;;){for(var Vt;Ft!==C||Z!==0&&Ft.nodeType!==3||(Re=he+Z),Ft!==ne||D!==0&&Ft.nodeType!==3||(Ue=he+D),Ft.nodeType===3&&(he+=Ft.nodeValue.length),(Vt=Ft.firstChild)!==null;)Nt=Ft,Ft=Vt;for(;;){if(Ft===g)break t;if(Nt===C&&++ut===Z&&(Re=he),Nt===ne&&++Rt===D&&(Ue=he),(Vt=Ft.nextSibling)!==null)break;Ft=Nt,Nt=Ft.parentNode}Ft=Vt}C=Re===-1||Ue===-1?null:{start:Re,end:Ue}}else C=null}C=C||{start:0,end:0}}else C=null;for(Nu={focusedElem:g,selectionRange:C},Id=!1,Xt=v;Xt!==null;)if(v=Xt,g=v.child,(v.subtreeFlags&1028)!==0&&g!==null)g.return=v,Xt=g;else for(;Xt!==null;){v=Xt;try{var rr=v.alternate;if((v.flags&1024)!==0)switch(v.tag){case 0:case 11:case 15:break;case 1:if(rr!==null){var ar=rr.memoizedProps,Mi=rr.memoizedState,ot=v.stateNode,Ye=ot.getSnapshotBeforeUpdate(v.elementType===v.type?ar:Hl(v.type,ar),Mi);ot.__reactInternalSnapshotBeforeUpdate=Ye}break;case 3:var st=v.stateNode.containerInfo;st.nodeType===1?st.textContent="":st.nodeType===9&&st.documentElement&&st.removeChild(st.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(Dt){_i(v,v.return,Dt)}if(g=v.sibling,g!==null){g.return=v.return,Xt=g;break}Xt=v.return}return rr=sO,sO=!1,rr}function ey(g,v,C){var D=v.updateQueue;if(D=D!==null?D.lastEffect:null,D!==null){var Z=D=D.next;do{if((Z.tag&g)===g){var ne=Z.destroy;Z.destroy=void 0,ne!==void 0&&nj(v,C,ne)}Z=Z.next}while(Z!==D)}}function Xb(g,v){if(v=v.updateQueue,v=v!==null?v.lastEffect:null,v!==null){var C=v=v.next;do{if((C.tag&g)===g){var D=C.create;C.destroy=D()}C=C.next}while(C!==v)}}function ij(g){var v=g.ref;if(v!==null){var C=g.stateNode;switch(g.tag){case 5:g=C;break;default:g=C}typeof v=="function"?v(g):v.current=g}}function lO(g){var v=g.alternate;v!==null&&(g.alternate=null,lO(v)),g.child=null,g.deletions=null,g.sibling=null,g.tag===5&&(v=g.stateNode,v!==null&&(delete v[ul],delete v[Hd],delete v[ea],delete v[qS],delete v[$S])),g.stateNode=null,g.return=null,g.dependencies=null,g.memoizedProps=null,g.memoizedState=null,g.pendingProps=null,g.stateNode=null,g.updateQueue=null}function cO(g){return g.tag===5||g.tag===3||g.tag===4}function uO(g){e:for(;;){for(;g.sibling===null;){if(g.return===null||cO(g.return))return null;g=g.return}for(g.sibling.return=g.return,g=g.sibling;g.tag!==5&&g.tag!==6&&g.tag!==18;){if(g.flags&2||g.child===null||g.tag===4)continue e;g.child.return=g,g=g.child}if(!(g.flags&2))return g.stateNode}}function oj(g,v,C){var D=g.tag;if(D===5||D===6)g=g.stateNode,v?C.nodeType===8?C.parentNode.insertBefore(g,v):C.insertBefore(g,v):(C.nodeType===8?(v=C.parentNode,v.insertBefore(g,C)):(v=C,v.appendChild(g)),C=C._reactRootContainer,C!=null||v.onclick!==null||(v.onclick=Ud));else if(D!==4&&(g=g.child,g!==null))for(oj(g,v,C),g=g.sibling;g!==null;)oj(g,v,C),g=g.sibling}function aj(g,v,C){var D=g.tag;if(D===5||D===6)g=g.stateNode,v?C.insertBefore(g,v):C.appendChild(g);else if(D!==4&&(g=g.child,g!==null))for(aj(g,v,C),g=g.sibling;g!==null;)aj(g,v,C),g=g.sibling}var Vo=null,Vl=!1;function Zd(g,v,C){for(C=C.child;C!==null;)dO(g,v,C),C=C.sibling}function dO(g,v,C){if(ba&&typeof ba.onCommitFiberUnmount=="function")try{ba.onCommitFiberUnmount(uu,C)}catch{}switch(C.tag){case 5:oa||pg(C,v);case 6:var D=Vo,Z=Vl;Vo=null,Zd(g,v,C),Vo=D,Vl=Z,Vo!==null&&(Vl?(g=Vo,C=C.stateNode,g.nodeType===8?g.parentNode.removeChild(C):g.removeChild(C)):Vo.removeChild(C.stateNode));break;case 18:Vo!==null&&(Vl?(g=Vo,C=C.stateNode,g.nodeType===8?Hv(g.parentNode,C):g.nodeType===1&&Hv(g,C),Ll(g)):Hv(Vo,C.stateNode));break;case 4:D=Vo,Z=Vl,Vo=C.stateNode.containerInfo,Vl=!0,Zd(g,v,C),Vo=D,Vl=Z;break;case 0:case 11:case 14:case 15:if(!oa&&(D=C.updateQueue,D!==null&&(D=D.lastEffect,D!==null))){Z=D=D.next;do{var ne=Z,he=ne.destroy;ne=ne.tag,he!==void 0&&((ne&2)!==0||(ne&4)!==0)&&nj(C,v,he),Z=Z.next}while(Z!==D)}Zd(g,v,C);break;case 1:if(!oa&&(pg(C,v),D=C.stateNode,typeof D.componentWillUnmount=="function"))try{D.props=C.memoizedProps,D.state=C.memoizedState,D.componentWillUnmount()}catch(Re){_i(C,v,Re)}Zd(g,v,C);break;case 21:Zd(g,v,C);break;case 22:C.mode&1?(oa=(D=oa)||C.memoizedState!==null,Zd(g,v,C),oa=D):Zd(g,v,C);break;default:Zd(g,v,C)}}function fO(g){var v=g.updateQueue;if(v!==null){g.updateQueue=null;var C=g.stateNode;C===null&&(C=g.stateNode=new QX),v.forEach(function(D){var Z=aZ.bind(null,g,D);C.has(D)||(C.add(D),D.then(Z,Z))})}}function Yl(g,v){var C=v.deletions;if(C!==null)for(var D=0;D<C.length;D++){var Z=C[D];try{var ne=g,he=v,Re=he;e:for(;Re!==null;){switch(Re.tag){case 5:Vo=Re.stateNode,Vl=!1;break e;case 3:Vo=Re.stateNode.containerInfo,Vl=!0;break e;case 4:Vo=Re.stateNode.containerInfo,Vl=!0;break e}Re=Re.return}if(Vo===null)throw Error(r(160));dO(ne,he,Z),Vo=null,Vl=!1;var Ue=Z.alternate;Ue!==null&&(Ue.return=null),Z.return=null}catch(ut){_i(Z,v,ut)}}if(v.subtreeFlags&12854)for(v=v.child;v!==null;)pO(v,g),v=v.sibling}function pO(g,v){var C=g.alternate,D=g.flags;switch(g.tag){case 0:case 11:case 14:case 15:if(Yl(v,g),Lc(g),D&4){try{ey(3,g,g.return),Xb(3,g)}catch(ar){_i(g,g.return,ar)}try{ey(5,g,g.return)}catch(ar){_i(g,g.return,ar)}}break;case 1:Yl(v,g),Lc(g),D&512&&C!==null&&pg(C,C.return);break;case 5:if(Yl(v,g),Lc(g),D&512&&C!==null&&pg(C,C.return),g.flags&32){var Z=g.stateNode;try{Ae(Z,"")}catch(ar){_i(g,g.return,ar)}}if(D&4&&(Z=g.stateNode,Z!=null)){var ne=g.memoizedProps,he=C!==null?C.memoizedProps:ne,Re=g.type,Ue=g.updateQueue;if(g.updateQueue=null,Ue!==null)try{Re==="input"&&ne.type==="radio"&&ne.name!=null&&Me(Z,ne),Se(Re,he);var ut=Se(Re,ne);for(he=0;he<Ue.length;he+=2){var Rt=Ue[he],Ft=Ue[he+1];Rt==="style"?Pt(Z,Ft):Rt==="dangerouslySetInnerHTML"?nt(Z,Ft):Rt==="children"?Ae(Z,Ft):k(Z,Rt,Ft,ut)}switch(Re){case"input":ke(Z,ne);break;case"textarea":Ne(Z,ne);break;case"select":var Nt=Z._wrapperState.wasMultiple;Z._wrapperState.wasMultiple=!!ne.multiple;var Vt=ne.value;Vt!=null?ce(Z,!!ne.multiple,Vt,!1):Nt!==!!ne.multiple&&(ne.defaultValue!=null?ce(Z,!!ne.multiple,ne.defaultValue,!0):ce(Z,!!ne.multiple,ne.multiple?[]:"",!1))}Z[Hd]=ne}catch(ar){_i(g,g.return,ar)}}break;case 6:if(Yl(v,g),Lc(g),D&4){if(g.stateNode===null)throw Error(r(162));Z=g.stateNode,ne=g.memoizedProps;try{Z.nodeValue=ne}catch(ar){_i(g,g.return,ar)}}break;case 3:if(Yl(v,g),Lc(g),D&4&&C!==null&&C.memoizedState.isDehydrated)try{Ll(v.containerInfo)}catch(ar){_i(g,g.return,ar)}break;case 4:Yl(v,g),Lc(g);break;case 13:Yl(v,g),Lc(g),Z=g.child,Z.flags&8192&&(ne=Z.memoizedState!==null,Z.stateNode.isHidden=ne,!ne||Z.alternate!==null&&Z.alternate.memoizedState!==null||(cj=Gr())),D&4&&fO(g);break;case 22:if(Rt=C!==null&&C.memoizedState!==null,g.mode&1?(oa=(ut=oa)||Rt,Yl(v,g),oa=ut):Yl(v,g),Lc(g),D&8192){if(ut=g.memoizedState!==null,(g.stateNode.isHidden=ut)&&!Rt&&(g.mode&1)!==0)for(Xt=g,Rt=g.child;Rt!==null;){for(Ft=Xt=Rt;Xt!==null;){switch(Nt=Xt,Vt=Nt.child,Nt.tag){case 0:case 11:case 14:case 15:ey(4,Nt,Nt.return);break;case 1:pg(Nt,Nt.return);var rr=Nt.stateNode;if(typeof rr.componentWillUnmount=="function"){D=Nt,C=Nt.return;try{v=D,rr.props=v.memoizedProps,rr.state=v.memoizedState,rr.componentWillUnmount()}catch(ar){_i(D,C,ar)}}break;case 5:pg(Nt,Nt.return);break;case 22:if(Nt.memoizedState!==null){mO(Ft);continue}}Vt!==null?(Vt.return=Nt,Xt=Vt):mO(Ft)}Rt=Rt.sibling}e:for(Rt=null,Ft=g;;){if(Ft.tag===5){if(Rt===null){Rt=Ft;try{Z=Ft.stateNode,ut?(ne=Z.style,typeof ne.setProperty=="function"?ne.setProperty("display","none","important"):ne.display="none"):(Re=Ft.stateNode,Ue=Ft.memoizedProps.style,he=Ue!=null&&Ue.hasOwnProperty("display")?Ue.display:null,Re.style.display=ft("display",he))}catch(ar){_i(g,g.return,ar)}}}else if(Ft.tag===6){if(Rt===null)try{Ft.stateNode.nodeValue=ut?"":Ft.memoizedProps}catch(ar){_i(g,g.return,ar)}}else if((Ft.tag!==22&&Ft.tag!==23||Ft.memoizedState===null||Ft===g)&&Ft.child!==null){Ft.child.return=Ft,Ft=Ft.child;continue}if(Ft===g)break e;for(;Ft.sibling===null;){if(Ft.return===null||Ft.return===g)break e;Rt===Ft&&(Rt=null),Ft=Ft.return}Rt===Ft&&(Rt=null),Ft.sibling.return=Ft.return,Ft=Ft.sibling}}break;case 19:Yl(v,g),Lc(g),D&4&&fO(g);break;case 21:break;default:Yl(v,g),Lc(g)}}function Lc(g){var v=g.flags;if(v&2){try{e:{for(var C=g.return;C!==null;){if(cO(C)){var D=C;break e}C=C.return}throw Error(r(160))}switch(D.tag){case 5:var Z=D.stateNode;D.flags&32&&(Ae(Z,""),D.flags&=-33);var ne=uO(g);aj(g,ne,Z);break;case 3:case 4:var he=D.stateNode.containerInfo,Re=uO(g);oj(g,Re,he);break;default:throw Error(r(161))}}catch(Ue){_i(g,g.return,Ue)}g.flags&=-3}v&4096&&(g.flags&=-4097)}function ZX(g,v,C){Xt=g,hO(g)}function hO(g,v,C){for(var D=(g.mode&1)!==0;Xt!==null;){var Z=Xt,ne=Z.child;if(Z.tag===22&&D){var he=Z.memoizedState!==null||Qb;if(!he){var Re=Z.alternate,Ue=Re!==null&&Re.memoizedState!==null||oa;Re=Qb;var ut=oa;if(Qb=he,(oa=Ue)&&!ut)for(Xt=Z;Xt!==null;)he=Xt,Ue=he.child,he.tag===22&&he.memoizedState!==null?vO(Z):Ue!==null?(Ue.return=he,Xt=Ue):vO(Z);for(;ne!==null;)Xt=ne,hO(ne),ne=ne.sibling;Xt=Z,Qb=Re,oa=ut}gO(g)}else(Z.subtreeFlags&8772)!==0&&ne!==null?(ne.return=Z,Xt=ne):gO(g)}}function gO(g){for(;Xt!==null;){var v=Xt;if((v.flags&8772)!==0){var C=v.alternate;try{if((v.flags&8772)!==0)switch(v.tag){case 0:case 11:case 15:oa||Xb(5,v);break;case 1:var D=v.stateNode;if(v.flags&4&&!oa)if(C===null)D.componentDidMount();else{var Z=v.elementType===v.type?C.memoizedProps:Hl(v.type,C.memoizedProps);D.componentDidUpdate(Z,C.memoizedState,D.__reactInternalSnapshotBeforeUpdate)}var ne=v.updateQueue;ne!==null&&Ja(v,ne,D);break;case 3:var he=v.updateQueue;if(he!==null){if(C=null,v.child!==null)switch(v.child.tag){case 5:C=v.child.stateNode;break;case 1:C=v.child.stateNode}Ja(v,he,C)}break;case 5:var Re=v.stateNode;if(C===null&&v.flags&4){C=Re;var Ue=v.memoizedProps;switch(v.type){case"button":case"input":case"select":case"textarea":Ue.autoFocus&&C.focus();break;case"img":Ue.src&&(C.src=Ue.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(v.memoizedState===null){var ut=v.alternate;if(ut!==null){var Rt=ut.memoizedState;if(Rt!==null){var Ft=Rt.dehydrated;Ft!==null&&Ll(Ft)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}oa||v.flags&512&&ij(v)}catch(Nt){_i(v,v.return,Nt)}}if(v===g){Xt=null;break}if(C=v.sibling,C!==null){C.return=v.return,Xt=C;break}Xt=v.return}}function mO(g){for(;Xt!==null;){var v=Xt;if(v===g){Xt=null;break}var C=v.sibling;if(C!==null){C.return=v.return,Xt=C;break}Xt=v.return}}function vO(g){for(;Xt!==null;){var v=Xt;try{switch(v.tag){case 0:case 11:case 15:var C=v.return;try{Xb(4,v)}catch(Ue){_i(v,C,Ue)}break;case 1:var D=v.stateNode;if(typeof D.componentDidMount=="function"){var Z=v.return;try{D.componentDidMount()}catch(Ue){_i(v,Z,Ue)}}var ne=v.return;try{ij(v)}catch(Ue){_i(v,ne,Ue)}break;case 5:var he=v.return;try{ij(v)}catch(Ue){_i(v,he,Ue)}}}catch(Ue){_i(v,v.return,Ue)}if(v===g){Xt=null;break}var Re=v.sibling;if(Re!==null){Re.return=v.return,Xt=Re;break}Xt=v.return}}var JX=Math.ceil,Zb=S.ReactCurrentDispatcher,sj=S.ReactCurrentOwner,hl=S.ReactCurrentBatchConfig,rn=0,Co=null,Ki=null,Yo=0,Ns=0,hg=As(0),ao=0,ty=null,vp=0,Jb=0,lj=0,ry=null,ts=null,cj=0,gg=1/0,zu=null,e1=!1,uj=null,Jd=null,t1=!1,ef=null,r1=0,ny=0,dj=null,n1=-1,i1=0;function Aa(){return(rn&6)!==0?Gr():n1!==-1?n1:n1=Gr()}function tf(g){return(g.mode&1)===0?1:(rn&2)!==0&&Yo!==0?Yo&-Yo:di.transition!==null?(i1===0&&(i1=Ui()),i1):(g=Fr,g!==0||(g=window.event,g=g===void 0?16:Sc(g.type)),g)}function Gl(g,v,C,D){if(50<ny)throw ny=0,dj=null,Error(r(185));fu(g,C,D),((rn&2)===0||g!==Co)&&(g===Co&&((rn&2)===0&&(Jb|=C),ao===4&&rf(g,Yo)),rs(g,D),C===1&&rn===0&&(v.mode&1)===0&&(gg=Gr()+500,pp&&oe()))}function rs(g,v){var C=g.callbackNode;Td(g,v);var D=bc(g,g===Co?Yo:0);if(D===0)C!==null&&zt(C),g.callbackNode=null,g.callbackPriority=0;else if(v=D&-D,g.callbackPriority!==v){if(C!=null&&zt(C),v===1)g.tag===0?te(xO.bind(null,g)):W(xO.bind(null,g)),BS(function(){(rn&6)===0&&oe()}),C=null;else{switch(Zf(D)){case 1:C=$i;break;case 4:C=yo;break;case 16:C=oi;break;case 536870912:C=Ed;break;default:C=oi}C=EO(C,yO.bind(null,g))}g.callbackPriority=v,g.callbackNode=C}}function yO(g,v){if(n1=-1,i1=0,(rn&6)!==0)throw Error(r(327));var C=g.callbackNode;if(mg()&&g.callbackNode!==C)return null;var D=bc(g,g===Co?Yo:0);if(D===0)return null;if((D&30)!==0||(D&g.expiredLanes)!==0||v)v=o1(g,D);else{v=D;var Z=rn;rn|=2;var ne=wO();(Co!==g||Yo!==v)&&(zu=null,gg=Gr()+500,xp(g,v));do try{rZ();break}catch(Re){bO(g,Re)}while(!0);en(),Zb.current=ne,rn=Z,Ki!==null?v=0:(Co=null,Yo=0,v=ao)}if(v!==0){if(v===2&&(Z=xs(g),Z!==0&&(D=Z,v=fj(g,Z))),v===1)throw C=ty,xp(g,0),rf(g,D),rs(g,Gr()),C;if(v===6)rf(g,D);else{if(Z=g.current.alternate,(D&30)===0&&!eZ(Z)&&(v=o1(g,D),v===2&&(ne=xs(g),ne!==0&&(D=ne,v=fj(g,ne))),v===1))throw C=ty,xp(g,0),rf(g,D),rs(g,Gr()),C;switch(g.finishedWork=Z,g.finishedLanes=D,v){case 0:case 1:throw Error(r(345));case 2:bp(g,ts,zu);break;case 3:if(rf(g,D),(D&130023424)===D&&(v=cj+500-Gr(),10<v)){if(bc(g,0)!==0)break;if(Z=g.suspendedLanes,(Z&D)!==D){Aa(),g.pingedLanes|=g.suspendedLanes&Z;break}g.timeoutHandle=Uv(bp.bind(null,g,ts,zu),v);break}bp(g,ts,zu);break;case 4:if(rf(g,D),(D&4194240)===D)break;for(v=g.eventTimes,Z=-1;0<D;){var he=31-yi(D);ne=1<<he,he=v[he],he>Z&&(Z=he),D&=~ne}if(D=Z,D=Gr()-D,D=(120>D?120:480>D?480:1080>D?1080:1920>D?1920:3e3>D?3e3:4320>D?4320:1960*JX(D/1960))-D,10<D){g.timeoutHandle=Uv(bp.bind(null,g,ts,zu),D);break}bp(g,ts,zu);break;case 5:bp(g,ts,zu);break;default:throw Error(r(329))}}}return rs(g,Gr()),g.callbackNode===C?yO.bind(null,g):null}function fj(g,v){var C=ry;return g.current.memoizedState.isDehydrated&&(xp(g,v).flags|=256),g=o1(g,v),g!==2&&(v=ts,ts=C,v!==null&&pj(v)),g}function pj(g){ts===null?ts=g:ts.push.apply(ts,g)}function eZ(g){for(var v=g;;){if(v.flags&16384){var C=v.updateQueue;if(C!==null&&(C=C.stores,C!==null))for(var D=0;D<C.length;D++){var Z=C[D],ne=Z.getSnapshot;Z=Z.value;try{if(!Hi(ne(),Z))return!1}catch{return!1}}}if(C=v.child,v.subtreeFlags&16384&&C!==null)C.return=v,v=C;else{if(v===g)break;for(;v.sibling===null;){if(v.return===null||v.return===g)return!0;v=v.return}v.sibling.return=v.return,v=v.sibling}}return!0}function rf(g,v){for(v&=~lj,v&=~Jb,g.suspendedLanes|=v,g.pingedLanes&=~v,g=g.expirationTimes;0<v;){var C=31-yi(v),D=1<<C;g[C]=-1,v&=~D}}function xO(g){if((rn&6)!==0)throw Error(r(327));mg();var v=bc(g,0);if((v&1)===0)return rs(g,Gr()),null;var C=o1(g,v);if(g.tag!==0&&C===2){var D=xs(g);D!==0&&(v=D,C=fj(g,D))}if(C===1)throw C=ty,xp(g,0),rf(g,v),rs(g,Gr()),C;if(C===6)throw Error(r(345));return g.finishedWork=g.current.alternate,g.finishedLanes=v,bp(g,ts,zu),rs(g,Gr()),null}function hj(g,v){var C=rn;rn|=1;try{return g(v)}finally{rn=C,rn===0&&(gg=Gr()+500,pp&&oe())}}function yp(g){ef!==null&&ef.tag===0&&(rn&6)===0&&mg();var v=rn;rn|=1;var C=hl.transition,D=Fr;try{if(hl.transition=null,Fr=1,g)return g()}finally{Fr=D,hl.transition=C,rn=v,(rn&6)===0&&oe()}}function gj(){Ns=hg.current,fn(hg)}function xp(g,v){g.finishedWork=null,g.finishedLanes=0;var C=g.timeoutHandle;if(C!==-1&&(g.timeoutHandle=-1,Mb(C)),Ki!==null)for(C=Ki.return;C!==null;){var D=C;switch(at(D),D.tag){case 1:D=D.type.childContextTypes,D!=null&&rg();break;case 3:dl(),fn(ta),fn(io),Qv();break;case 5:Gv(D);break;case 4:dl();break;case 13:fn(Mn);break;case 19:fn(Mn);break;case 10:$n(D.type._context);break;case 22:case 23:gj()}C=C.return}if(Co=g,Ki=g=nf(g.current,null),Yo=Ns=v,ao=0,ty=null,lj=Jb=vp=0,ts=ry=null,En!==null){for(v=0;v<En.length;v++)if(C=En[v],D=C.interleaved,D!==null){C.interleaved=null;var Z=D.next,ne=C.pending;if(ne!==null){var he=ne.next;ne.next=Z,D.next=he}C.pending=D}En=null}return g}function bO(g,v){do{var C=Ki;try{if(en(),ng.current=Vb,Kd){for(var D=Un.memoizedState;D!==null;){var Z=D.queue;Z!==null&&(Z.pending=null),D=D.next}Kd=!1}if(fl=0,gi=ki=Un=null,$l=!1,Qd=0,sj.current=null,C===null||C.return===null){ao=1,ty=v,Ki=null;break}e:{var ne=g,he=C.return,Re=C,Ue=v;if(v=Yo,Re.flags|=32768,Ue!==null&&typeof Ue=="object"&&typeof Ue.then=="function"){var ut=Ue,Rt=Re,Ft=Rt.tag;if((Rt.mode&1)===0&&(Ft===0||Ft===11||Ft===15)){var Nt=Rt.alternate;Nt?(Rt.updateQueue=Nt.updateQueue,Rt.memoizedState=Nt.memoizedState,Rt.lanes=Nt.lanes):(Rt.updateQueue=null,Rt.memoizedState=null)}var Vt=H8(he);if(Vt!==null){Vt.flags&=-257,V8(Vt,he,Re,ne,v),Vt.mode&1&&U8(ne,ut,v),v=Vt,Ue=ut;var rr=v.updateQueue;if(rr===null){var ar=new Set;ar.add(Ue),v.updateQueue=ar}else rr.add(Ue);break e}else{if((v&1)===0){U8(ne,ut,v),mj();break e}Ue=Error(r(426))}}else if(jt&&Re.mode&1){var Mi=H8(he);if(Mi!==null){(Mi.flags&65536)===0&&(Mi.flags|=256),V8(Mi,he,Re,ne,v),qt(fg(Ue,Re));break e}}ne=Ue=fg(Ue,Re),ao!==4&&(ao=2),ry===null?ry=[ne]:ry.push(ne),ne=he;do{switch(ne.tag){case 3:ne.flags|=65536,v&=-v,ne.lanes|=v;var ot=q8(ne,Ue,v);Tn(ne,ot);break e;case 1:Re=Ue;var Ye=ne.type,st=ne.stateNode;if((ne.flags&128)===0&&(typeof Ye.getDerivedStateFromError=="function"||st!==null&&typeof st.componentDidCatch=="function"&&(Jd===null||!Jd.has(st)))){ne.flags|=65536,v&=-v,ne.lanes|=v;var Dt=$8(ne,Re,v);Tn(ne,Dt);break e}}ne=ne.return}while(ne!==null)}jO(C)}catch(cr){v=cr,Ki===C&&C!==null&&(Ki=C=C.return);continue}break}while(!0)}function wO(){var g=Zb.current;return Zb.current=Vb,g===null?Vb:g}function mj(){(ao===0||ao===3||ao===2)&&(ao=4),Co===null||(vp&268435455)===0&&(Jb&268435455)===0||rf(Co,Yo)}function o1(g,v){var C=rn;rn|=2;var D=wO();(Co!==g||Yo!==v)&&(zu=null,xp(g,v));do try{tZ();break}catch(Z){bO(g,Z)}while(!0);if(en(),rn=C,Zb.current=D,Ki!==null)throw Error(r(261));return Co=null,Yo=0,ao}function tZ(){for(;Ki!==null;)SO(Ki)}function rZ(){for(;Ki!==null&&!yr();)SO(Ki)}function SO(g){var v=CO(g.alternate,g,Ns);g.memoizedProps=g.pendingProps,v===null?jO(g):Ki=v,sj.current=null}function jO(g){var v=g;do{var C=v.alternate;if(g=v.return,(v.flags&32768)===0){if(C=GX(C,v,Ns),C!==null){Ki=C;return}}else{if(C=KX(C,v),C!==null){C.flags&=32767,Ki=C;return}if(g!==null)g.flags|=32768,g.subtreeFlags=0,g.deletions=null;else{ao=6,Ki=null;return}}if(v=v.sibling,v!==null){Ki=v;return}Ki=v=g}while(v!==null);ao===0&&(ao=5)}function bp(g,v,C){var D=Fr,Z=hl.transition;try{hl.transition=null,Fr=1,nZ(g,v,C,D)}finally{hl.transition=Z,Fr=D}return null}function nZ(g,v,C,D){do mg();while(ef!==null);if((rn&6)!==0)throw Error(r(327));C=g.finishedWork;var Z=g.finishedLanes;if(C===null)return null;if(g.finishedWork=null,g.finishedLanes=0,C===g.current)throw Error(r(177));g.callbackNode=null,g.callbackPriority=0;var ne=C.lanes|C.childLanes;if(Pv(g,ne),g===Co&&(Ki=Co=null,Yo=0),(C.subtreeFlags&2064)===0&&(C.flags&2064)===0||t1||(t1=!0,EO(oi,function(){return mg(),null})),ne=(C.flags&15990)!==0,(C.subtreeFlags&15990)!==0||ne){ne=hl.transition,hl.transition=null;var he=Fr;Fr=1;var Re=rn;rn|=4,sj.current=null,XX(g,C),pO(C,g),Ri(Nu),Id=!!dp,Nu=dp=null,g.current=C,ZX(C),Xn(),rn=Re,Fr=he,hl.transition=ne}else g.current=C;if(t1&&(t1=!1,ef=g,r1=Z),ne=g.pendingLanes,ne===0&&(Jd=null),$h(C.stateNode),rs(g,Gr()),v!==null)for(D=g.onRecoverableError,C=0;C<v.length;C++)Z=v[C],D(Z.value,{componentStack:Z.stack,digest:Z.digest});if(e1)throw e1=!1,g=uj,uj=null,g;return(r1&1)!==0&&g.tag!==0&&mg(),ne=g.pendingLanes,(ne&1)!==0?g===dj?ny++:(ny=0,dj=g):ny=0,oe(),null}function mg(){if(ef!==null){var g=Zf(r1),v=hl.transition,C=Fr;try{if(hl.transition=null,Fr=16>g?16:g,ef===null)var D=!1;else{if(g=ef,ef=null,r1=0,(rn&6)!==0)throw Error(r(331));var Z=rn;for(rn|=4,Xt=g.current;Xt!==null;){var ne=Xt,he=ne.child;if((Xt.flags&16)!==0){var Re=ne.deletions;if(Re!==null){for(var Ue=0;Ue<Re.length;Ue++){var ut=Re[Ue];for(Xt=ut;Xt!==null;){var Rt=Xt;switch(Rt.tag){case 0:case 11:case 15:ey(8,Rt,ne)}var Ft=Rt.child;if(Ft!==null)Ft.return=Rt,Xt=Ft;else for(;Xt!==null;){Rt=Xt;var Nt=Rt.sibling,Vt=Rt.return;if(lO(Rt),Rt===ut){Xt=null;break}if(Nt!==null){Nt.return=Vt,Xt=Nt;break}Xt=Vt}}}var rr=ne.alternate;if(rr!==null){var ar=rr.child;if(ar!==null){rr.child=null;do{var Mi=ar.sibling;ar.sibling=null,ar=Mi}while(ar!==null)}}Xt=ne}}if((ne.subtreeFlags&2064)!==0&&he!==null)he.return=ne,Xt=he;else e:for(;Xt!==null;){if(ne=Xt,(ne.flags&2048)!==0)switch(ne.tag){case 0:case 11:case 15:ey(9,ne,ne.return)}var ot=ne.sibling;if(ot!==null){ot.return=ne.return,Xt=ot;break e}Xt=ne.return}}var Ye=g.current;for(Xt=Ye;Xt!==null;){he=Xt;var st=he.child;if((he.subtreeFlags&2064)!==0&&st!==null)st.return=he,Xt=st;else e:for(he=Ye;Xt!==null;){if(Re=Xt,(Re.flags&2048)!==0)try{switch(Re.tag){case 0:case 11:case 15:Xb(9,Re)}}catch(cr){_i(Re,Re.return,cr)}if(Re===he){Xt=null;break e}var Dt=Re.sibling;if(Dt!==null){Dt.return=Re.return,Xt=Dt;break e}Xt=Re.return}}if(rn=Z,oe(),ba&&typeof ba.onPostCommitFiberRoot=="function")try{ba.onPostCommitFiberRoot(uu,g)}catch{}D=!0}return D}finally{Fr=C,hl.transition=v}}return!1}function kO(g,v,C){v=fg(C,v),v=q8(g,v,1),g=pi(g,v,1),v=Aa(),g!==null&&(fu(g,1,v),rs(g,v))}function _i(g,v,C){if(g.tag===3)kO(g,g,C);else for(;v!==null;){if(v.tag===3){kO(v,g,C);break}else if(v.tag===1){var D=v.stateNode;if(typeof v.type.getDerivedStateFromError=="function"||typeof D.componentDidCatch=="function"&&(Jd===null||!Jd.has(D))){g=fg(C,g),g=$8(v,g,1),v=pi(v,g,1),g=Aa(),v!==null&&(fu(v,1,g),rs(v,g));break}}v=v.return}}function iZ(g,v,C){var D=g.pingCache;D!==null&&D.delete(v),v=Aa(),g.pingedLanes|=g.suspendedLanes&C,Co===g&&(Yo&C)===C&&(ao===4||ao===3&&(Yo&130023424)===Yo&&500>Gr()-cj?xp(g,0):lj|=C),rs(g,v)}function _O(g,v){v===0&&((g.mode&1)===0?v=1:(v=wa,wa<<=1,(wa&130023424)===0&&(wa=4194304)));var C=Aa();g=An(g,v),g!==null&&(fu(g,v,C),rs(g,C))}function oZ(g){var v=g.memoizedState,C=0;v!==null&&(C=v.retryLane),_O(g,C)}function aZ(g,v){var C=0;switch(g.tag){case 13:var D=g.stateNode,Z=g.memoizedState;Z!==null&&(C=Z.retryLane);break;case 19:D=g.stateNode;break;default:throw Error(r(314))}D!==null&&D.delete(v),_O(g,C)}var CO;CO=function(g,v,C){if(g!==null)if(g.memoizedProps!==v.pendingProps||ta.current)es=!0;else{if((g.lanes&C)===0&&(v.flags&128)===0)return es=!1,YX(g,v,C);es=(g.flags&131072)!==0}else es=!1,jt&&(v.flags&1048576)!==0&&et(v,ye,v.index);switch(v.lanes=0,v.tag){case 2:var D=v.type;Kb(g,v),g=v.pendingProps;var Z=Yd(v,io.current);si(v,C),Z=hp(null,v,D,g,Z,C);var ne=pl();return v.flags|=1,typeof Z=="object"&&Z!==null&&typeof Z.render=="function"&&Z.$$typeof===void 0?(v.tag=1,v.memoizedState=null,v.updateQueue=null,ra(D)?(ne=!0,Fu(v)):ne=!1,v.memoizedState=Z.state!==null&&Z.state!==void 0?Z.state:null,oo(v),Z.updater=Yb,v.stateNode=Z,Z._reactInternals=v,YS(v,D,g,C),v=XS(null,v,D,!0,ne,C)):(v.tag=0,jt&&ne&&yt(v),Ea(null,v,Z,C),v=v.child),v;case 16:D=v.elementType;e:{switch(Kb(g,v),g=v.pendingProps,Z=D._init,D=Z(D._payload),v.type=D,Z=v.tag=lZ(D),g=Hl(D,g),Z){case 0:v=QS(null,v,D,g,C);break e;case 1:v=Z8(null,v,D,g,C);break e;case 11:v=Y8(null,v,D,g,C);break e;case 14:v=G8(null,v,D,Hl(D.type,g),C);break e}throw Error(r(306,D,""))}return v;case 0:return D=v.type,Z=v.pendingProps,Z=v.elementType===D?Z:Hl(D,Z),QS(g,v,D,Z,C);case 1:return D=v.type,Z=v.pendingProps,Z=v.elementType===D?Z:Hl(D,Z),Z8(g,v,D,Z,C);case 3:e:{if(J8(v),g===null)throw Error(r(387));D=v.pendingProps,ne=v.memoizedState,Z=ne.element,na(g,v),_o(v,D,null,C);var he=v.memoizedState;if(D=he.element,ne.isDehydrated)if(ne={element:D,isDehydrated:!1,cache:he.cache,pendingSuspenseBoundaries:he.pendingSuspenseBoundaries,transitions:he.transitions},v.updateQueue.baseState=ne,v.memoizedState=ne,v.flags&256){Z=fg(Error(r(423)),v),v=eO(g,v,D,C,Z);break e}else if(D!==Z){Z=fg(Error(r(424)),v),v=eO(g,v,D,C,Z);break e}else for(mt=Ho(v.stateNode.containerInfo.firstChild),ht=v,jt=!0,Et=null,C=ti(v,null,D,C),v.child=C;C;)C.flags=C.flags&-3|4096,C=C.sibling;else{if(Gt(),D===Z){v=Du(g,v,C);break e}Ea(g,v,D,C)}v=v.child}return v;case 5:return Wb(v),g===null&&Jt(v),D=v.type,Z=v.pendingProps,ne=g!==null?g.memoizedProps:null,he=Z.children,$v(D,Z)?he=null:ne!==null&&$v(D,ne)&&(v.flags|=32),X8(g,v),Ea(g,v,he,C),v.child;case 6:return g===null&&Jt(v),null;case 13:return tO(g,v,C);case 4:return Gd(v,v.stateNode.containerInfo),D=v.pendingProps,g===null?v.child=Si(v,null,D,C):Ea(g,v,D,C),v.child;case 11:return D=v.type,Z=v.pendingProps,Z=v.elementType===D?Z:Hl(D,Z),Y8(g,v,D,Z,C);case 7:return Ea(g,v,v.pendingProps,C),v.child;case 8:return Ea(g,v,v.pendingProps.children,C),v.child;case 12:return Ea(g,v,v.pendingProps.children,C),v.child;case 10:e:{if(D=v.type._context,Z=v.pendingProps,ne=v.memoizedProps,he=Z.value,mn(Li,D._currentValue),D._currentValue=he,ne!==null)if(Hi(ne.value,he)){if(ne.children===Z.children&&!ta.current){v=Du(g,v,C);break e}}else for(ne=v.child,ne!==null&&(ne.return=v);ne!==null;){var Re=ne.dependencies;if(Re!==null){he=ne.child;for(var Ue=Re.firstContext;Ue!==null;){if(Ue.context===D){if(ne.tag===1){Ue=fi(-1,C&-C),Ue.tag=2;var ut=ne.updateQueue;if(ut!==null){ut=ut.shared;var Rt=ut.pending;Rt===null?Ue.next=Ue:(Ue.next=Rt.next,Rt.next=Ue),ut.pending=Ue}}ne.lanes|=C,Ue=ne.alternate,Ue!==null&&(Ue.lanes|=C),tn(ne.return,C,v),Re.lanes|=C;break}Ue=Ue.next}}else if(ne.tag===10)he=ne.type===v.type?null:ne.child;else if(ne.tag===18){if(he=ne.return,he===null)throw Error(r(341));he.lanes|=C,Re=he.alternate,Re!==null&&(Re.lanes|=C),tn(he,C,v),he=ne.sibling}else he=ne.child;if(he!==null)he.return=ne;else for(he=ne;he!==null;){if(he===v){he=null;break}if(ne=he.sibling,ne!==null){ne.return=he.return,he=ne;break}he=he.return}ne=he}Ea(g,v,Z.children,C),v=v.child}return v;case 9:return Z=v.type,D=v.pendingProps.children,si(v,C),Z=li(Z),D=D(Z),v.flags|=1,Ea(g,v,D,C),v.child;case 14:return D=v.type,Z=Hl(D,v.pendingProps),Z=Hl(D.type,Z),G8(g,v,D,Z,C);case 15:return K8(g,v,v.type,v.pendingProps,C);case 17:return D=v.type,Z=v.pendingProps,Z=v.elementType===D?Z:Hl(D,Z),Kb(g,v),v.tag=1,ra(D)?(g=!0,Fu(v)):g=!1,si(v,C),B8(v,D,Z),YS(v,D,Z,C),XS(null,v,D,!0,g,C);case 19:return nO(g,v,C);case 22:return Q8(g,v,C)}throw Error(r(156,v.tag))};function EO(g,v){return xa(g,v)}function sZ(g,v,C,D){this.tag=g,this.key=C,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=v,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=D,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gl(g,v,C,D){return new sZ(g,v,C,D)}function vj(g){return g=g.prototype,!(!g||!g.isReactComponent)}function lZ(g){if(typeof g=="function")return vj(g)?1:0;if(g!=null){if(g=g.$$typeof,g===A)return 11;if(g===z)return 14}return 2}function nf(g,v){var C=g.alternate;return C===null?(C=gl(g.tag,v,g.key,g.mode),C.elementType=g.elementType,C.type=g.type,C.stateNode=g.stateNode,C.alternate=g,g.alternate=C):(C.pendingProps=v,C.type=g.type,C.flags=0,C.subtreeFlags=0,C.deletions=null),C.flags=g.flags&14680064,C.childLanes=g.childLanes,C.lanes=g.lanes,C.child=g.child,C.memoizedProps=g.memoizedProps,C.memoizedState=g.memoizedState,C.updateQueue=g.updateQueue,v=g.dependencies,C.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext},C.sibling=g.sibling,C.index=g.index,C.ref=g.ref,C}function a1(g,v,C,D,Z,ne){var he=2;if(D=g,typeof g=="function")vj(g)&&(he=1);else if(typeof g=="string")he=5;else e:switch(g){case O:return wp(C.children,Z,ne,v);case T:he=8,Z|=8;break;case R:return g=gl(12,C,v,Z|2),g.elementType=R,g.lanes=ne,g;case F:return g=gl(13,C,v,Z),g.elementType=F,g.lanes=ne,g;case L:return g=gl(19,C,v,Z),g.elementType=L,g.lanes=ne,g;case Q:return s1(C,Z,ne,v);default:if(typeof g=="object"&&g!==null)switch(g.$$typeof){case I:he=10;break e;case E:he=9;break e;case A:he=11;break e;case z:he=14;break e;case V:he=16,D=null;break e}throw Error(r(130,g==null?g:typeof g,""))}return v=gl(he,C,v,Z),v.elementType=g,v.type=D,v.lanes=ne,v}function wp(g,v,C,D){return g=gl(7,g,D,v),g.lanes=C,g}function s1(g,v,C,D){return g=gl(22,g,D,v),g.elementType=Q,g.lanes=C,g.stateNode={isHidden:!1},g}function yj(g,v,C){return g=gl(6,g,null,v),g.lanes=C,g}function xj(g,v,C){return v=gl(4,g.children!==null?g.children:[],g.key,v),v.lanes=C,v.stateNode={containerInfo:g.containerInfo,pendingChildren:null,implementation:g.implementation},v}function cZ(g,v,C,D,Z){this.tag=v,this.containerInfo=g,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Pd(0),this.expirationTimes=Pd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pd(0),this.identifierPrefix=D,this.onRecoverableError=Z,this.mutableSourceEagerHydrationData=null}function bj(g,v,C,D,Z,ne,he,Re,Ue){return g=new cZ(g,v,C,Re,Ue),v===1?(v=1,ne===!0&&(v|=8)):v=0,ne=gl(3,null,null,v),g.current=ne,ne.stateNode=g,ne.memoizedState={element:D,isDehydrated:C,cache:null,transitions:null,pendingSuspenseBoundaries:null},oo(ne),g}function uZ(g,v,C){var D=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:P,key:D==null?null:""+D,children:g,containerInfo:v,implementation:C}}function AO(g){if(!g)return Ic;g=g._reactInternals;e:{if(Ln(g)!==g||g.tag!==1)throw Error(r(170));var v=g;do{switch(v.tag){case 3:v=v.stateNode.context;break e;case 1:if(ra(v.type)){v=v.stateNode.__reactInternalMemoizedMergedChildContext;break e}}v=v.return}while(v!==null);throw Error(r(171))}if(g.tag===1){var C=g.type;if(ra(C))return Yv(g,C,v)}return v}function TO(g,v,C,D,Z,ne,he,Re,Ue){return g=bj(C,D,!0,g,Z,ne,he,Re,Ue),g.context=AO(null),C=g.current,D=Aa(),Z=tf(C),ne=fi(D,Z),ne.callback=v??null,pi(C,ne,Z),g.current.lanes=Z,fu(g,Z,D),rs(g,D),g}function l1(g,v,C,D){var Z=v.current,ne=Aa(),he=tf(Z);return C=AO(C),v.context===null?v.context=C:v.pendingContext=C,v=fi(ne,he),v.payload={element:g},D=D===void 0?null:D,D!==null&&(v.callback=D),g=pi(Z,v,he),g!==null&&(Gl(g,Z,he,ne),ko(g,Z,he)),he}function c1(g){if(g=g.current,!g.child)return null;switch(g.child.tag){case 5:return g.child.stateNode;default:return g.child.stateNode}}function PO(g,v){if(g=g.memoizedState,g!==null&&g.dehydrated!==null){var C=g.retryLane;g.retryLane=C!==0&&C<v?C:v}}function wj(g,v){PO(g,v),(g=g.alternate)&&PO(g,v)}function dZ(){return null}var OO=typeof reportError=="function"?reportError:function(g){console.error(g)};function Sj(g){this._internalRoot=g}u1.prototype.render=Sj.prototype.render=function(g){var v=this._internalRoot;if(v===null)throw Error(r(409));l1(g,v,null,null)},u1.prototype.unmount=Sj.prototype.unmount=function(){var g=this._internalRoot;if(g!==null){this._internalRoot=null;var v=g.containerInfo;yp(function(){l1(null,g,null,null)}),v[So]=null}};function u1(g){this._internalRoot=g}u1.prototype.unstable_scheduleHydration=function(g){if(g){var v=Uh();g={blockedOn:null,target:g,priority:v};for(var C=0;C<rl.length&&v!==0&&v<rl[C].priority;C++);rl.splice(C,0,g),C===0&&nl(g)}};function jj(g){return!(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)}function d1(g){return!(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11&&(g.nodeType!==8||g.nodeValue!==" react-mount-point-unstable "))}function IO(){}function fZ(g,v,C,D,Z){if(Z){if(typeof D=="function"){var ne=D;D=function(){var ut=c1(he);ne.call(ut)}}var he=TO(v,D,g,0,null,!1,!1,"",IO);return g._reactRootContainer=he,g[So]=he.current,Ou(g.nodeType===8?g.parentNode:g),yp(),he}for(;Z=g.lastChild;)g.removeChild(Z);if(typeof D=="function"){var Re=D;D=function(){var ut=c1(Ue);Re.call(ut)}}var Ue=bj(g,0,!1,null,null,!1,!1,"",IO);return g._reactRootContainer=Ue,g[So]=Ue.current,Ou(g.nodeType===8?g.parentNode:g),yp(function(){l1(v,Ue,C,D)}),Ue}function f1(g,v,C,D,Z){var ne=C._reactRootContainer;if(ne){var he=ne;if(typeof Z=="function"){var Re=Z;Z=function(){var Ue=c1(he);Re.call(Ue)}}l1(v,he,g,Z)}else he=fZ(C,v,g,Z,D);return c1(he)}pu=function(g){switch(g.tag){case 3:var v=g.stateNode;if(v.current.memoizedState.isDehydrated){var C=el(v.pendingLanes);C!==0&&(Xf(v,C|1),rs(v,Gr()),(rn&6)===0&&(gg=Gr()+500,oe()))}break;case 13:yp(function(){var D=An(g,1);if(D!==null){var Z=Aa();Gl(D,g,1,Z)}}),wj(g,1)}},wc=function(g){if(g.tag===13){var v=An(g,134217728);if(v!==null){var C=Aa();Gl(v,g,134217728,C)}wj(g,134217728)}},Od=function(g){if(g.tag===13){var v=tf(g),C=An(g,v);if(C!==null){var D=Aa();Gl(C,g,v,D)}wj(g,v)}},Uh=function(){return Fr},Hh=function(g,v){var C=Fr;try{return Fr=g,v()}finally{Fr=C}},We=function(g,v,C){switch(v){case"input":if(ke(g,C),v=C.name,C.type==="radio"&&v!=null){for(C=g;C.parentNode;)C=C.parentNode;for(C=C.querySelectorAll("input[name="+JSON.stringify(""+v)+'][type="radio"]'),v=0;v<C.length;v++){var D=C[v];if(D!==g&&D.form===g.form){var Z=fp(D);if(!Z)throw Error(r(90));me(D),ke(D,Z)}}}break;case"textarea":Ne(g,C);break;case"select":v=C.value,v!=null&&ce(g,!!C.multiple,v,!1)}},De=hj,tt=yp;var pZ={usingClientEntryPoint:!1,Events:[Vd,Ru,fp,pe,xe,hj]},iy={findFiberByHostInstance:Oc,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},hZ={bundleType:iy.bundleType,version:iy.version,rendererPackageName:iy.rendererPackageName,rendererConfig:iy.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:S.ReactCurrentDispatcher,findHostInstanceByFiber:function(g){return g=zo(g),g===null?null:g.stateNode},findFiberByHostInstance:iy.findFiberByHostInstance||dZ,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 p1=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!p1.isDisabled&&p1.supportsFiber)try{uu=p1.inject(hZ),ba=p1}catch{}}return ns.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pZ,ns.createPortal=function(g,v){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!jj(v))throw Error(r(200));return uZ(g,v,null,C)},ns.createRoot=function(g,v){if(!jj(g))throw Error(r(299));var C=!1,D="",Z=OO;return v!=null&&(v.unstable_strictMode===!0&&(C=!0),v.identifierPrefix!==void 0&&(D=v.identifierPrefix),v.onRecoverableError!==void 0&&(Z=v.onRecoverableError)),v=bj(g,1,!1,null,null,C,!1,D,Z),g[So]=v.current,Ou(g.nodeType===8?g.parentNode:g),new Sj(v)},ns.findDOMNode=function(g){if(g==null)return null;if(g.nodeType===1)return g;var v=g._reactInternals;if(v===void 0)throw typeof g.render=="function"?Error(r(188)):(g=Object.keys(g).join(","),Error(r(268,g)));return g=zo(v),g=g===null?null:g.stateNode,g},ns.flushSync=function(g){return yp(g)},ns.hydrate=function(g,v,C){if(!d1(v))throw Error(r(200));return f1(null,g,v,!0,C)},ns.hydrateRoot=function(g,v,C){if(!jj(g))throw Error(r(405));var D=C!=null&&C.hydratedSources||null,Z=!1,ne="",he=OO;if(C!=null&&(C.unstable_strictMode===!0&&(Z=!0),C.identifierPrefix!==void 0&&(ne=C.identifierPrefix),C.onRecoverableError!==void 0&&(he=C.onRecoverableError)),v=TO(v,null,g,1,C??null,Z,!1,ne,he),g[So]=v.current,Ou(g),D)for(g=0;g<D.length;g++)C=D[g],Z=C._getVersion,Z=Z(C._source),v.mutableSourceEagerHydrationData==null?v.mutableSourceEagerHydrationData=[C,Z]:v.mutableSourceEagerHydrationData.push(C,Z);return new u1(v)},ns.render=function(g,v,C){if(!d1(v))throw Error(r(200));return f1(null,g,v,!1,C)},ns.unmountComponentAtNode=function(g){if(!d1(g))throw Error(r(40));return g._reactRootContainer?(yp(function(){f1(null,null,g,!1,function(){g._reactRootContainer=null,g[So]=null})}),!0):!1},ns.unstable_batchedUpdates=hj,ns.unstable_renderSubtreeIntoContainer=function(g,v,C,D){if(!d1(C))throw Error(r(200));if(g==null||g._reactInternals===void 0)throw Error(r(38));return f1(g,v,C,!1,D)},ns.version="18.3.1-next-f1338f8080-20240426",ns}var BO;function j6(){if(BO)return Cj.exports;BO=1;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)}}return e(),Cj.exports=kZ(),Cj.exports}var WO;function _Z(){if(WO)return g1;WO=1;var e=j6();return g1.createRoot=e.createRoot,g1.hydrateRoot=e.hydrateRoot,g1}var YW=_Z(),j=_w();const ze=un(j),GW=yZ({__proto__:null,default:ze},[j]);var k6=j6();const CZ=un(k6);/**
|
||
* @remix-run/router v1.23.2
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function tx(){return tx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tx.apply(this,arguments)}var bf;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(bf||(bf={}));const qO="popstate";function EZ(e){e===void 0&&(e={});function t(n,o){let{pathname:a,search:s,hash:l}=n.location;return $3("",{pathname:a,search:s,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(n,o){return typeof o=="string"?o:T0(o)}return TZ(t,r,null,e)}function mi(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _6(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function AZ(){return Math.random().toString(36).substr(2,8)}function $O(e,t){return{usr:e.state,key:e.key,idx:t}}function $3(e,t,r,n){return r===void 0&&(r=null),tx({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?tv(t):t,{state:r,key:t&&t.key||n||AZ()})}function T0(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function tv(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function TZ(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:a=!1}=n,s=o.history,l=bf.Pop,c=null,u=d();u==null&&(u=0,s.replaceState(tx({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function f(){l=bf.Pop;let x=d(),b=x==null?null:x-u;u=x,c&&c({action:l,location:m.location,delta:b})}function h(x,b){l=bf.Push;let w=$3(m.location,x,b);u=d()+1;let k=$O(w,u),S=m.createHref(w);try{s.pushState(k,"",S)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;o.location.assign(S)}a&&c&&c({action:l,location:m.location,delta:1})}function p(x,b){l=bf.Replace;let w=$3(m.location,x,b);u=d();let k=$O(w,u),S=m.createHref(w);s.replaceState(k,"",S),a&&c&&c({action:l,location:m.location,delta:0})}function y(x){let b=o.location.origin!=="null"?o.location.origin:o.location.href,w=typeof x=="string"?x:T0(x);return w=w.replace(/ $/,"%20"),mi(b,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,b)}let m={get action(){return l},get location(){return e(o,s)},listen(x){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(qO,f),c=x,()=>{o.removeEventListener(qO,f),c=null}},createHref(x){return t(o,x)},createURL:y,encodeLocation(x){let b=y(x);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:p,go(x){return s.go(x)}};return m}var UO;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(UO||(UO={}));function PZ(e,t,r){return r===void 0&&(r="/"),OZ(e,t,r)}function OZ(e,t,r,n){let o=typeof t=="string"?tv(t):t,a=gm(o.pathname||"/",r);if(a==null)return null;let s=KW(e);IZ(s);let l=null;for(let c=0;l==null&&c<s.length;++c){let u=$Z(a);l=WZ(s[c],u)}return l}function KW(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let o=(a,s,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:s,route:a};c.relativePath.startsWith("/")&&(mi(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 u=Cf([n,c.relativePath]),d=r.concat(c);a.children&&a.children.length>0&&(mi(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),KW(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:zZ(u,a.index),routesMeta:d})};return e.forEach((a,s)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))o(a,s);else for(let c of QW(a.path))o(a,s,c)}),t}function QW(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return o?[a,""]:[a];let s=QW(n.join("/")),l=[];return l.push(...s.map(c=>c===""?a:[a,c].join("/"))),o&&l.push(...s),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function IZ(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:BZ(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const NZ=/^:[\w-]+$/,RZ=3,LZ=2,FZ=1,MZ=10,DZ=-2,HO=e=>e==="*";function zZ(e,t){let r=e.split("/"),n=r.length;return r.some(HO)&&(n+=DZ),t&&(n+=LZ),r.filter(o=>!HO(o)).reduce((o,a)=>o+(NZ.test(a)?RZ:a===""?FZ:MZ),n)}function BZ(e,t){return e.length===t.length&&e.slice(0,-1).every((n,o)=>n===t[o])?e[e.length-1]-t[t.length-1]:0}function WZ(e,t,r){let{routesMeta:n}=e,o={},a="/",s=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,d=a==="/"?t:t.slice(a.length)||"/",f=U3({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f)return null;Object.assign(o,f.params),s.push({params:o,pathname:Cf([a,f.pathname]),pathnameBase:GZ(Cf([a,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(a=Cf([a,f.pathnameBase]))}return s}function U3(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=qZ(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let a=o[0],s=a.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:n.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let m=l[f]||"";s=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const y=l[f];return p&&!y?u[h]=void 0:u[h]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:s,pattern:e}}function qZ(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),_6(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}function $Z(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return _6(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function gm(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const UZ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,HZ=e=>UZ.test(e);function VZ(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?tv(e):e,a;if(r)if(HZ(r))a=r;else{if(r.includes("//")){let s=r;r=r.replace(/\/\/+/g,"/"),_6(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+r))}r.startsWith("/")?a=VO(r.substring(1),"/"):a=VO(r,t)}else a=t;return{pathname:a,search:KZ(n),hash:QZ(o)}}function VO(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Tj(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function YZ(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function C6(e,t){let r=YZ(e);return t?r.map((n,o)=>o===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function E6(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=tv(e):(o=tx({},e),mi(!o.pathname||!o.pathname.includes("?"),Tj("?","pathname","search",o)),mi(!o.pathname||!o.pathname.includes("#"),Tj("#","pathname","hash",o)),mi(!o.search||!o.search.includes("#"),Tj("#","search","hash",o)));let a=e===""||o.pathname==="",s=a?"/":o.pathname,l;if(s==null)l=r;else{let f=t.length-1;if(!n&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;o.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=VZ(o,l),u=s&&s!=="/"&&s.endsWith("/"),d=(a||s===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Cf=e=>e.join("/").replace(/\/\/+/g,"/"),GZ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),KZ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,QZ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function XZ(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const XW=["post","put","patch","delete"];new Set(XW);const ZZ=["get",...XW];new Set(ZZ);/**
|
||
* React Router v6.30.3
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function rx(){return rx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rx.apply(this,arguments)}const Cw=j.createContext(null),ZW=j.createContext(null),yd=j.createContext(null),Ew=j.createContext(null),ru=j.createContext({outlet:null,matches:[],isDataRoute:!1}),JW=j.createContext(null);function JZ(e,t){let{relative:r}=t===void 0?{}:t;rv()||mi(!1);let{basename:n,navigator:o}=j.useContext(yd),{hash:a,pathname:s,search:l}=Aw(e,{relative:r}),c=s;return n!=="/"&&(c=s==="/"?n:Cf([n,s])),o.createHref({pathname:c,search:l,hash:a})}function rv(){return j.useContext(Ew)!=null}function xd(){return rv()||mi(!1),j.useContext(Ew).location}function eq(e){j.useContext(yd).static||j.useLayoutEffect(e)}function bd(){let{isDataRoute:e}=j.useContext(ru);return e?hJ():eJ()}function eJ(){rv()||mi(!1);let e=j.useContext(Cw),{basename:t,future:r,navigator:n}=j.useContext(yd),{matches:o}=j.useContext(ru),{pathname:a}=xd(),s=JSON.stringify(C6(o,r.v7_relativeSplatPath)),l=j.useRef(!1);return eq(()=>{l.current=!0}),j.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let f=E6(u,JSON.parse(s),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Cf([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,s,a,e])}const tJ=j.createContext(null);function rJ(e){let t=j.useContext(ru).outlet;return t&&j.createElement(tJ.Provider,{value:e},t)}function A6(){let{matches:e}=j.useContext(ru),t=e[e.length-1];return t?t.params:{}}function Aw(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=j.useContext(yd),{matches:o}=j.useContext(ru),{pathname:a}=xd(),s=JSON.stringify(C6(o,n.v7_relativeSplatPath));return j.useMemo(()=>E6(e,JSON.parse(s),a,r==="path"),[e,s,a,r])}function nJ(e,t){return iJ(e,t)}function iJ(e,t,r,n){rv()||mi(!1);let{navigator:o}=j.useContext(yd),{matches:a}=j.useContext(ru),s=a[a.length-1],l=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=xd(),d;if(t){var f;let x=typeof t=="string"?tv(t):t;c==="/"||(f=x.pathname)!=null&&f.startsWith(c)||mi(!1),d=x}else d=u;let h=d.pathname||"/",p=h;if(c!=="/"){let x=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(x.length).join("/")}let y=PZ(e,{pathname:p}),m=cJ(y&&y.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:Cf([c,o.encodeLocation?o.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:Cf([c,o.encodeLocation?o.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),a,r,n);return t&&m?j.createElement(Ew.Provider,{value:{location:rx({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:bf.Pop}},m):m}function oJ(){let e=pJ(),t=XZ(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),r?j.createElement("pre",{style:o},r):null,null)}const aJ=j.createElement(oJ,null);class sJ extends j.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?j.createElement(ru.Provider,{value:this.props.routeContext},j.createElement(JW.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function lJ(e){let{routeContext:t,match:r,children:n}=e,o=j.useContext(Cw);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),j.createElement(ru.Provider,{value:t},n)}function cJ(e,t,r,n){var o;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,l=(o=r)==null?void 0:o.errors;if(l!=null){let d=s.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||mi(!1),s=s.slice(0,Math.min(s.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d<s.length;d++){let f=s[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:p}=r,y=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||y){c=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,f,h)=>{let p,y=!1,m=null,x=null;r&&(p=l&&f.route.id?l[f.route.id]:void 0,m=f.route.errorElement||aJ,c&&(u<0&&h===0?(gJ("route-fallback"),y=!0,x=null):u===h&&(y=!0,x=f.route.hydrateFallbackElement||null)));let b=t.concat(s.slice(0,h+1)),w=()=>{let k;return p?k=m:y?k=x:f.route.Component?k=j.createElement(f.route.Component,null):f.route.element?k=f.route.element:k=d,j.createElement(lJ,{match:f,routeContext:{outlet:d,matches:b,isDataRoute:r!=null},children:k})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?j.createElement(sJ,{location:r.location,revalidation:r.revalidation,component:m,error:p,children:w(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):w()},null)}var tq=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(tq||{}),rq=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(rq||{});function uJ(e){let t=j.useContext(Cw);return t||mi(!1),t}function dJ(e){let t=j.useContext(ZW);return t||mi(!1),t}function fJ(e){let t=j.useContext(ru);return t||mi(!1),t}function nq(e){let t=fJ(),r=t.matches[t.matches.length-1];return r.route.id||mi(!1),r.route.id}function pJ(){var e;let t=j.useContext(JW),r=dJ(),n=nq();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function hJ(){let{router:e}=uJ(tq.UseNavigateStable),t=nq(rq.UseNavigateStable),r=j.useRef(!1);return eq(()=>{r.current=!0}),j.useCallback(function(o,a){a===void 0&&(a={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,rx({fromRouteId:t},a)))},[e,t])}const YO={};function gJ(e,t,r){YO[e]||(YO[e]=!0)}function mJ(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function th(e){let{to:t,replace:r,state:n,relative:o}=e;rv()||mi(!1);let{future:a,static:s}=j.useContext(yd),{matches:l}=j.useContext(ru),{pathname:c}=xd(),u=bd(),d=E6(t,C6(l,a.v7_relativeSplatPath),c,o==="path"),f=JSON.stringify(d);return j.useEffect(()=>u(JSON.parse(f),{replace:r,state:n,relative:o}),[u,f,o,r,n]),null}function iq(e){return rJ(e.context)}function as(e){mi(!1)}function vJ(e){let{basename:t="/",children:r=null,location:n,navigationType:o=bf.Pop,navigator:a,static:s=!1,future:l}=e;rv()&&mi(!1);let c=t.replace(/^\/*/,"/"),u=j.useMemo(()=>({basename:c,navigator:a,static:s,future:rx({v7_relativeSplatPath:!1},l)}),[c,l,a,s]);typeof n=="string"&&(n=tv(n));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:y="default"}=n,m=j.useMemo(()=>{let x=gm(d,c);return x==null?null:{location:{pathname:x,search:f,hash:h,state:p,key:y},navigationType:o}},[c,d,f,h,p,y,o]);return m==null?null:j.createElement(yd.Provider,{value:u},j.createElement(Ew.Provider,{children:r,value:m}))}function yJ(e){let{children:t,location:r}=e;return nJ(H3(t),r)}new Promise(()=>{});function H3(e,t){t===void 0&&(t=[]);let r=[];return j.Children.forEach(e,(n,o)=>{if(!j.isValidElement(n))return;let a=[...t,o];if(n.type===j.Fragment){r.push.apply(r,H3(n.props.children,a));return}n.type!==as&&mi(!1),!n.props.index||!n.props.children||mi(!1);let s={id:n.props.id||a.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&&(s.children=H3(n.props.children,a)),r.push(s)}),r}/**
|
||
* React Router DOM v6.30.3
|
||
*
|
||
* Copyright (c) Remix Software Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE.md file in the root directory of this source tree.
|
||
*
|
||
* @license MIT
|
||
*/function P0(){return P0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},P0.apply(this,arguments)}function oq(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function xJ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function bJ(e,t){return e.button===0&&(!t||t==="_self")&&!xJ(e)}function V3(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function wJ(e,t){let r=V3(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(a=>{r.append(o,a)})}),r}const SJ=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],jJ=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],kJ="6";try{window.__reactRouterVersion=kJ}catch{}const _J=j.createContext({isTransitioning:!1}),CJ="startTransition",GO=GW[CJ];function EJ(e){let{basename:t,children:r,future:n,window:o}=e,a=j.useRef();a.current==null&&(a.current=EZ({window:o,v5Compat:!0}));let s=a.current,[l,c]=j.useState({action:s.action,location:s.location}),{v7_startTransition:u}=n||{},d=j.useCallback(f=>{u&&GO?GO(()=>c(f)):c(f)},[c,u]);return j.useLayoutEffect(()=>s.listen(d),[s,d]),j.useEffect(()=>mJ(n),[n]),j.createElement(vJ,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:s,future:n})}const AJ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",TJ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,PJ=j.forwardRef(function(t,r){let{onClick:n,relative:o,reloadDocument:a,replace:s,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=oq(t,SJ),{basename:p}=j.useContext(yd),y,m=!1;if(typeof u=="string"&&TJ.test(u)&&(y=u,AJ))try{let k=new URL(window.location.href),S=u.startsWith("//")?new URL(k.protocol+u):new URL(u),_=gm(S.pathname,p);S.origin===k.origin&&_!=null?u=_+S.search+S.hash:m=!0}catch{}let x=JZ(u,{relative:o}),b=IJ(u,{replace:s,state:l,target:c,preventScrollReset:d,relative:o,viewTransition:f});function w(k){n&&n(k),k.defaultPrevented||b(k)}return j.createElement("a",P0({},h,{href:y||x,onClick:m||a?n:w,ref:r,target:c}))}),KO=j.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:o=!1,className:a="",end:s=!1,style:l,to:c,viewTransition:u,children:d}=t,f=oq(t,jJ),h=Aw(c,{relative:f.relative}),p=xd(),y=j.useContext(ZW),{navigator:m,basename:x}=j.useContext(yd),b=y!=null&&NJ(h)&&u===!0,w=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,k=p.pathname,S=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;o||(k=k.toLowerCase(),S=S?S.toLowerCase():null,w=w.toLowerCase()),S&&x&&(S=gm(S,x)||S);const _=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let P=k===w||!s&&k.startsWith(w)&&k.charAt(_)==="/",O=S!=null&&(S===w||!s&&S.startsWith(w)&&S.charAt(w.length)==="/"),T={isActive:P,isPending:O,isTransitioning:b},R=P?n:void 0,I;typeof a=="function"?I=a(T):I=[a,P?"active":null,O?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let E=typeof l=="function"?l(T):l;return j.createElement(PJ,P0({},f,{"aria-current":R,className:I,ref:r,style:E,to:c,viewTransition:u}),typeof d=="function"?d(T):d)});var Y3;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Y3||(Y3={}));var QO;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(QO||(QO={}));function OJ(e){let t=j.useContext(Cw);return t||mi(!1),t}function IJ(e,t){let{target:r,replace:n,state:o,preventScrollReset:a,relative:s,viewTransition:l}=t===void 0?{}:t,c=bd(),u=xd(),d=Aw(e,{relative:s});return j.useCallback(f=>{if(bJ(f,r)){f.preventDefault();let h=n!==void 0?n:T0(u)===T0(d);c(e,{replace:h,state:o,preventScrollReset:a,relative:s,viewTransition:l})}},[u,c,d,n,o,r,e,a,s,l])}function aq(e){let t=j.useRef(V3(e)),r=j.useRef(!1),n=xd(),o=j.useMemo(()=>wJ(n.search,r.current?null:t.current),[n.search]),a=bd(),s=j.useCallback((l,c)=>{const u=V3(typeof l=="function"?l(o):l);r.current=!0,a("?"+u,c)},[a,o]);return[o,s]}function NJ(e,t){t===void 0&&(t={});let r=j.useContext(_J);r==null&&mi(!1);let{basename:n}=OJ(Y3.useViewTransitionState),o=Aw(e,{relative:t.relative});if(!r.isTransitioning)return!1;let a=gm(r.currentLocation.pathname,n)||r.currentLocation.pathname,s=gm(r.nextLocation.pathname,n)||r.nextLocation.pathname;return U3(o.pathname,s)!=null||U3(o.pathname,a)!=null}const sq=j.createContext({theme:"light",setTheme:()=>{}});function RJ({children:e}){const[t,r]=j.useState(()=>{try{const o=localStorage.getItem("eb-theme");if(o==="dark"||o==="light")return o}catch{}return"light"}),n=o=>{r(o);try{localStorage.setItem("eb-theme",o)}catch{}};return j.useEffect(()=>{const o=document.documentElement;t==="dark"?o.classList.add("dark"):o.classList.remove("dark")},[t]),i.jsx(sq.Provider,{value:{theme:t,setTheme:n},children:e})}function lq(){return j.useContext(sq)}let O0=0;const G3=new Set;function cq(){G3.forEach(e=>e())}function LJ(e){return G3.add(e),()=>{G3.delete(e)}}function XO(){return O0>0}function uq(){O0+=1,cq()}function dq(){O0=Math.max(0,O0-1),cq()}const FJ=new Set(["POST","PUT","PATCH","DELETE"]);function fq(e){const t=(e||"GET").toUpperCase();return FJ.has(t)}const Dy="https://api.eventbuzz.live/api",T6=Dy,mm={access:"eventbuzz_access_token",refresh:"eventbuzz_refresh_token"};let El=null,nd=null;function pq(){try{const e=localStorage.getItem(mm.access),t=localStorage.getItem(mm.refresh);e&&t&&(El=e,nd=t)}catch{}}pq();function vf(e,t){El=e,nd=t;try{localStorage.setItem(mm.access,e),localStorage.setItem(mm.refresh,t)}catch{}}function hq(){El=null,nd=null;try{localStorage.removeItem(mm.access),localStorage.removeItem(mm.refresh)}catch{}}function MJ(){return El||(pq(),El)}function DJ(){return nd}async function gq(){var t;if(!nd)return!1;const e=T6.replace(/\/api\/?$/,"");try{const n=await(await fetch(`${e}/api/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:nd})})).json();if(n.success&&((t=n.data)!=null&&t.token))return vf(n.data.token,nd),!0}catch{}return hq(),!1}async function Fg(e,t={}){var a;const{skipGlobalLoading:r,...n}=t,o=fq(n.method)&&!r;o&&uq();try{const s=e.startsWith("http")?e:`${T6}${e.startsWith("/")?e:`/${e}`}`,l={"Content-Type":"application/json",...typeof n.headers=="object"&&!(n.headers instanceof Headers)?n.headers:{}};El&&(l.Authorization=`Bearer ${El}`);let c=await fetch(s,{...n,headers:l});c.status===401&&nd&&await gq()&&(l.Authorization=`Bearer ${El}`,c=await fetch(s,{...n,headers:l}));let u;try{u=await c.json()}catch{return{error:c.statusText||"Network error",status:c.status}}const d=u;return d.success===!0&&"data"in d?{data:d.data,status:c.status}:{error:((a=d.error)==null?void 0:a.message)||(typeof d.error=="string"?d.error:c.statusText),status:c.status}}finally{o&&dq()}}const Xe={get:e=>Fg(e,{method:"GET"}),post:(e,t)=>Fg(e,{method:"POST",body:JSON.stringify(t)}),put:(e,t)=>Fg(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Fg(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Fg(e,{method:"DELETE"})};async function vm(e,t={}){const{skipGlobalLoading:r,...n}=t,o=fq(n.method)&&!r;o&&uq();try{const a=e.startsWith("http")?e:`${T6}${e.startsWith("/")?e:`/${e}`}`,s={...typeof n.headers=="object"&&n.headers&&!(n.headers instanceof Headers)?n.headers:{}};El&&(s.Authorization=`Bearer ${El}`),typeof FormData<"u"&&n.body instanceof FormData&&(delete s["Content-Type"],delete s["content-type"]);let l=await fetch(a,{...n,headers:s});return l.status===401&&nd&&await gq()&&(s.Authorization=`Bearer ${El}`,l=await fetch(a,{...n,headers:s})),l}finally{o&&dq()}}const Ia={async register(e){const t=await Xe.post("/auth/register",e);return t.data&&vf(t.data.token,t.data.refreshToken),t},async login(e,t){const r=await Xe.post("/auth/login",{email:e,password:t}),n=r.data;return n&&"requiresTwoFactor"in n&&n.requiresTwoFactor||n&&"token"in n&&n.token&&"refreshToken"in n&&vf(n.token,n.refreshToken),r},async googleLogin(e){const t=await Xe.post("/auth/google",{idToken:e}),r=t.data;return r&&"requiresTwoFactor"in r&&r.requiresTwoFactor||r&&"token"in r&&r.token&&"refreshToken"in r&&vf(r.token,r.refreshToken),t},async googleRegister(e){var r;const t=await Xe.post("/auth/google/register",e);return(r=t.data)!=null&&r.token&&t.data.refreshToken&&vf(t.data.token,t.data.refreshToken),t},async completeLogin2fa(e,t){var n;const r=await Xe.post("/auth/login/2fa",{twoFactorToken:e,token:t});return(n=r.data)!=null&&n.token&&r.data.refreshToken&&vf(r.data.token,r.data.refreshToken),r},async refresh(){var r;const e=DJ();if(!e)return{error:"No refresh token",status:401};const t=await Xe.post("/auth/refresh",{refreshToken:e});return(r=t.data)!=null&&r.token&&vf(t.data.token,e),t},async me(){return Xe.get("/auth/me")},async updateMe(e){return Xe.put("/auth/me",e)},async changePassword(e,t){return Xe.post("/auth/change-password",{currentPassword:e,newPassword:t})},async setup2fa(){return Xe.post("/auth/2fa/setup",{})},async verify2faSetup(e){return Xe.post("/auth/2fa/verify-setup",{token:e})},async disable2fa(e,t){return Xe.post("/auth/2fa/disable",{currentPassword:e,token:t??""})},logout(){hq()}},zr={list(e){const t=new URLSearchParams;e!=null&&e.organization&&t.set("organization",e.organization),e!=null&&e.status&&t.set("status",e.status),e!=null&&e.type&&t.set("type",e.type),(e==null?void 0:e.page)!=null&&t.set("page",String(e.page)),(e==null?void 0:e.limit)!=null&&t.set("limit",String(e.limit)),e!=null&&e.recordKind&&t.set("recordKind",e.recordKind),e!=null&&e.activitySubtype&&t.set("activitySubtype",e.activitySubtype),e!=null&&e.enrich&&t.set("enrich","1");const r=t.toString();return Xe.get(`/events${r?`?${r}`:""}`)},get(e){return Xe.get(`/events/${e}`)},create(e){return Xe.post("/events",e)},update(e,t){return Xe.put(`/events/${e}`,t)},remove(e){return Xe.delete(`/events/${e}`)},analytics(e){return Xe.get(`/events/${e}/analytics`)},duplicate(e){return Xe.post(`/events/${e}/duplicate`,{})},generateFromAi(e){return Xe.post("/events/generate-from-ai",e)},aiExtractPreview(e){return Xe.post("/events/ai-extract-preview",e)},emailerLinkTargets(e){return Xe.get(`/events/${e}/emailer-link-targets`)}},ZO={leaderboard(e,t){const r=t!=null&&t>0?`?limit=${encodeURIComponent(String(t))}`:"";return Xe.get(`/events/${e}/leaderboard${r}`)},create(e,t){return Xe.post(`/events/${e}/reward-points`,{source:"manual",...t})}},Ei={listAll(e){var n,o;const t=new URLSearchParams;e!=null&&e.organization&&t.set("organization",e.organization),t.set("page",String((e==null?void 0:e.page)??1)),t.set("limit",String((e==null?void 0:e.limit)??20)),(n=e==null?void 0:e.q)!=null&&n.trim()&&t.set("q",e.q.trim()),(o=e==null?void 0:e.tag)!=null&&o.trim()&&t.set("tag",e.tag.trim());const r=t.toString();return Xe.get(`/participants${r?`?${r}`:""}`)},listDistinctTags(e){const t=new URLSearchParams;e!=null&&e.organization&&t.set("organization",e.organization);const r=t.toString();return Xe.get(`/participants/tags${r?`?${r}`:""}`)},matchingIds(e){var n,o;const t=new URLSearchParams;e!=null&&e.organization&&t.set("organization",e.organization),(n=e==null?void 0:e.q)!=null&&n.trim()&&t.set("q",e.q.trim()),(o=e==null?void 0:e.tag)!=null&&o.trim()&&t.set("tag",e.tag.trim());const r=t.toString();return Xe.get(`/participants/matching-ids${r?`?${r}`:""}`)},bulk(e){return Xe.post("/participants/bulk",e)},list(e,t){var o;const r=new URLSearchParams;r.set("page",String((t==null?void 0:t.page)??1)),r.set("limit",String((t==null?void 0:t.limit)??20)),t!=null&&t.status&&r.set("status",t.status),(o=t==null?void 0:t.q)!=null&&o.trim()&&r.set("q",t.q.trim()),t!=null&&t.designation&&r.set("designation",t.designation);const n=r.toString();return Xe.get(`/events/${e}/participants${n?`?${n}`:""}`)},get(e){return Xe.get(`/participants/${e}`)},create(e,t){return Xe.post(`/events/${e}/participants`,t)},update(e,t){return Xe.put(`/participants/${e}`,t)},remove(e,t){const r=new URLSearchParams({event_id:t});return Xe.delete(`/participants/${e}?${r.toString()}`)},deleteOne(e){return Xe.delete(`/participants/${e}`)},checkIn(e,t){const r=new URLSearchParams({event_id:t});return Xe.post(`/participants/${e}/check-in?${r.toString()}`,{})},async downloadExport(e,t="participants-export.csv"){var s;const r=await vm(`/events/${e}/participants/export`,{method:"GET"});if(!r.ok){let l=r.statusText;try{const c=await r.json();l=((s=c==null?void 0:c.error)==null?void 0:s.message)||l}catch{}return{ok:!1,error:l}}const n=await r.blob(),o=URL.createObjectURL(n),a=document.createElement("a");return a.href=o,a.download=t,a.click(),URL.revokeObjectURL(o),{ok:!0}},importCsv(e,t){return Xe.post(`/events/${e}/participants/import`,{csv:t})},async downloadExportAll(e,t="all-participants-export.csv"){var c,u,d;const r=new URLSearchParams;e!=null&&e.organization&&r.set("organization",e.organization),(c=e==null?void 0:e.q)!=null&&c.trim()&&r.set("q",e.q.trim()),(u=e==null?void 0:e.tag)!=null&&u.trim()&&r.set("tag",e.tag.trim());const n=r.toString(),o=await vm(`/participants/export${n?`?${n}`:""}`,{method:"GET"});if(!o.ok){let f=o.statusText;try{const h=await o.json();f=((d=h==null?void 0:h.error)==null?void 0:d.message)||f}catch{}return{ok:!1,error:f}}const a=await o.blob(),s=URL.createObjectURL(a),l=document.createElement("a");return l.href=s,l.download=t,l.click(),URL.revokeObjectURL(s),{ok:!0}},importGlobal(e){return Xe.post("/participants/import",e)}},Fa={list(e){const t=new URLSearchParams;e!=null&&e.organization&&t.set("organization",e.organization);const r=t.toString();return Xe.get(`/participant-lists${r?`?${r}`:""}`)},create(e){return Xe.post("/participant-lists",e)},get(e){return Xe.get(`/participant-lists/${e}`)},update(e,t){return Xe.put(`/participant-lists/${e}`,t)},members(e,t){const r=new URLSearchParams;return t!=null&&t.organization&&r.set("organization",t.organization),r.set("page",String((t==null?void 0:t.page)??1)),r.set("limit",String((t==null?void 0:t.limit)??50)),Xe.get(`/participant-lists/${e}/members?${r}`)},remove(e){return Xe.delete(`/participant-lists/${e}`)}},Hs={list(e){const t=new URLSearchParams;e!=null&&e.type&&t.set("type",e.type),e!=null&&e.organization&&t.set("organization",e.organization),(e==null?void 0:e.page)!=null&&t.set("page",String(e.page)),(e==null?void 0:e.limit)!=null&&t.set("limit",String(e.limit));const r=t.toString();return Xe.get(`/design-templates${r?`?${r}`:""}`)},get(e){return Xe.get(`/design-templates/${e}`)},create(e){return Xe.post("/design-templates",e)},update(e,t){return Xe.put(`/design-templates/${e}`,t)},remove(e){return Xe.delete(`/design-templates/${e}`)},duplicate(e){return Xe.post(`/design-templates/${e}/duplicate`,{})},useForEvent(e,t){return Xe.post(`/design-templates/${e}/use/${t}`,{})}},mq={list(e){const t=new URLSearchParams;e!=null&&e.organization&&t.set("organization",e.organization),e!=null&&e.event&&t.set("event",e.event),(e==null?void 0:e.page)!=null&&t.set("page",String(e.page)),(e==null?void 0:e.limit)!=null&&t.set("limit",String(e.limit));const r=t.toString();return Xe.get(`/badge-batches${r?`?${r}`:""}`)},get(e,t){const r=new URLSearchParams;t&&r.set("organization",t);const n=r.toString();return Xe.get(`/badge-batches/${e}${n?`?${n}`:""}`)},create(e){return Xe.post("/badge-batches",e)}},m1={async list(e){var r;const t=await Xe.get(`/events/${e}/tickets`);if(t.error)throw new Error(t.error);return((r=t.data)==null?void 0:r.tickets)??[]},async create(e,t){const r=await Xe.post(`/events/${e}/tickets`,t);if(r.error||!r.data)throw new Error(r.error??"Failed to create ticket");return r.data},async update(e,t,r){const n=await Xe.patch(`/events/${e}/tickets/${t}`,r);if(n.error||!n.data)throw new Error(n.error??"Failed to update ticket");return n.data},async remove(e,t){const r=await Xe.delete(`/events/${e}/tickets/${t}`);if(r.error)throw new Error(r.error)}};async function af(e){var n;let t;try{t=await e.json()}catch{return{error:e.statusText||"Network error"}}const r=t;return r.success===!0&&r.data!==void 0?{data:r.data}:{error:((n=r.error)==null?void 0:n.message)||"Request failed"}}function sf(e){const t=Dy.endsWith("/")?Dy.slice(0,-1):Dy,r=e.startsWith("/")?e:`/${e}`;return`${t}${r}`}const lf={async getEventSummary(e){const t=await fetch(sf(`/public/events/${e}/summary`),{method:"GET"}),r=await af(t);if(r.error)throw new Error(r.error);return r.data},async listTickets(e){var n;const t=await fetch(sf(`/public/events/${e}/tickets`),{method:"GET"}),r=await af(t);if(r.error)throw new Error(r.error);return((n=r.data)==null?void 0:n.tickets)??[]},async checkoutOptions(e){const t=await fetch(sf(`/public/events/${e}/tickets/checkout-options`),{method:"GET"}),r=await af(t);if(r.error)throw new Error(r.error);return r.data},async quote(e,t){const r=await fetch(sf(`/public/events/${e}/tickets/quote`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await af(r);if(n.error)throw new Error(n.error);return n.data},async manualQuote(e,t){const r=await fetch(sf(`/public/events/${e}/tickets/manual-quote`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await af(r);if(n.error)throw new Error(n.error);return n.data},async checkout(e,t){const r=await fetch(sf(`/public/events/${e}/tickets/checkout`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await af(r);if(n.error)throw new Error(n.error);return n.data},async verifyPayment(e,t){const r=await fetch(sf(`/public/events/${e}/payment/verify`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await af(r);if(n.error)throw new Error(n.error)},async manualSubmit(e,t){const r=await fetch(sf(`/public/events/${e}/tickets/manual-submit`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await af(r);if(n.error)throw new Error(n.error);return n.data}},Pj={async get(e){var r;const t=await Xe.get(`/events/${e}/ticketing-manual-payment`);if(t.error||!((r=t.data)!=null&&r.ticketingManualPayment))throw new Error(t.error??"Failed to load manual payment settings");return t.data.ticketingManualPayment},async patch(e,t){var n;const r=await Xe.patch(`/events/${e}/ticketing-manual-payment`,t);if(r.error||!((n=r.data)!=null&&n.ticketingManualPayment))throw new Error(r.error??"Failed to save");return r.data.ticketingManualPayment},async checkoutEnablementOrder(e){const t=await Xe.post(`/events/${e}/ticketing-manual-enablement/checkout-order`,{});if(t.error||!t.data)throw new Error(t.error??"Failed to create payment order");return t.data}},v1={async list(e,t="pending_review"){var o;const r=t==="pending_review"?"":`?status=${encodeURIComponent(t)}`,n=await Xe.get(`/events/${e}/ticket-manual-orders${r}`);if(n.error)throw new Error(n.error);return((o=n.data)==null?void 0:o.orders)??[]},async approve(e,t){const r=await Xe.post(`/events/${e}/ticket-manual-orders/${t}/approve`,{});if(r.error)throw new Error(r.error)},async reject(e,t,r){const n=await Xe.post(`/events/${e}/ticket-manual-orders/${t}/reject`,{reason:r});if(n.error)throw new Error(n.error)}},Ef={list(e){const t=new URLSearchParams;e!=null&&e.organization&&t.set("organization",e.organization),(e==null?void 0:e.page)!=null&&t.set("page",String(e.page)),(e==null?void 0:e.limit)!=null&&t.set("limit",String(e.limit));const r=t.toString();return Xe.get(`/speakers${r?`?${r}`:""}`)},get(e){return Xe.get(`/speakers/${e}`)},create(e){return Xe.post("/speakers",e)},update(e,t){return Xe.put(`/speakers/${e}`,t)},remove(e){return Xe.delete(`/speakers/${e}`)},byEvent(e){return Xe.get(`/events/${e}/speakers`)}};async function y1(e){if(e.error||!e.data)throw new Error(e.error??"Request failed");return e.data}const Ma={async list(e){var o;const t=new URLSearchParams;e!=null&&e.organization&&t.set("organization",e.organization);const r=t.toString(),n=await Xe.get(`/forms${r?`?${r}`:""}`);if(n.error)throw new Error(n.error);return((o=n.data)==null?void 0:o.forms)??[]},async listForEvent(e){var r;const t=await Xe.get(`/events/${e}/forms`);if(t.error)throw new Error(t.error);return((r=t.data)==null?void 0:r.forms)??[]},async get(e){return y1(await Xe.get(`/forms/${e}`))},async create(e){return y1(await Xe.post("/forms",e))},async createForEvent(e,t){return y1(await Xe.post(`/events/${e}/forms`,t))},async update(e,t){return y1(await Xe.put(`/forms/${e}`,t))},async remove(e){const t=await Xe.delete(`/forms/${e}`);if(t.error)throw new Error(t.error)},async getPublic(e){var o;const t=`${Dy}/public/forms/${e}`,r=await fetch(t);let n;try{n=await r.json()}catch{throw new Error("Network error")}if(!n.success||!n.data)throw new Error(((o=n.error)==null?void 0:o.message)||"Form not available");return n.data},async submit(e,t){const r=await Xe.post(`/forms/${e}/submit`,t);if(r.error)throw new Error(r.error);return r.data},async listSubmissions(e,t){var a,s,l,c;const r=new URLSearchParams;t!=null&&t.q&&r.set("q",t.q),t!=null&&t.dateFrom&&r.set("dateFrom",t.dateFrom),t!=null&&t.dateTo&&r.set("dateTo",t.dateTo),(t==null?void 0:t.page)!=null&&r.set("page",String(t.page)),(t==null?void 0:t.limit)!=null&&r.set("limit",String(t.limit));const n=r.toString(),o=await Xe.get(`/forms/${e}/submissions${n?`?${n}`:""}`);if(o.error)throw new Error(o.error);return{submissions:((a=o.data)==null?void 0:a.submissions)??[],total:((s=o.data)==null?void 0:s.total)??0,page:((l=o.data)==null?void 0:l.page)??1,limit:((c=o.data)==null?void 0:c.limit)??20}},async exportSubmissionsCsv(e,t){var o;const r=new URLSearchParams;r.set("export","csv"),t!=null&&t.q&&r.set("q",t.q),t!=null&&t.dateFrom&&r.set("dateFrom",t.dateFrom),t!=null&&t.dateTo&&r.set("dateTo",t.dateTo);const n=await vm(`/forms/${e}/submissions?${r.toString()}`,{method:"GET"});if(!n.ok){let a=n.statusText;try{a=((o=(await n.json()).error)==null?void 0:o.message)||a}catch{}throw new Error(a)}return n.blob()}},nx={list(){return Xe.get("/users")},create(e){return Xe.post("/users",e)},update(e,t){return Xe.put(`/users/${e}`,t)},remove(e){return Xe.delete(`/users/${e}`)}},rh={list(e){return Xe.get(`/events/${e}/tracks`)},create(e,t){return Xe.post(`/events/${e}/tracks`,t)},update(e,t){return Xe.put(`/tracks/${e}`,t)},remove(e){return Xe.delete(`/tracks/${e}`)}},Da={list(e){return Xe.get(`/events/${e}/sessions`)},create(e,t){return Xe.post(`/events/${e}/sessions`,t)},update(e,t){return Xe.put(`/sessions/${e}`,t)},remove(e){return Xe.delete(`/sessions/${e}`)}},za={listStaff(e){return Xe.get(`/events/${e}/staff`)},listAvailableUsers(e){return Xe.get(`/events/${e}/staff/available-users`)},agendaTree(e){return Xe.get(`/events/${e}/agenda-tree`)},addStaff(e,t){return Xe.post(`/events/${e}/staff`,t)},updateStaff(e,t,r){return Xe.put(`/events/${e}/staff/${t}`,r)},removeStaff(e,t){return Xe.delete(`/events/${e}/staff/${t}`)},sendInvites(e,t){return Xe.post(`/events/${e}/staff/invites`,t)},cancelInvite(e,t){return Xe.delete(`/events/${e}/staff/invites/${t}`)},resendInvite(e,t){return Xe.post(`/events/${e}/staff/invites/${t}/resend`,{})},invitePreview(e){return Xe.get(`/event-invites/${e}`)},inviteAccept(e){return Xe.post("/event-invites/accept",e)}},Oa={listByEvent(e){return Xe.get(`/events/${e}/quiz-polls`)},listBySession(e){return Xe.get(`/sessions/${e}/quiz-polls`)},get(e){return Xe.get(`/quiz-polls/${e}`)},create(e,t){return Xe.post(`/events/${e}/quiz-polls`,t)},update(e,t){return Xe.put(`/quiz-polls/${e}`,t)},remove(e){return Xe.delete(`/quiz-polls/${e}`)},publish(e){return Xe.post(`/quiz-polls/${e}/publish`,{})},close(e){return Xe.post(`/quiz-polls/${e}/close`,{})}},zJ=["home","agenda","speakers","registration","sponsors","custom"],BJ=["header","banner","contact_form","agenda","register_links","speakers","footer","sponsors","cta","custom_html","countdown","gallery","about","venue","faq","tickets"],Wc={list(e){return Xe.get(`/events/${e}/pages`)},get(e){return Xe.get(`/pages/${e}`)},create(e,t){return Xe.post(`/events/${e}/pages`,t)},update(e,t){return Xe.put(`/pages/${e}`,t)},remove(e){return Xe.delete(`/pages/${e}`)},publish(e){return Xe.post(`/pages/${e}/publish`,{})},exportHtml(e,t){const r=t?`?registrationUrl=${encodeURIComponent(t)}`:"";return Xe.get(`/pages/${e}/export-html${r}`)}},Uc={get(e){return Xe.get(`/events/${e}/website-settings`)},update(e,t){return Xe.put(`/events/${e}/website-settings`,t)},checkFolder(e,t,r){const n=new URLSearchParams({folder:t});return r&&n.set("micrositeId",r),Xe.get(`/events/${e}/website-settings/check-folder?${n.toString()}`)},publishMicrosite(e,t){return Xe.post(`/events/${e}/website/publish-microsite`,t??{})},micrositePreviewHtml(e,t){const r=t?`?micrositeId=${encodeURIComponent(t)}`:"";return Xe.get(`/events/${e}/website-settings/microsite-preview-html${r}`)}},ua={listForOrganization(e){return Xe.get(`/event-microsites?organization=${encodeURIComponent(e)}`)},list(e){return Xe.get(`/events/${e}/microsites`)},get(e,t){return Xe.get(`/events/${e}/microsites/${t}`)},create(e,t){return Xe.post(`/events/${e}/microsites`,t)},update(e,t,r){return Xe.put(`/events/${e}/microsites/${t}`,r)},delete(e,t){return Xe.delete(`/events/${e}/microsites/${t}`)},publish(e,t,r){return Xe.post(`/events/${e}/microsites/${t}/publish`,r??{})},previewHtml(e,t){return Xe.get(`/events/${e}/microsites/${t}/preview-html`)},checkFolder(e,t,r){const n=new URLSearchParams({folder:t});return r&&n.set("micrositeId",r),Xe.get(`/events/${e}/microsites/check-folder?${n.toString()}`)}};async function vq(e={}){var n,o;const t=new URLSearchParams;e.organization&&t.set("organization",e.organization),t.set("page",String(e.page??1)),t.set("limit",String(e.limit??200)),e.type&&t.set("type",e.type);const r=await Xe.get(`/library/media?${t.toString()}`);if(r.error)throw new Error(r.error);return{media:((n=r.data)==null?void 0:n.media)??[],total:((o=r.data)==null?void 0:o.total)??0}}async function Ys(e,t={}){var a;const r=new FormData;r.append("file",e),r.append("name",e.name),t.eventId&&r.append("eventId",t.eventId),t.module&&r.append("module",t.module),t.description!=null&&r.append("description",t.description),t.visibility&&r.append("visibility",t.visibility),t.tags&&r.append("tags",t.tags),t.contentCollectionId&&r.append("contentCollectionId",t.contentCollectionId);const o=await(await vm("/media/upload",{method:"POST",body:r,skipGlobalLoading:!0})).json();if(o.success&&o.data)return o.data;throw new Error(((a=o.error)==null?void 0:a.message)||"Upload failed")}const I0={async list(e){var n;const t=new URLSearchParams;t.set("limit","200"),e!=null&&e.organization&&t.set("organization",e.organization);const r=await Xe.get(`/content-collections?${t}`);if(r.error)throw new Error(r.error);return((n=r.data)==null?void 0:n.collections)??[]},async create(e){const t=await Xe.post("/content-collections",e);if(t.error||!t.data)throw new Error(t.error??"Failed to create collection");return t.data},async get(e){const t=await Xe.get(`/content-collections/${e}`);if(t.error||!t.data)throw new Error(t.error??"Not found");return t.data},async update(e,t){const r=await Xe.put(`/content-collections/${e}`,t);if(r.error||!r.data)throw new Error(r.error??"Failed to update collection");return r.data},async remove(e){const t=await Xe.delete(`/content-collections/${e}`);if(t.error)throw new Error(t.error)}},ls={async get(e){const t=e!=null&&e.cacheBust?`?_=${encodeURIComponent(String(Date.now()))}`:"",r=await Xe.get(`/organization${t}`);if(r.error)throw new Error(r.error);return r.data??null},async update(e){const t=await Xe.put("/organization",e);if(t.error||t.data==null)throw new Error(t.error??"Update failed");return t.data},getEmailSettings(){return Xe.get("/organization/email-settings")},updateEmailSettings(e){return Xe.put("/organization/email-settings",e)},testEmailSettings(e){return Xe.post("/organization/email-settings/test",{to:e})},getWhatsAppSettings(){return Xe.get("/organization/whatsapp-settings")},updateWhatsAppSettings(e){return Xe.put("/organization/whatsapp-settings",e)}},Bg={list(e){const t=new URLSearchParams;e!=null&&e.sync&&t.set("sync","1"),e!=null&&e.status&&t.set("status",e.status);const r=t.toString();return Xe.get(`/whatsapp-templates${r?`?${r}`:""}`)},get(e,t){const r=new URLSearchParams;t!=null&&t.sync&&r.set("sync","1");const n=r.toString();return Xe.get(`/whatsapp-templates/${e}${n?`?${n}`:""}`)},create(e){return Xe.post("/whatsapp-templates",e)},sync(e){return Xe.post(`/whatsapp-templates/${e}/sync`,{})},remove(e){return Xe.delete(`/whatsapp-templates/${e}`)}},co={listByOrg(e){const t=new URLSearchParams;e!=null&&e.channel&&t.set("channel",e.channel);const r=t.toString();return Xe.get(`/campaigns${r?`?${r}`:""}`)},listForEvent(e){return Xe.get(`/events/${e}/campaigns`)},create(e,t){return Xe.post(`/events/${e}/campaigns`,t)},get(e){return Xe.get(`/campaigns/${e}`)},update(e,t){return Xe.put(`/campaigns/${e}`,t)},remove(e){return Xe.delete(`/campaigns/${e}`)},send(e,t={}){return Xe.post(`/campaigns/${e}/send`,t)},schedule(e,t){return Xe.post(`/campaigns/${e}/schedule`,{scheduledFor:t})},cancel(e){return Xe.post(`/campaigns/${e}/cancel`,{})},stop(e){return Xe.post(`/campaigns/${e}/stop`,{})},analytics(e){return Xe.get(`/campaigns/${e}/analytics`)},preview(e,t){return Xe.post(`/campaigns/${e}/preview`,t||{})}};function P6(){return typeof window>"u"?Promise.reject(new Error("No window")):window.Razorpay?Promise.resolve():new Promise((t,r)=>{const n=document.createElement("script");n.src="https://checkout.razorpay.com/v1/checkout.js",n.async=!0,n.onload=()=>t(),n.onerror=()=>r(new Error("Failed to load Razorpay")),document.body.appendChild(n)})}const Ku={async catalog(){const e=await Xe.get("/subscription/catalog");if(e.error||!e.data)throw new Error(e.error??"Failed to load catalog");return e.data},async checkoutOrder(e){const t=await Xe.post("/subscription/checkout/order",{targetPlanId:e});if(t.error||!t.data)throw new Error(t.error??"Failed to create payment order");return t.data},async checkoutVerify(e){const t=await Xe.post("/subscription/checkout/verify",e);if(t.error||!t.data)throw new Error(t.error??"Payment verification failed");return t.data},async contactSalesRequest(e){const t=await Xe.post("/subscription/contact-sales",e);if(t.error||t.data==null)throw new Error(t.error??"Failed to send request");return t.data},async listInvoices(){const e=await Xe.get("/subscription/invoices");if(e.error||!e.data)throw new Error(e.error??"Failed to load invoices");return e.data},async downloadInvoice(e){const t=await vm(`/subscription/invoices/${encodeURIComponent(e)}/invoice`,{method:"GET",skipGlobalLoading:!0});if(!t.ok)throw new Error("Download failed");const r=await t.blob(),n=URL.createObjectURL(r),o=document.createElement("a");o.href=n,o.download=`eventbuzz-invoice-${e}.html`,o.click(),URL.revokeObjectURL(n)}},Zu={async listOrganizations(e={}){const t=new URLSearchParams;e.page!=null&&t.set("page",String(e.page)),e.limit!=null&&t.set("limit",String(e.limit)),e.search&&t.set("search",e.search);const r=t.toString(),n=`/platform-admin/organizations${r?`?${r}`:""}`,o=await Xe.get(n);if(o.error||!o.data)throw new Error(o.error??"Failed to load organizations");const a=o.data;return{organizations:a.organizations??[],total:a.total??0,page:a.page??1,limit:a.limit??20}},async createOrganization(e){const t=await Xe.post("/platform-admin/organizations",e);if(t.error||!t.data)throw new Error(t.error??"Failed to create organization");return t.data},async getOrganization(e){const t=await Xe.get(`/platform-admin/organizations/${e}`);if(t.error||!t.data)throw new Error(t.error??"Failed to load organization");return t.data},async patchOrganizationSubscription(e,t){const r=await Xe.patch(`/platform-admin/organizations/${e}/subscription`,t);if(r.error||!r.data)throw new Error(r.error??"Failed to update subscription");return r.data},async listPermissions(){const e=await Xe.get("/platform-admin/permissions");if(e.error||!e.data)throw new Error(e.error??"Failed to load permissions");return e.data},async listPlans(){const e=await Xe.get("/platform-admin/plans");if(e.error||!e.data)throw new Error(e.error??"Failed to load plans");return e.data},async createPlan(e){const t=await Xe.post("/platform-admin/plans",e);if(t.error||!t.data)throw new Error(t.error??"Failed to create plan");return t.data},async updatePlan(e,t){const r=encodeURIComponent(e),n=await Xe.put(`/platform-admin/plans/${r}`,t);if(n.error||!n.data)throw new Error(n.error??"Failed to update plan");return n.data},async deletePlan(e){const t=encodeURIComponent(e),r=await Xe.delete(`/platform-admin/plans/${t}`);if(r.error||!r.data)throw new Error(r.error??"Failed to delete plan");return r.data}},JO={async create(e){const t=await Xe.post("/admin-requests",e);if(t.error||!t.data)throw new Error(t.error??"Request failed");return t.data}},Bu={getPlatformConfig(){return Xe.get("/platform/payment-config")},updatePlatformConfig(e){return Xe.put("/platform/payment-config",e)},getOrgProfile(){return Xe.get("/organization/payment-profile")},updateOrgProfile(e){return Xe.put("/organization/payment-profile",e)},addGateway(e){return Xe.post("/organization/payment-profile/gateways",e)},patchGateway(e,t){return Xe.patch(`/organization/payment-profile/gateways/${e}`,t)},deleteGateway(e){return Xe.delete(`/organization/payment-profile/gateways/${e}`)},listTransactions(e){const t=new URLSearchParams;Object.entries(e).forEach(([n,o])=>{o!=null&&String(o)!==""&&t.set(n,String(o))});const r=t.toString();return Xe.get(`/payment/transactions${r?`?${r}`:""}`)},async downloadTransactionsCsv(e){const t=new URLSearchParams;Object.entries(e).forEach(([s,l])=>{l&&t.set(s,l)});const r=await vm(`/payment/transactions/export?${t.toString()}`,{method:"GET",skipGlobalLoading:!0});if(!r.ok)throw new Error("Export failed");const n=await r.blob(),o=URL.createObjectURL(n),a=document.createElement("a");a.href=o,a.download="payment-transactions.csv",a.click(),URL.revokeObjectURL(o)}};function yq(e){if(e===null||typeof e!="object")return!1;const t=e;return t.version===1&&typeof t.layoutId=="string"&&Array.isArray(t.sections)}function zn(e){if(!(!(e!=null&&e.organization)||typeof e.organization!="object"))return e.organization._id}const K3="eventbuzz_user";function WJ(){try{const e=localStorage.getItem(K3);return e?JSON.parse(e):null}catch{return null}}function ml(e){try{e?localStorage.setItem(K3,JSON.stringify(e)):localStorage.removeItem(K3)}catch{}}const xq=j.createContext(null);function qJ({children:e}){const[t,r]=j.useState(()=>({user:WJ(),loading:!0,checked:!1})),n=j.useCallback(async()=>{try{const f=await Ia.me();f.data?(ml(f.data),r(h=>({...h,user:f.data,checked:!0}))):(ml(null),r(h=>({...h,user:null,checked:!0})))}catch{ml(null),r(f=>({...f,user:null,checked:!0}))}},[]);j.useEffect(()=>{let f=!1;return(async()=>{try{const h=await Ia.me();if(f)return;h.data?(ml(h.data),r({user:h.data,loading:!1,checked:!0})):(ml(null),r({user:null,loading:!1,checked:!0}))}catch{f||(ml(null),r({user:null,loading:!1,checked:!0}))}})(),()=>{f=!0}},[]);const o=j.useCallback(async(f,h)=>{const p=await Ia.login(f,h);if(p.error)return{error:p.error};const y=p.data;return y&&"requiresTwoFactor"in y&&y.requiresTwoFactor&&y.twoFactorToken?{requiresTwoFactor:!0,twoFactorToken:y.twoFactorToken,email:"email"in y?y.email:void 0}:y&&"user"in y&&y.user?(ml(y.user),r(m=>({...m,user:y.user})),{success:!0}):{error:"Login failed"}},[]),a=j.useCallback(async f=>{let h=await Ia.googleLogin(f);if(h.error&&/register first|not registered/i.test(h.error)&&(h=await Ia.googleRegister({idToken:f})),h.error)return{error:h.error};const p=h.data;return p&&"requiresTwoFactor"in p&&p.requiresTwoFactor&&p.twoFactorToken?{requiresTwoFactor:!0,twoFactorToken:p.twoFactorToken,email:"email"in p?p.email:void 0}:p&&"user"in p&&p.user?(ml(p.user),r(y=>({...y,user:p.user})),{success:!0}):{error:"Google sign-in failed"}},[]),s=j.useCallback(async(f,h)=>{var y;const p=await Ia.completeLogin2fa(f,h.replace(/\s/g,""));return p.error?{error:p.error}:(y=p.data)!=null&&y.user?(ml(p.data.user),r(m=>({...m,user:p.data.user})),{}):{error:"Verification failed"}},[]),l=j.useCallback(async f=>{const h=await Ia.register(f);if(h.data){const p=h.data.user;return ml(p),r(y=>({...y,user:p})),{}}return{error:h.error||"Registration failed"}},[]),c=j.useCallback(async f=>{const h=await Ia.googleRegister(f);if(h.data){const p=h.data.user;return ml(p),r(y=>({...y,user:p})),{}}return{error:h.error||"Registration failed"}},[]),u=j.useCallback(()=>{Ia.logout(),ml(null),r({user:null,loading:!1,checked:!0})},[]),d={...t,login:o,loginWithGoogleCredential:a,completeTwoFactorLogin:s,register:l,registerWithGoogle:c,logout:u,refreshUser:n};return i.jsx(xq.Provider,{value:d,children:e})}function Ur(){const e=j.useContext(xq);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $J=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),UJ=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),eI=e=>{const t=UJ(e);return t.charAt(0).toUpperCase()+t.slice(1)},bq=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/var HJ={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"};/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const VJ=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:a,iconNode:s,...l},c)=>j.createElement("svg",{ref:c,...HJ,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:bq("lucide",o),...l},[...s.map(([u,d])=>j.createElement(u,d)),...Array.isArray(a)?a:[a]]));/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Lt=(e,t)=>{const r=j.forwardRef(({className:n,...o},a)=>j.createElement(VJ,{ref:a,iconNode:t,className:bq(`lucide-${$J(eI(e))}`,`lucide-${e}`,n),...o}));return r.displayName=eI(e),r};/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const YJ=[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]],GJ=Lt("align-left",YJ);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const KJ=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],QJ=Lt("archive",KJ);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const XJ=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],wq=Lt("arrow-left",XJ);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ZJ=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],O6=Lt("arrow-right",ZJ);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const JJ=[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h4",key:"q8tih4"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h10",key:"jvxblo"}]],eee=Lt("arrow-up-narrow-wide",JJ);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const tee=[["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"}]],ree=Lt("award",tee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const nee=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]],iee=Lt("bell-off",nee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const oee=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],I6=Lt("bell",oee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const aee=[["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"}]],N0=Lt("book-open",aee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const see=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],tI=Lt("bookmark",see);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const lee=[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]],nb=Lt("building-2",lee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const cee=[["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"}]],Sq=Lt("calendar-days",cee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const uee=[["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"}]],Wi=Lt("calendar",uee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const dee=[["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"}]],N6=Lt("chart-column",dee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const fee=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],jq=Lt("chart-line",fee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const pee=[["line",{x1:"12",x2:"12",y1:"20",y2:"10",key:"1vz5eb"}],["line",{x1:"18",x2:"18",y1:"20",y2:"4",key:"cun8e5"}],["line",{x1:"6",x2:"6",y1:"20",y2:"16",key:"hq0ia6"}]],hee=Lt("chart-no-axes-column-increasing",pee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const gee=[["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"}]],nu=Lt("chart-no-axes-column",gee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const mee=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Oi=Lt("check",mee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const vee=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],po=Lt("chevron-down",vee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const yee=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Nf=Lt("chevron-left",yee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const xee=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],va=Lt("chevron-right",xee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const bee=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],$f=Lt("chevron-up",bee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const wee=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],nv=Lt("circle-alert",wee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const See=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],iv=Lt("circle-check",See);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const jee=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ib=Lt("circle-help",jee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const kee=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],ob=Lt("clock",kee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const _ee=[["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"}]],iu=Lt("copy",_ee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Cee=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],ov=Lt("credit-card",Cee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Eee=[["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"}]],Al=Lt("download",Eee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Aee=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Tee=Lt("ellipsis",Aee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Pee=[["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"}]],av=Lt("external-link",Pee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Oee=[["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"}]],R6=Lt("eye-off",Oee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Iee=[["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"}]],Ah=Lt("eye",Iee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Nee=[["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"}]],Ree=Lt("file-image",Nee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Lee=[["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"}]],lh=Lt("file-text",Lee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Fee=[["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"}]],L6=Lt("file",Fee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Mee=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]],Dee=Lt("film",Mee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const zee=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],rI=Lt("folder-open",zee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Bee=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Wee=Lt("funnel",Bee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const qee=[["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"}]],ud=Lt("globe",qee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $ee=[["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"}]],sv=Lt("grip-vertical",$ee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Uee=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Hee=Lt("hash",Uee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Vee=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],F6=Lt("house",Vee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Yee=[["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"}]],R0=Lt("image",Yee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Gee=[["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:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Tw=Lt("layers",Gee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Kee=[["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"}]],Qee=Lt("layout-dashboard",Kee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Xee=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],ab=Lt("layout-grid",Xee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Zee=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]],Jee=Lt("layout-list",Zee);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ete=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],Q3=Lt("link-2",ete);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const tte=[["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"}]],rte=Lt("linkedin",tte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const nte=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],sb=Lt("list",nte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ite=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ix=Lt("loader-circle",ite);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ote=[["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"}]],ate=Lt("lock",ote);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ste=[["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"}]],lte=Lt("log-out",ste);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const cte=[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]],kq=Lt("mail-check",cte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ute=[["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"}]],Uf=Lt("mail",ute);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const dte=[["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"}]],lb=Lt("map-pin",dte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const fte=[["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"}]],pte=Lt("menu",fte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const hte=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],Zs=Lt("message-circle",hte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const gte=[["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"}]],ch=Lt("message-square",gte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const mte=[["path",{d:"m11 7.601-5.994 8.19a1 1 0 0 0 .1 1.298l.817.818a1 1 0 0 0 1.314.087L15.09 12",key:"80a601"}],["path",{d:"M16.5 21.174C15.5 20.5 14.372 20 13 20c-2.058 0-3.928 2.356-6 2-2.072-.356-2.775-3.369-1.5-4.5",key:"j0ngtp"}],["circle",{cx:"16",cy:"7",r:"5",key:"d08jfb"}]],Pw=Lt("mic-vocal",mte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const vte=[["path",{d:"M5 12h14",key:"1ays0h"}]],Ow=Lt("minus",vte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const yte=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],nI=Lt("moon",yte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const xte=[["path",{d:"M12.586 12.586 19 19",key:"ea5xo7"}],["path",{d:"M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z",key:"277e5u"}]],bte=Lt("mouse-pointer",xte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const wte=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],Wg=Lt("palette",wte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ste=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],_q=Lt("panels-top-left",Ste);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const jte=[["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"}]],Ii=Lt("pencil",jte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const kte=[["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"}]],Iw=Lt("phone",kte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const _te=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],Cq=Lt("plug",_te);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Cte=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],wr=Lt("plus",Cte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ete=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],lv=Lt("qr-code",Ete);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ate=[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]],Eq=Lt("radio",Ate);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Tte=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],X3=Lt("refresh-cw",Tte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Pte=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],Aq=Lt("rocket",Pte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ote=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Ite=Lt("rotate-ccw",Ote);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Nte=[["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"}]],Nw=Lt("save",Nte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Rte=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Pi=Lt("search",Rte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Lte=[["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"}]],Tq=Lt("send",Lte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Fte=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Pl=Lt("settings",Fte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Mte=[["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"}]],Dte=Lt("shield-check",Mte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const zte=[["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"}]],id=Lt("shield",zte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Bte=[["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"}]],Wte=Lt("sparkles",Bte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const qte=[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],M6=Lt("square-check-big",qte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $te=[["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"}]],Z3=Lt("square-pen",$te);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ute=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Pq=Lt("square",Ute);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Hte=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Rf=Lt("star",Hte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Vte=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],iI=Lt("sun",Vte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Yte=[["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"}]],Oq=Lt("tag",Yte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Gte=[["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"}]],Kte=Lt("ticket",Gte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Qte=[["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"}]],gn=Lt("trash-2",Qte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Xte=[["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"}]],D6=Lt("trending-up",Xte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Zte=[["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"}]],od=Lt("trophy",Zte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Jte=[["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"}]],ere=Lt("twitter",Jte);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const tre=[["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"}]],ou=Lt("upload",tre);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const rre=[["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"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]],Iq=Lt("user-check",rre);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const nre=[["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"}]],z6=Lt("user-plus",nre);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ire=[["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:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]],ore=Lt("user-x",ire);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const are=[["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"}]],ym=Lt("user",are);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const sre=[["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"}]],vi=Lt("users",sre);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const lre=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],er=Lt("x",lre);/**
|
||
* @license lucide-react v0.487.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const cre=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],B6=Lt("zap",cre);function cb({title:e="Confirm",message:t,confirmLabel:r="Confirm",cancelLabel:n="Cancel",variant:o="danger",onConfirm:a,onCancel:s}){const l=o==="danger",c=o==="warning";return i.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"confirm-modal-title",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",zIndex:110,display:"flex",alignItems:"center",justifyContent:"center"},onClick:s,children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"360px",padding:"20px",boxShadow:"var(--shadow-xl)"},onClick:u=>u.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"flex-start",marginBottom:"20px"},children:[i.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"50%",background:l?"#fee2e2":c?"#fef3c7":"var(--secondary)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:i.jsx(nv,{size:16,style:{color:l?"var(--destructive)":c?"#b45309":"var(--muted)"}})}),i.jsxs("div",{children:[i.jsx("p",{id:"confirm-modal-title",style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"5px"},children:e}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:t})]})]}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"},children:[i.jsx("button",{type:"button",onClick:s,style:{padding:"6px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:n}),i.jsx("button",{type:"button",onClick:a,style:{padding:"6px 14px",borderRadius:"var(--radius-button)",border:"none",background:l?"var(--destructive)":c?"#b45309":"var(--primary)",color:"#fff",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",cursor:"pointer"},children:r})]})]})})}function ps(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function oI(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Nq(...e){return t=>{let r=!1;const n=e.map(o=>{const a=oI(o,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let o=0;o<n.length;o++){const a=n[o];typeof a=="function"?a():oI(e[o],null)}}}}function Nl(...e){return j.useCallback(Nq(...e),e)}function ure(e,t){const r=j.createContext(t),n=a=>{const{children:s,...l}=a,c=j.useMemo(()=>l,Object.values(l));return i.jsx(r.Provider,{value:c,children:s})};n.displayName=e+"Provider";function o(a){const s=j.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[n,o]}function Rw(e,t=[]){let r=[];function n(a,s){const l=j.createContext(s),c=r.length;r=[...r,s];const u=f=>{var b;const{scope:h,children:p,...y}=f,m=((b=h==null?void 0:h[e])==null?void 0:b[c])||l,x=j.useMemo(()=>y,Object.values(y));return i.jsx(m.Provider,{value:x,children:p})};u.displayName=a+"Provider";function d(f,h){var m;const p=((m=h==null?void 0:h[e])==null?void 0:m[c])||l,y=j.useContext(p);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${a}\``)}return[u,d]}const o=()=>{const a=r.map(s=>j.createContext(s));return function(l){const c=(l==null?void 0:l[e])||a;return j.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,dre(o,...t)]}function dre(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const s=n.reduce((l,{useScope:c,scopeName:u})=>{const f=c(a)[`__scope${u}`];return{...l,...f}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var uh=globalThis!=null&&globalThis.document?j.useLayoutEffect:()=>{},fre=GW.useId||(()=>{}),pre=0;function h0(e){const[t,r]=j.useState(fre());return uh(()=>{r(n=>n??String(pre++))},[e]),e||(t?`radix-${t}`:"")}function Lf(e){const t=j.useRef(e);return j.useEffect(()=>{t.current=e}),j.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function W6({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,o]=hre({defaultProp:t,onChange:r}),a=e!==void 0,s=a?e:n,l=Lf(r),c=j.useCallback(u=>{if(a){const f=typeof u=="function"?u(e):u;f!==e&&l(f)}else o(u)},[a,e,o,l]);return[s,c]}function hre({defaultProp:e,onChange:t}){const r=j.useState(e),[n]=r,o=j.useRef(n),a=Lf(t);return j.useEffect(()=>{o.current!==n&&(a(n),o.current=n)},[n,o,a]),r}var Lw=j.forwardRef((e,t)=>{const{children:r,...n}=e,o=j.Children.toArray(r),a=o.find(mre);if(a){const s=a.props.children,l=o.map(c=>c===a?j.Children.count(s)>1?j.Children.only(null):j.isValidElement(s)?s.props.children:null:c);return i.jsx(J3,{...n,ref:t,children:j.isValidElement(s)?j.cloneElement(s,void 0,l):null})}return i.jsx(J3,{...n,ref:t,children:r})});Lw.displayName="Slot";var J3=j.forwardRef((e,t)=>{const{children:r,...n}=e;if(j.isValidElement(r)){const o=yre(r),a=vre(n,r.props);return r.type!==j.Fragment&&(a.ref=t?Nq(t,o):o),j.cloneElement(r,a)}return j.Children.count(r)>1?j.Children.only(null):null});J3.displayName="SlotClone";var gre=({children:e})=>i.jsx(i.Fragment,{children:e});function mre(e){return j.isValidElement(e)&&e.type===gre}function vre(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...l)=>{a(...l),o(...l)}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function yre(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var xre=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ya=xre.reduce((e,t)=>{const r=j.forwardRef((n,o)=>{const{asChild:a,...s}=n,l=a?Lw:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(l,{...s,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function bre(e,t){e&&k6.flushSync(()=>e.dispatchEvent(t))}function wre(e,t=globalThis==null?void 0:globalThis.document){const r=Lf(e);j.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Sre="DismissableLayer",eE="dismissableLayer.update",jre="dismissableLayer.pointerDownOutside",kre="dismissableLayer.focusOutside",aI,Rq=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),q6=j.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=e,u=j.useContext(Rq),[d,f]=j.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=j.useState({}),y=Nl(t,O=>f(O)),m=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(x),w=d?m.indexOf(d):-1,k=u.layersWithOutsidePointerEventsDisabled.size>0,S=w>=b,_=Ere(O=>{const T=O.target,R=[...u.branches].some(I=>I.contains(T));!S||R||(o==null||o(O),s==null||s(O),O.defaultPrevented||l==null||l())},h),P=Are(O=>{const T=O.target;[...u.branches].some(I=>I.contains(T))||(a==null||a(O),s==null||s(O),O.defaultPrevented||l==null||l())},h);return wre(O=>{w===u.layers.size-1&&(n==null||n(O),!O.defaultPrevented&&l&&(O.preventDefault(),l()))},h),j.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(aI=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),sI(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=aI)}},[d,h,r,u]),j.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),sI())},[d,u]),j.useEffect(()=>{const O=()=>p({});return document.addEventListener(eE,O),()=>document.removeEventListener(eE,O)},[]),i.jsx(ya.div,{...c,ref:y,style:{pointerEvents:k?S?"auto":"none":void 0,...e.style},onFocusCapture:ps(e.onFocusCapture,P.onFocusCapture),onBlurCapture:ps(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:ps(e.onPointerDownCapture,_.onPointerDownCapture)})});q6.displayName=Sre;var _re="DismissableLayerBranch",Cre=j.forwardRef((e,t)=>{const r=j.useContext(Rq),n=j.useRef(null),o=Nl(t,n);return j.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),i.jsx(ya.div,{...e,ref:o})});Cre.displayName=_re;function Ere(e,t=globalThis==null?void 0:globalThis.document){const r=Lf(e),n=j.useRef(!1),o=j.useRef(()=>{});return j.useEffect(()=>{const a=l=>{if(l.target&&!n.current){let c=function(){Lq(jre,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Are(e,t=globalThis==null?void 0:globalThis.document){const r=Lf(e),n=j.useRef(!1);return j.useEffect(()=>{const o=a=>{a.target&&!n.current&&Lq(kre,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function sI(){const e=new CustomEvent(eE);document.dispatchEvent(e)}function Lq(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?bre(o,a):o.dispatchEvent(a)}var Oj="focusScope.autoFocusOnMount",Ij="focusScope.autoFocusOnUnmount",lI={bubbles:!1,cancelable:!0},Tre="FocusScope",$6=j.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=e,[l,c]=j.useState(null),u=Lf(o),d=Lf(a),f=j.useRef(null),h=Nl(t,m=>c(m)),p=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(n){let m=function(k){if(p.paused||!l)return;const S=k.target;l.contains(S)?f.current=S:mf(f.current,{select:!0})},x=function(k){if(p.paused||!l)return;const S=k.relatedTarget;S!==null&&(l.contains(S)||mf(f.current,{select:!0}))},b=function(k){if(document.activeElement===document.body)for(const _ of k)_.removedNodes.length>0&&mf(l)};document.addEventListener("focusin",m),document.addEventListener("focusout",x);const w=new MutationObserver(b);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",x),w.disconnect()}}},[n,l,p.paused]),j.useEffect(()=>{if(l){uI.add(p);const m=document.activeElement;if(!l.contains(m)){const b=new CustomEvent(Oj,lI);l.addEventListener(Oj,u),l.dispatchEvent(b),b.defaultPrevented||(Pre(Lre(Fq(l)),{select:!0}),document.activeElement===m&&mf(l))}return()=>{l.removeEventListener(Oj,u),setTimeout(()=>{const b=new CustomEvent(Ij,lI);l.addEventListener(Ij,d),l.dispatchEvent(b),b.defaultPrevented||mf(m??document.body,{select:!0}),l.removeEventListener(Ij,d),uI.remove(p)},0)}}},[l,u,d,p]);const y=j.useCallback(m=>{if(!r&&!n||p.paused)return;const x=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(x&&b){const w=m.currentTarget,[k,S]=Ore(w);k&&S?!m.shiftKey&&b===S?(m.preventDefault(),r&&mf(k,{select:!0})):m.shiftKey&&b===k&&(m.preventDefault(),r&&mf(S,{select:!0})):b===w&&m.preventDefault()}},[r,n,p.paused]);return i.jsx(ya.div,{tabIndex:-1,...s,ref:h,onKeyDown:y})});$6.displayName=Tre;function Pre(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(mf(n,{select:t}),document.activeElement!==r)return}function Ore(e){const t=Fq(e),r=cI(t,e),n=cI(t.reverse(),e);return[r,n]}function Fq(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function cI(e,t){for(const r of e)if(!Ire(r,{upTo:t}))return r}function Ire(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Nre(e){return e instanceof HTMLInputElement&&"select"in e}function mf(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Nre(e)&&t&&e.select()}}var uI=Rre();function Rre(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=dI(e,t),e.unshift(t)},remove(t){var r;e=dI(e,t),(r=e[0])==null||r.resume()}}}function dI(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Lre(e){return e.filter(t=>t.tagName!=="A")}var Fre="Portal",U6=j.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[o,a]=j.useState(!1);uh(()=>a(!0),[]);const s=r||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?CZ.createPortal(i.jsx(ya.div,{...n,ref:t}),s):null});U6.displayName=Fre;function Mre(e,t){return j.useReducer((r,n)=>t[r][n]??r,e)}var cv=e=>{const{present:t,children:r}=e,n=Dre(t),o=typeof r=="function"?r({present:n.isPresent}):j.Children.only(r),a=Nl(n.ref,zre(o));return typeof r=="function"||n.isPresent?j.cloneElement(o,{ref:a}):null};cv.displayName="Presence";function Dre(e){const[t,r]=j.useState(),n=j.useRef({}),o=j.useRef(e),a=j.useRef("none"),s=e?"mounted":"unmounted",[l,c]=Mre(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return j.useEffect(()=>{const u=x1(n.current);a.current=l==="mounted"?u:"none"},[l]),uh(()=>{const u=n.current,d=o.current;if(d!==e){const h=a.current,p=x1(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),uh(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=p=>{const m=x1(n.current).includes(p.animationName);if(p.target===t&&m&&(c("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=p=>{p.target===t&&(a.current=x1(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:j.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function x1(e){return(e==null?void 0:e.animationName)||"none"}function zre(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Nj=0;function Mq(){j.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??fI()),document.body.insertAdjacentElement("beforeend",e[1]??fI()),Nj++,()=>{Nj===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Nj--}},[])}function fI(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Hc=function(){return Hc=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Hc.apply(this,arguments)};function Dq(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Bre(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}var g0="right-scroll-bar-position",m0="width-before-scroll-bar",Wre="with-scroll-bars-hidden",qre="--removed-body-scroll-bar-size";function Rj(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $re(e,t){var r=j.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var Ure=typeof window<"u"?j.useLayoutEffect:j.useEffect,pI=new WeakMap;function Hre(e,t){var r=$re(null,function(n){return e.forEach(function(o){return Rj(o,n)})});return Ure(function(){var n=pI.get(r);if(n){var o=new Set(n),a=new Set(e),s=r.current;o.forEach(function(l){a.has(l)||Rj(l,null)}),a.forEach(function(l){o.has(l)||Rj(l,s)})}pI.set(r,e)},[e]),r}function Vre(e){return e}function Yre(e,t){t===void 0&&(t=Vre);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var s=t(a,n);return r.push(s),function(){r=r.filter(function(l){return l!==s})}},assignSyncMedium:function(a){for(n=!0;r.length;){var s=r;r=[],s.forEach(a)}r={push:function(l){return a(l)},filter:function(){return r}}},assignMedium:function(a){n=!0;var s=[];if(r.length){var l=r;r=[],l.forEach(a),s=r}var c=function(){var d=s;s=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){s.push(d),u()},filter:function(d){return s=s.filter(d),r}}}};return o}function Gre(e){e===void 0&&(e={});var t=Yre(null);return t.options=Hc({async:!0,ssr:!1},e),t}var zq=function(e){var t=e.sideCar,r=Dq(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return j.createElement(n,Hc({},r))};zq.isSideCarExport=!0;function Kre(e,t){return e.useMedium(t),zq}var Bq=Gre(),Lj=function(){},Fw=j.forwardRef(function(e,t){var r=j.useRef(null),n=j.useState({onScrollCapture:Lj,onWheelCapture:Lj,onTouchMoveCapture:Lj}),o=n[0],a=n[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,y=e.noIsolation,m=e.inert,x=e.allowPinchZoom,b=e.as,w=b===void 0?"div":b,k=e.gapMode,S=Dq(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=h,P=Hre([r,t]),O=Hc(Hc({},S),o);return j.createElement(j.Fragment,null,d&&j.createElement(_,{sideCar:Bq,removeScrollBar:u,shards:f,noRelative:p,noIsolation:y,inert:m,setCallbacks:a,allowPinchZoom:!!x,lockRef:r,gapMode:k}),s?j.cloneElement(j.Children.only(l),Hc(Hc({},O),{ref:P})):j.createElement(w,Hc({},O,{className:c,ref:P}),l))});Fw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Fw.classNames={fullWidth:m0,zeroRight:g0};var Qre=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Xre(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Qre();return t&&e.setAttribute("nonce",t),e}function Zre(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Jre(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ene=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Xre())&&(Zre(t,r),Jre(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tne=function(){var e=ene();return function(t,r){j.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Wq=function(){var e=tne(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},rne={left:0,top:0,right:0,gap:0},Fj=function(e){return parseInt(e||"",10)||0},nne=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Fj(r),Fj(n),Fj(o)]},ine=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return rne;var t=nne(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},one=Wq(),Xg="data-scroll-locked",ane=function(e,t,r,n){var o=e.left,a=e.top,s=e.right,l=e.gap;return r===void 0&&(r="margin"),`
|
||
.`.concat(Wre,` {
|
||
overflow: hidden `).concat(n,`;
|
||
padding-right: `).concat(l,"px ").concat(n,`;
|
||
}
|
||
body[`).concat(Xg,`] {
|
||
overflow: hidden `).concat(n,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
|
||
padding-left: `.concat(o,`px;
|
||
padding-top: `).concat(a,`px;
|
||
padding-right: `).concat(s,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(l,"px ").concat(n,`;
|
||
`),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(g0,` {
|
||
right: `).concat(l,"px ").concat(n,`;
|
||
}
|
||
|
||
.`).concat(m0,` {
|
||
margin-right: `).concat(l,"px ").concat(n,`;
|
||
}
|
||
|
||
.`).concat(g0," .").concat(g0,` {
|
||
right: 0 `).concat(n,`;
|
||
}
|
||
|
||
.`).concat(m0," .").concat(m0,` {
|
||
margin-right: 0 `).concat(n,`;
|
||
}
|
||
|
||
body[`).concat(Xg,`] {
|
||
`).concat(qre,": ").concat(l,`px;
|
||
}
|
||
`)},hI=function(){var e=parseInt(document.body.getAttribute(Xg)||"0",10);return isFinite(e)?e:0},sne=function(){j.useEffect(function(){return document.body.setAttribute(Xg,(hI()+1).toString()),function(){var e=hI()-1;e<=0?document.body.removeAttribute(Xg):document.body.setAttribute(Xg,e.toString())}},[])},lne=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;sne();var a=j.useMemo(function(){return ine(o)},[o]);return j.createElement(one,{styles:ane(a,!t,o,r?"":"!important")})},tE=!1;if(typeof window<"u")try{var b1=Object.defineProperty({},"passive",{get:function(){return tE=!0,!0}});window.addEventListener("test",b1,b1),window.removeEventListener("test",b1,b1)}catch{tE=!1}var vg=tE?{passive:!1}:!1,cne=function(e){return e.tagName==="TEXTAREA"},qq=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!cne(e)&&r[t]==="visible")},une=function(e){return qq(e,"overflowY")},dne=function(e){return qq(e,"overflowX")},gI=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=$q(e,n);if(o){var a=Uq(e,n),s=a[1],l=a[2];if(s>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},fne=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},pne=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},$q=function(e,t){return e==="v"?une(t):dne(t)},Uq=function(e,t){return e==="v"?fne(t):pne(t)},hne=function(e,t){return e==="h"&&t==="rtl"?-1:1},gne=function(e,t,r,n,o){var a=hne(e,window.getComputedStyle(t).direction),s=a*n,l=r.target,c=t.contains(l),u=!1,d=s>0,f=0,h=0;do{if(!l)break;var p=Uq(e,l),y=p[0],m=p[1],x=p[2],b=m-x-a*y;(y||b)&&$q(e,l)&&(f+=b,h+=y);var w=l.parentNode;l=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(u=!0),u},w1=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},mI=function(e){return[e.deltaX,e.deltaY]},vI=function(e){return e&&"current"in e?e.current:e},mne=function(e,t){return e[0]===t[0]&&e[1]===t[1]},vne=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},yne=0,yg=[];function xne(e){var t=j.useRef([]),r=j.useRef([0,0]),n=j.useRef(),o=j.useState(yne++)[0],a=j.useState(Wq)[0],s=j.useRef(e);j.useEffect(function(){s.current=e},[e]),j.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Bre([e.lockRef.current],(e.shards||[]).map(vI),!0).filter(Boolean);return m.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=j.useCallback(function(m,x){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var b=w1(m),w=r.current,k="deltaX"in m?m.deltaX:w[0]-b[0],S="deltaY"in m?m.deltaY:w[1]-b[1],_,P=m.target,O=Math.abs(k)>Math.abs(S)?"h":"v";if("touches"in m&&O==="h"&&P.type==="range")return!1;var T=window.getSelection(),R=T&&T.anchorNode,I=R?R===P||R.contains(P):!1;if(I)return!1;var E=gI(O,P);if(!E)return!0;if(E?_=O:(_=O==="v"?"h":"v",E=gI(O,P)),!E)return!1;if(!n.current&&"changedTouches"in m&&(k||S)&&(n.current=_),!_)return!0;var A=n.current||_;return gne(A,x,m,A==="h"?k:S)},[]),c=j.useCallback(function(m){var x=m;if(!(!yg.length||yg[yg.length-1]!==a)){var b="deltaY"in x?mI(x):w1(x),w=t.current.filter(function(_){return _.name===x.type&&(_.target===x.target||x.target===_.shadowParent)&&mne(_.delta,b)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var k=(s.current.shards||[]).map(vI).filter(Boolean).filter(function(_){return _.contains(x.target)}),S=k.length>0?l(x,k[0]):!s.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),u=j.useCallback(function(m,x,b,w){var k={name:m,delta:x,target:b,should:w,shadowParent:bne(b)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(S){return S!==k})},1)},[]),d=j.useCallback(function(m){r.current=w1(m),n.current=void 0},[]),f=j.useCallback(function(m){u(m.type,mI(m),m.target,l(m,e.lockRef.current))},[]),h=j.useCallback(function(m){u(m.type,w1(m),m.target,l(m,e.lockRef.current))},[]);j.useEffect(function(){return yg.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,vg),document.addEventListener("touchmove",c,vg),document.addEventListener("touchstart",d,vg),function(){yg=yg.filter(function(m){return m!==a}),document.removeEventListener("wheel",c,vg),document.removeEventListener("touchmove",c,vg),document.removeEventListener("touchstart",d,vg)}},[]);var p=e.removeScrollBar,y=e.inert;return j.createElement(j.Fragment,null,y?j.createElement(a,{styles:vne(o)}):null,p?j.createElement(lne,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function bne(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wne=Kre(Bq,xne);var H6=j.forwardRef(function(e,t){return j.createElement(Fw,Hc({},e,{ref:t,sideCar:wne}))});H6.classNames=Fw.classNames;var Sne=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xg=new WeakMap,S1=new WeakMap,j1={},Mj=0,Hq=function(e){return e&&(e.host||Hq(e.parentNode))},jne=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Hq(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},kne=function(e,t,r,n){var o=jne(t,Array.isArray(e)?e:[e]);j1[r]||(j1[r]=new WeakMap);var a=j1[r],s=[],l=new Set,c=new Set(o),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};o.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var p=h.getAttribute(n),y=p!==null&&p!=="false",m=(xg.get(h)||0)+1,x=(a.get(h)||0)+1;xg.set(h,m),a.set(h,x),s.push(h),m===1&&y&&S1.set(h,!0),x===1&&h.setAttribute(r,"true"),y||h.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",h,b)}})};return d(t),l.clear(),Mj++,function(){s.forEach(function(f){var h=xg.get(f)-1,p=a.get(f)-1;xg.set(f,h),a.set(f,p),h||(S1.has(f)||f.removeAttribute(n),S1.delete(f)),p||f.removeAttribute(r)}),Mj--,Mj||(xg=new WeakMap,xg=new WeakMap,S1=new WeakMap,j1={})}},Vq=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Sne(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),kne(n,o,r,"aria-hidden")):function(){return null}},V6="Dialog",[Yq]=Rw(V6),[_ne,hc]=Yq(V6),Gq=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,l=j.useRef(null),c=j.useRef(null),[u=!1,d]=W6({prop:n,defaultProp:o,onChange:a});return i.jsx(_ne,{scope:t,triggerRef:l,contentRef:c,contentId:h0(),titleId:h0(),descriptionId:h0(),open:u,onOpenChange:d,onOpenToggle:j.useCallback(()=>d(f=>!f),[d]),modal:s,children:r})};Gq.displayName=V6;var Kq="DialogTrigger",Cne=j.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=hc(Kq,r),a=Nl(t,o.triggerRef);return i.jsx(ya.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":K6(o.open),...n,ref:a,onClick:ps(e.onClick,o.onOpenToggle)})});Cne.displayName=Kq;var Y6="DialogPortal",[Ene,Qq]=Yq(Y6,{forceMount:void 0}),Xq=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:o}=e,a=hc(Y6,t);return i.jsx(Ene,{scope:t,forceMount:r,children:j.Children.map(n,s=>i.jsx(cv,{present:r||a.open,children:i.jsx(U6,{asChild:!0,container:o,children:s})}))})};Xq.displayName=Y6;var L0="DialogOverlay",Zq=j.forwardRef((e,t)=>{const r=Qq(L0,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,a=hc(L0,e.__scopeDialog);return a.modal?i.jsx(cv,{present:n||a.open,children:i.jsx(Ane,{...o,ref:t})}):null});Zq.displayName=L0;var Ane=j.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=hc(L0,r);return i.jsx(H6,{as:Lw,allowPinchZoom:!0,shards:[o.contentRef],children:i.jsx(ya.div,{"data-state":K6(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),dh="DialogContent",Jq=j.forwardRef((e,t)=>{const r=Qq(dh,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,a=hc(dh,e.__scopeDialog);return i.jsx(cv,{present:n||a.open,children:a.modal?i.jsx(Tne,{...o,ref:t}):i.jsx(Pne,{...o,ref:t})})});Jq.displayName=dh;var Tne=j.forwardRef((e,t)=>{const r=hc(dh,e.__scopeDialog),n=j.useRef(null),o=Nl(t,r.contentRef,n);return j.useEffect(()=>{const a=n.current;if(a)return Vq(a)},[]),i.jsx(e$,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ps(e.onCloseAutoFocus,a=>{var s;a.preventDefault(),(s=r.triggerRef.current)==null||s.focus()}),onPointerDownOutside:ps(e.onPointerDownOutside,a=>{const s=a.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&a.preventDefault()}),onFocusOutside:ps(e.onFocusOutside,a=>a.preventDefault())})}),Pne=j.forwardRef((e,t)=>{const r=hc(dh,e.__scopeDialog),n=j.useRef(!1),o=j.useRef(!1);return i.jsx(e$,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,l;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),a.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=a.target;((u=r.triggerRef.current)==null?void 0:u.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),e$=j.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,...s}=e,l=hc(dh,r),c=j.useRef(null),u=Nl(t,c);return Mq(),i.jsxs(i.Fragment,{children:[i.jsx($6,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,children:i.jsx(q6,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":K6(l.open),...s,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),i.jsxs(i.Fragment,{children:[i.jsx(Ine,{titleId:l.titleId}),i.jsx(Rne,{contentRef:c,descriptionId:l.descriptionId})]})]})}),G6="DialogTitle",t$=j.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=hc(G6,r);return i.jsx(ya.h2,{id:o.titleId,...n,ref:t})});t$.displayName=G6;var r$="DialogDescription",One=j.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=hc(r$,r);return i.jsx(ya.p,{id:o.descriptionId,...n,ref:t})});One.displayName=r$;var n$="DialogClose",i$=j.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,o=hc(n$,r);return i.jsx(ya.button,{type:"button",...n,ref:t,onClick:ps(e.onClick,()=>o.onOpenChange(!1))})});i$.displayName=n$;function K6(e){return e?"open":"closed"}var o$="DialogTitleWarning",[UNe,a$]=ure(o$,{contentName:dh,titleName:G6,docsSlug:"dialog"}),Ine=({titleId:e})=>{const t=a$(o$),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
||
|
||
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||
|
||
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return j.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Nne="DialogDescriptionWarning",Rne=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${a$(Nne).contentName}}.`;return j.useEffect(()=>{var a;const o=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},s$=Gq,l$=Xq,c$=Zq,u$=Jq,d$=t$,f$=i$;function p$(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=p$(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Lr(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=p$(e))&&(n&&(n+=" "),n+=t);return n}const Q6="-",Lne=e=>{const t=Mne(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{const l=s.split(Q6);return l[0]===""&&l.length!==1&&l.shift(),h$(l,t)||Fne(s)},getConflictingClassGroupIds:(s,l)=>{const c=r[s]||[];return l&&n[s]?[...c,...n[s]]:c}}},h$=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?h$(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;const a=e.join(Q6);return(s=t.validators.find(({validator:l})=>l(a)))==null?void 0:s.classGroupId},yI=/^\[(.+)\]$/,Fne=e=>{if(yI.test(e)){const t=yI.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Mne=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const o in r)rE(r[o],n,o,t);return n},rE=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){const a=o===""?t:xI(t,o);a.classGroupId=r;return}if(typeof o=="function"){if(Dne(o)){rE(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([a,s])=>{rE(s,xI(t,a),r,n)})})},xI=(e,t)=>{let r=e;return t.split(Q6).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Dne=e=>e.isThemeGetter,zne=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(a,s)=>{r.set(a,s),t++,t>e&&(t=0,n=r,r=new Map)};return{get(a){let s=r.get(a);if(s!==void 0)return s;if((s=n.get(a))!==void 0)return o(a,s),s},set(a,s){r.has(a)?r.set(a,s):o(a,s)}}},nE="!",iE=":",Bne=iE.length,Wne=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const a=[];let s=0,l=0,c=0,u;for(let y=0;y<o.length;y++){let m=o[y];if(s===0&&l===0){if(m===iE){a.push(o.slice(c,y)),c=y+Bne;continue}if(m==="/"){u=y;continue}}m==="["?s++:m==="]"?s--:m==="("?l++:m===")"&&l--}const d=a.length===0?o:o.substring(c),f=qne(d),h=f!==d,p=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:p}};if(t){const o=t+iE,a=n;n=s=>s.startsWith(o)?a(s.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(r){const o=n;n=a=>r({className:a,parseClassName:o})}return n},qne=e=>e.endsWith(nE)?e.substring(0,e.length-1):e.startsWith(nE)?e.substring(1):e,$ne=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const o=[];let a=[];return n.forEach(s=>{s[0]==="["||t[s]?(o.push(...a.sort(),s),a=[]):a.push(s)}),o.push(...a.sort()),o}},Une=e=>({cache:zne(e.cacheSize),parseClassName:Wne(e),sortModifiers:$ne(e),...Lne(e)}),Hne=/\s+/,Vne=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:a}=t,s=[],l=e.trim().split(Hne);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:f,modifiers:h,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:m}=r(d);if(f){c=d+(c.length>0?" "+c:c);continue}let x=!!m,b=n(x?y.substring(0,m):y);if(!b){if(!x){c=d+(c.length>0?" "+c:c);continue}if(b=n(y),!b){c=d+(c.length>0?" "+c:c);continue}x=!1}const w=a(h).join(":"),k=p?w+nE:w,S=k+b;if(s.includes(S))continue;s.push(S);const _=o(b,x);for(let P=0;P<_.length;++P){const O=_[P];s.push(k+O)}c=d+(c.length>0?" "+c:c)}return c};function Yne(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=g$(t))&&(n&&(n+=" "),n+=r);return n}const g$=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=g$(e[n]))&&(r&&(r+=" "),r+=t);return r};function Gne(e,...t){let r,n,o,a=s;function s(c){const u=t.reduce((d,f)=>f(d),e());return r=Une(u),n=r.cache.get,o=r.cache.set,a=l,l(c)}function l(c){const u=n(c);if(u)return u;const d=Vne(c,r);return o(c,d),d}return function(){return a(Yne.apply(null,arguments))}}const so=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},m$=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,v$=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Kne=/^\d+\/\d+$/,Qne=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xne=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Zne=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Jne=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eie=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bg=e=>Kne.test(e),Dr=e=>!!e&&!Number.isNaN(Number(e)),cf=e=>!!e&&Number.isInteger(Number(e)),Dj=e=>e.endsWith("%")&&Dr(e.slice(0,-1)),Wu=e=>Qne.test(e),tie=()=>!0,rie=e=>Xne.test(e)&&!Zne.test(e),y$=()=>!1,nie=e=>Jne.test(e),iie=e=>eie.test(e),oie=e=>!nr(e)&&!ir(e),aie=e=>uv(e,w$,y$),nr=e=>m$.test(e),Sp=e=>uv(e,S$,rie),zj=e=>uv(e,die,Dr),bI=e=>uv(e,x$,y$),sie=e=>uv(e,b$,iie),k1=e=>uv(e,j$,nie),ir=e=>v$.test(e),ay=e=>dv(e,S$),lie=e=>dv(e,fie),wI=e=>dv(e,x$),cie=e=>dv(e,w$),uie=e=>dv(e,b$),_1=e=>dv(e,j$,!0),uv=(e,t,r)=>{const n=m$.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},dv=(e,t,r=!1)=>{const n=v$.exec(e);return n?n[1]?t(n[1]):r:!1},x$=e=>e==="position"||e==="percentage",b$=e=>e==="image"||e==="url",w$=e=>e==="length"||e==="size"||e==="bg-size",S$=e=>e==="length",die=e=>e==="number",fie=e=>e==="family-name",j$=e=>e==="shadow",pie=()=>{const e=so("color"),t=so("font"),r=so("text"),n=so("font-weight"),o=so("tracking"),a=so("leading"),s=so("breakpoint"),l=so("container"),c=so("spacing"),u=so("radius"),d=so("shadow"),f=so("inset-shadow"),h=so("text-shadow"),p=so("drop-shadow"),y=so("blur"),m=so("perspective"),x=so("aspect"),b=so("ease"),w=so("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...S(),ir,nr],P=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],T=()=>[ir,nr,c],R=()=>[bg,"full","auto",...T()],I=()=>[cf,"none","subgrid",ir,nr],E=()=>["auto",{span:["full",cf,ir,nr]},cf,ir,nr],A=()=>[cf,"auto",ir,nr],F=()=>["auto","min","max","fr",ir,nr],L=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...T()],Q=()=>[bg,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],U=()=>[e,ir,nr],ee=()=>[...S(),wI,bI,{position:[ir,nr]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",cie,aie,{size:[ir,nr]}],M=()=>[Dj,ay,Sp],$=()=>["","none","full",u,ir,nr],q=()=>["",Dr,ay,Sp],Y=()=>["solid","dashed","dotted","double"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>[Dr,Dj,wI,bI],re=()=>["","none",y,ir,nr],J=()=>["none",Dr,ir,nr],ae=()=>["none",Dr,ir,nr],le=()=>[Dr,ir,nr],me=()=>[bg,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Wu],breakpoint:[Wu],color:[tie],container:[Wu],"drop-shadow":[Wu],ease:["in","out","in-out"],font:[oie],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Wu],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Wu],shadow:[Wu],spacing:["px",Dr],text:[Wu],"text-shadow":[Wu],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",bg,nr,ir,x]}],container:["container"],columns:[{columns:[Dr,nr,ir,l]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{start:R()}],end:[{end:R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[cf,"auto",ir,nr]}],basis:[{basis:[bg,"full","auto",l,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Dr,bg,"auto","initial","none",nr]}],grow:[{grow:["",Dr,ir,nr]}],shrink:[{shrink:["",Dr,ir,nr]}],order:[{order:[cf,"first","last","none",ir,nr]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...L(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...L()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":L()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],w:[{w:[l,"screen",...Q()]}],"min-w":[{"min-w":[l,"screen","none",...Q()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[s]},...Q()]}],h:[{h:["screen",...Q()]}],"min-h":[{"min-h":["screen","none",...Q()]}],"max-h":[{"max-h":["screen",...Q()]}],"font-size":[{text:["base",r,ay,Sp]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,ir,zj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Dj,nr]}],"font-family":[{font:[lie,nr,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ir,nr]}],"line-clamp":[{"line-clamp":[Dr,"none",ir,zj]}],leading:[{leading:[a,...T()]}],"list-image":[{"list-image":["none",ir,nr]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ir,nr]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:[Dr,"from-font","auto",ir,Sp]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Dr,"auto",ir,nr]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ir,nr]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ir,nr]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},cf,ir,nr],radial:["",ir,nr],conic:[cf,ir,nr]},uie,sie]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:M()}],"gradient-via-pos":[{via:M()}],"gradient-to-pos":[{to:M()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:$()}],"rounded-s":[{"rounded-s":$()}],"rounded-e":[{"rounded-e":$()}],"rounded-t":[{"rounded-t":$()}],"rounded-r":[{"rounded-r":$()}],"rounded-b":[{"rounded-b":$()}],"rounded-l":[{"rounded-l":$()}],"rounded-ss":[{"rounded-ss":$()}],"rounded-se":[{"rounded-se":$()}],"rounded-ee":[{"rounded-ee":$()}],"rounded-es":[{"rounded-es":$()}],"rounded-tl":[{"rounded-tl":$()}],"rounded-tr":[{"rounded-tr":$()}],"rounded-br":[{"rounded-br":$()}],"rounded-bl":[{"rounded-bl":$()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Y(),"hidden","none"]}],"divide-style":[{divide:[...Y(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...Y(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Dr,ir,nr]}],"outline-w":[{outline:["",Dr,ay,Sp]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",d,_1,k1]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",f,_1,k1]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Dr,Sp]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",h,_1,k1]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Dr,ir,nr]}],"mix-blend":[{"mix-blend":[...K(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":K()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Dr]}],"mask-image-linear-from-pos":[{"mask-linear-from":G()}],"mask-image-linear-to-pos":[{"mask-linear-to":G()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":G()}],"mask-image-t-to-pos":[{"mask-t-to":G()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":G()}],"mask-image-r-to-pos":[{"mask-r-to":G()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":G()}],"mask-image-b-to-pos":[{"mask-b-to":G()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":G()}],"mask-image-l-to-pos":[{"mask-l-to":G()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":G()}],"mask-image-x-to-pos":[{"mask-x-to":G()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":G()}],"mask-image-y-to-pos":[{"mask-y-to":G()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[ir,nr]}],"mask-image-radial-from-pos":[{"mask-radial-from":G()}],"mask-image-radial-to-pos":[{"mask-radial-to":G()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[Dr]}],"mask-image-conic-from-pos":[{"mask-conic-from":G()}],"mask-image-conic-to-pos":[{"mask-conic-to":G()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ee()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ir,nr]}],filter:[{filter:["","none",ir,nr]}],blur:[{blur:re()}],brightness:[{brightness:[Dr,ir,nr]}],contrast:[{contrast:[Dr,ir,nr]}],"drop-shadow":[{"drop-shadow":["","none",p,_1,k1]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Dr,ir,nr]}],"hue-rotate":[{"hue-rotate":[Dr,ir,nr]}],invert:[{invert:["",Dr,ir,nr]}],saturate:[{saturate:[Dr,ir,nr]}],sepia:[{sepia:["",Dr,ir,nr]}],"backdrop-filter":[{"backdrop-filter":["","none",ir,nr]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[Dr,ir,nr]}],"backdrop-contrast":[{"backdrop-contrast":[Dr,ir,nr]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Dr,ir,nr]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Dr,ir,nr]}],"backdrop-invert":[{"backdrop-invert":["",Dr,ir,nr]}],"backdrop-opacity":[{"backdrop-opacity":[Dr,ir,nr]}],"backdrop-saturate":[{"backdrop-saturate":[Dr,ir,nr]}],"backdrop-sepia":[{"backdrop-sepia":["",Dr,ir,nr]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ir,nr]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Dr,"initial",ir,nr]}],ease:[{ease:["linear","initial",b,ir,nr]}],delay:[{delay:[Dr,ir,nr]}],animate:[{animate:["none",w,ir,nr]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,ir,nr]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:J()}],"rotate-x":[{"rotate-x":J()}],"rotate-y":[{"rotate-y":J()}],"rotate-z":[{"rotate-z":J()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[ir,nr,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ir,nr]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ir,nr]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Dr,ay,Sp,zj]}],stroke:[{stroke:["none",...U()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},hie=Gne(pie);function Xo(...e){return hie(Lr(e))}function gie({...e}){return i.jsx(s$,{"data-slot":"dialog",...e})}function mie({...e}){return i.jsx(l$,{"data-slot":"dialog-portal",...e})}const k$=j.forwardRef(({className:e,...t},r)=>i.jsx(c$,{ref:r,"data-slot":"dialog-overlay",className:Xo("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t}));k$.displayName="DialogOverlay";function vie({className:e,children:t,...r}){return i.jsxs(mie,{"data-slot":"dialog-portal",children:[i.jsx(k$,{}),i.jsxs(u$,{"data-slot":"dialog-content",className:Xo("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,i.jsxs(f$,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[i.jsx(er,{}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function yie({className:e,...t}){return i.jsx("div",{"data-slot":"dialog-header",className:Xo("flex flex-col gap-2 text-center sm:text-left",e),...t})}function xie({className:e,...t}){return i.jsx(d$,{"data-slot":"dialog-title",className:Xo("text-lg leading-none font-semibold",e),...t})}function bie({open:e,onOpenChange:t,title:r,children:n,contentClassName:o}){return i.jsx(gie,{open:e,onOpenChange:t,children:i.jsxs(vie,{className:o,children:[r&&i.jsx(yie,{children:i.jsx(xie,{children:r})}),n]})})}function SI({icon:e,title:t,description:r,action:n,style:o}){return i.jsxs("div",{style:{textAlign:"center",padding:"48px 24px",border:"2px dashed var(--border)",borderRadius:"var(--radius-card)",background:"var(--card)",...o},children:[e&&i.jsx("div",{style:{width:"48px",height:"48px",borderRadius:"var(--radius-card)",background:"var(--secondary)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px",color:"var(--muted)"},children:e}),i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"8px"},children:t}),r&&i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--muted)",marginBottom:"20px",maxWidth:"360px",margin:"0 auto 20px"},children:r}),n]})}function fh({message:e="Loading…",style:t}){return i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px",padding:"48px 24px",...t},children:[i.jsx("div",{style:{width:"32px",height:"32px",border:"3px solid var(--border)",borderTopColor:"var(--primary)",borderRadius:"50%",animation:"spin 0.8s linear infinite"}}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:e}),i.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]})}class wie extends j.Component{constructor(){super(...arguments);yn(this,"state",{hasError:!1,error:null})}static getDerivedStateFromError(r){return{hasError:!0,error:r}}componentDidCatch(r,n){var o,a;(a=(o=this.props).onError)==null||a.call(o,r,n)}render(){return this.state.hasError&&this.state.error?this.props.fallback?this.props.fallback:i.jsxs("div",{style:{padding:"24px",margin:"24px",border:"1px solid var(--destructive)",borderRadius:"var(--radius-card)",background:"#fef2f2",color:"var(--destructive)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"},children:[i.jsx(nv,{size:20}),i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",fontSize:"var(--text-base)"},children:"Something went wrong"})]}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",margin:0},children:this.state.error.message})]}):this.props.children}}function Sie(){return j.useSyncExternalStore(LJ,XO,XO)?i.jsxs("div",{role:"status","aria-live":"polite","aria-busy":"true","aria-label":"Please wait",style:{position:"fixed",inset:0,zIndex:1e5,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(15, 23, 42, 0.45)",backdropFilter:"blur(2px)",pointerEvents:"all"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"16px",padding:"28px 36px",borderRadius:"var(--radius-card)",background:"var(--card)",border:"1px solid var(--border)",boxShadow:"var(--elevation-sm)",minWidth:"200px"},children:[i.jsx("div",{style:{width:"36px",height:"36px",border:"3px solid var(--border)",borderTopColor:"var(--primary)",borderRadius:"50%",animation:"eb-global-spin 0.8s linear infinite"}}),i.jsx("p",{style:{margin:0,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:"Please wait"})]}),i.jsx("style",{children:"@keyframes eb-global-spin { to { transform: rotate(360deg); } }"})]}):null}const Ao={p10df6080:"M37.7893 38.8274C36.0748 38.8274 34.6629 38.4744 33.5536 37.7684C32.4778 37.0289 31.6879 36.054 31.1836 34.8438C30.6794 33.6336 30.4272 32.3225 30.4272 30.9106C30.4272 29.9694 30.4777 29.0113 30.5785 28.0364C30.713 27.0615 30.8642 26.1371 31.0323 25.263L34.1587 10.4381H43.689L40.5122 25.616C40.4114 26.053 40.3105 26.6077 40.2097 27.28C40.1088 27.9188 40.0584 28.5239 40.0584 29.0953C40.0584 29.8013 40.2433 30.3392 40.6131 30.7089C40.9829 31.0451 41.4199 31.2132 41.9241 31.2132C42.4956 31.2132 43.0503 30.9611 43.5882 30.4568C44.1596 29.9526 44.6975 29.1626 45.2018 28.0868C45.706 27.0111 46.1262 25.6496 46.4624 24.0024L49.3366 10.4381H58.8669L52.9672 38.3231H45.353L45.6556 34.4404H45.4539C44.8488 35.4825 44.1765 36.3229 43.4369 36.9616C42.6973 37.6004 41.8569 38.071 40.9156 38.3735C40.008 38.6761 38.9659 38.8274 37.7893 38.8274Z",p142b6380:"M31.0583 13.3131C31.4698 13.0263 32.0388 13.1259 32.2977 13.5556C33.4072 15.3973 34.0662 17.4753 34.2208 19.6197C34.2569 20.1201 33.8493 20.5294 33.3477 20.5322V20.5322C32.846 20.5349 32.4408 20.1299 32.3996 19.6299C32.2533 17.8536 31.7076 16.1329 30.8035 14.5969C30.549 14.1646 30.6467 13.6 31.0583 13.3131V13.3131Z",p1674a600:"M53.2547 29.9849C53.3365 27.5678 52.774 25.1726 51.6264 23.0438C50.4786 20.9149 48.7858 19.1285 46.7213 17.8684C44.6571 16.6085 42.2954 15.9192 39.8775 15.8715C37.4595 15.8238 35.0718 16.4192 32.9594 17.5968C30.8471 18.7745 29.0848 20.4922 27.854 22.5741C26.6232 24.6561 25.9672 27.0281 25.9537 29.4466C25.9407 31.7765 26.5261 34.0685 27.6484 36.107L27.6474 36.1073L27.6618 36.1307C27.7003 36.2002 27.7376 36.2704 27.7774 36.3394L27.7828 36.3369L35.9118 50.1145C37.7038 49.0572 38.2991 46.7469 37.2418 44.9548L31.0476 34.4551L31.0598 34.4478C30.1875 32.9338 29.7328 31.2149 29.7426 29.4677C29.7524 27.7203 30.2264 26.0069 31.1156 24.5027C32.0048 22.9986 33.2778 21.7579 34.8038 20.907C36.3301 20.0561 38.0556 19.6251 39.8027 19.6596C41.5497 19.6941 43.2565 20.1923 44.748 21.1027C46.2394 22.013 47.4622 23.3033 48.2914 24.8413C49.1207 26.3794 49.5268 28.1107 49.4676 29.8572C49.4084 31.6035 48.8866 33.3032 47.9553 34.7816L47.9627 34.7867L37.0389 53.7059C35.9959 55.5125 36.6149 57.8227 38.4215 58.8657L51.1614 36.8009C52.4505 34.7545 53.1729 32.402 53.2547 29.9849Z",p1945f480:"M63.6456 33.23L69.3941 6.35351H71.8649L70.9068 12.3541H70.9573C71.5624 11.3792 72.3355 10.4043 73.2768 9.42944C74.2181 8.42094 75.3442 7.58052 76.6553 6.90819C77.9663 6.20224 79.4287 5.84926 81.0423 5.84926C82.4878 5.84926 83.7148 6.11819 84.7233 6.65606C85.7654 7.16031 86.5554 7.89988 87.0933 8.87476C87.6311 9.84965 87.9001 11.0598 87.9001 12.5054C87.9001 13.1105 87.8496 13.766 87.7488 14.4719C87.6816 15.1779 87.5807 15.8166 87.4462 16.3881L83.8156 33.23H80.8406L84.4712 16.0351C84.6392 15.3628 84.7569 14.7745 84.8241 14.2702C84.8914 13.766 84.925 13.2954 84.925 12.8583C84.925 11.3456 84.5216 10.2362 83.7148 9.53029C82.9416 8.82434 81.8154 8.47136 80.3363 8.47136C78.8572 8.47136 77.378 8.9588 75.8989 9.93369C74.4198 10.875 73.0919 12.2364 71.9153 14.0181C70.7724 15.7998 69.932 17.9513 69.3941 20.4725L66.6711 33.23H63.6456Z",p1e5a9f00:"M21.5276 21.5276C21.5276 18.7006 20.9708 15.9012 19.8889 13.2893C18.8071 10.6775 17.2213 8.30431 15.2223 6.30529C13.2233 4.30626 10.8501 2.72055 8.23826 1.63869C5.62641 0.556826 2.82705 -8.70599e-07 0 0L1.3922e-06 4.5208C2.23337 4.5208 4.44486 4.96069 6.50822 5.81536C8.57159 6.67003 10.4464 7.92274 12.0256 9.50197C13.6049 11.0812 14.8576 12.956 15.7122 15.0194C16.5669 17.0827 17.0068 19.2942 17.0068 21.5276H21.5276Z",p24dd2380:"M15.6318 38.8273C14.6905 38.8273 13.8333 38.7096 13.0601 38.4743C12.3206 38.239 11.6146 37.8524 10.9423 37.3145C10.3036 36.7766 9.64805 36.0875 8.97571 35.2471H8.77401L7.56381 38.323H6.10352e-05L8.11849 0H17.6488L16.4386 5.69803C16.2369 6.70653 16.0016 7.69822 15.7327 8.67311C15.4637 9.61437 15.1948 10.4716 14.9259 11.2448C14.6569 12.018 14.4216 12.6399 14.2199 13.1105H14.4216C14.8586 12.5726 15.3125 12.0684 15.7831 11.5978C16.2537 11.0935 16.8252 10.6901 17.4975 10.3876C18.1699 10.085 19.0271 9.93373 20.0692 9.93373C21.5147 9.93373 22.8258 10.2699 24.0024 10.9422C25.2126 11.6146 26.1706 12.7239 26.8766 14.2703C27.6162 15.8166 27.9859 17.9177 27.9859 20.5734C27.9859 21.9181 27.8179 23.414 27.4817 25.0612C27.1791 26.7084 26.7085 28.3389 26.0698 29.9525C25.4311 31.5661 24.6243 33.0452 23.6494 34.3899C22.6745 35.7345 21.5147 36.8103 20.1701 37.6171C18.8254 38.4239 17.3126 38.8273 15.6318 38.8273ZM13.3123 31.1627C13.8501 31.1627 14.3544 30.9778 14.825 30.608C15.3293 30.2046 15.7831 29.6835 16.1865 29.0448C16.5899 28.3725 16.9429 27.6161 17.2454 26.7757C17.5816 25.9016 17.8337 24.9772 18.0018 24.0023C18.1699 23.0274 18.2539 22.0693 18.2539 21.1281C18.2539 19.9851 18.069 19.1111 17.6992 18.506C17.3631 17.9009 16.842 17.5983 16.1361 17.5983C15.6318 17.5983 15.1612 17.7496 14.7242 18.0522C14.3208 18.3547 13.9342 18.7749 13.5644 19.3128C13.2282 19.817 12.9257 20.4053 12.6567 21.0777C12.3878 21.75 12.1525 22.4559 11.9508 23.1955C11.7827 23.9351 11.6482 24.6915 11.5474 25.4646C11.4465 26.2042 11.3961 26.927 11.3961 27.6329C11.3961 28.675 11.5474 29.5323 11.8499 30.2046C12.1861 30.8433 12.6735 31.1627 13.3123 31.1627Z",p2c694f80:"M48.5463 14.0889C48.1347 13.8021 47.5657 13.9017 47.3069 14.3314C46.3407 15.9351 45.7146 17.7206 45.4677 19.5764C45.4015 20.0737 45.7836 20.5069 46.2842 20.5398V20.5398C46.7848 20.5728 47.2137 20.1929 47.2849 19.6963C47.5039 18.1702 48.019 16.7014 48.8011 15.3727C49.0555 14.9404 48.9578 14.3758 48.5463 14.0889V14.0889Z",p2fc98c00:"M56.3998 38.3231L57.4588 32.8772L69.8129 17.8001H61.2407L62.9047 10.4381H82.873L81.5619 16.3882L69.3591 30.9611H78.7886L77.175 38.3231H56.3998Z",p30ec5580:"M78.8566 38.3231L79.9155 32.8772L92.2697 17.8001H83.6974L85.3614 10.4381H105.33L104.019 16.3882L91.8158 30.9611H101.245L99.6317 38.3231H78.8566Z",p33b7c800:"M53.7052 24.2408C55.6176 22.6016 57.9466 21.5226 60.4336 21.1246C62.9206 20.7266 65.4696 21.0249 67.7979 21.9852C70.1261 22.9455 72.1434 24.5309 73.6266 26.5663C75.1098 28.602 76.0016 31.0087 76.2024 33.5194C76.4031 36.03 75.9053 38.5473 74.7644 40.7927C73.6234 43.0382 71.8832 44.9243 69.737 46.2425C67.6663 47.5142 65.2953 48.2073 62.869 48.2567L62.8692 48.2576L62.8458 48.2568C62.7651 48.2583 62.6843 48.262 62.6035 48.2621L62.6027 48.2552L49.4801 48.1318C49.4996 46.0511 51.2025 44.3796 53.2832 44.3992L62.6 44.4869L62.6002 44.4727C64.4199 44.471 66.2041 43.966 67.7547 43.0137C69.3051 42.0613 70.5624 40.6984 71.3867 39.0762C72.2108 37.4541 72.5703 35.6354 72.4254 33.8217C72.2803 32.0078 71.6363 30.2688 70.5647 28.7981C69.493 27.3274 68.0347 26.1813 66.3524 25.4875C64.6702 24.7937 62.8287 24.5792 61.0319 24.8668C59.2352 25.1544 57.5531 25.9333 56.1715 27.1175C54.7898 28.3017 53.7621 29.845 53.203 31.5768L49.5972 30.4127C50.371 28.0159 51.793 25.8799 53.7052 24.2408Z",p3763d600:"M25.2927 33.23L21.6621 6.40394H24.5364L26.7551 23.7501C26.8895 24.5569 26.9904 25.3974 27.0576 26.2714C27.1249 27.1454 27.1921 27.969 27.2593 28.7422C27.3266 29.4818 27.3602 30.1205 27.3602 30.6584H27.5114C27.8476 29.9524 28.2006 29.2129 28.5704 28.4397C28.9738 27.6329 29.3772 26.8261 29.7806 26.0193C30.184 25.1789 30.5874 24.4057 30.9908 23.6997L40.6724 6.40394H43.7483L28.7216 33.23H25.2927Z",p37f9b00:"M28.0432 34.0512C29.248 36.0968 30.9683 37.7905 33.0324 38.9632C35.0965 40.136 37.4322 40.7467 39.8061 40.7343C42.1801 40.722 44.5093 40.0871 46.5611 38.893C48.613 37.699 50.3156 35.9875 51.4991 33.9295L49.6351 32.8576C48.6392 34.5895 47.2063 36.0297 45.4796 37.0346C43.7529 38.0395 41.7928 38.5738 39.795 38.5841C37.7972 38.5945 35.8317 38.0806 34.0946 37.0937C32.3576 36.1068 30.9099 34.6814 29.896 32.96L28.0432 34.0512Z",p48e8300:"M51.5881 33.7343C49.7728 33.7343 48.1424 33.3645 46.6969 32.625C45.2514 31.8518 44.1084 30.7088 43.268 29.1961C42.4612 27.6833 42.0578 25.784 42.0578 23.498C42.0578 21.2121 42.3772 19.027 43.0159 16.9428C43.6882 14.8249 44.6295 12.9424 45.8397 11.2952C47.0835 9.61436 48.529 8.30331 50.1762 7.36204C51.8235 6.38715 53.6556 5.89971 55.6726 5.89971C57.8577 5.89971 59.5553 6.45439 60.7655 7.56374C62.0093 8.63947 62.6312 10.085 62.6312 11.9003C62.6312 13.413 62.2614 14.7409 61.5219 15.8839C60.7823 16.9932 59.7066 17.9177 58.2947 18.6572C56.9164 19.3968 55.2187 19.9683 53.2017 20.3717C51.2184 20.7415 48.9492 20.9264 46.3944 20.9264H45.1337C45.1001 21.2625 45.0665 21.6659 45.0329 22.1366C44.9993 22.5736 44.9825 23.0106 44.9825 23.4476C44.9825 25.9353 45.6044 27.8682 46.8482 29.2465C48.092 30.5912 49.8401 31.2635 52.0924 31.2635C53.4707 31.2635 54.7313 31.0786 55.8743 30.7088C57.0172 30.339 58.1266 29.902 59.2023 29.3978V31.9694C58.1938 32.4401 57.0509 32.8603 55.7734 33.2301C54.5296 33.5662 53.1345 33.7343 51.5881 33.7343ZM46.949 18.506C49.3694 18.506 51.5545 18.3043 53.5043 17.9009C55.4541 17.4639 56.9836 16.7747 58.093 15.8334C59.2359 14.8586 59.8074 13.6147 59.8074 12.102C59.8074 11.0263 59.4376 10.1354 58.6981 9.42947C57.9921 8.72352 56.8996 8.37054 55.4204 8.37054C54.0758 8.37054 52.7311 8.77394 51.3864 9.58074C50.0754 10.3539 48.8988 11.4969 47.8567 13.0096C46.8146 14.5224 46.0414 16.3545 45.5371 18.506H46.949Z",p5358df0:"M13.382 21.5276C13.382 19.7702 13.0359 18.0301 12.3634 16.4065C11.6909 14.7829 10.7052 13.3077 9.46252 12.0651C8.21989 10.8224 6.74466 9.83673 5.12108 9.16422C3.4975 8.49172 1.75735 8.14558 2.50846e-06 8.14558L3.90565e-06 12.6826C1.16155 12.6826 2.31172 12.9114 3.38485 13.3559C4.45797 13.8004 5.43304 14.4519 6.25438 15.2732C7.07571 16.0946 7.72723 17.0696 8.17173 18.1428C8.61624 19.2159 8.84502 20.3661 8.84502 21.5276H13.382Z",p6535700:"M9.5304 33.7343C7.7151 33.7343 6.08469 33.3645 4.63917 32.625C3.19366 31.8518 2.05069 30.7088 1.21027 29.1961C0.403473 27.6833 7.30464e-05 25.784 7.30464e-05 23.498C7.30464e-05 21.2121 0.319431 19.027 0.958148 16.9428C1.63048 14.8249 2.57175 12.9424 3.78195 11.2952C5.02577 9.61436 6.47128 8.30331 8.1185 7.36204C9.76572 6.38715 11.5978 5.89971 13.6148 5.89971C15.7999 5.89971 17.4976 6.45439 18.7078 7.56374C19.9516 8.63947 20.5735 10.085 20.5735 11.9003C20.5735 13.413 20.2037 14.7409 19.4641 15.8839C18.7246 16.9932 17.6488 17.9177 16.2369 18.6572C14.8586 19.3968 13.161 19.9683 11.144 20.3717C9.16062 20.7415 6.89149 20.9264 4.33662 20.9264H3.076C3.04238 21.2625 3.00877 21.6659 2.97515 22.1366C2.94153 22.5736 2.92472 23.0106 2.92472 23.4476C2.92472 25.9353 3.54663 27.8682 4.79045 29.2465C6.03427 30.5912 7.78233 31.2635 10.0347 31.2635C11.4129 31.2635 12.6736 31.0786 13.8165 30.7088C14.9595 30.339 16.0688 29.902 17.1446 29.3978V31.9694C16.1361 32.4401 14.9931 32.8603 13.7157 33.2301C12.4719 33.5662 11.0768 33.7343 9.5304 33.7343ZM4.8913 18.506C7.3117 18.506 9.49678 18.3043 11.4466 17.9009C13.3963 17.4639 14.9259 16.7747 16.0352 15.8334C17.1782 14.8586 17.7497 13.6147 17.7497 12.102C17.7497 11.0263 17.3799 10.1354 16.6403 9.42947C15.9344 8.72352 14.8418 8.37054 13.3627 8.37054C12.018 8.37054 10.6734 8.77394 9.3287 9.58074C8.01765 10.3539 6.84107 11.4969 5.79895 13.0096C4.75683 14.5224 3.98365 16.3545 3.4794 18.506H4.8913Z",p6970200:"M31.8056 40.9033C32.6086 42.2668 33.7553 43.3958 35.1312 44.1775C36.507 44.9592 38.0639 45.3662 39.6463 45.358C41.2287 45.3498 42.7812 44.9266 44.1489 44.1307C45.5165 43.3348 46.6514 42.1939 47.4403 40.8222L45.2644 39.5709C44.6945 40.562 43.8745 41.3862 42.8864 41.9613C41.8982 42.5364 40.7765 42.8421 39.6332 42.8481C38.49 42.854 37.3651 42.5599 36.3711 41.9951C35.377 41.4303 34.5486 40.6147 33.9684 39.6295L31.8056 40.9033Z",pd494300:"M25.6088 24.241C23.6964 22.6019 21.3675 21.5229 18.8804 21.1248C16.3935 20.7269 13.8445 21.0251 11.5161 21.9855C9.18797 22.9458 7.17066 24.5312 5.6875 26.5666C4.20423 28.6022 3.31243 31.0089 3.11167 33.5196C2.91094 36.0303 3.40878 38.5476 4.54967 40.793C5.69062 43.0385 7.43083 44.9246 9.57707 46.2428C11.6477 47.5145 14.0188 48.2076 16.4451 48.2569L16.4448 48.2579L16.4683 48.2571C16.549 48.2586 16.6297 48.2623 16.7105 48.2623L16.7113 48.2555L29.834 48.132C29.8144 46.0513 28.1115 44.3798 26.0308 44.3994L16.7141 44.4872L16.7139 44.473C14.8942 44.4713 13.11 43.9663 11.5594 43.014C10.0089 42.0616 8.75165 40.6987 7.92739 39.0765C7.10323 37.4543 6.74374 35.6357 6.88868 33.822C7.03372 32.0081 7.67779 30.2691 8.74935 28.7984C9.82102 27.3276 11.2794 26.1816 12.9617 25.4877C14.6438 24.794 16.4854 24.5795 18.2821 24.867C20.0789 25.1547 21.7609 25.9335 23.1426 27.1177C24.5242 28.302 25.5519 29.8453 26.111 31.577L29.7168 30.413C28.943 28.0162 27.5211 25.8801 25.6088 24.241Z",pdd63b00:"M97.0978 33.7343C95.3833 33.7343 94.0218 33.3141 93.0133 32.4737C92.0048 31.6333 91.5006 30.3054 91.5006 28.4901C91.5006 28.0195 91.5342 27.5153 91.6014 26.9774C91.6687 26.4059 91.7695 25.8176 91.904 25.2125L95.3833 8.72354H91.3493L91.7023 7.16037L95.8876 6.15187L98.308 1.2012e-05H100.123L98.7618 6.40399H106.275L105.771 8.72354H98.2575L94.7782 25.1621C94.6774 25.6663 94.5765 26.1874 94.4757 26.7253C94.4084 27.2295 94.3748 27.717 94.3748 28.1876C94.3748 29.1289 94.6101 29.8852 95.0808 30.4567C95.585 31.0282 96.375 31.3139 97.4507 31.3139C98.1567 31.3139 98.8122 31.2635 99.4173 31.1627C100.022 31.0282 100.611 30.8601 101.182 30.6584V32.978C100.712 33.1461 100.106 33.3141 99.3669 33.4822C98.6609 33.6503 97.9046 33.7343 97.0978 33.7343Z"},_$="linear-gradient(135deg, rgb(11,77,209) 0%, rgb(29,102,239) 45%, rgb(107,53,210) 100%)",Fc="#EF8D1D";function C$({variant:e="color",scale:t=1}){const r=e==="light"?"white":"#0F3072",n=Math.round(320*t),o=Math.round(60*t);return i.jsxs("div",{style:{position:"relative",width:n,height:o,flexShrink:0},children:[i.jsxs("svg",{style:{position:"absolute",left:0,top:0},fill:"none",preserveAspectRatio:"none",viewBox:"0 0 79.3139 60.1372",width:Math.round(79*t),height:Math.round(60*t),children:[i.jsx("path",{d:Ao.pd494300,fill:Fc}),i.jsx("path",{d:Ao.p33b7c800,fill:Fc}),i.jsx("path",{d:Ao.p142b6380,fill:r}),i.jsx("path",{d:Ao.p2c694f80,fill:r}),i.jsx("circle",{cx:"39.8711",cy:"7.36343",r:"6.01221",fill:r,transform:"rotate(75 39.8711 7.36343)"}),i.jsx("circle",{cx:"17.7246",cy:"12.6819",r:"5.28744",fill:Fc,transform:"rotate(75 17.7246 12.6819)"}),i.jsx("circle",{cx:"5.28744",cy:"5.28744",r:"5.28744",fill:Fc,transform:"matrix(-0.258819 0.965926 0.965926 0.258819 58.2047 6.20616)"}),i.jsx("path",{d:Ao.p1674a600,fill:r}),i.jsx("path",{d:Ao.p6970200,fill:r}),i.jsx("path",{d:Ao.p37f9b00,fill:r})]}),i.jsxs("svg",{style:{position:"absolute",left:Math.round(91*t),top:Math.round(13*t)},fill:"none",preserveAspectRatio:"none",viewBox:"0 0 106.275 33.7343",width:Math.round(106*t),height:Math.round(34*t),children:[i.jsx("path",{d:Ao.pdd63b00,fill:r}),i.jsx("path",{d:Ao.p1945f480,fill:r}),i.jsx("path",{d:Ao.p48e8300,fill:r}),i.jsx("path",{d:Ao.p3763d600,fill:r}),i.jsx("path",{d:Ao.p6535700,fill:r})]}),i.jsxs("svg",{style:{position:"absolute",left:Math.round(197*t),top:Math.round(8*t)},fill:"none",preserveAspectRatio:"none",viewBox:"0 0 105.33 38.8275",width:Math.round(106*t),height:Math.round(39*t),children:[i.jsx("path",{d:Ao.p30ec5580,fill:Fc}),i.jsx("path",{d:Ao.p2fc98c00,fill:Fc}),i.jsx("path",{d:Ao.p10df6080,fill:Fc}),i.jsx("path",{d:Ao.p24dd2380,fill:Fc})]}),i.jsxs("svg",{style:{position:"absolute",left:Math.round(298*t),top:Math.round(9*t)},fill:"none",preserveAspectRatio:"none",viewBox:"0 0 21.5276 21.5276",width:Math.round(22*t),height:Math.round(22*t),children:[i.jsx("path",{d:Ao.p1e5a9f00,fill:Fc}),i.jsx("path",{d:Ao.p5358df0,fill:Fc})]})]})}function E$(){return i.jsxs("div",{"aria-hidden":"true",style:{position:"fixed",inset:0,zIndex:0,backgroundImage:_$,overflow:"hidden"},children:[i.jsx("div",{style:{position:"absolute",top:"-160px",right:"-160px",width:480,height:480,borderRadius:"50%",background:"rgba(255,255,255,0.07)"}}),i.jsx("div",{style:{position:"absolute",top:"-60px",right:"-60px",width:280,height:280,borderRadius:"50%",border:"1px solid rgba(255,255,255,0.12)",background:"transparent"}}),i.jsx("div",{style:{position:"absolute",bottom:"-200px",left:"-200px",width:560,height:560,borderRadius:"50%",background:"rgba(255,255,255,0.06)"}}),i.jsx("div",{style:{position:"absolute",bottom:"-80px",left:"-80px",width:300,height:300,borderRadius:"50%",border:"1px solid rgba(255,255,255,0.10)",background:"transparent"}}),i.jsx("div",{style:{position:"absolute",top:"20%",left:"12%",width:80,height:80,borderRadius:"50%",background:"rgba(255,255,255,0.05)"}}),i.jsx("div",{style:{position:"absolute",bottom:"18%",right:"8%",width:120,height:120,borderRadius:"50%",background:"rgba(255,255,255,0.05)"}})]})}function Qu({label:e,placeholder:t,value:r,onChange:n,type:o="text",required:a,showToggle:s,inputMode:l,autoComplete:c,name:u}){const[d,f]=j.useState(!1),[h,p]=j.useState(!1),y=s?h?"text":"password":o;return i.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)",marginBottom:5},children:[a&&i.jsx("span",{style:{color:"var(--destructive)",marginRight:3},children:"*"}),e]}),i.jsxs("div",{style:{position:"relative"},children:[i.jsx("input",{type:y,value:r,onChange:m=>n(m.target.value),placeholder:t,required:a,name:u,inputMode:l,autoComplete:c,onFocus:()=>f(!0),onBlur:()=>f(!1),style:{width:"100%",padding:"8px 12px",paddingRight:s?38:12,border:d?"1px solid var(--primary)":"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-normal)",color:"var(--card-foreground)",outline:"none",boxSizing:"border-box",boxShadow:d?"0 0 0 2px rgba(11,77,209,0.10)":"none",transition:"border-color 0.15s, box-shadow 0.15s"}}),s&&i.jsx("button",{type:"button",tabIndex:-1,onClick:()=>p(m=>!m),style:{position:"absolute",right:10,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",padding:0,lineHeight:0},children:h?i.jsx(R6,{size:15}):i.jsx(Ah,{size:15})})]})]})}function A$({label:e,disabled:t}){const[r,n]=j.useState(!1),o=!!t;return i.jsx("button",{type:"submit",disabled:o,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"10px 24px",borderRadius:"var(--radius-button)",background:"var(--primary)",border:"none",cursor:o?"not-allowed":"pointer",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",fontSize:"var(--text-sm)",color:"var(--primary-foreground)",letterSpacing:"0.02em",opacity:o?.55:r?.88:1,transition:"opacity 0.15s ease"},children:e})}function T$({prompt:e,linkLabel:t,onClick:r}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:6,flexWrap:"wrap"},children:[i.jsx("span",{style:{fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-normal)",fontSize:"var(--text-sm)",color:"var(--muted)"},children:e}),i.jsx("button",{type:"button",onClick:r,style:{fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",fontSize:"var(--text-sm)",color:"var(--primary)",textDecoration:"underline",textDecorationSkipInk:"none",background:"none",border:"none",cursor:"pointer",padding:0,opacity:1,transition:"opacity 0.15s ease"},onMouseEnter:n=>{n.currentTarget.style.opacity="0.7"},onMouseLeave:n=>{n.currentTarget.style.opacity="1"},children:t})]})}function F0({label:e}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i.jsx("div",{style:{flex:1,height:1,background:"var(--border)"}}),i.jsx("span",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-xs)",color:"var(--muted)",whiteSpace:"nowrap"},children:e}),i.jsx("div",{style:{flex:1,height:1,background:"var(--border)"}})]})}const X6="951022141012-uqd3e8da53gj8vhbhg9ibha5f9k8jsqj.apps.googleusercontent.com";function jie(e){try{const t=e.split(".")[1];if(!t)return null;const r=t.replace(/-/g,"+").replace(/_/g,"/"),n=r+"=".repeat((4-r.length%4)%4),o=atob(n);return JSON.parse(o)}catch{return null}}function P$({text:e,onCredential:t}){const r=j.useRef(null),n=j.useRef(t);return n.current=t,j.useEffect(()=>{var l,c;if(!r.current)return;const o=r.current;let a=!0;const s=()=>{var f,h;if(!a||!o.isConnected)return;const u=(h=(f=window.google)==null?void 0:f.accounts)==null?void 0:h.id;if(!u)return;o.innerHTML="",u.initialize({client_id:X6,callback:p=>{p.credential&&n.current(p.credential)}});const d=Math.max(Math.floor(o.getBoundingClientRect().width),280);u.renderButton(o,{type:"standard",theme:"outline",size:"large",text:e,width:Math.min(400,d)})};if((c=(l=window.google)==null?void 0:l.accounts)!=null&&c.id)s();else{const u=window.setInterval(()=>{var f,h;(h=(f=window.google)==null?void 0:f.accounts)!=null&&h.id&&(window.clearInterval(u),s())},100),d=window.setTimeout(()=>window.clearInterval(u),2e4);return()=>{a=!1,window.clearInterval(u),window.clearTimeout(d)}}return()=>{a=!1}},[e]),i.jsx("div",{style:{width:"100%"},children:i.jsx("div",{ref:r,style:{width:"100%",minHeight:44}})})}function kie({onNavigateToLogin:e,onSuccess:t,onRegister:r,onRegisterWithGoogle:n}){const[o,a]=j.useState(""),[s,l]=j.useState(""),[c,u]=j.useState(""),[d,f]=j.useState(""),[h,p]=j.useState(""),[y,m]=j.useState(""),[x,b]=j.useState(null),[w,k]=j.useState(!1),S=async O=>{if(!n)return;b(null);const T=jie(O);if(!(T!=null&&T.email)){b("Could not read your Google account details. Try again.");return}k(!0);try{const R=await n({idToken:O,teamName:o.trim()||void 0,firstName:T.given_name||void 0,lastName:T.family_name||void 0});if(R.error){b(R.error);return}t==null||t()}finally{k(!1)}},_=async O=>{if(O.preventDefault(),b(null),r){const T=await r({email:s,password:c,teamName:o.trim(),firstName:d||void 0,lastName:h||void 0});if(T.error){b(T.error);return}}t==null||t()},P=[{icon:i.jsx(Wi,{size:16}),label:"Manage all your events in one place"},{icon:i.jsx(vi,{size:16}),label:"Track participants and attendance"},{icon:i.jsx(nu,{size:16}),label:"Real-time analytics and insights"}];return i.jsxs("div",{style:{minHeight:"100vh",width:"100%",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:"32px 16px"},children:[i.jsx(E$,{}),i.jsxs("div",{style:{position:"relative",zIndex:1,display:"flex",flexDirection:"row",borderRadius:"var(--radius-card)",overflow:"hidden",boxShadow:"0px 20px 48px 0px rgba(0,0,0,0.28), 0px 4px 12px 0px rgba(0,0,0,0.18)",width:"min(960px, 100%)",minHeight:640},children:[i.jsxs("div",{style:{flex:"0 0 42%",position:"relative",overflow:"hidden",display:"flex",flexDirection:"column",justifyContent:"space-between",padding:"40px 36px",minHeight:580},children:[i.jsx("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"none",background:"linear-gradient(160deg, rgba(11,77,209,0.92) 0%, rgba(29,102,239,0.88) 50%, rgba(107,53,210,0.92) 100%)"}}),i.jsxs("div",{style:{position:"relative",zIndex:1,display:"flex",flexDirection:"column",height:"100%",gap:0},children:[i.jsx("div",{children:i.jsx(C$,{variant:"light",scale:.72})}),i.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",gap:20,paddingTop:32,paddingBottom:16},children:[i.jsxs("div",{children:[i.jsxs("p",{style:{fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",fontSize:"var(--text-2xl)",color:"white",lineHeight:1.25,margin:"0 0 10px"},children:["Your event",i.jsx("br",{}),"management portal"]}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-normal)",fontSize:"var(--text-sm)",color:"rgba(255,255,255,0.80)",lineHeight:1.55,margin:0},children:"Everything you need to run exceptional events — in one place."})]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:P.map((O,T)=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i.jsx("div",{style:{width:28,height:28,borderRadius:"var(--radius-button)",background:"rgba(255,255,255,0.15)",display:"flex",alignItems:"center",justifyContent:"center",color:"white",flexShrink:0},children:O.icon}),i.jsx("span",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-normal)",color:"rgba(255,255,255,0.88)",lineHeight:1.4},children:O.label})]},T))})]}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-xs)",color:"rgba(255,255,255,0.55)",margin:0},children:"© 2026 Stratawiz Technologies · EventBuzz"})]})]}),i.jsxs("div",{style:{flex:"1 1 0",background:"var(--card)",display:"flex",flexDirection:"column",overflowY:"auto",padding:"40px 40px 36px"},children:[i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{marginBottom:28},children:[i.jsx("h2",{style:{fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",fontSize:"var(--text-2xl)",color:"var(--foreground)",lineHeight:1.25,margin:"0 0 6px"},children:"Create your account"}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-normal)",fontSize:"var(--text-sm)",color:"var(--muted)",margin:0,lineHeight:1.5},children:"Complete your registration to access the portal"})]}),i.jsxs("form",{onSubmit:_,style:{display:"flex",flexDirection:"column",gap:14,flex:1},children:[x&&i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--destructive)",margin:0},children:x}),n&&X6&&i.jsxs(i.Fragment,{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 4px"},children:"Sign up with Google — your account is created instantly, no extra steps."}),w&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:0},children:"Creating your account with Google…"}),i.jsx(P$,{text:"signup_with",onCredential:O=>{S(O)}}),i.jsx(F0,{label:"or register with email"})]}),i.jsx(Qu,{label:"Team Name",placeholder:"Enter your team or organization name",value:o,onChange:a,type:"text",required:!0}),i.jsx(Qu,{label:"Email Address",placeholder:"Enter your email address",value:s,onChange:l,type:"email",required:!0}),r&&i.jsx(Qu,{label:"Password",placeholder:"Choose a password (min 6 characters)",value:c,onChange:u,type:"password",required:!0}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[i.jsx(Qu,{label:"First Name",placeholder:"First name",value:d,onChange:f,required:!0}),i.jsx(Qu,{label:"Last Name",placeholder:"Last name",value:h,onChange:p,required:!0})]}),i.jsx(Qu,{label:"Phone Number",placeholder:"Enter your phone number",value:y,onChange:m,type:"tel"}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[i.jsx(A$,{label:"Create Account"}),i.jsx(F0,{label:"Already registered?"}),i.jsx(T$,{prompt:"Have an account?",linkLabel:"Sign in here",onClick:e})]})]})]}),i.jsxs("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-xs)",color:"var(--muted)",marginTop:24,lineHeight:1.5,textAlign:"center"},children:["By registering you agree to our"," ",i.jsx("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"Terms of Service"})," ","and"," ",i.jsx("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"Privacy Policy"}),"."]})]})]})]})}function _ie({onNavigateToRegister:e,onSuccess:t,onLogin:r,onLoginWithGoogle:n,onCompleteTwoFactorLogin:o}){const[a,s]=j.useState(""),[l,c]=j.useState(""),[u,d]=j.useState(""),[f,h]=j.useState("password"),[p,y]=j.useState(null),[m,x]=j.useState(null),[b,w]=j.useState(!1),k=async P=>{if(n){x(null),w(!0);try{const O=await n(P);if("error"in O&&O.error){x(O.error);return}if("requiresTwoFactor"in O&&O.requiresTwoFactor){y(O.twoFactorToken),O.email&&s(O.email),h("2fa"),d("");return}t==null||t()}finally{w(!1)}}},S=()=>{h("password"),y(null),d(""),x(null)},_=async P=>{if(P.preventDefault(),x(null),f==="2fa"){if(!o||!p)return;const O=await o(p,u.trim());if(O.error){x(O.error);return}t==null||t();return}if(r){const O=await r(a,l);if("error"in O){x(O.error);return}if("requiresTwoFactor"in O&&O.requiresTwoFactor){y(O.twoFactorToken),h("2fa"),d("");return}}else{t==null||t();return}t==null||t()};return i.jsxs("div",{style:{minHeight:"100vh",width:"100%",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:"32px 16px"},children:[i.jsx(E$,{}),i.jsxs("div",{style:{position:"relative",zIndex:1,background:"var(--card)",borderRadius:"var(--radius-card)",overflow:"hidden",boxShadow:"0px 20px 48px 0px rgba(0,0,0,0.28), 0px 4px 12px 0px rgba(0,0,0,0.18)",width:"min(440px, 100%)"},children:[i.jsxs("div",{style:{padding:"32px 40px 28px",backgroundImage:_$,display:"flex",flexDirection:"column",alignItems:"center",gap:16,position:"relative",overflow:"hidden"},children:[i.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:-40,right:-40,width:160,height:160,borderRadius:"50%",border:"1px solid rgba(255,255,255,0.15)",background:"transparent"}}),i.jsx("div",{"aria-hidden":"true",style:{position:"absolute",bottom:-50,left:-30,width:120,height:120,borderRadius:"50%",background:"rgba(255,255,255,0.06)"}}),i.jsx("div",{style:{position:"relative",zIndex:1},children:i.jsx(C$,{variant:"light",scale:.72})}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-normal)",fontSize:"var(--text-xs)",color:"rgba(255,255,255,0.72)",margin:0,letterSpacing:"0.04em",textTransform:"uppercase",position:"relative",zIndex:1},children:"Event Management Portal"})]}),i.jsxs("div",{style:{padding:"32px 40px 36px"},children:[i.jsxs("div",{style:{marginBottom:24,textAlign:"center"},children:[i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",fontSize:"var(--text-xl)",color:"var(--foreground)",margin:"0 0 6px",lineHeight:1.3},children:f==="2fa"?"Authenticator code":"Welcome back"}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-normal)",fontSize:"var(--text-sm)",color:"var(--muted)",margin:0,lineHeight:1.5},children:f==="2fa"?"Open Google Authenticator and enter the 6-digit code for your EventBuzz account.":"Enter your email to access your portal"})]}),i.jsxs("form",{onSubmit:_,style:{display:"flex",flexDirection:"column",gap:14},children:[m&&i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--destructive)",margin:0},children:m}),f==="password"?i.jsxs(i.Fragment,{children:[i.jsx(Qu,{label:"Email Address",placeholder:"Enter your email address",value:a,onChange:s,type:"email",required:!0}),r&&i.jsx(Qu,{label:"Password",placeholder:"Enter your password",value:l,onChange:c,type:"password",required:!0})]}):i.jsxs(i.Fragment,{children:[i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:0},children:["Signed in as ",i.jsx("strong",{style:{color:"var(--foreground)"},children:a})]}),i.jsx(Qu,{label:"Authentication code",placeholder:"000000",value:u,onChange:d,type:"text",inputMode:"numeric",autoComplete:"one-time-code",required:!0})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,marginTop:8},children:[i.jsx(A$,{label:f==="2fa"?"Verify and sign in":"Sign In"}),f==="2fa"&&i.jsx("button",{type:"button",onClick:S,style:{background:"none",border:"none",cursor:"pointer",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--primary)",padding:"4px 0"},children:"← Use a different account"}),f==="password"&&n&&X6&&i.jsxs(i.Fragment,{children:[i.jsx(F0,{label:"or"}),b&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:0},children:"Signing in with Google…"}),i.jsx(P$,{text:"signin_with",onCredential:P=>{k(P)}})]}),i.jsx(F0,{label:"New to EventBuzz?"}),i.jsx(T$,{prompt:"Don't have an account?",linkLabel:"Register here",onClick:e})]})]}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-xs)",color:"var(--muted)",marginTop:24,lineHeight:1.5,textAlign:"center"},children:"© 2026 Stratawiz Technologies · EventBuzz"})]})]})]})}function Cie(){var c,u;const e=bd(),t=xd(),{user:r,checked:n,login:o,loginWithGoogleCredential:a,completeTwoFactorLogin:s}=Ur(),l=((u=(c=t.state)==null?void 0:c.from)==null?void 0:u.pathname)??"/home";return n&&r?i.jsx(th,{to:l,replace:!0}):i.jsx(_ie,{onNavigateToRegister:()=>e("/register"),onSuccess:()=>e(l,{replace:!0}),onLogin:o,onLoginWithGoogle:a,onCompleteTwoFactorLogin:s})}function Eie(){const e=bd(),{user:t,checked:r,register:n,registerWithGoogle:o}=Ur();return r&&t?i.jsx(th,{to:"/home",replace:!0}):i.jsx(kie,{onNavigateToLogin:()=>e("/login"),onSuccess:()=>e("/home",{replace:!0}),onRegister:n,onRegisterWithGoogle:o})}function Aie(){const[e]=aq(),t=bd(),r=e.get("token")||"",[n,o]=j.useState(!0),[a,s]=j.useState(null),[l,c]=j.useState(null),[u,d]=j.useState(""),[f,h]=j.useState(""),[p,y]=j.useState(""),[m,x]=j.useState(!1);j.useEffect(()=>{if(!r){s("Missing invitation link."),o(!1);return}za.invitePreview(r).then(w=>{if(o(!1),w.error||!w.data){s(w.error||"Invalid or expired invitation.");return}const k=w.data;c(k),k.accountExists&&!k.sameOrganization&&s("This email is already registered with another organization.")})},[r]);const b=async w=>{if(w.preventDefault(),!r||!u)return;x(!0),s(null);const k=await za.inviteAccept({token:r,password:u,firstName:l!=null&&l.accountExists?void 0:f,lastName:l!=null&&l.accountExists?void 0:p});if(x(!1),k.error||!k.data){s(k.error||"Could not accept invitation.");return}const S=k.data;vf(S.token,S.refreshToken),t("/events",{replace:!0})};return n?i.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Loading invitation…"}):i.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"var(--secondary)"},children:i.jsxs("div",{style:{width:"100%",maxWidth:420,background:"var(--card)",borderRadius:12,padding:28,border:"1px solid var(--border)",boxShadow:"var(--shadow-md)"},children:[i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"1.25rem",margin:"0 0 8px",color:"var(--foreground)"},children:"Event invitation"}),l&&i.jsxs("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",marginBottom:20,lineHeight:1.5},children:["Join ",i.jsx("strong",{children:l.eventName}),l.organizationName?` · ${l.organizationName}`:""," as ",i.jsx("strong",{children:l.eventRole||"team member"}),".",i.jsx("br",{}),i.jsx("span",{style:{fontSize:"var(--text-xs)"},children:l.email})]}),a&&i.jsx("div",{style:{padding:12,background:"#fef2f2",color:"#b91c1c",borderRadius:8,marginBottom:16,fontSize:"var(--text-sm)"},children:a}),l&&(!l.accountExists||l.sameOrganization)&&!(a!=null&&a.includes("another organization"))&&i.jsxs("form",{onSubmit:b,children:[!l.accountExists&&i.jsxs(i.Fragment,{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-sm)",marginBottom:6},children:"First name"}),i.jsx("input",{value:f,onChange:w=>h(w.target.value),style:{width:"100%",marginBottom:12,padding:10,borderRadius:8,border:"1px solid var(--border)"}}),i.jsx("label",{style:{display:"block",fontSize:"var(--text-sm)",marginBottom:6},children:"Last name"}),i.jsx("input",{value:p,onChange:w=>y(w.target.value),style:{width:"100%",marginBottom:12,padding:10,borderRadius:8,border:"1px solid var(--border)"}})]}),i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)",marginBottom:6},children:[l.accountExists?"Password":"Create password"," ",i.jsx("span",{style:{color:"var(--destructive)"},children:"*"})]}),i.jsx("input",{type:"password",value:u,onChange:w=>d(w.target.value),placeholder:l.accountExists?"Your account password":"At least 6 characters",style:{width:"100%",marginBottom:16,padding:10,borderRadius:8,border:"1px solid var(--border)"},autoComplete:l.accountExists?"current-password":"new-password"}),i.jsx("button",{type:"submit",disabled:m||!u,style:{width:"100%",padding:12,borderRadius:8,border:"none",background:"var(--primary)",color:"var(--primary-foreground)",fontWeight:600,cursor:m?"wait":"pointer"},children:m?"Please wait…":l.accountExists?"Accept & sign in":"Create account & join"})]})]})})}const O$=j.createContext(null),Tie="home";function Pie({children:e,activeNavFromUrl:t,setActiveNavToUrl:r}){const[n,o]=j.useState(Tie),[a,s]=j.useState(null),[l,c]=j.useState(""),[u,d]=j.useState(!1),[f,h]=j.useState(!1),[p,y]=j.useState(null),[m,x]=j.useState(!1),[b,w]=j.useState(null),_={activeNav:t??n,setActiveNav:r??o,selectedEventId:a,setSelectedEventId:s,searchQuery:l,setSearchQuery:c,sidebarCollapsed:u,setSidebarCollapsed:d,drawerOpen:f,setDrawerOpen:h,settingsInitialSection:p,setSettingsInitialSection:y,openAgendaSessionPanelOnce:m,setOpenAgendaSessionPanelOnce:x,pendingMicrositeBuilder:b,setPendingMicrositeBuilder:w};return i.jsx(O$.Provider,{value:_,children:e})}function eo(){const e=j.useContext(O$);if(!e)throw new Error("useAppNav must be used within AppNavProvider");return e}function jI(e){return e<640?"mobile":e<1024?"tablet":"desktop"}function qi(){const[e,t]=j.useState(()=>jI(window.innerWidth));return j.useEffect(()=>{const r=()=>t(jI(window.innerWidth));return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),e}const kI=[{id:"home",label:"Home",icon:i.jsx(F6,{size:16})},{id:"events",label:"All Events",icon:i.jsx(Tw,{size:16})},{id:"activities",label:"Activities",icon:i.jsx(B6,{size:16})},{id:"design",label:"Design",icon:i.jsx(Wg,{size:16}),children:[{id:"design-brochure",label:"Brochure"},{id:"design-microsite",label:"Microsite Templates"},{id:"design-badges",label:"Badges"},{id:"design-emailers",label:"Emailers"},{id:"design-whatsapp-templates",label:"WhatsApp Templates"}]},{id:"faculty",label:"Faculty & Speakers",icon:i.jsx(Pw,{size:16})},{id:"all-participants",label:"Participants",icon:i.jsx(vi,{size:16})},{id:"forms",label:"Forms & Workflow",icon:i.jsx(lh,{size:16}),children:[{id:"forms-feedback",label:"Feedback"},{id:"forms-registration",label:"Registration"},{id:"forms-other",label:"Other Forms"},{id:"forms-add",label:"Add New Form",isAction:!0}]},{id:"content",label:"Content",icon:i.jsx(N0,{size:16}),children:[{id:"content-library",label:"Library"},{id:"content-collections",label:"Collections"}]},{id:"messaging",label:"Messaging",icon:i.jsx(ch,{size:16}),children:[{id:"messaging-email",label:"Email"},{id:"messaging-whatsapp",label:"WhatsApp"}]},{id:"payment",label:"Payment Settings",icon:i.jsx(ov,{size:16})},{id:"user-management",label:"User Management",icon:i.jsx(id,{size:16})},{id:"settings",label:"Settings",icon:i.jsx(Pl,{size:16})}];function I$(e,t){var r;return!!((r=e.children)!=null&&r.some(n=>n.id===t))}function Oie(e,t){return t===e.id||I$(e,t)}function Gp({label:e,children:t}){const[r,n]=j.useState(!1);return i.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:[t,r&&i.jsxs("div",{style:{position:"absolute",left:"calc(100% + 8px)",top:"50%",transform:"translateY(-50%)",background:"var(--foreground)",color:"#fff",padding:"4px 10px",borderRadius:"var(--radius-button)",fontSize:"12px",fontFamily:"var(--font-noto-sans)",whiteSpace:"nowrap",zIndex:300,pointerEvents:"none",boxShadow:"var(--elevation-sm)"},children:[e,i.jsx("span",{style:{position:"absolute",right:"100%",top:"50%",transform:"translateY(-50%)",borderWidth:"4px",borderStyle:"solid",borderColor:"transparent var(--foreground) transparent transparent"}})]})]})}function _I({activeItem:e,onNavigate:t,showCollapsed:r,selectedEventId:n,onEventSelect:o}){const a=kI.filter(f=>f.children).reduce((f,h)=>(f[h.id]=I$(h,e),f),{}),[s,l]=j.useState({events:!0,...a}),c=f=>l(h=>({...h,[f]:!h[f]})),u=f=>({width:"100%",display:"flex",alignItems:"center",gap:r?0:"9px",padding:r?"8px 0":"7px 10px",justifyContent:r?"center":"flex-start",borderRadius:"var(--radius-button)",background:f?"var(--sidebar-accent)":"transparent",border:"none",cursor:"pointer",textAlign:"left",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:f?"var(--font-weight-medium)":"var(--font-weight-normal)",color:f?"var(--sidebar-accent-foreground)":"var(--sidebar-foreground)",transition:"background 0.12s",marginBottom:"1px",whiteSpace:"nowrap",overflow:"hidden"}),d=f=>({color:f?"var(--sidebar-primary)":"var(--muted)",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"});return i.jsx(i.Fragment,{children:kI.map(f=>{if(f.id==="events"){const m=e==="events",x=!!s.events&&!r;return r?i.jsx(Gp,{label:"All Events",children:i.jsxs("button",{onClick:()=>t("events"),style:{...u(m||!!n),position:"relative"},onMouseEnter:b=>{m||(b.currentTarget.style.background="var(--accent)")},onMouseLeave:b=>{m||(b.currentTarget.style.background=m||n?"var(--sidebar-accent)":"transparent")},children:[i.jsx("span",{style:d(m||!!n),children:f.icon}),n&&i.jsx("span",{style:{position:"absolute",top:"6px",right:"6px",width:"6px",height:"6px",borderRadius:"50%",background:"#16a34a",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--sidebar)"}})]})},"events"):i.jsx("div",{style:{marginBottom:"1px"},children:i.jsx("div",{style:{display:"flex",alignItems:"center"},children:i.jsxs("button",{onClick:()=>{t("events"),x||l(b=>({...b,events:!0}))},style:{...u(m),flex:1,borderRadius:"var(--radius-button) 0 0 var(--radius-button)",marginBottom:0,overflow:"hidden"},onMouseEnter:b=>{m||(b.currentTarget.style.background="var(--accent)")},onMouseLeave:b=>{m||(b.currentTarget.style.background="transparent")},children:[i.jsx("span",{style:d(m),children:f.icon}),i.jsx("span",{style:{flex:1,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",overflow:"hidden",textOverflow:"ellipsis"},children:f.label}),n&&!x&&i.jsx("span",{style:{width:"5px",height:"5px",borderRadius:"50%",background:"var(--primary)",flexShrink:0,marginRight:"2px"}})]})})},"events")}const h=Oie(f,e),p=!!s[f.id]&&!r;if(f.children){const m=i.jsxs("button",{onClick:()=>c(f.id),style:u(h),onMouseEnter:x=>{h||(x.currentTarget.style.background="var(--accent)")},onMouseLeave:x=>{h||(x.currentTarget.style.background="transparent")},children:[i.jsx("span",{style:d(h),children:f.icon}),!r&&i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{flex:1,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:f.label}),i.jsx(va,{size:13,style:{color:"var(--muted)",flexShrink:0,transform:p?"rotate(90deg)":"none",transition:"transform 0.18s"}})]})]});return i.jsxs("div",{children:[r?i.jsx(Gp,{label:f.label,children:m}):m,p&&i.jsx("div",{style:{paddingLeft:"14px",marginBottom:"2px"},children:i.jsx("div",{style:{borderLeft:"1px solid var(--sidebar-border)",paddingLeft:"8px"},children:f.children.map(x=>{const b=e===x.id;return i.jsxs("button",{onClick:()=>t(x.id),style:{...u(b),padding:"5px 8px",fontSize:"var(--text-xs)",gap:"6px"},onMouseEnter:w=>{b||(w.currentTarget.style.background="var(--accent)")},onMouseLeave:w=>{b||(w.currentTarget.style.background="transparent")},children:[x.isAction&&i.jsx(wr,{size:11,style:{color:"var(--primary)",flexShrink:0}}),i.jsx("span",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-xs)",color:b?"var(--sidebar-accent-foreground)":x.isAction?"var(--primary)":"var(--card-foreground)"},children:x.label})]},x.id)})})})]},f.id)}const y=i.jsxs("button",{onClick:()=>t(f.id),style:u(h),onMouseEnter:m=>{h||(m.currentTarget.style.background="var(--accent)")},onMouseLeave:m=>{h||(m.currentTarget.style.background="transparent")},children:[i.jsx("span",{style:d(h),children:f.icon}),!r&&i.jsxs(i.Fragment,{children:[i.jsx("span",{style:{flex:1,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:f.label}),h&&i.jsx("span",{style:{width:"5px",height:"5px",borderRadius:"50%",background:"var(--primary)",flexShrink:0}})]})]},f.id);return r?i.jsx(Gp,{label:f.label,children:y},f.id):y})})}function N$(e){var t;return e?e.firstName||e.lastName?[e.firstName,e.lastName].filter(Boolean).join(" ").trim():((t=e.email)==null?void 0:t.split("@")[0])??"User":"User"}function Iie(e){return N$(e).slice(0,2).toUpperCase()||"?"}function CI({collapsed:e,onNavigate:t}){const{theme:r,setTheme:n}=lq(),{user:o,logout:a}=Ur(),s=bd(),l=(o==null?void 0:o.platform_admin)==="yes",c=N$(o??null),u=Iie(o??null),d=(o==null?void 0:o.email)??"",f=()=>{a(),s("/login",{replace:!0})},h={width:"100%",display:"flex",alignItems:"center",gap:e?0:"9px",padding:e?"8px 0":"7px 10px",justifyContent:e?"center":"flex-start",borderRadius:"var(--radius-button)",background:"transparent",border:"none",cursor:"pointer",transition:"background 0.12s",marginBottom:"1px",whiteSpace:"nowrap",overflow:"hidden"};return i.jsxs("div",{style:{borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"var(--sidebar-border)",padding:e?"8px 4px 12px":"8px 8px 12px",display:"flex",flexDirection:"column",alignItems:e?"center":"stretch",gap:"2px",flexShrink:0},children:[e?i.jsx(Gp,{label:r==="dark"?"Switch to Light":"Switch to Dark",children:i.jsx("button",{onClick:()=>n(r==="dark"?"light":"dark"),style:{...h,marginBottom:"4px"},onMouseEnter:p=>{p.currentTarget.style.background="var(--accent)"},onMouseLeave:p=>{p.currentTarget.style.background="transparent"},children:i.jsx("span",{style:{color:"var(--muted)",flexShrink:0,display:"flex"},children:r==="dark"?i.jsx(iI,{size:16}):i.jsx(nI,{size:16})})})}):i.jsxs("div",{style:{marginBottom:"4px"},children:[i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",fontWeight:"700",letterSpacing:"0.07em",textTransform:"uppercase",margin:"0 0 6px 2px"},children:"Appearance"}),i.jsx("div",{style:{display:"flex",alignItems:"center",background:"var(--sidebar-accent)",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"1px",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopColor:"var(--sidebar-border)",borderRightColor:"var(--sidebar-border)",borderBottomColor:"var(--sidebar-border)",borderLeftColor:"var(--sidebar-border)",borderRadius:"var(--radius-button)",padding:"2px",gap:"2px"},children:["light","dark"].map(p=>{const y=r===p;return i.jsx("button",{onClick:()=>n(p),style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",padding:"5px",borderRadius:"var(--radius-button)",border:"none",cursor:"pointer",background:y?"var(--sidebar)":"transparent",boxShadow:y?"var(--elevation-sm)":"none",color:y?"var(--sidebar-foreground)":"var(--muted)",transition:"background 0.15s, color 0.15s, box-shadow 0.15s"},onMouseEnter:m=>{y||(m.currentTarget.style.color="var(--sidebar-foreground)")},onMouseLeave:m=>{y||(m.currentTarget.style.color="var(--muted)")},title:p==="light"?"Light mode":"Dark mode",children:p==="light"?i.jsx(iI,{size:13}):i.jsx(nI,{size:13})},p)})})]}),l&&(e?i.jsx(Gp,{label:"Go to Super Admin Panel",children:i.jsx("button",{type:"button",style:h,onClick:()=>s("/super-admin"),onMouseEnter:p=>{p.currentTarget.style.background="var(--accent)"},onMouseLeave:p=>{p.currentTarget.style.background="transparent"},children:i.jsx("span",{style:{color:"var(--muted)",flexShrink:0,display:"flex"},children:i.jsx(id,{size:16})})})}):i.jsxs("button",{type:"button",style:h,onClick:()=>s("/super-admin"),onMouseEnter:p=>{p.currentTarget.style.background="var(--accent)"},onMouseLeave:p=>{p.currentTarget.style.background="transparent"},children:[i.jsx("span",{style:{color:"var(--muted)",flexShrink:0,display:"flex"},children:i.jsx(id,{size:16})}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--sidebar-foreground)"},children:"Go to Super Admin Panel"})]})),e?i.jsx(Gp,{label:"Settings",children:i.jsx("button",{style:h,onClick:()=>t("settings"),onMouseEnter:p=>{p.currentTarget.style.background="var(--accent)"},onMouseLeave:p=>{p.currentTarget.style.background="transparent"},children:i.jsx("span",{style:{color:"var(--muted)",flexShrink:0,display:"flex"},children:i.jsx(Pl,{size:16})})})}):i.jsxs("button",{style:h,onClick:()=>t("settings"),onMouseEnter:p=>{p.currentTarget.style.background="var(--accent)"},onMouseLeave:p=>{p.currentTarget.style.background="transparent"},children:[i.jsx("span",{style:{color:"var(--muted)",flexShrink:0,display:"flex"},children:i.jsx(Pl,{size:16})}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--sidebar-foreground)"},children:"Settings"})]}),e?i.jsx(Gp,{label:`${c} · Log out`,children:i.jsx("button",{type:"button",onClick:f,style:{...h,padding:"6px 0"},onMouseEnter:p=>{p.currentTarget.style.background="var(--accent)"},onMouseLeave:p=>{p.currentTarget.style.background="transparent"},children:i.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx("span",{style:{color:"#fff",fontSize:"10px",fontFamily:"var(--font-inter)",fontWeight:"600"},children:u})})})}):i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 10px",borderRadius:"var(--radius-button)"},children:[i.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:i.jsx("span",{style:{color:"#fff",fontSize:"10px",fontFamily:"var(--font-inter)",fontWeight:"600"},children:u})}),i.jsxs("div",{style:{flex:1,overflow:"hidden"},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--sidebar-foreground)",lineHeight:"1.3",margin:0},children:c}),i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",margin:0},children:d||"—"})]}),i.jsx("button",{type:"button",onClick:f,title:"Log out",style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",padding:"2px",flexShrink:0},onMouseEnter:p=>{p.currentTarget.style.color="var(--foreground)"},onMouseLeave:p=>{p.currentTarget.style.color="var(--muted)"},children:i.jsx(lte,{size:13})})]})]})}function EI(){return i.jsx("div",{style:{padding:"10px 14px 4px",flexShrink:0},children:i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",fontWeight:"700",letterSpacing:"0.07em",textTransform:"uppercase",margin:0},children:"Portfolio"})})}function AI({activeItem:e,onItemClick:t,collapsed:r,onToggleCollapse:n,drawerOpen:o,onDrawerClose:a,selectedEventId:s,onEventSelect:l}){const c=qi(),u=c==="mobile"||c==="tablet",d=p=>{t(p),u&&a&&a()},f=p=>{l==null||l(p),u&&a&&a()};if(u)return i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:a,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",zIndex:40,opacity:o?1:0,pointerEvents:o?"auto":"none",transition:"opacity 0.22s"}}),i.jsxs("aside",{style:{position:"fixed",top:0,left:0,bottom:0,width:"272px",background:"var(--sidebar)",borderRight:"1px solid var(--sidebar-border)",zIndex:50,display:"flex",flexDirection:"column",transform:o?"translateX(0)":"translateX(-100%)",transition:"transform 0.22s cubic-bezier(0.4,0,0.2,1)",boxShadow:o?"var(--elevation-sm)":"none",overflow:"hidden"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 14px 14px 16px",borderBottom:"1px solid var(--sidebar-border)",flexShrink:0,minHeight:"52px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"9px"},children:[i.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"6px",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx("span",{style:{color:"#fff",fontSize:"11px",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)"},children:"EB"})}),i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",fontSize:"var(--text-base)",color:"var(--sidebar-foreground)"},children:"EventBuzz"})]}),i.jsx("button",{onClick:a,style:{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",borderRadius:"var(--radius-button)",color:"var(--muted)"},onMouseEnter:p=>{p.currentTarget.style.background="var(--accent)"},onMouseLeave:p=>{p.currentTarget.style.background="none"},children:i.jsx(er,{size:15})})]}),i.jsx(EI,{}),i.jsx("nav",{style:{flex:1,overflowY:"auto",overflowX:"hidden",padding:"4px 8px"},children:i.jsx(_I,{activeItem:e,onNavigate:d,showCollapsed:!1,selectedEventId:s,onEventSelect:f})}),i.jsx(CI,{collapsed:!1,onNavigate:d})]})]});const h=r?60:240;return i.jsxs("aside",{style:{width:`${h}px`,flexShrink:0,height:"100%",display:"flex",flexDirection:"column",background:"var(--sidebar)",borderRight:"1px solid var(--sidebar-border)",transition:"width 0.2s cubic-bezier(0.4,0,0.2,1)",overflow:"hidden",zIndex:30,position:"relative"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:r?"center":"space-between",padding:r?"14px 0":"14px 12px 14px 14px",borderBottom:"1px solid var(--sidebar-border)",flexShrink:0,minHeight:"52px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"9px",overflow:"hidden"},children:[i.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"6px",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:i.jsx("span",{style:{color:"#fff",fontSize:"11px",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)"},children:"EB"})}),!r&&i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",fontSize:"var(--text-base)",color:"var(--sidebar-foreground)",whiteSpace:"nowrap",overflow:"hidden"},children:"EventBuzz"})]}),i.jsx("button",{onClick:n,title:r?"Expand sidebar":"Collapse sidebar",style:{width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",borderRadius:"var(--radius-button)",color:"var(--muted)",flexShrink:0},onMouseEnter:p=>{p.currentTarget.style.background="var(--accent)",p.currentTarget.style.color="var(--primary)"},onMouseLeave:p=>{p.currentTarget.style.background="none",p.currentTarget.style.color="var(--muted)"},children:r?i.jsx(va,{size:14}):i.jsx(Nf,{size:14})})]}),!r&&i.jsx(EI,{}),i.jsx("nav",{style:{flex:1,overflowY:"auto",overflowX:"hidden",padding:r?"8px 4px":"4px 8px"},children:i.jsx(_I,{activeItem:e,onNavigate:d,showCollapsed:r,selectedEventId:s,onEventSelect:f})}),r&&i.jsx("div",{style:{borderTop:"1px solid var(--sidebar-border)",padding:"8px 4px 4px",display:"flex",justifyContent:"center"},children:i.jsx("button",{onClick:n,title:"Expand",style:{width:"36px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",borderRadius:"var(--radius-button)",color:"var(--muted)"},onMouseEnter:p=>{p.currentTarget.style.background="var(--accent)",p.currentTarget.style.color="var(--primary)"},onMouseLeave:p=>{p.currentTarget.style.background="none",p.currentTarget.style.color="var(--muted)"},children:i.jsx(va,{size:14})})}),i.jsx(CI,{collapsed:r,onNavigate:d})]})}const oE="eb:organization-subscription-updated",aE={Live:{bg:"#dcfce7",color:"#15803d",dot:"#16a34a"},Upcoming:{bg:"#dbeafe",color:"#1d4ed8"},Completed:{bg:"#f1f5f9",color:"#475569"},Draft:{bg:"#ffedd5",color:"#c2410c"}},Nie={Physical:i.jsx(nb,{size:10}),Virtual:i.jsx(ud,{size:10}),Hybrid:i.jsx(B6,{size:10})},Z6=[{id:"e1",title:"Napcon Jaipur 2026",subtitle:"27th National Conference on Pulmonary Diseases",status:"Live",type:"Conference",location:"Birla Auditorium, Jaipur",locationType:"Physical",startDate:"Nov 23, 2025",endDate:"Nov 26, 2025",participants:26,sessions:12},{id:"e2",title:"Napcon Mumbai 2025",subtitle:"26th National Conference on Pulmonary Diseases",status:"Completed",type:"Conference",location:"NSCI Dome, Mumbai",locationType:"Physical",startDate:"Oct 12, 2025",endDate:"Oct 15, 2025",participants:342,sessions:28},{id:"e3",title:"CHEST India 2026",subtitle:"Annual Indian CHEST Conference",status:"Upcoming",type:"Conference",location:"Taj Palace, New Delhi",locationType:"Physical",startDate:"Mar 15, 2026",endDate:"Mar 18, 2026",participants:0,sessions:0},{id:"e4",title:"ICS Annual Conference 2026",subtitle:"Indian Chest Society Annual Scientific Conference",status:"Upcoming",type:"Conference",location:"Hotel Lalit, Bengaluru",locationType:"Hybrid",startDate:"Jun 10, 2026",endDate:"Jun 12, 2026",participants:0,sessions:0},{id:"e5",title:"COPD Management Workshop",subtitle:"Evidence-based COPD Treatment Protocols",status:"Completed",type:"Workshop",location:"AIIMS, New Delhi",locationType:"Physical",startDate:"Sep 05, 2025",endDate:"Sep 05, 2025",participants:48,sessions:6},{id:"e6",title:"Interventional Pulmonology",subtitle:"Advanced Bronchoscopy & Intervention Training",status:"Completed",type:"Workshop",location:"PGI Chandigarh",locationType:"Physical",startDate:"Nov 28, 2025",endDate:"Nov 29, 2025",participants:22,sessions:8},{id:"e7",title:"Respiratory Physiology Lab",subtitle:"Masterclass: PFT & Interpretation",status:"Upcoming",type:"Workshop",location:"Online",locationType:"Virtual",startDate:"Apr 10, 2026",endDate:"Apr 10, 2026",participants:0,sessions:0},{id:"e8",title:"IMA Annual Summit 2025",subtitle:"Indian Medical Association National Congress",status:"Completed",type:"Summit",location:"Vigyan Bhavan, New Delhi",locationType:"Physical",startDate:"Aug 20, 2025",endDate:"Aug 22, 2025",participants:520,sessions:18},{id:"e9",title:"AIIMS Research Conclave 2026",subtitle:"National Medical Research & Innovation Summit",status:"Upcoming",type:"Summit",location:"AIIMS Auditorium, New Delhi",locationType:"Physical",startDate:"Jul 15, 2026",endDate:"Jul 17, 2026",participants:0,sessions:0},{id:"e10",title:"Monthly CME – December 2025",subtitle:"Asthma & Allergy Management Update",status:"Upcoming",type:"CME",location:"Online",locationType:"Virtual",startDate:"Dec 20, 2025",endDate:"Dec 20, 2025",participants:0,sessions:0},{id:"e11",title:"Monthly CME – November 2025",subtitle:"COPD Exacerbations: Case Studies",status:"Completed",type:"CME",location:"Online",locationType:"Virtual",startDate:"Nov 20, 2025",endDate:"Nov 20, 2025",participants:65,sessions:4},{id:"e12",title:"Monthly CME – October 2025",subtitle:"Sleep Apnoea: Diagnosis & Management",status:"Completed",type:"CME",location:"Online",locationType:"Virtual",startDate:"Oct 18, 2025",endDate:"Oct 18, 2025",participants:72,sessions:4}],R$=[{id:"p0",navId:"home",title:"Home",section:"Portfolio",description:"Dashboard home — AI event ideas and quick actions",icon:i.jsx(F6,{size:14})},{id:"p1",navId:"events",title:"All Events",section:"Portfolio",description:"Browse and manage all your events",icon:i.jsx(Tw,{size:14})},{id:"p2",navId:"design-brochure",title:"Design · Brochure",section:"Design",description:"Create and manage event brochures",icon:i.jsx(Wg,{size:14})},{id:"p3",navId:"design-microsite",title:"Design · Microsite Templates",section:"Design",description:"Manage microsite templates for events",icon:i.jsx(Wg,{size:14})},{id:"p4",navId:"design-badges",title:"Design · Badges",section:"Design",description:"Create attendee and speaker badges",icon:i.jsx(Wg,{size:14})},{id:"p5",navId:"design-emailers",title:"Design · Emailers",section:"Design",description:"Design email templates and newsletters",icon:i.jsx(Wg,{size:14})},{id:"p5w",navId:"design-whatsapp-templates",title:"Design · WhatsApp Templates",section:"Design",description:"Create Meta message templates and sync approval status",icon:i.jsx(Zs,{size:14})},{id:"p6",navId:"faculty",title:"Faculty & Speakers",section:"Portfolio",description:"Manage faculty profiles and speaker details",icon:i.jsx(Pw,{size:14})},{id:"p7",navId:"all-participants",title:"Participants",section:"Portfolio",description:"View and manage all participants across events",icon:i.jsx(vi,{size:14})},{id:"p8",navId:"forms-feedback",title:"Forms · Feedback",section:"Forms & Workflow",description:"Feedback forms and response analytics",icon:i.jsx(lh,{size:14})},{id:"p9",navId:"forms-registration",title:"Forms · Registration",section:"Forms & Workflow",description:"Registration forms and submissions",icon:i.jsx(lh,{size:14})},{id:"p10",navId:"content-library",title:"Content · Library",section:"Content",description:"Manage your content library and assets",icon:i.jsx(N0,{size:14})},{id:"p11",navId:"content-collections",title:"Content · Collections",section:"Content",description:"Organise content into curated collections",icon:i.jsx(N0,{size:14})},{id:"p12",navId:"messaging-email",title:"Messaging · Email",section:"Messaging",description:"Email campaigns, templates, and analytics",icon:i.jsx(ch,{size:14})},{id:"p13",navId:"messaging-whatsapp",title:"Messaging · WhatsApp",section:"Messaging",description:"WhatsApp messaging campaigns",icon:i.jsx(ch,{size:14})},{id:"p14",navId:"payment",title:"Payment Settings",section:"Portfolio",description:"Configure payment gateways and billing",icon:i.jsx(ov,{size:14})},{id:"p15",navId:"user-management",title:"User Management",section:"Portfolio",description:"Manage team members, roles, and permissions",icon:i.jsx(id,{size:14})},{id:"p16",navId:"settings",title:"Settings",section:"General",description:"Organisation, profile, and platform preferences",icon:i.jsx(Pl,{size:14})},{id:"p17",navId:"dashboard",title:"Dashboard",section:"Event",description:"Tracks, sessions, and schedule for the event",icon:i.jsx(ab,{size:14})},{id:"p18",navId:"analytics",title:"Event Analytics",section:"Event",description:"Stats, charts, quick actions, and feature overview",icon:i.jsx(jq,{size:14})},{id:"p19",navId:"participants",title:"Event Participants",section:"Event",description:"Registrations, check-ins, and attendance",icon:i.jsx(vi,{size:14})},{id:"p20",navId:"permissions",title:"Permissions",section:"Event",description:"Control team access and event-level roles",icon:i.jsx(id,{size:14})},{id:"p21",navId:"questions",title:"Q&A Questions",section:"Event",description:"Manage audience questions and Q&A sessions",icon:i.jsx(ib,{size:14})},{id:"p22",navId:"quiz",title:"Quiz & Polls",section:"Event",description:"Create quizzes, polls, and live surveys",icon:i.jsx(nu,{size:14})},{id:"p23",navId:"rewards",title:"Reward Points",section:"Event",description:"Configure and manage attendee rewards",icon:i.jsx(ree,{size:14})}],Rie=[{id:"a1",title:"Create New Event",description:"Set up a new conference, workshop, or CME",icon:i.jsx(wr,{size:14}),navTarget:"events"},{id:"a2",title:"Add Speaker / Faculty",description:"Add a new faculty or speaker profile",icon:i.jsx(Pw,{size:14}),navTarget:"faculty"},{id:"a3",title:"New Email Campaign",description:"Draft and send an email campaign",icon:i.jsx(ch,{size:14}),navTarget:"messaging-email"},{id:"a4",title:"Invite Team Member",description:"Send an invitation to a team member",icon:i.jsx(vi,{size:14}),navTarget:"user-management"},{id:"a5",title:"Upload Content",description:"Upload files, videos, or documents",icon:i.jsx(ou,{size:14}),navTarget:"content-library"},{id:"a6",title:"Connect Payment Gateway",description:"Link Razorpay, Stripe, or other gateways",icon:i.jsx(ov,{size:14}),navTarget:"payment"}],Lie=[{label:"Home",navId:"home",icon:i.jsx(F6,{size:12})},{label:"All Events",navId:"events",icon:i.jsx(Tw,{size:12})},{label:"Faculty & Speakers",navId:"faculty",icon:i.jsx(Pw,{size:12})},{label:"Design",navId:"design-brochure",icon:i.jsx(Wg,{size:12})},{label:"Participants",navId:"all-participants",icon:i.jsx(vi,{size:12})},{label:"Messaging",navId:"messaging-email",icon:i.jsx(ch,{size:12})},{label:"Settings",navId:"settings",icon:i.jsx(Pl,{size:12})}];function L$(e){const t=e.trim().toLowerCase();if(!t)return{events:[],pages:[],actions:[],total:0};const r=(...s)=>s.some(l=>l.toLowerCase().includes(t)),n=Z6.filter(s=>r(s.title,s.subtitle,s.location,s.type,s.status)),o=R$.filter(s=>r(s.title,s.section,s.description)),a=Rie.filter(s=>r(s.title,s.description));return{events:n,pages:o,actions:a,total:n.length+o.length+a.length}}function C1({text:e,q:t}){if(!t.trim())return i.jsx(i.Fragment,{children:e});const r=e.toLowerCase().indexOf(t.toLowerCase());return r===-1?i.jsx(i.Fragment,{children:e}):i.jsxs(i.Fragment,{children:[e.slice(0,r),i.jsx("mark",{style:{background:"var(--accent)",color:"var(--accent-foreground)",borderRadius:"2px",padding:"0 1px"},children:e.slice(r,r+t.length)}),e.slice(r+t.length)]})}function TI({query:e,results:t,activeIndex:r,onEventClick:n,onPageClick:o,onActionClick:a,onViewAll:s}){const l=e.trim(),c=t?Math.min(t.events.length,4):0,u=t?Math.min(t.pages.length,5):0;t&&Math.min(t.actions.length,3);const d=c,f=c+u,h=({label:p,count:y})=>i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px 4px"},children:[i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"700",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.07em"},children:p}),i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",background:"var(--secondary)",padding:"1px 6px",borderRadius:"999px"},children:y})]});return l?!t||t.total===0?i.jsxs("div",{style:{padding:"28px 14px",textAlign:"center"},children:[i.jsx(Pi,{size:20,style:{color:"var(--border)",margin:"0 auto 10px"}}),i.jsxs("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:['No results for "',l,'"']}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Try a different search term"})]}):i.jsxs("div",{children:[t.events.length>0&&i.jsxs("div",{children:[i.jsx(h,{label:"Events",count:t.events.length}),t.events.slice(0,4).map((p,y)=>{const m=aE[p.status],x=r===y;return i.jsxs("button",{onClick:()=>n(p),style:{display:"flex",alignItems:"center",gap:"10px",width:"100%",padding:"8px 14px",textAlign:"left",background:x?"var(--accent)":"none",border:"none",cursor:"pointer",transition:"background 0.1s"},onMouseEnter:b=>{b.currentTarget.style.background="var(--secondary)"},onMouseLeave:b=>{b.currentTarget.style.background=x?"var(--accent)":"none"},children:[i.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:m.dot??m.color,flexShrink:0}}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"0 0 1px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i.jsx(C1,{text:p.title,q:l})}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"3px"},children:[i.jsx(lb,{size:9}),p.location]}),i.jsx("span",{style:{margin:"0 6px",color:"var(--border)"},children:"·"}),i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"3px"},children:[i.jsx(Wi,{size:9}),p.startDate]})]})]}),i.jsx("span",{style:{padding:"1px 7px",borderRadius:"999px",background:m.bg,color:m.color,fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",flexShrink:0},children:p.status})]},p.id)}),t.events.length>4&&i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",padding:"4px 14px 6px",margin:0},children:["+",t.events.length-4," more event",t.events.length-4>1?"s":""]})]}),t.events.length>0&&t.pages.length>0&&i.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"4px 0"}}),t.pages.length>0&&i.jsxs("div",{children:[i.jsx(h,{label:"Pages",count:t.pages.length}),t.pages.slice(0,5).map((p,y)=>{const m=r===d+y;return i.jsxs("button",{onClick:()=>o(p),style:{display:"flex",alignItems:"center",gap:"10px",width:"100%",padding:"7px 14px",textAlign:"left",background:m?"var(--accent)":"none",border:"none",cursor:"pointer",transition:"background 0.1s"},onMouseEnter:x=>{x.currentTarget.style.background="var(--secondary)"},onMouseLeave:x=>{x.currentTarget.style.background=m?"var(--accent)":"none"},children:[i.jsx("div",{style:{width:"26px",height:"26px",borderRadius:"var(--radius-button)",background:"var(--secondary)",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"var(--primary)"},children:p.icon}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"0 0 1px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i.jsx(C1,{text:p.title,q:l})}),i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:p.section})]}),i.jsx(va,{size:12,style:{color:"var(--muted)",flexShrink:0}})]},p.id)})]}),(t.events.length>0||t.pages.length>0)&&t.actions.length>0&&i.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"4px 0"}}),t.actions.length>0&&i.jsxs("div",{children:[i.jsx(h,{label:"Quick Actions",count:t.actions.length}),t.actions.slice(0,3).map((p,y)=>{const m=r===f+y;return i.jsxs("button",{onClick:()=>a(p),style:{display:"flex",alignItems:"center",gap:"10px",width:"100%",padding:"7px 14px",textAlign:"left",background:m?"var(--accent)":"none",border:"none",cursor:"pointer",transition:"background 0.1s"},onMouseEnter:x=>{x.currentTarget.style.background="var(--secondary)"},onMouseLeave:x=>{x.currentTarget.style.background=m?"var(--accent)":"none"},children:[i.jsx("div",{style:{width:"26px",height:"26px",borderRadius:"var(--radius-button)",background:"var(--accent)",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"var(--accent-foreground)"},children:p.icon}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"0 0 1px"},children:i.jsx(C1,{text:p.title,q:l})}),i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i.jsx(C1,{text:p.description,q:l})})]}),i.jsx("span",{style:{padding:"2px 8px",borderRadius:"var(--radius-button)",background:"var(--accent)",color:"var(--accent-foreground)",fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",flexShrink:0},children:"Go"})]},p.id)})]}),i.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"4px 0 0"},children:i.jsxs("button",{onClick:s,style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"10px 14px",background:"none",border:"none",cursor:"pointer",borderRadius:"0 0 var(--radius-card) var(--radius-card)",transition:"background 0.1s"},onMouseEnter:p=>{p.currentTarget.style.background="var(--secondary)"},onMouseLeave:p=>{p.currentTarget.style.background="none"},children:[i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--primary)"},children:["View all ",t.total," result",t.total!==1?"s":"",' for "',l,'"']}),i.jsx(O6,{size:13,style:{color:"var(--primary)",flexShrink:0}})]})})]}):i.jsxs("div",{children:[i.jsxs("div",{style:{padding:"12px 14px 8px"},children:[i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"700",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.07em",marginBottom:"8px"},children:"Suggested"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:Lie.map(p=>i.jsxs("button",{onClick:()=>o({id:p.navId,navId:p.navId,title:p.label,section:"",description:"",icon:p.icon}),style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"4px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",cursor:"pointer",transition:"background 0.1s, border-color 0.1s"},onMouseEnter:y=>{y.currentTarget.style.borderColor="var(--primary)",y.currentTarget.style.color="var(--primary)"},onMouseLeave:y=>{y.currentTarget.style.borderColor="var(--border)",y.currentTarget.style.color="var(--card-foreground)"},children:[i.jsx("span",{style:{color:"var(--primary)"},children:p.icon}),p.label]},p.navId))})]}),i.jsx("div",{style:{borderTop:"1px solid var(--border)",margin:"4px 0"}}),i.jsxs("div",{style:{padding:"4px 14px 10px"},children:[i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"700",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.07em",marginBottom:"4px",paddingTop:"8px"},children:"Recent Events"}),Z6.slice(0,3).map(p=>{const y=aE[p.status];return i.jsxs("button",{onClick:()=>n(p),style:{display:"flex",alignItems:"center",gap:"10px",width:"100%",padding:"8px 0",textAlign:"left",background:"none",border:"none",borderBottom:"1px solid var(--border)",cursor:"pointer"},onMouseEnter:m=>{m.currentTarget.style.background="var(--secondary)",m.currentTarget.style.borderRadius="var(--radius-button)",m.currentTarget.style.paddingLeft="6px"},onMouseLeave:m=>{m.currentTarget.style.background="none",m.currentTarget.style.paddingLeft="0"},children:[i.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:y.dot??y.color,flexShrink:0}}),i.jsx("span",{style:{flex:1,fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:p.title}),i.jsx("span",{style:{padding:"1px 6px",borderRadius:"999px",background:y.bg,color:y.color,fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",flexShrink:0},children:p.status})]},p.id)})]})]})}function F$(e){var t;return e?e.firstName||e.lastName?[e.firstName,e.lastName].filter(Boolean).join(" ").trim():((t=e.email)==null?void 0:t.split("@")[0])??"User":"User"}function Fie(e){return F$(e).slice(0,2).toUpperCase()||"?"}function Mie(e,t){if(!e)return"Free";const r=t.find(n=>n.id===e);return r!=null&&r.name?r.name:e.replace(/[_-]+/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function Die(e,t){var s,l,c;const r=(s=e.subscription)==null?void 0:s.maxParticipants;if(r!=null&&Number.isFinite(Number(r)))return Number(r);const n=((l=e.subscription)==null?void 0:l.plan)??"free",o=t.find(u=>u.id===n),a=(c=o==null?void 0:o.defaultLimits)==null?void 0:c.maxParticipants;return a!=null&&Number.isFinite(Number(a))?Number(a):null}function zie(e){if(!e)return{desktop:"",mobile:"",title:""};const t=new Date(e);if(Number.isNaN(t.getTime()))return{desktop:"",mobile:"",title:""};const r=t.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}),n=t.toLocaleDateString("en-IN",{day:"numeric",month:"short"});return{desktop:` · Renews ${r}`,mobile:` · ${n}`,title:` Renews on ${r}.`}}function Bie({isMobile:e}){const{user:t}=Ur(),r=F$(t??null),n=Fie(t??null);return i.jsxs("button",{style:{display:"flex",alignItems:"center",gap:e?"0":"8px",padding:e?"4px":"4px 8px 4px 4px",borderRadius:"var(--radius-button)",background:"none",border:"none",cursor:"pointer"},onMouseEnter:o=>{o.currentTarget.style.background="var(--secondary)"},onMouseLeave:o=>{o.currentTarget.style.background="none"},children:[i.jsx("div",{style:{width:"26px",height:"26px",borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx("span",{style:{color:"#fff",fontSize:"10px",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)"},children:n})}),!e&&i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:r})]})}function Wie({onMenuClick:e,onNavigate:t,onEventSelect:r,onOpenSearchPage:n}){var $,q;const{user:o}=Ur(),{setActiveNav:a,setSettingsInitialSection:s}=eo(),[l,c]=j.useState(""),[u,d]=j.useState(!1),[f,h]=j.useState(-1),[p,y]=j.useState(!1),[m,x]=j.useState(!1),[b,w]=j.useState(null),[k,S]=j.useState([]),[_,P]=j.useState(0),O=qi(),T=O==="mobile",R=O==="tablet",I=j.useRef(null),E=j.useRef(null),A=j.useRef(null),F=j.useMemo(()=>l.trim()?L$(l):null,[l]),L=j.useMemo(()=>F?[...F.events.slice(0,4).map(Y=>({type:"event",data:Y})),...F.pages.slice(0,5).map(Y=>({type:"page",data:Y})),...F.actions.slice(0,3).map(Y=>({type:"action",data:Y}))]:[],[F]);j.useEffect(()=>{const Y=K=>{I.current&&!I.current.contains(K.target)&&(d(!1),h(-1))};return document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[]),j.useEffect(()=>{const Y=()=>P(K=>K+1);return window.addEventListener(oE,Y),()=>window.removeEventListener(oE,Y)},[]),j.useEffect(()=>{var K;if(!((K=o==null?void 0:o.organization)!=null&&K._id)){w(null),S([]);return}let Y=!1;return(async()=>{try{const[G,re]=await Promise.all([ls.get({cacheBust:_>0}),Ku.catalog().then(J=>J.plans).catch(()=>[])]);Y||(w(G),S(re))}catch{Y||(w(null),S([]))}})(),()=>{Y=!0}},[($=o==null?void 0:o.organization)==null?void 0:$._id,_]);const z=j.useMemo(()=>{var me,Oe,we;if(!((me=o==null?void 0:o.organization)!=null&&me._id)||!b)return null;const Y=(Oe=b.subscription)==null?void 0:Oe.plan,K=Mie(Y,k),G=Die(b,k),re=G==null?"Unlimited participants":`${G.toLocaleString("en-IN")} participants max`,J=zie((we=b.subscription)==null?void 0:we.expiresAt),ae=T?`${K} · ${G==null?"∞":G.toLocaleString("en-IN")}${J.mobile}`:`${K} · ${re}${J.desktop}`,le=`${K} — ${re}.${J.title} Open Billing in Settings.`;return{label:ae,title:le}},[(q=o==null?void 0:o.organization)==null?void 0:q._id,b,k,T]);j.useEffect(()=>{const Y=K=>{var G;(K.metaKey||K.ctrlKey)&&K.key==="k"&&(K.preventDefault(),T?(y(!0),setTimeout(()=>{var re;return(re=A.current)==null?void 0:re.focus()},50)):((G=E.current)==null||G.focus(),d(!0)))};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[T]);const V=Y=>{if(Y.key==="ArrowDown")Y.preventDefault(),h(K=>Math.min(K+1,L.length-1));else if(Y.key==="ArrowUp")Y.preventDefault(),h(K=>Math.max(K-1,-1));else if(Y.key==="Enter")if(f>=0&&L[f]){const K=L[f];Q(K)}else l.trim()&&B();else Y.key==="Escape"&&(d(!1),h(-1),y(!1))},Q=Y=>{Y.type==="event"?r==null||r(Y.data.id):Y.type==="page"?t==null||t(Y.data.navId):t==null||t(Y.data.navTarget),M()},U=Y=>{r==null||r(Y.id),M()},ee=Y=>{t==null||t(Y.navId),M()},H=Y=>{t==null||t(Y.navTarget),M()},B=()=>{n==null||n(l),M()},M=()=>{d(!1),h(-1),y(!1),c("")};return i.jsxs(i.Fragment,{children:[i.jsxs("header",{style:{height:"52px",display:"flex",alignItems:"center",justifyContent:"space-between",padding:T?"0 12px":"0 24px",background:"var(--card)",borderBottom:"1px solid var(--border)",flexShrink:0,zIndex:20,gap:"10px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flex:1,minWidth:0},children:[(T||R)&&i.jsx("button",{onClick:e,style:{width:"34px",height:"34px",display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",color:"var(--muted)",borderRadius:"var(--radius-button)",flexShrink:0},onMouseEnter:Y=>{Y.currentTarget.style.background="var(--secondary)",Y.currentTarget.style.color="var(--foreground)"},onMouseLeave:Y=>{Y.currentTarget.style.background="none",Y.currentTarget.style.color="var(--muted)"},"aria-label":"Open menu",children:i.jsx(pte,{size:18})}),T&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"7px"},children:[i.jsx("div",{style:{width:"26px",height:"26px",borderRadius:"6px",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx("span",{style:{color:"#fff",fontSize:"10px",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)"},children:"EB"})}),i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",fontSize:"var(--text-sm)",color:"var(--foreground)"},children:"EventBuzz"})]}),!T&&i.jsxs("div",{ref:I,style:{position:"relative"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"0 10px",height:"32px",width:R?"220px":"300px",background:"var(--secondary)",borderRadius:u?"var(--radius-button) var(--radius-button) 0 0":"var(--radius-button)",borderWidth:"1px",borderStyle:"solid",borderColor:m||u?"var(--ring)":"transparent",borderBottomColor:u?"transparent":m?"var(--ring)":"transparent",transition:"border-color 0.15s",boxShadow:u?"0 -1px 0 0 var(--ring)":"none"},children:[i.jsx(Pi,{size:13,style:{color:"var(--muted)",flexShrink:0}}),i.jsx("input",{ref:E,type:"text",value:l,placeholder:"Search events, pages, actions…",onChange:Y=>{c(Y.target.value),h(-1),d(!0)},onFocus:()=>{x(!0),d(!0)},onBlur:()=>x(!1),onKeyDown:V,style:{background:"transparent",border:"none",outline:"none",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",width:"100%"}}),l?i.jsx("button",{onClick:()=>{c(""),h(-1)},style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",padding:"0",flexShrink:0},children:i.jsx(er,{size:12})}):!R&&i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",flexShrink:0,background:"var(--border)",padding:"1px 5px",borderRadius:"3px"},children:"⌘K"})]}),u&&i.jsx("div",{style:{position:"absolute",top:"32px",left:0,width:R?"340px":"420px",background:"var(--card)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--ring)",borderTop:"none",borderRadius:"0 var(--radius-card) var(--radius-card) var(--radius-card)",boxShadow:"var(--elevation-sm)",zIndex:200,maxHeight:"440px",overflowY:"auto"},children:i.jsx(TI,{query:l,results:F,activeIndex:f,onEventClick:U,onPageClick:ee,onActionClick:H,onViewAll:B})})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",flexShrink:0},children:[T&&i.jsx("button",{"aria-label":"Search",onClick:()=>{y(!0),setTimeout(()=>{var Y;return(Y=A.current)==null?void 0:Y.focus()},60)},style:{width:"34px",height:"34px",display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",color:"var(--muted)",borderRadius:"var(--radius-button)"},onMouseEnter:Y=>{Y.currentTarget.style.background="var(--secondary)",Y.currentTarget.style.color="var(--foreground)"},onMouseLeave:Y=>{Y.currentTarget.style.background="none",Y.currentTarget.style.color="var(--muted)"},children:i.jsx(Pi,{size:16})}),z&&i.jsxs("button",{type:"button","aria-label":z.title,title:z.title,onClick:()=>{s("billing"),a("settings")},style:{display:"inline-flex",alignItems:"center",gap:"6px",maxWidth:T?"min(46vw, 200px)":"none",padding:"4px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",cursor:"pointer",flexShrink:1,minWidth:0},onMouseEnter:Y=>{Y.currentTarget.style.background="var(--accent)",Y.currentTarget.style.borderColor="var(--primary)"},onMouseLeave:Y=>{Y.currentTarget.style.background="var(--secondary)",Y.currentTarget.style.borderColor="var(--border)"},children:[i.jsx(ov,{size:14,style:{color:"var(--primary)",flexShrink:0},"aria-hidden":!0}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:"left",color:"var(--primary)"},children:z.label})]}),i.jsxs("button",{style:{position:"relative",width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",cursor:"pointer",color:"var(--muted)",borderRadius:"var(--radius-button)"},"aria-label":"Notifications (3 unread)",onMouseEnter:Y=>{Y.currentTarget.style.background="var(--secondary)",Y.currentTarget.style.color="var(--foreground)"},onMouseLeave:Y=>{Y.currentTarget.style.background="none",Y.currentTarget.style.color="var(--muted)"},children:[i.jsx(I6,{size:16}),i.jsx("span",{style:{position:"absolute",top:"4px",right:"4px",minWidth:"14px",height:"14px",borderRadius:"999px",background:"var(--destructive)",border:"2px solid var(--card)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"8px",fontFamily:"var(--font-inter)",fontWeight:"700",color:"var(--destructive-foreground)",padding:"0 2px",lineHeight:1},children:"3"})]}),i.jsx("div",{style:{width:"1px",height:"20px",background:"var(--border)",margin:"0 2px"}}),i.jsx(Bie,{isMobile:T})]})]}),p&&i.jsxs("div",{style:{position:"fixed",inset:0,zIndex:300,display:"flex",flexDirection:"column"},children:[i.jsx("div",{onClick:()=>y(!1),style:{position:"absolute",inset:0,background:"rgba(0,0,0,0.5)"}}),i.jsxs("div",{style:{position:"relative",background:"var(--card)",boxShadow:"var(--elevation-sm)",display:"flex",flexDirection:"column",maxHeight:"90vh"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 14px",borderBottom:"1px solid var(--border)"},children:[i.jsx(Pi,{size:16,style:{color:"var(--muted)",flexShrink:0}}),i.jsx("input",{ref:A,type:"text",value:l,placeholder:"Search events, pages, actions…",onChange:Y=>{c(Y.target.value),h(-1)},onKeyDown:V,style:{flex:1,background:"transparent",border:"none",outline:"none",fontSize:"var(--text-base)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"}}),l&&i.jsx("button",{onClick:()=>c(""),style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",padding:"2px"},children:i.jsx(er,{size:14})}),i.jsx("button",{onClick:()=>{y(!1),c("")},style:{background:"none",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--primary)",padding:"4px 0 4px 4px",flexShrink:0},children:"Cancel"})]}),i.jsx("div",{style:{overflowY:"auto",flex:1},children:i.jsx(TI,{query:l,results:F,activeIndex:f,onEventClick:U,onPageClick:ee,onActionClick:H,onViewAll:B})})]})]})]})}const M$=[{id:"dashboard",label:"Dashboard",shortLabel:"Dash",icon:i.jsx(Qee,{size:13})},{id:"participants",label:"Participants",shortLabel:"People",icon:i.jsx(vi,{size:13})},{id:"permissions",label:"Users & Permissions",shortLabel:"Permissions",icon:i.jsx(Dte,{size:13})},{id:"questions",label:"Questions",shortLabel:"Q&A",icon:i.jsx(ch,{size:13})},{id:"quiz",label:"Quiz & Polls",shortLabel:"Quiz",icon:i.jsx(nu,{size:13})},{id:"rewards",label:"Reward Points",shortLabel:"Rewards",icon:i.jsx(od,{size:13})},{id:"ticketing",label:"Ticketing",shortLabel:"Tickets",icon:i.jsx(Kte,{size:13})},{id:"analytics",label:"Analytics",shortLabel:"Analytics",icon:i.jsx(jq,{size:13})}],qie=new Set([...M$.map(e=>e.id),"website"]);function $ie({activeItem:e,onNavigate:t}){const r=j.useRef(null),o=qi()==="mobile",[a,s]=j.useState(!1),[l,c]=j.useState(!1);return j.useEffect(()=>{const u=r.current;if(!u)return;const d=()=>{c(u.scrollLeft>4),s(u.scrollLeft+u.clientWidth<u.scrollWidth-4)};return d(),u.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d),()=>{u.removeEventListener("scroll",d),window.removeEventListener("resize",d)}},[]),i.jsxs("div",{style:{flexShrink:0,background:"var(--card)",borderBottom:"1px solid var(--border)",zIndex:20,display:"flex",alignItems:"stretch",height:o?"40px":"44px",position:"relative"},children:[l&&i.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:"32px",zIndex:2,background:"linear-gradient(to right, var(--card) 0%, transparent 100%)",pointerEvents:"none"}}),i.jsx("div",{ref:r,style:{display:"flex",alignItems:"stretch",flex:1,overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none"},children:M$.map(u=>{const d=e===u.id;return i.jsxs("button",{onClick:()=>t(u.id),style:{display:"flex",alignItems:"center",gap:o?"4px":"6px",padding:o?"0 10px":"0 16px",height:"100%",background:"transparent",borderTopWidth:0,borderTopStyle:"solid",borderTopColor:"transparent",borderLeftWidth:0,borderLeftStyle:"solid",borderLeftColor:"transparent",borderRightWidth:0,borderRightStyle:"solid",borderRightColor:"transparent",borderBottomWidth:"2px",borderBottomStyle:"solid",borderBottomColor:d?"var(--primary)":"transparent",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:d?"var(--font-weight-medium)":"var(--font-weight-normal)",color:d?"var(--primary)":"var(--card-foreground)",whiteSpace:"nowrap",flexShrink:0,transition:"color 0.12s, border-color 0.12s, background 0.12s"},onMouseEnter:f=>{d||(f.currentTarget.style.background="var(--secondary)",f.currentTarget.style.color="var(--foreground)")},onMouseLeave:f=>{d||(f.currentTarget.style.background="transparent",f.currentTarget.style.color="var(--card-foreground)")},children:[i.jsx("span",{style:{color:d?"var(--primary)":"var(--muted)",display:"flex",flexShrink:0},children:u.icon}),o?u.shortLabel:u.label]},u.id)})}),a&&i.jsx("div",{style:{position:"absolute",right:0,top:0,bottom:0,width:"32px",zIndex:2,background:"linear-gradient(to left, var(--card) 0%, transparent 100%)",pointerEvents:"none"}})]})}function nc(e){return e==="dropdown"||e==="checkboxes"||e==="radio"}function ph(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_|_$/g,"")||"field"}function Uie(e){return{Conference:"conference",Workshop:"workshop",Summit:"summit",CME:"cme",Webinar:"webinar"}[e]||e.toLowerCase()}function Hie(e){return{Draft:"draft",Upcoming:"upcoming",Live:"live",Completed:"completed"}[e]||e.toLowerCase()}function J6(e){return{Physical:"physical",Virtual:"virtual",Hybrid:"hybrid"}[e]||e.toLowerCase()}function Bj(e){return new Date(e+"T12:00:00.000Z").toISOString()}function M0(e){const t=e==null?void 0:e.trim();if(!t)return null;const r=new Date(t);return Number.isNaN(r.getTime())?null:r.toISOString()}function Vie(e){var l;const t=M0(e.startLocal),r=M0(e.endLocal);if(!t||!r)throw new RangeError("Invalid start or end date/time.");if(new Date(r).getTime()<=new Date(t).getTime())throw new RangeError("End must be after start.");const n=e.locationTypeLabel.trim(),o=e.virtualLink.trim(),a=o&&!o.startsWith("http")?`https://${o}`:o,s={name:e.eventName.trim(),description:e.description.trim()||void 0,type:"conference",status:"draft",startDate:t,endDate:r,location:e.venue.trim()||void 0,locationType:J6(n),virtualLink:n==="Virtual"||n==="Hybrid"?a:void 0,bootstrapAgenda:!0,settings:{registrationOpen:!1,requiresApproval:!1,verifyEmail:!0,enableFeedback:!0,enableRatings:!1,authenticationType:"otp_email",registrationBaseFields:"name_email"},tags:[],metadata:{registrationCustomFields:[]}};return(l=e.organizationId)!=null&&l.trim()&&(s.organization=e.organizationId.trim()),s}function Yie(e){const t=(e||"physical").toLowerCase();return t==="virtual"?"Virtual":t==="hybrid"?"Hybrid":"Physical"}function D$(e,t,r){var p,y,m,x;const n=(t.eventName??e.name??"").trim();if(n.length<3)throw new RangeError("Event name must be at least 3 characters.");let o,a;if((p=t.startLocal)!=null&&p.trim()&&((y=t.endLocal)!=null&&y.trim())){const b=M0(t.startLocal),w=M0(t.endLocal);if(!b||!w)throw new RangeError("Invalid start or end date/time.");if(new Date(w).getTime()<=new Date(b).getTime())throw new RangeError("End must be after start.");o=b,a=w}else{const b=e.startDate,w=e.endDate;o=typeof b=="string"?b:new Date(b).toISOString(),a=typeof w=="string"?w:new Date(w).toISOString()}const s=((m=t.locationType)==null?void 0:m.trim())||Yie(e.locationType),l=(t.venue??e.location??"").trim(),c=(t.virtualLink??e.virtualLink??"").trim(),u=c&&!c.startsWith("http")?`https://${c}`:c,d=typeof e.type=="string"&&e.type.trim()?e.type.trim().toLowerCase():"conference",f=typeof e.status=="string"&&e.status.trim()?e.status.trim().toLowerCase():"draft",h={name:n,description:((x=e.description)==null?void 0:x.trim())||void 0,type:d,status:f,startDate:o,endDate:a,location:l||void 0,locationType:J6(s),virtualLink:(s==="Virtual"||s==="Hybrid")&&u||void 0,bootstrapAgenda:!0,settings:{registrationOpen:!1,requiresApproval:!1,verifyEmail:!0,enableFeedback:!0,enableRatings:!1,authenticationType:"otp_email",registrationBaseFields:"name_email"},tags:Array.isArray(e.tags)?e.tags.filter(b=>typeof b=="string"&&b.trim()):[],metadata:{registrationCustomFields:[]}};return r!=null&&r.trim()&&(h.organization=r.trim()),h}function z$(e){return{name:String(e.name??""),subtitle:e.subtitle!=null?String(e.subtitle):void 0,description:e.description!=null?String(e.description):void 0,type:e.type!=null?String(e.type):void 0,status:e.status!=null?String(e.status):void 0,startDate:String(e.startDate??""),endDate:String(e.endDate??""),location:e.location!=null?String(e.location):void 0,locationType:String(e.locationType??"physical"),virtualLink:e.virtualLink!=null?String(e.virtualLink):void 0,tags:Array.isArray(e.tags)?e.tags.map(String):void 0}}function B$(e,t){const r=e.registrationRequired==="Yes",n=e.registrationMode;let o=!0,a=!1;r?(n==="Invite Only"&&(o=!1),n==="Approval Required"&&(a=!0)):o=!1;const s=e.virtualLink.trim(),l=s&&!s.startsWith("http")?`https://${s}`:s,c=e.eventType.trim()||"Conference",u=e.status.trim()||"Draft",d=e.locationType.trim()||"Physical",f=(t==null?void 0:t.tags)!=null?t.tags.map(h=>String(h).trim()).filter(Boolean):e.keyPeople.split(/[,;]/).map(h=>h.trim()).filter(Boolean);return{name:e.eventName.trim(),description:e.description.trim()||void 0,type:Uie(c),status:Hie(u),startDate:Bj(e.startDate.trim()),endDate:Bj(e.endDate.trim()),location:e.venue.trim()||void 0,locationType:J6(d),virtualLink:(d==="Virtual"||d==="Hybrid")&&l||void 0,image:e.eventLogo||void 0,bannerImage:e.eventBanner||void 0,tags:f,settings:{registrationOpen:o,requiresApproval:a,registrationMode:n||void 0,verifyEmail:e.verifyEmail==="Yes",registrationDeadline:e.registrationDeadline?Bj(e.registrationDeadline.trim()):void 0,authenticationType:e.authenticationType||void 0,registrationBaseFields:e.registrationBaseFields||void 0,enableFeedback:e.enableFeedback==="Yes",enableRatings:e.enableRatings==="Yes"},metadata:{registrationCustomFields:e.customFields.filter(h=>h.label.trim()).map(h=>({label:h.label.trim(),code:(h.code.trim()||ph(h.label)).replace(/[^a-z0-9_]/gi,"_"),fieldType:h.fieldType,options:nc(h.fieldType)?h.options.filter(p=>p.label.trim()&&p.value.trim()).map(p=>({value:p.value.trim(),label:p.label.trim()})):[]}))}}}const Xr={width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",outline:"none",boxSizing:"border-box"},Ra={...Xr,cursor:"pointer",appearance:"none",paddingRight:"32px"};function ur({text:e,required:t}){return i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)",marginBottom:"5px"},children:[t&&i.jsx("span",{style:{color:"var(--destructive)",marginRight:"2px"},children:"*"}),e]})}function lr({children:e,error:t}){return i.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e,t?i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--destructive)",margin:"5px 0 0",lineHeight:1.35},children:t}):null]})}function No({children:e}){return i.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},children:e})}function La({children:e}){return i.jsxs("div",{style:{position:"relative"},children:[e,i.jsx(po,{size:14,style:{position:"absolute",right:10,top:"50%",transform:"translateY(-50%)",color:"var(--muted)",pointerEvents:"none"}})]})}function wf({name:e,value:t,onChange:r,options:n}){return i.jsx("div",{style:{display:"flex",gap:"20px",alignItems:"center",flexWrap:"wrap"},children:n.map(o=>i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:[i.jsx("input",{type:"radio",name:e,value:o.value,checked:t===o.value,onChange:()=>r(o.value),style:{accentColor:"var(--primary)",width:"16px",height:"16px",cursor:"pointer"}}),o.label]},o.value))})}function D0({label:e,preview:t,error:r,inputRef:n,onFile:o}){return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsxs("div",{onClick:()=>{var a;return(a=n.current)==null?void 0:a.click()},onDragOver:a=>a.preventDefault(),onDrop:a=>{a.preventDefault();const s=a.dataTransfer.files[0];if(s!=null&&s.type.startsWith("image/")){const l=new FileReader;l.onload=()=>{typeof l.result=="string"&&o(l.result)},l.readAsDataURL(s)}},style:{border:`1.5px dashed ${r?"var(--destructive)":"var(--primary)"}`,borderRadius:"var(--radius-button)",background:"var(--secondary)",padding:"16px 12px",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",cursor:"pointer"},children:[i.jsx("input",{ref:n,type:"file",accept:"image/*",style:{display:"none"},onChange:a=>{var l;const s=(l=a.target.files)==null?void 0:l[0];if(s){const c=new FileReader;c.onload=()=>{typeof c.result=="string"&&o(c.result)},c.readAsDataURL(s)}}}),t?i.jsx("img",{src:t,alt:"",style:{maxHeight:72,maxWidth:"100%",objectFit:"contain",borderRadius:4}}):i.jsx(ou,{size:22,style:{color:"var(--primary)"}}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",textAlign:"center",margin:0},children:["Drag and drop or ",i.jsxs("span",{style:{color:"var(--primary)",textDecoration:"underline"},children:["select ",e]})]})]}),r?i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",margin:0},children:r}):null]})}function Gie({n:e,state:t}){const r=t==="todo"?"var(--muted)":"var(--primary)";return i.jsx("div",{style:{width:28,height:28,borderRadius:"50%",background:r,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t==="done"?i.jsx(Oi,{size:13,style:{color:"#fff"}}):i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-inter)",color:"#fff",fontWeight:"var(--font-weight-medium)"},children:e})})}function Sf({n:e,title:t,subtitle:r,open:n,completed:o,onToggle:a,children:s,onNext:l,nextLabel:c,nextDisabled:u}){const d=n?"active":o?"done":"todo";return i.jsxs("div",{style:{borderBottom:"1px solid var(--border)"},children:[i.jsxs("button",{type:"button",onClick:a,style:{width:"100%",display:"flex",alignItems:"center",gap:"12px",padding:"14px 20px",background:"none",border:"none",cursor:"pointer",textAlign:"left"},children:[i.jsx(Gie,{n:e,state:d}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:n?"var(--primary)":"var(--card-foreground)",margin:0},children:t}),!n&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:r})]}),n?i.jsx($f,{size:18,style:{color:"var(--muted)"}}):i.jsx(po,{size:18,style:{color:"var(--muted)"}})]}),n&&i.jsxs("div",{style:{padding:"0 20px 16px"},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"0 0 14px 40px"},children:r}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:s}),i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"12px",marginTop:"18px",paddingTop:"12px",borderTop:"1px solid var(--border)"},children:[o&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px",fontSize:"var(--text-xs)",color:"var(--primary)"},children:[i.jsx(Oi,{size:12})," Complete"]}),i.jsx("button",{type:"button",disabled:u,onClick:l,style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 16px",borderRadius:"var(--radius-button)",background:u?"var(--secondary)":"var(--primary)",color:u?"var(--muted)":"var(--primary-foreground)",border:"none",cursor:u?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:c})]})]})]})}const eT=[{label:"Text",value:"text"},{label:"Textarea",value:"textarea"},{label:"Dropdown",value:"dropdown"},{label:"Checkboxes",value:"checkboxes"},{label:"Radio",value:"radio"},{label:"Yes / No",value:"yes_no"},{label:"Stars (rating)",value:"stars"},{label:"Image upload",value:"image_upload"},{label:"File upload",value:"file_upload"}],tT=[{label:"OTP on Email",value:"otp_email"},{label:"Link on Email",value:"link_email"},{label:"None",value:"none"}],rT=[{label:"Name & Email",value:"name_email"},{label:"Email Only",value:"email_only"},{label:"Name, Email & Phone",value:"name_email_phone"},{label:"Anonymous with Name",value:"anonymous_name"},{label:"Anonymous",value:"anonymous"}],W$=new Set(tT.map(e=>e.value)),q$=new Set(rT.map(e=>e.value));function $$(){return{id:Math.random().toString(36).slice(2),label:"",code:"",codeAuto:!0,fieldType:"text",options:[]}}const PI={eventName:"",eventType:"",description:"",status:"",locationType:"",venue:"",virtualLink:"",startDate:"",endDate:"",registrationRequired:"No",registrationMode:"",verifyEmail:"Yes",registrationDeadline:"",authenticationType:"otp_email",registrationBaseFields:"name_email",enableFeedback:"Yes",enableRatings:"No",keyPeople:"",eventLogo:null,eventBanner:null,customFields:[]};function Wj(e){if(!e)return"";const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":t.toISOString().slice(0,10)}function Kie(e){const t=(e||"conference").toLowerCase();return{conference:"Conference",workshop:"Workshop",summit:"Summit",cme:"CME",webinar:"Webinar"}[t]||"Conference"}function Qie(e){const t=(e||"draft").toLowerCase();return{draft:"Draft",upcoming:"Upcoming",live:"Live",completed:"Completed"}[t]||"Draft"}function Xie(e){const t=(e||"physical").toLowerCase();return t==="virtual"?"Virtual":t==="hybrid"?"Hybrid":"Physical"}function Zie(e){const t=typeof e=="string"?e:"";return W$.has(t)?t:"otp_email"}function Jie(e){const t=typeof e=="string"?e:"";return q$.has(t)?t:"name_email"}function z0(e){const t=e.settings||{};let r="No",n="";const o=t.registrationMode;o==="Invite Only"?(r="Yes",n="Invite Only"):o==="Approval Required"||t.requiresApproval===!0?(r="Yes",n="Approval Required"):o==="Open"||t.registrationOpen===!0?(r="Yes",n="Open"):t.registrationOpen===!1&&t.requiresApproval===!1&&!o?r="No":(t.registrationOpen||t.requiresApproval)&&(r="Yes",n=t.requiresApproval?"Approval Required":"Open");const l=((e.metadata||{}).registrationCustomFields||[]).map(d=>{const f=d.options||[],h=d.fieldType||"text";return{id:Math.random().toString(36).slice(2),label:String(d.label||""),code:String(d.code||ph(String(d.label||""))),codeAuto:!d.code,fieldType:nc(h)||eT.some(p=>p.value===h)?h:"text",options:nc(h)?(f.length?f:[{value:"",label:""}]).map(p=>({id:Math.random().toString(36).slice(2),value:String(p.value??""),label:String(p.label??"")})):[]}}),c=String(e.virtualLink||""),u=Xie(e.locationType);return{eventName:String(e.name||""),eventType:Kie(e.type),description:String(e.description||e.subtitle||""),status:Qie(e.status),locationType:u,venue:u==="Virtual"?"":String(e.location||""),virtualLink:u==="Physical"?"":c,startDate:Wj(e.startDate),endDate:Wj(e.endDate),registrationRequired:r,registrationMode:n,verifyEmail:t.verifyEmail===!1?"No":"Yes",registrationDeadline:t.registrationDeadline?Wj(t.registrationDeadline):"",authenticationType:Zie(t.authenticationType),registrationBaseFields:Jie(t.registrationBaseFields),enableFeedback:t.enableFeedback===!1?"No":"Yes",enableRatings:t.enableRatings===!0?"Yes":"No",keyPeople:Array.isArray(e.tags)?e.tags.join(", "):"",eventLogo:e.image||null,eventBanner:e.bannerImage||null,customFields:l}}function eoe(e,t){const r=z0(t),n=o=>o.trim();return{eventName:n(e.eventName)||r.eventName,description:e.description,eventType:e.eventType||r.eventType,status:e.status||r.status,locationType:e.locationType||r.locationType,venue:e.venue,virtualLink:e.virtualLink,startDate:n(e.startDate)||r.startDate,endDate:n(e.endDate)||r.endDate,registrationRequired:e.registrationRequired,registrationMode:e.registrationMode||r.registrationMode,verifyEmail:e.verifyEmail,registrationDeadline:e.registrationDeadline,authenticationType:e.authenticationType||r.authenticationType,registrationBaseFields:e.registrationBaseFields||r.registrationBaseFields,enableFeedback:e.enableFeedback,enableRatings:e.enableRatings,keyPeople:e.keyPeople,eventLogo:e.eventLogo,eventBanner:e.eventBanner,customFields:e.customFields}}function toe(e){const t={};if(e.locationType==="Virtual"||e.locationType==="Hybrid"){const r=e.virtualLink.trim();if(r)try{new URL(r.startsWith("http")?r:`https://${r}`)}catch{t.virtualLink="Enter a valid URL (e.g. https://…)."}}if(e.startDate&&e.endDate){const r=new Date(e.startDate);new Date(e.endDate)<r&&(t.endDate="End date must be on or after the start date.")}return t}function OI(e,t){const r={},n=e.eventName.trim();return n?n.length<3&&(r.eventName="Event name must be at least 3 characters."):r.eventName="Event name is required.",t!=null&&t.editMode||(e.eventType||(r.eventType="Please select an event type."),e.description.trim()||(r.description="Description is required.")),r}function II(e,t){const r={};if(!(t!=null&&t.editMode)&&!e.status&&(r.status="Please select a status."),e.locationType||(r.locationType="Please select a location type."),e.startDate||(r.startDate="Start date is required."),e.endDate||(r.endDate="End date is required."),e.startDate&&e.endDate){const n=new Date(e.startDate);new Date(e.endDate)<n&&(r.endDate="End date must be on or after the start date.")}if((e.locationType==="Physical"||e.locationType==="Hybrid")&&(e.venue.trim()||(r.venue="Venue or address is required for this location type.")),e.locationType==="Virtual"||e.locationType==="Hybrid"){const n=e.virtualLink.trim();if(!n)r.virtualLink="Meeting or stream URL is required.";else try{new URL(n.startsWith("http")?n:`https://${n}`)}catch{r.virtualLink="Enter a valid URL (e.g. https://…)."}}return r}function NI(e,t){if(t!=null&&t.editMode)return{};const r={};return e.eventLogo||(r.eventLogo="Event logo is required."),e.eventBanner||(r.eventBanner="Banner image is required."),r}function roe(e){const t={};return e.label.trim()||(t[`cf_${e.id}_label`]="Field label is required."),e.fieldType||(t[`cf_${e.id}_type`]="Select a field type."),(e.code.trim()||ph(e.label)).replace(/[^a-z0-9_]/gi,"_")||(t[`cf_${e.id}_code`]="Field code is required."),nc(e.fieldType)&&(e.options.filter(o=>o.label.trim()&&o.value.trim()).length===0&&(t[`cf_${e.id}_options`]="Add at least one option with both Value and Label."),e.options.forEach(o=>{const a=o.label.trim(),s=o.value.trim();a&&!s&&(t[`cf_${e.id}_opt_${o.id}`]="Value is required when Label is set."),s&&!a&&(t[`cf_${e.id}_opt_${o.id}`]="Label is required when Value is set.")})),t}function RI(e,t){const r={};return e.registrationRequired==="Yes"&&!e.registrationMode&&(r.registrationMode="Select a registration mode when registration is required."),!(t!=null&&t.editMode)&&e.registrationRequired==="Yes"&&((!e.authenticationType||!W$.has(e.authenticationType))&&(r.authenticationType="Select an authentication type."),(!e.registrationBaseFields||!q$.has(e.registrationBaseFields))&&(r.registrationBaseFields="Select registration base fields.")),t!=null&&t.editMode||e.customFields.forEach(n=>Object.assign(r,roe(n))),r}function noe(...e){return e.reduce((t,r)=>({...t,...r}),{})}function uf(e,t){const r={...e};return t.forEach(n=>{delete r[n]}),r}function qj(e){const t=["registrationMode","authenticationType","registrationBaseFields"];return e.customFields.forEach(r=>{t.push(`cf_${r.id}_label`,`cf_${r.id}_type`,`cf_${r.id}_code`,`cf_${r.id}_options`),r.options.forEach(n=>t.push(`cf_${r.id}_opt_${n.id}`))}),t}const $j=["eventName","eventType","description"],Uj=["status","locationType","startDate","endDate","venue","virtualLink"],Hj=["eventLogo","eventBanner"],Zg=4;function ioe({onClose:e,onSuccess:t,eventId:r}){const n=!!r,[o,a]=j.useState(1),[s,l]=j.useState(new Set),[c,u]=j.useState(PI),[d,f]=j.useState({}),[h,p]=j.useState(!1),[y,m]=j.useState(null),[x,b]=j.useState(null),[w,k]=j.useState(!!r),[S,_]=j.useState([]),P=j.useRef(null),O=j.useRef(null),T={editMode:n};j.useEffect(()=>{if(!r){k(!1),u(PI),_([]),l(new Set),a(1),b(null);return}k(!0),b(null),zr.get(r).then(q=>{if(k(!1),q.error||!q.data){b(q.error||"Could not load event.");return}const Y=q.data;u(z0(Y));const K=Y.tags;_(Array.isArray(K)?K.map(String):[]),l(new Set([1,2,3,4])),a(1)})},[r]);const R=j.useCallback((q,Y)=>{u(K=>({...K,[q]:Y}))},[]),I=Math.round(s.size/Zg*100),E=()=>u(q=>({...q,customFields:[...q.customFields,$$()]})),A=q=>{u(Y=>({...Y,customFields:Y.customFields.filter(K=>K.id!==q)})),f(Y=>{const K={...Y};return Object.keys(K).forEach(G=>{(G.startsWith(`cf_${q}_`)||G===`cf_${q}_label`)&&delete K[G]}),K})},F=(q,Y)=>{u(K=>({...K,customFields:K.customFields.map(G=>{if(G.id!==q)return G;const re={...G,label:Y};return G.codeAuto&&(re.code=ph(Y)),re})}))},L=(q,Y)=>{u(K=>({...K,customFields:K.customFields.map(G=>G.id===q?{...G,code:Y,codeAuto:!1}:G)}))},z=(q,Y)=>{u(K=>({...K,customFields:K.customFields.map(G=>{if(G.id!==q)return G;const re={...G,fieldType:Y};return nc(Y)&&G.options.length===0&&(re.options=[{id:Math.random().toString(36).slice(2),value:"",label:""}]),nc(Y)||(re.options=[]),re})}))},V=q=>{u(Y=>({...Y,customFields:Y.customFields.map(K=>K.id===q?{...K,options:[...K.options,{id:Math.random().toString(36).slice(2),value:"",label:""}]}:K)}))},Q=(q,Y)=>{u(K=>({...K,customFields:K.customFields.map(G=>G.id===q?{...G,options:G.options.filter(re=>re.id!==Y)}:G)})),f(K=>{const G={...K};return delete G[`cf_${q}_opt_${Y}`],G})},U=(q,Y,K,G)=>{u(re=>({...re,customFields:re.customFields.map(J=>J.id===q?{...J,options:J.options.map(ae=>ae.id===Y?{...ae,[K]:G}:ae)}:J)}))},ee=q=>{m(null);let Y={};if(q===1?Y=OI(c,T):q===2?Y=II(c,T):q===3?Y=NI(c,T):q===4&&(Y=RI(c,T)),Object.keys(Y).length>0){f(K=>{let G={...K};return q===1&&(G=uf(G,$j)),q===2&&(G=uf(G,Uj)),q===3&&(G=uf(G,Hj)),q===4&&(G=uf(G,qj(c))),{...G,...Y}}),a(q);return}q===1&&f(K=>uf(K,$j)),q===2&&f(K=>uf(K,Uj)),q===3&&f(K=>uf(K,Hj)),q===4&&f(K=>uf(K,qj(c))),l(K=>new Set([...K,q])),q<Zg&&a(q+1)},H=()=>B$(c,n?{tags:S}:void 0),B=async()=>{m(null);const q=noe(OI(c,T),II(c,T),NI(c,T),RI(c,T));if(Object.keys(q).length>0){f(q);for(const G of[1,2,3,4]){let re=[];if(G===1&&(re=$j),G===2&&(re=Uj),G===3&&(re=Hj),G===4&&(re=qj(c)),re.some(J=>q[J])){a(G);break}}return}f({}),p(!0);const Y=H(),K=n&&r?await zr.update(r,Y):await zr.create(Y);p(!1),K.data!=null&&!K.error?(t==null||t(),e()):m(K.error||"Could not save event. Please try again.")},M=q=>d[q],$=q=>a(Y=>Y===q?0:q);return i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:e,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:200}}),i.jsxs("div",{style:{position:"fixed",top:0,right:0,height:"100%",width:"min(580px, 100vw)",background:"var(--card)",zIndex:201,display:"flex",flexDirection:"column",boxShadow:"-4px 0 32px rgba(0,0,0,0.18)",animation:"slideInRight 0.25s ease"},children:[i.jsx("style",{children:"@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }"}),i.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)",flexShrink:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",marginBottom:"12px"},children:[i.jsxs("div",{children:[i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:n?"Edit Event":"Create New Event"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"4px 0 0"},children:n?"Update details and save.":"4 steps: Basic → Schedule → Media → Registration & form fields. Save submits when all are valid."})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:[i.jsx("button",{type:"button",onClick:e,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",color:"var(--muted)"},children:i.jsx(er,{size:14})}),i.jsx("button",{type:"button",disabled:h||w||!!x,onClick:()=>B(),style:{padding:"6px 14px",borderRadius:"var(--radius-button)",background:h||w||x?"var(--secondary)":"var(--primary)",color:h||w||x?"var(--muted)":"var(--primary-foreground)",border:"none",cursor:h||w||x?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:h?"Saving…":n?"Save changes":"Save event"})]})]}),x&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",margin:"0 0 8px"},children:x}),i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"6px"},children:[i.jsxs("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:[s.size," of ",Zg," sections complete"]}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",color:"var(--primary)",fontWeight:"var(--font-weight-medium)"},children:[I,"%"]})]}),i.jsx("div",{style:{height:"6px",borderRadius:"99px",background:"var(--border)",overflow:"hidden"},children:i.jsx("div",{style:{height:"100%",width:`${I}%`,background:"#22c55e",borderRadius:"99px",transition:"width 0.3s ease"}})})]}),i.jsxs("div",{style:{flex:1,overflowY:"auto",position:"relative"},children:[w&&i.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(255,255,255,0.85)",zIndex:5,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--muted)"},children:"Loading event…"}),i.jsxs(Sf,{n:1,title:"Basic Information",subtitle:"Core details about your event",open:o===1,completed:s.has(1),onToggle:()=>$(1),onNext:()=>ee(1),nextLabel:"Continue to Schedule & Location",nextDisabled:h,children:[i.jsxs(lr,{error:M("eventName"),children:[i.jsx(ur,{text:"Event Name",required:!0}),i.jsx("input",{style:{...Xr,...M("eventName")?{borderColor:"var(--destructive)"}:{}},value:c.eventName,onChange:q=>R("eventName",q.target.value)})]}),i.jsxs(lr,{error:M("eventType"),children:[i.jsx(ur,{text:"Event type",required:!n}),i.jsx(La,{children:i.jsxs("select",{style:{...Ra,...M("eventType")?{borderColor:"var(--destructive)"}:{}},value:c.eventType,onChange:q=>R("eventType",q.target.value),children:[i.jsx("option",{value:"",children:"Select Type"}),i.jsx("option",{children:"Conference"}),i.jsx("option",{children:"Workshop"}),i.jsx("option",{children:"Summit"}),i.jsx("option",{children:"CME"}),i.jsx("option",{children:"Webinar"})]})})]}),i.jsxs(lr,{error:M("description"),children:[i.jsx(ur,{text:"Description",required:!n}),i.jsx("textarea",{style:{...Xr,resize:"vertical",minHeight:"80px",...M("description")?{borderColor:"var(--destructive)"}:{}},value:c.description,onChange:q=>R("description",q.target.value)})]})]}),i.jsxs(Sf,{n:2,title:"Schedule & Location",subtitle:"When and where",open:o===2,completed:s.has(2),onToggle:()=>$(2),onNext:()=>ee(2),nextLabel:"Continue to Media & Tags",nextDisabled:h,children:[i.jsxs(No,{children:[i.jsxs(lr,{error:M("status"),children:[i.jsx(ur,{text:"Status",required:!n}),i.jsx(La,{children:i.jsxs("select",{style:{...Ra,...M("status")?{borderColor:"var(--destructive)"}:{}},value:c.status,onChange:q=>R("status",q.target.value),children:[i.jsx("option",{value:"",children:"Select Status"}),i.jsx("option",{children:"Draft"}),i.jsx("option",{children:"Upcoming"}),i.jsx("option",{children:"Live"}),i.jsx("option",{children:"Completed"})]})})]}),i.jsxs(lr,{error:M("locationType"),children:[i.jsx(ur,{text:"Location Type",required:!0}),i.jsx(La,{children:i.jsxs("select",{style:{...Ra,...M("locationType")?{borderColor:"var(--destructive)"}:{}},value:c.locationType,onChange:q=>R("locationType",q.target.value),children:[i.jsx("option",{value:"",children:"Select"}),i.jsx("option",{children:"Physical"}),i.jsx("option",{children:"Virtual"}),i.jsx("option",{children:"Hybrid"})]})})]})]}),(c.locationType==="Physical"||c.locationType==="Hybrid")&&i.jsxs(lr,{error:M("venue"),children:[i.jsx(ur,{text:"Venue / Address",required:!0}),i.jsx("input",{style:{...Xr,...M("venue")?{borderColor:"var(--destructive)"}:{}},value:c.venue,onChange:q=>R("venue",q.target.value)})]}),(c.locationType==="Virtual"||c.locationType==="Hybrid")&&i.jsxs(lr,{error:M("virtualLink"),children:[i.jsx(ur,{text:"Virtual link",required:!0}),i.jsx("input",{style:{...Xr,...M("virtualLink")?{borderColor:"var(--destructive)"}:{}},placeholder:"https://…",value:c.virtualLink,onChange:q=>R("virtualLink",q.target.value)})]}),i.jsxs(No,{children:[i.jsxs(lr,{error:M("startDate"),children:[i.jsx(ur,{text:"Start Date",required:!0}),i.jsx("input",{type:"date",style:{...Xr,...M("startDate")?{borderColor:"var(--destructive)"}:{}},value:c.startDate,onChange:q=>R("startDate",q.target.value)})]}),i.jsxs(lr,{error:M("endDate"),children:[i.jsx(ur,{text:"End Date",required:!0}),i.jsx("input",{type:"date",style:{...Xr,...M("endDate")?{borderColor:"var(--destructive)"}:{}},value:c.endDate,onChange:q=>R("endDate",q.target.value)})]})]})]}),i.jsxs(Sf,{n:3,title:"Media",subtitle:"Logo and banner (optional)",open:o===3,completed:s.has(3),onToggle:()=>$(3),onNext:()=>ee(3),nextLabel:"Continue to Registration",nextDisabled:h,children:[i.jsxs(No,{children:[i.jsxs(lr,{children:[i.jsx(ur,{text:"Event logo"}),i.jsx(D0,{label:"logo",preview:c.eventLogo,error:M("eventLogo"),inputRef:P,onFile:q=>{R("eventLogo",q),f(Y=>{const K={...Y};return delete K.eventLogo,K})}})]}),i.jsxs(lr,{children:[i.jsx(ur,{text:"Banner image"}),i.jsx(D0,{label:"banner",preview:c.eventBanner,error:M("eventBanner"),inputRef:O,onFile:q=>{R("eventBanner",q),f(Y=>{const K={...Y};return delete K.eventBanner,K})}})]})]}),i.jsxs(No,{children:[i.jsxs(lr,{children:[i.jsx(ur,{text:"Enable Feedback",required:!n}),i.jsx(wf,{name:"enableFeedback",value:c.enableFeedback,onChange:q=>R("enableFeedback",q),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]})]}),i.jsxs(lr,{children:[i.jsx(ur,{text:"Enable Ratings",required:!n}),i.jsx(wf,{name:"enableRatings",value:c.enableRatings,onChange:q=>R("enableRatings",q),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]})]})]})]}),i.jsxs(Sf,{n:4,title:"Registration & Form Fields",subtitle:"Registration rules and custom registration fields",open:o===4,completed:s.has(4),onToggle:()=>$(4),onNext:()=>B(),nextLabel:"Save event",nextDisabled:h,children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:0,fontFamily:"var(--font-noto-sans)"},children:"Registration settings"}),i.jsxs(No,{children:[i.jsxs(lr,{children:[i.jsx(ur,{text:"Registration Required",required:!0}),i.jsx(wf,{name:"regRequired",value:c.registrationRequired,onChange:q=>R("registrationRequired",q),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]})]}),i.jsxs(lr,{error:M("registrationMode"),children:[i.jsx(ur,{text:"Registration Mode",required:c.registrationRequired==="Yes"}),i.jsx(La,{children:i.jsxs("select",{style:{...Ra,...M("registrationMode")?{borderColor:"var(--destructive)"}:{}},value:c.registrationMode,onChange:q=>R("registrationMode",q.target.value),disabled:c.registrationRequired!=="Yes",children:[i.jsx("option",{value:"",children:c.registrationRequired==="Yes"?"Select mode":"N/A"}),i.jsx("option",{children:"Open"}),i.jsx("option",{children:"Invite Only"}),i.jsx("option",{children:"Approval Required"})]})})]})]}),i.jsxs(No,{children:[i.jsxs(lr,{children:[i.jsx(ur,{text:"Verify Email",required:!0}),i.jsx(wf,{name:"verifyEmail",value:c.verifyEmail,onChange:q=>R("verifyEmail",q),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]})]}),i.jsxs(lr,{children:[i.jsx(ur,{text:"Registration Deadline"}),i.jsx("input",{type:"date",style:Xr,value:c.registrationDeadline,onChange:q=>R("registrationDeadline",q.target.value)})]})]}),i.jsxs(No,{children:[i.jsxs(lr,{error:M("authenticationType"),children:[i.jsx(ur,{text:"Authentication Type",required:c.registrationRequired==="Yes"&&!n}),i.jsx(La,{children:i.jsx("select",{style:{...Ra,...M("authenticationType")?{borderColor:"var(--destructive)"}:{}},value:c.authenticationType,onChange:q=>R("authenticationType",q.target.value),disabled:c.registrationRequired!=="Yes",children:tT.map(q=>i.jsx("option",{value:q.value,children:q.label},q.value))})})]}),i.jsxs(lr,{error:M("registrationBaseFields"),children:[i.jsx(ur,{text:"Registration Base Fields",required:c.registrationRequired==="Yes"&&!n}),i.jsx(La,{children:i.jsx("select",{style:{...Ra,...M("registrationBaseFields")?{borderColor:"var(--destructive)"}:{}},value:c.registrationBaseFields,onChange:q=>R("registrationBaseFields",q.target.value),disabled:c.registrationRequired!=="Yes",children:rT.map(q=>i.jsx("option",{value:q.value,children:q.label},q.value))})})]})]}),i.jsxs("div",{style:{borderTop:"1px solid var(--border)",paddingTop:"12px",marginTop:"4px"},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 10px",fontFamily:"var(--font-noto-sans)"},children:"Custom registration fields (optional)"}),c.customFields.map((q,Y)=>i.jsxs("div",{style:{background:"var(--secondary)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"12px",marginBottom:"10px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"10px"},children:[i.jsxs("span",{style:{fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",fontFamily:"var(--font-noto-sans)"},children:["Field ",Y+1]}),i.jsx("button",{type:"button",onClick:()=>A(q.id),style:{background:"none",border:"none",cursor:"pointer",color:"var(--destructive)"},children:i.jsx(gn,{size:14})})]}),i.jsxs(No,{children:[i.jsxs(lr,{error:M(`cf_${q.id}_label`),children:[i.jsx(ur,{text:"Field Label",required:!0}),i.jsx("input",{style:{...Xr,...M(`cf_${q.id}_label`)?{borderColor:"var(--destructive)"}:{}},placeholder:"e.g. Dietary preference",value:q.label,onChange:K=>F(q.id,K.target.value)})]}),i.jsxs(lr,{error:M(`cf_${q.id}_code`),children:[i.jsx(ur,{text:"Field Code",required:!0}),i.jsx("input",{style:{...Xr,...M(`cf_${q.id}_code`)?{borderColor:"var(--destructive)"}:{},opacity:q.codeAuto?.92:1},placeholder:"auto from label",value:q.code||(q.codeAuto?ph(q.label):""),onChange:K=>L(q.id,K.target.value)}),i.jsx("p",{style:{fontSize:"10px",color:"var(--muted)",margin:"4px 0 0"},children:"Auto-updates from label until you edit it."})]})]}),i.jsxs(lr,{error:M(`cf_${q.id}_type`),children:[i.jsx(ur,{text:"Field Type",required:!0}),i.jsx(La,{children:i.jsx("select",{style:{...Ra,...M(`cf_${q.id}_type`)?{borderColor:"var(--destructive)"}:{}},value:q.fieldType,onChange:K=>z(q.id,K.target.value),children:eT.map(K=>i.jsx("option",{value:K.value,children:K.label},K.value))})})]}),nc(q.fieldType)&&i.jsxs("div",{style:{marginTop:"10px"},children:[i.jsx(ur,{text:"Options (Value & Label)",required:!0}),M(`cf_${q.id}_options`)&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",margin:"0 0 6px"},children:M(`cf_${q.id}_options`)}),q.options.map(K=>i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr auto",gap:"8px",alignItems:"start",marginBottom:"8px"},children:[i.jsx(lr,{error:M(`cf_${q.id}_opt_${K.id}`),children:i.jsx("input",{style:{...Xr,...M(`cf_${q.id}_opt_${K.id}`)?{borderColor:"var(--destructive)"}:{}},placeholder:"Value",value:K.value,onChange:G=>U(q.id,K.id,"value",G.target.value)})}),i.jsx(lr,{error:M(`cf_${q.id}_opt_${K.id}`),children:i.jsx("input",{style:{...Xr,...M(`cf_${q.id}_opt_${K.id}`)?{borderColor:"var(--destructive)"}:{}},placeholder:"Label",value:K.label,onChange:G=>U(q.id,K.id,"label",G.target.value)})}),i.jsx("button",{type:"button",onClick:()=>Q(q.id,K.id),style:{padding:"8px",border:"none",background:"transparent",cursor:"pointer",color:"var(--destructive)",marginTop:"4px"},"aria-label":"Remove option",children:i.jsx(gn,{size:14})})]},K.id)),i.jsxs("button",{type:"button",onClick:()=>V(q.id),style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"var(--radius-button)",border:"1px dashed var(--primary)",background:"var(--card)",color:"var(--primary)",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(wr,{size:12})," Add option"]})]})]},q.id)),i.jsxs("button",{type:"button",onClick:E,style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--primary)",background:"var(--secondary)",color:"var(--primary)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:13})," Add custom field"]})]})]})]}),i.jsxs("div",{style:{padding:"14px 20px",borderTop:"1px solid var(--border)",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"12px",background:"var(--card)"},children:[y&&i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",flex:1},children:y}),i.jsx("button",{type:"button",disabled:h,onClick:()=>B(),style:{padding:"8px 20px",borderRadius:"var(--radius-button)",background:h?"var(--secondary)":"var(--primary)",color:h?"var(--muted)":"var(--primary-foreground)",border:"none",cursor:h?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:h?"Saving…":"Save event"})]})]})]})}var Vj=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Jg={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return typeof console<"u"&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var r=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-r.getTime())/864e5-3+(r.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},ox={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},ss=function(e,t){return t===void 0&&(t=2),("000"+e).slice(t*-1)},jl=function(e){return e===!0?1:0};function LI(e,t){var r;return function(){var n=this,o=arguments;clearTimeout(r),r=setTimeout(function(){return e.apply(n,o)},t)}}var Yj=function(e){return e instanceof Array?e:[e]};function Ta(e,t,r){if(r===!0)return e.classList.add(t);e.classList.remove(t)}function pn(e,t,r){var n=window.document.createElement(e);return t=t||"",r=r||"",n.className=t,r!==void 0&&(n.textContent=r),n}function E1(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function U$(e,t){if(t(e))return e;if(e.parentNode)return U$(e.parentNode,t)}function A1(e,t){var r=pn("div","numInputWrapper"),n=pn("input","numInput "+e),o=pn("span","arrowUp"),a=pn("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?n.type="number":(n.type="text",n.pattern="\\d*"),t!==void 0)for(var s in t)n.setAttribute(s,t[s]);return r.appendChild(n),r.appendChild(o),r.appendChild(a),r}function Rs(e){try{if(typeof e.composedPath=="function"){var t=e.composedPath();return t[0]}return e.target}catch{return e.target}}var Gj=function(){},B0=function(e,t,r){return r.months[t?"shorthand":"longhand"][e]},ooe={D:Gj,F:function(e,t,r){e.setMonth(r.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,r){e.setHours(e.getHours()%12+12*jl(new RegExp(r.amPM[1],"i").test(t)))},M:function(e,t,r){e.setMonth(r.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(parseFloat(t)*1e3)},W:function(e,t,r){var n=parseInt(t),o=new Date(e.getFullYear(),0,2+(n-1)*7,0,0,0,0);return o.setDate(o.getDate()-o.getDay()+r.firstDayOfWeek),o},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:Gj,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:Gj,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},Hp={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},zy={Z:function(e){return e.toISOString()},D:function(e,t,r){return t.weekdays.shorthand[zy.w(e,t,r)]},F:function(e,t,r){return B0(zy.n(e,t,r)-1,!1,t)},G:function(e,t,r){return ss(zy.h(e,t,r))},H:function(e){return ss(e.getHours())},J:function(e,t){return t.ordinal!==void 0?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[jl(e.getHours()>11)]},M:function(e,t){return B0(e.getMonth(),!0,t)},S:function(e){return ss(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,r){return r.getWeek(e)},Y:function(e){return ss(e.getFullYear(),4)},d:function(e){return ss(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return ss(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return ss(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},H$=function(e){var t=e.config,r=t===void 0?Jg:t,n=e.l10n,o=n===void 0?ox:n,a=e.isMobile,s=a===void 0?!1:a;return function(l,c,u){var d=u||o;return r.formatDate!==void 0&&!s?r.formatDate(l,c,d):c.split("").map(function(f,h,p){return zy[f]&&p[h-1]!=="\\"?zy[f](l,d,r):f!=="\\"?f:""}).join("")}},sE=function(e){var t=e.config,r=t===void 0?Jg:t,n=e.l10n,o=n===void 0?ox:n;return function(a,s,l,c){if(!(a!==0&&!a)){var u=c||o,d,f=a;if(a instanceof Date)d=new Date(a.getTime());else if(typeof a!="string"&&a.toFixed!==void 0)d=new Date(a);else if(typeof a=="string"){var h=s||(r||Jg).dateFormat,p=String(a).trim();if(p==="today")d=new Date,l=!0;else if(r&&r.parseDate)d=r.parseDate(a,h);else if(/Z$/.test(p)||/GMT$/.test(p))d=new Date(a);else{for(var y=void 0,m=[],x=0,b=0,w="";x<h.length;x++){var k=h[x],S=k==="\\",_=h[x-1]==="\\"||S;if(Hp[k]&&!_){w+=Hp[k];var P=new RegExp(w).exec(a);P&&(y=!0)&&m[k!=="Y"?"push":"unshift"]({fn:ooe[k],val:P[++b]})}else S||(w+=".")}d=!r||!r.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),m.forEach(function(O){var T=O.fn,R=O.val;return d=T(d,R,u)||d}),d=y?d:void 0}}if(!(d instanceof Date&&!isNaN(d.getTime()))){r.errorHandler(new Error("Invalid date provided: "+f));return}return l===!0&&d.setHours(0,0,0,0),d}}};function Ms(e,t,r){return r===void 0&&(r=!0),r!==!1?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var aoe=function(e,t,r){return e>Math.min(t,r)&&e<Math.max(t,r)},Kj=function(e,t,r){return e*3600+t*60+r},soe=function(e){var t=Math.floor(e/3600),r=(e-t*3600)/60;return[t,r,e-t*3600-r*60]},loe={DAY:864e5};function Qj(e){var t=e.defaultHour,r=e.defaultMinute,n=e.defaultSeconds;if(e.minDate!==void 0){var o=e.minDate.getHours(),a=e.minDate.getMinutes(),s=e.minDate.getSeconds();t<o&&(t=o),t===o&&r<a&&(r=a),t===o&&r===a&&n<s&&(n=e.minDate.getSeconds())}if(e.maxDate!==void 0){var l=e.maxDate.getHours(),c=e.maxDate.getMinutes();t=Math.min(t,l),t===l&&(r=Math.min(c,r)),t===l&&r===c&&(n=e.maxDate.getSeconds())}return{hours:t,minutes:r,seconds:n}}typeof Object.assign!="function"&&(Object.assign=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var n=function(l){l&&Object.keys(l).forEach(function(c){return e[c]=l[c]})},o=0,a=t;o<a.length;o++){var s=a[o];n(s)}return e});var pa=function(){return pa=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},pa.apply(this,arguments)},FI=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var a=arguments[t],s=0,l=a.length;s<l;s++,o++)n[o]=a[s];return n},coe=300;function uoe(e,t){var r={config:pa(pa({},Jg),Xi.defaultConfig),l10n:ox};r.parseDate=sE({config:r.config,l10n:r.l10n}),r._handlers=[],r.pluginElements=[],r.loadedPlugins=[],r._bind=m,r._setHoursFromDate=h,r._positionCalendar=fe,r.changeMonth=B,r.changeYear=G,r.clear=M,r.close=$,r.onMouseOver=me,r._createElement=pn,r.createDay=P,r.destroy=q,r.isEnabled=re,r.jumpToDate=w,r.updateValue=Pe,r.open=we,r.redraw=je,r.set=vt,r.setDate=Ot,r.toggle=Pt;function n(){r.utils={getDaysInMonth:function(pe,xe){return pe===void 0&&(pe=r.currentMonth),xe===void 0&&(xe=r.currentYear),pe===1&&(xe%4===0&&xe%100!==0||xe%400===0)?29:r.l10n.daysInMonth[pe]}}}function o(){r.element=r.input=e,r.isOpen=!1,Me(),se(),Te(),Ae(),n(),r.isMobile||_(),b(),(r.selectedDates.length||r.config.noCalendar)&&(r.config.enableTime&&h(r.config.noCalendar?r.latestSelectedDateObj:void 0),Pe(!1)),l();var pe=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!r.isMobile&&pe&&fe(),At("onReady")}function a(){var pe;return((pe=r.calendarContainer)===null||pe===void 0?void 0:pe.getRootNode()).activeElement||document.activeElement}function s(pe){return pe.bind(r)}function l(){var pe=r.config;pe.weekNumbers===!1&&pe.showMonths===1||pe.noCalendar!==!0&&window.requestAnimationFrame(function(){if(r.calendarContainer!==void 0&&(r.calendarContainer.style.visibility="hidden",r.calendarContainer.style.display="block"),r.daysContainer!==void 0){var xe=(r.days.offsetWidth+1)*pe.showMonths;r.daysContainer.style.width=xe+"px",r.calendarContainer.style.width=xe+(r.weekWrapper!==void 0?r.weekWrapper.offsetWidth:0)+"px",r.calendarContainer.style.removeProperty("visibility"),r.calendarContainer.style.removeProperty("display")}})}function c(pe){if(r.selectedDates.length===0){var xe=r.config.minDate===void 0||Ms(new Date,r.config.minDate)>=0?new Date:new Date(r.config.minDate.getTime()),De=Qj(r.config);xe.setHours(De.hours,De.minutes,De.seconds,xe.getMilliseconds()),r.selectedDates=[xe],r.latestSelectedDateObj=xe}pe!==void 0&&pe.type!=="blur"&&Ze(pe);var tt=r._input.value;f(),Pe(),r._input.value!==tt&&r._debouncedChange()}function u(pe,xe){return pe%12+12*jl(xe===r.l10n.amPM[1])}function d(pe){switch(pe%24){case 0:case 12:return 12;default:return pe%12}}function f(){if(!(r.hourElement===void 0||r.minuteElement===void 0)){var pe=(parseInt(r.hourElement.value.slice(-2),10)||0)%24,xe=(parseInt(r.minuteElement.value,10)||0)%60,De=r.secondElement!==void 0?(parseInt(r.secondElement.value,10)||0)%60:0;r.amPM!==void 0&&(pe=u(pe,r.amPM.textContent));var tt=r.config.minTime!==void 0||r.config.minDate&&r.minDateHasTime&&r.latestSelectedDateObj&&Ms(r.latestSelectedDateObj,r.config.minDate,!0)===0,Le=r.config.maxTime!==void 0||r.config.maxDate&&r.maxDateHasTime&&r.latestSelectedDateObj&&Ms(r.latestSelectedDateObj,r.config.maxDate,!0)===0;if(r.config.maxTime!==void 0&&r.config.minTime!==void 0&&r.config.minTime>r.config.maxTime){var Ke=Kj(r.config.minTime.getHours(),r.config.minTime.getMinutes(),r.config.minTime.getSeconds()),Fe=Kj(r.config.maxTime.getHours(),r.config.maxTime.getMinutes(),r.config.maxTime.getSeconds()),Ve=Kj(pe,xe,De);if(Ve>Fe&&Ve<Ke){var xt=soe(Ke);pe=xt[0],xe=xt[1],De=xt[2]}}else{if(Le){var dt=r.config.maxTime!==void 0?r.config.maxTime:r.config.maxDate;pe=Math.min(pe,dt.getHours()),pe===dt.getHours()&&(xe=Math.min(xe,dt.getMinutes())),xe===dt.getMinutes()&&(De=Math.min(De,dt.getSeconds()))}if(tt){var Tt=r.config.minTime!==void 0?r.config.minTime:r.config.minDate;pe=Math.max(pe,Tt.getHours()),pe===Tt.getHours()&&xe<Tt.getMinutes()&&(xe=Tt.getMinutes()),xe===Tt.getMinutes()&&(De=Math.max(De,Tt.getSeconds()))}}p(pe,xe,De)}}function h(pe){var xe=pe||r.latestSelectedDateObj;xe&&xe instanceof Date&&p(xe.getHours(),xe.getMinutes(),xe.getSeconds())}function p(pe,xe,De){r.latestSelectedDateObj!==void 0&&r.latestSelectedDateObj.setHours(pe%24,xe,De||0,0),!(!r.hourElement||!r.minuteElement||r.isMobile)&&(r.hourElement.value=ss(r.config.time_24hr?pe:(12+pe)%12+12*jl(pe%12===0)),r.minuteElement.value=ss(xe),r.amPM!==void 0&&(r.amPM.textContent=r.l10n.amPM[jl(pe>=12)]),r.secondElement!==void 0&&(r.secondElement.value=ss(De)))}function y(pe){var xe=Rs(pe),De=parseInt(xe.value)+(pe.delta||0);(De/1e3>1||pe.key==="Enter"&&!/[^\d]/.test(De.toString()))&&G(De)}function m(pe,xe,De,tt){if(xe instanceof Array)return xe.forEach(function(Le){return m(pe,Le,De,tt)});if(pe instanceof Array)return pe.forEach(function(Le){return m(Le,xe,De,tt)});pe.addEventListener(xe,De,tt),r._handlers.push({remove:function(){return pe.removeEventListener(xe,De,tt)}})}function x(){At("onChange")}function b(){if(r.config.wrap&&["open","close","toggle","clear"].forEach(function(De){Array.prototype.forEach.call(r.element.querySelectorAll("[data-"+De+"]"),function(tt){return m(tt,"click",r[De])})}),r.isMobile){ft();return}var pe=LI(Oe,50);if(r._debouncedChange=LI(x,coe),r.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&m(r.daysContainer,"mouseover",function(De){r.config.mode==="range"&&me(Rs(De))}),m(r._input,"keydown",le),r.calendarContainer!==void 0&&m(r.calendarContainer,"keydown",le),!r.config.inline&&!r.config.static&&m(window,"resize",pe),window.ontouchstart!==void 0?m(window.document,"touchstart",K):m(window.document,"mousedown",K),m(window.document,"focus",K,{capture:!0}),r.config.clickOpens===!0&&(m(r._input,"focus",r.open),m(r._input,"click",r.open)),r.daysContainer!==void 0&&(m(r.monthNav,"click",rt),m(r.monthNav,["keyup","increment"],y),m(r.daysContainer,"click",Ne)),r.timeContainer!==void 0&&r.minuteElement!==void 0&&r.hourElement!==void 0){var xe=function(De){return Rs(De).select()};m(r.timeContainer,["increment"],c),m(r.timeContainer,"blur",c,{capture:!0}),m(r.timeContainer,"click",k),m([r.hourElement,r.minuteElement],["focus","click"],xe),r.secondElement!==void 0&&m(r.secondElement,"focus",function(){return r.secondElement&&r.secondElement.select()}),r.amPM!==void 0&&m(r.amPM,"click",function(De){c(De)})}r.config.allowInput&&m(r._input,"blur",ae)}function w(pe,xe){var De=pe!==void 0?r.parseDate(pe):r.latestSelectedDateObj||(r.config.minDate&&r.config.minDate>r.now?r.config.minDate:r.config.maxDate&&r.config.maxDate<r.now?r.config.maxDate:r.now),tt=r.currentYear,Le=r.currentMonth;try{De!==void 0&&(r.currentYear=De.getFullYear(),r.currentMonth=De.getMonth())}catch(Ke){Ke.message="Invalid date supplied: "+De,r.config.errorHandler(Ke)}xe&&r.currentYear!==tt&&(At("onYearChange"),F()),xe&&(r.currentYear!==tt||r.currentMonth!==Le)&&At("onMonthChange"),r.redraw()}function k(pe){var xe=Rs(pe);~xe.className.indexOf("arrow")&&S(pe,xe.classList.contains("arrowUp")?1:-1)}function S(pe,xe,De){var tt=pe&&Rs(pe),Le=De||tt&&tt.parentNode&&tt.parentNode.firstChild,Ke=Ht("increment");Ke.delta=xe,Le&&Le.dispatchEvent(Ke)}function _(){var pe=window.document.createDocumentFragment();if(r.calendarContainer=pn("div","flatpickr-calendar"),r.calendarContainer.tabIndex=-1,!r.config.noCalendar){if(pe.appendChild(V()),r.innerContainer=pn("div","flatpickr-innerContainer"),r.config.weekNumbers){var xe=H(),De=xe.weekWrapper,tt=xe.weekNumbers;r.innerContainer.appendChild(De),r.weekNumbers=tt,r.weekWrapper=De}r.rContainer=pn("div","flatpickr-rContainer"),r.rContainer.appendChild(U()),r.daysContainer||(r.daysContainer=pn("div","flatpickr-days"),r.daysContainer.tabIndex=-1),A(),r.rContainer.appendChild(r.daysContainer),r.innerContainer.appendChild(r.rContainer),pe.appendChild(r.innerContainer)}r.config.enableTime&&pe.appendChild(Q()),Ta(r.calendarContainer,"rangeMode",r.config.mode==="range"),Ta(r.calendarContainer,"animate",r.config.animate===!0),Ta(r.calendarContainer,"multiMonth",r.config.showMonths>1),r.calendarContainer.appendChild(pe);var Le=r.config.appendTo!==void 0&&r.config.appendTo.nodeType!==void 0;if((r.config.inline||r.config.static)&&(r.calendarContainer.classList.add(r.config.inline?"inline":"static"),r.config.inline&&(!Le&&r.element.parentNode?r.element.parentNode.insertBefore(r.calendarContainer,r._input.nextSibling):r.config.appendTo!==void 0&&r.config.appendTo.appendChild(r.calendarContainer)),r.config.static)){var Ke=pn("div","flatpickr-wrapper");r.element.parentNode&&r.element.parentNode.insertBefore(Ke,r.element),Ke.appendChild(r.element),r.altInput&&Ke.appendChild(r.altInput),Ke.appendChild(r.calendarContainer)}!r.config.static&&!r.config.inline&&(r.config.appendTo!==void 0?r.config.appendTo:window.document.body).appendChild(r.calendarContainer)}function P(pe,xe,De,tt){var Le=re(xe,!0),Ke=pn("span",pe,xe.getDate().toString());return Ke.dateObj=xe,Ke.$i=tt,Ke.setAttribute("aria-label",r.formatDate(xe,r.config.ariaDateFormat)),pe.indexOf("hidden")===-1&&Ms(xe,r.now)===0&&(r.todayDateElem=Ke,Ke.classList.add("today"),Ke.setAttribute("aria-current","date")),Le?(Ke.tabIndex=-1,Se(xe)&&(Ke.classList.add("selected"),r.selectedDateElem=Ke,r.config.mode==="range"&&(Ta(Ke,"startRange",r.selectedDates[0]&&Ms(xe,r.selectedDates[0],!0)===0),Ta(Ke,"endRange",r.selectedDates[1]&&Ms(xe,r.selectedDates[1],!0)===0),pe==="nextMonthDay"&&Ke.classList.add("inRange")))):Ke.classList.add("flatpickr-disabled"),r.config.mode==="range"&&ct(xe)&&!Se(xe)&&Ke.classList.add("inRange"),r.weekNumbers&&r.config.showMonths===1&&pe!=="prevMonthDay"&&tt%7===6&&r.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+r.config.getWeek(xe)+"</span>"),At("onDayCreate",Ke),Ke}function O(pe){pe.focus(),r.config.mode==="range"&&me(pe)}function T(pe){for(var xe=pe>0?0:r.config.showMonths-1,De=pe>0?r.config.showMonths:-1,tt=xe;tt!=De;tt+=pe)for(var Le=r.daysContainer.children[tt],Ke=pe>0?0:Le.children.length-1,Fe=pe>0?Le.children.length:-1,Ve=Ke;Ve!=Fe;Ve+=pe){var xt=Le.children[Ve];if(xt.className.indexOf("hidden")===-1&&re(xt.dateObj))return xt}}function R(pe,xe){for(var De=pe.className.indexOf("Month")===-1?pe.dateObj.getMonth():r.currentMonth,tt=xe>0?r.config.showMonths:-1,Le=xe>0?1:-1,Ke=De-r.currentMonth;Ke!=tt;Ke+=Le)for(var Fe=r.daysContainer.children[Ke],Ve=De-r.currentMonth===Ke?pe.$i+xe:xe<0?Fe.children.length-1:0,xt=Fe.children.length,dt=Ve;dt>=0&&dt<xt&&dt!=(xe>0?xt:-1);dt+=Le){var Tt=Fe.children[dt];if(Tt.className.indexOf("hidden")===-1&&re(Tt.dateObj)&&Math.abs(pe.$i-dt)>=Math.abs(xe))return O(Tt)}r.changeMonth(Le),I(T(Le),0)}function I(pe,xe){var De=a(),tt=J(De||document.body),Le=pe!==void 0?pe:tt?De:r.selectedDateElem!==void 0&&J(r.selectedDateElem)?r.selectedDateElem:r.todayDateElem!==void 0&&J(r.todayDateElem)?r.todayDateElem:T(xe>0?1:-1);Le===void 0?r._input.focus():tt?R(Le,xe):O(Le)}function E(pe,xe){for(var De=(new Date(pe,xe,1).getDay()-r.l10n.firstDayOfWeek+7)%7,tt=r.utils.getDaysInMonth((xe-1+12)%12,pe),Le=r.utils.getDaysInMonth(xe,pe),Ke=window.document.createDocumentFragment(),Fe=r.config.showMonths>1,Ve=Fe?"prevMonthDay hidden":"prevMonthDay",xt=Fe?"nextMonthDay hidden":"nextMonthDay",dt=tt+1-De,Tt=0;dt<=tt;dt++,Tt++)Ke.appendChild(P("flatpickr-day "+Ve,new Date(pe,xe-1,dt),dt,Tt));for(dt=1;dt<=Le;dt++,Tt++)Ke.appendChild(P("flatpickr-day",new Date(pe,xe,dt),dt,Tt));for(var Mt=Le+1;Mt<=42-De&&(r.config.showMonths===1||Tt%7!==0);Mt++,Tt++)Ke.appendChild(P("flatpickr-day "+xt,new Date(pe,xe+1,Mt%Le),Mt,Tt));var fr=pn("div","dayContainer");return fr.appendChild(Ke),fr}function A(){if(r.daysContainer!==void 0){E1(r.daysContainer),r.weekNumbers&&E1(r.weekNumbers);for(var pe=document.createDocumentFragment(),xe=0;xe<r.config.showMonths;xe++){var De=new Date(r.currentYear,r.currentMonth,1);De.setMonth(r.currentMonth+xe),pe.appendChild(E(De.getFullYear(),De.getMonth()))}r.daysContainer.appendChild(pe),r.days=r.daysContainer.firstChild,r.config.mode==="range"&&r.selectedDates.length===1&&me()}}function F(){if(!(r.config.showMonths>1||r.config.monthSelectorType!=="dropdown")){var pe=function(tt){return r.config.minDate!==void 0&&r.currentYear===r.config.minDate.getFullYear()&&tt<r.config.minDate.getMonth()?!1:!(r.config.maxDate!==void 0&&r.currentYear===r.config.maxDate.getFullYear()&&tt>r.config.maxDate.getMonth())};r.monthsDropdownContainer.tabIndex=-1,r.monthsDropdownContainer.innerHTML="";for(var xe=0;xe<12;xe++)if(pe(xe)){var De=pn("option","flatpickr-monthDropdown-month");De.value=new Date(r.currentYear,xe).getMonth().toString(),De.textContent=B0(xe,r.config.shorthandCurrentMonth,r.l10n),De.tabIndex=-1,r.currentMonth===xe&&(De.selected=!0),r.monthsDropdownContainer.appendChild(De)}}}function L(){var pe=pn("div","flatpickr-month"),xe=window.document.createDocumentFragment(),De;r.config.showMonths>1||r.config.monthSelectorType==="static"?De=pn("span","cur-month"):(r.monthsDropdownContainer=pn("select","flatpickr-monthDropdown-months"),r.monthsDropdownContainer.setAttribute("aria-label",r.l10n.monthAriaLabel),m(r.monthsDropdownContainer,"change",function(Fe){var Ve=Rs(Fe),xt=parseInt(Ve.value,10);r.changeMonth(xt-r.currentMonth),At("onMonthChange")}),F(),De=r.monthsDropdownContainer);var tt=A1("cur-year",{tabindex:"-1"}),Le=tt.getElementsByTagName("input")[0];Le.setAttribute("aria-label",r.l10n.yearAriaLabel),r.config.minDate&&Le.setAttribute("min",r.config.minDate.getFullYear().toString()),r.config.maxDate&&(Le.setAttribute("max",r.config.maxDate.getFullYear().toString()),Le.disabled=!!r.config.minDate&&r.config.minDate.getFullYear()===r.config.maxDate.getFullYear());var Ke=pn("div","flatpickr-current-month");return Ke.appendChild(De),Ke.appendChild(tt),xe.appendChild(Ke),pe.appendChild(xe),{container:pe,yearElement:Le,monthElement:De}}function z(){E1(r.monthNav),r.monthNav.appendChild(r.prevMonthNav),r.config.showMonths&&(r.yearElements=[],r.monthElements=[]);for(var pe=r.config.showMonths;pe--;){var xe=L();r.yearElements.push(xe.yearElement),r.monthElements.push(xe.monthElement),r.monthNav.appendChild(xe.container)}r.monthNav.appendChild(r.nextMonthNav)}function V(){return r.monthNav=pn("div","flatpickr-months"),r.yearElements=[],r.monthElements=[],r.prevMonthNav=pn("span","flatpickr-prev-month"),r.prevMonthNav.innerHTML=r.config.prevArrow,r.nextMonthNav=pn("span","flatpickr-next-month"),r.nextMonthNav.innerHTML=r.config.nextArrow,z(),Object.defineProperty(r,"_hidePrevMonthArrow",{get:function(){return r.__hidePrevMonthArrow},set:function(pe){r.__hidePrevMonthArrow!==pe&&(Ta(r.prevMonthNav,"flatpickr-disabled",pe),r.__hidePrevMonthArrow=pe)}}),Object.defineProperty(r,"_hideNextMonthArrow",{get:function(){return r.__hideNextMonthArrow},set:function(pe){r.__hideNextMonthArrow!==pe&&(Ta(r.nextMonthNav,"flatpickr-disabled",pe),r.__hideNextMonthArrow=pe)}}),r.currentYearElement=r.yearElements[0],gt(),r.monthNav}function Q(){r.calendarContainer.classList.add("hasTime"),r.config.noCalendar&&r.calendarContainer.classList.add("noCalendar");var pe=Qj(r.config);r.timeContainer=pn("div","flatpickr-time"),r.timeContainer.tabIndex=-1;var xe=pn("span","flatpickr-time-separator",":"),De=A1("flatpickr-hour",{"aria-label":r.l10n.hourAriaLabel});r.hourElement=De.getElementsByTagName("input")[0];var tt=A1("flatpickr-minute",{"aria-label":r.l10n.minuteAriaLabel});if(r.minuteElement=tt.getElementsByTagName("input")[0],r.hourElement.tabIndex=r.minuteElement.tabIndex=-1,r.hourElement.value=ss(r.latestSelectedDateObj?r.latestSelectedDateObj.getHours():r.config.time_24hr?pe.hours:d(pe.hours)),r.minuteElement.value=ss(r.latestSelectedDateObj?r.latestSelectedDateObj.getMinutes():pe.minutes),r.hourElement.setAttribute("step",r.config.hourIncrement.toString()),r.minuteElement.setAttribute("step",r.config.minuteIncrement.toString()),r.hourElement.setAttribute("min",r.config.time_24hr?"0":"1"),r.hourElement.setAttribute("max",r.config.time_24hr?"23":"12"),r.hourElement.setAttribute("maxlength","2"),r.minuteElement.setAttribute("min","0"),r.minuteElement.setAttribute("max","59"),r.minuteElement.setAttribute("maxlength","2"),r.timeContainer.appendChild(De),r.timeContainer.appendChild(xe),r.timeContainer.appendChild(tt),r.config.time_24hr&&r.timeContainer.classList.add("time24hr"),r.config.enableSeconds){r.timeContainer.classList.add("hasSeconds");var Le=A1("flatpickr-second");r.secondElement=Le.getElementsByTagName("input")[0],r.secondElement.value=ss(r.latestSelectedDateObj?r.latestSelectedDateObj.getSeconds():pe.seconds),r.secondElement.setAttribute("step",r.minuteElement.getAttribute("step")),r.secondElement.setAttribute("min","0"),r.secondElement.setAttribute("max","59"),r.secondElement.setAttribute("maxlength","2"),r.timeContainer.appendChild(pn("span","flatpickr-time-separator",":")),r.timeContainer.appendChild(Le)}return r.config.time_24hr||(r.amPM=pn("span","flatpickr-am-pm",r.l10n.amPM[jl((r.latestSelectedDateObj?r.hourElement.value:r.config.defaultHour)>11)]),r.amPM.title=r.l10n.toggleTitle,r.amPM.tabIndex=-1,r.timeContainer.appendChild(r.amPM)),r.timeContainer}function U(){r.weekdayContainer?E1(r.weekdayContainer):r.weekdayContainer=pn("div","flatpickr-weekdays");for(var pe=r.config.showMonths;pe--;){var xe=pn("div","flatpickr-weekdaycontainer");r.weekdayContainer.appendChild(xe)}return ee(),r.weekdayContainer}function ee(){if(r.weekdayContainer){var pe=r.l10n.firstDayOfWeek,xe=FI(r.l10n.weekdays.shorthand);pe>0&&pe<xe.length&&(xe=FI(xe.splice(pe,xe.length),xe.splice(0,pe)));for(var De=r.config.showMonths;De--;)r.weekdayContainer.children[De].innerHTML=`
|
||
<span class='flatpickr-weekday'>
|
||
`+xe.join("</span><span class='flatpickr-weekday'>")+`
|
||
</span>
|
||
`}}function H(){r.calendarContainer.classList.add("hasWeeks");var pe=pn("div","flatpickr-weekwrapper");pe.appendChild(pn("span","flatpickr-weekday",r.l10n.weekAbbreviation));var xe=pn("div","flatpickr-weeks");return pe.appendChild(xe),{weekWrapper:pe,weekNumbers:xe}}function B(pe,xe){xe===void 0&&(xe=!0);var De=xe?pe:pe-r.currentMonth;De<0&&r._hidePrevMonthArrow===!0||De>0&&r._hideNextMonthArrow===!0||(r.currentMonth+=De,(r.currentMonth<0||r.currentMonth>11)&&(r.currentYear+=r.currentMonth>11?1:-1,r.currentMonth=(r.currentMonth+12)%12,At("onYearChange"),F()),A(),At("onMonthChange"),gt())}function M(pe,xe){if(pe===void 0&&(pe=!0),xe===void 0&&(xe=!0),r.input.value="",r.altInput!==void 0&&(r.altInput.value=""),r.mobileInput!==void 0&&(r.mobileInput.value=""),r.selectedDates=[],r.latestSelectedDateObj=void 0,xe===!0&&(r.currentYear=r._initialDate.getFullYear(),r.currentMonth=r._initialDate.getMonth()),r.config.enableTime===!0){var De=Qj(r.config),tt=De.hours,Le=De.minutes,Ke=De.seconds;p(tt,Le,Ke)}r.redraw(),pe&&At("onChange")}function $(){r.isOpen=!1,r.isMobile||(r.calendarContainer!==void 0&&r.calendarContainer.classList.remove("open"),r._input!==void 0&&r._input.classList.remove("active")),At("onClose")}function q(){r.config!==void 0&&At("onDestroy");for(var pe=r._handlers.length;pe--;)r._handlers[pe].remove();if(r._handlers=[],r.mobileInput)r.mobileInput.parentNode&&r.mobileInput.parentNode.removeChild(r.mobileInput),r.mobileInput=void 0;else if(r.calendarContainer&&r.calendarContainer.parentNode)if(r.config.static&&r.calendarContainer.parentNode){var xe=r.calendarContainer.parentNode;if(xe.lastChild&&xe.removeChild(xe.lastChild),xe.parentNode){for(;xe.firstChild;)xe.parentNode.insertBefore(xe.firstChild,xe);xe.parentNode.removeChild(xe)}}else r.calendarContainer.parentNode.removeChild(r.calendarContainer);r.altInput&&(r.input.type="text",r.altInput.parentNode&&r.altInput.parentNode.removeChild(r.altInput),delete r.altInput),r.input&&(r.input.type=r.input._type,r.input.classList.remove("flatpickr-input"),r.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(De){try{delete r[De]}catch{}})}function Y(pe){return r.calendarContainer.contains(pe)}function K(pe){if(r.isOpen&&!r.config.inline){var xe=Rs(pe),De=Y(xe),tt=xe===r.input||xe===r.altInput||r.element.contains(xe)||pe.path&&pe.path.indexOf&&(~pe.path.indexOf(r.input)||~pe.path.indexOf(r.altInput)),Le=!tt&&!De&&!Y(pe.relatedTarget),Ke=!r.config.ignoredFocusElements.some(function(Fe){return Fe.contains(xe)});Le&&Ke&&(r.config.allowInput&&r.setDate(r._input.value,!1,r.config.altInput?r.config.altFormat:r.config.dateFormat),r.timeContainer!==void 0&&r.minuteElement!==void 0&&r.hourElement!==void 0&&r.input.value!==""&&r.input.value!==void 0&&c(),r.close(),r.config&&r.config.mode==="range"&&r.selectedDates.length===1&&r.clear(!1))}}function G(pe){if(!(!pe||r.config.minDate&&pe<r.config.minDate.getFullYear()||r.config.maxDate&&pe>r.config.maxDate.getFullYear())){var xe=pe,De=r.currentYear!==xe;r.currentYear=xe||r.currentYear,r.config.maxDate&&r.currentYear===r.config.maxDate.getFullYear()?r.currentMonth=Math.min(r.config.maxDate.getMonth(),r.currentMonth):r.config.minDate&&r.currentYear===r.config.minDate.getFullYear()&&(r.currentMonth=Math.max(r.config.minDate.getMonth(),r.currentMonth)),De&&(r.redraw(),At("onYearChange"),F())}}function re(pe,xe){var De;xe===void 0&&(xe=!0);var tt=r.parseDate(pe,void 0,xe);if(r.config.minDate&&tt&&Ms(tt,r.config.minDate,xe!==void 0?xe:!r.minDateHasTime)<0||r.config.maxDate&&tt&&Ms(tt,r.config.maxDate,xe!==void 0?xe:!r.maxDateHasTime)>0)return!1;if(!r.config.enable&&r.config.disable.length===0)return!0;if(tt===void 0)return!1;for(var Le=!!r.config.enable,Ke=(De=r.config.enable)!==null&&De!==void 0?De:r.config.disable,Fe=0,Ve=void 0;Fe<Ke.length;Fe++){if(Ve=Ke[Fe],typeof Ve=="function"&&Ve(tt))return Le;if(Ve instanceof Date&&tt!==void 0&&Ve.getTime()===tt.getTime())return Le;if(typeof Ve=="string"){var xt=r.parseDate(Ve,void 0,!0);return xt&&xt.getTime()===tt.getTime()?Le:!Le}else if(typeof Ve=="object"&&tt!==void 0&&Ve.from&&Ve.to&&tt.getTime()>=Ve.from.getTime()&&tt.getTime()<=Ve.to.getTime())return Le}return!Le}function J(pe){return r.daysContainer!==void 0?pe.className.indexOf("hidden")===-1&&pe.className.indexOf("flatpickr-disabled")===-1&&r.daysContainer.contains(pe):!1}function ae(pe){var xe=pe.target===r._input,De=r._input.value.trimEnd()!==We();xe&&De&&!(pe.relatedTarget&&Y(pe.relatedTarget))&&r.setDate(r._input.value,!0,pe.target===r.altInput?r.config.altFormat:r.config.dateFormat)}function le(pe){var xe=Rs(pe),De=r.config.wrap?e.contains(xe):xe===r._input,tt=r.config.allowInput,Le=r.isOpen&&(!tt||!De),Ke=r.config.inline&&De&&!tt;if(pe.keyCode===13&&De){if(tt)return r.setDate(r._input.value,!0,xe===r.altInput?r.config.altFormat:r.config.dateFormat),r.close(),xe.blur();r.open()}else if(Y(xe)||Le||Ke){var Fe=!!r.timeContainer&&r.timeContainer.contains(xe);switch(pe.keyCode){case 13:Fe?(pe.preventDefault(),c(),qe()):Ne(pe);break;case 27:pe.preventDefault(),qe();break;case 8:case 46:De&&!r.config.allowInput&&(pe.preventDefault(),r.clear());break;case 37:case 39:if(!Fe&&!De){pe.preventDefault();var Ve=a();if(r.daysContainer!==void 0&&(tt===!1||Ve&&J(Ve))){var xt=pe.keyCode===39?1:-1;pe.ctrlKey?(pe.stopPropagation(),B(xt),I(T(1),0)):I(void 0,xt)}}else r.hourElement&&r.hourElement.focus();break;case 38:case 40:pe.preventDefault();var dt=pe.keyCode===40?1:-1;r.daysContainer&&xe.$i!==void 0||xe===r.input||xe===r.altInput?pe.ctrlKey?(pe.stopPropagation(),G(r.currentYear-dt),I(T(1),0)):Fe||I(void 0,dt*7):xe===r.currentYearElement?G(r.currentYear-dt):r.config.enableTime&&(!Fe&&r.hourElement&&r.hourElement.focus(),c(pe),r._debouncedChange());break;case 9:if(Fe){var Tt=[r.hourElement,r.minuteElement,r.secondElement,r.amPM].concat(r.pluginElements).filter(function(hr){return hr}),Mt=Tt.indexOf(xe);if(Mt!==-1){var fr=Tt[Mt+(pe.shiftKey?-1:1)];pe.preventDefault(),(fr||r._input).focus()}}else!r.config.noCalendar&&r.daysContainer&&r.daysContainer.contains(xe)&&pe.shiftKey&&(pe.preventDefault(),r._input.focus());break}}if(r.amPM!==void 0&&xe===r.amPM)switch(pe.key){case r.l10n.amPM[0].charAt(0):case r.l10n.amPM[0].charAt(0).toLowerCase():r.amPM.textContent=r.l10n.amPM[0],f(),Pe();break;case r.l10n.amPM[1].charAt(0):case r.l10n.amPM[1].charAt(0).toLowerCase():r.amPM.textContent=r.l10n.amPM[1],f(),Pe();break}(De||Y(xe))&&At("onKeyDown",pe)}function me(pe,xe){if(xe===void 0&&(xe="flatpickr-day"),!(r.selectedDates.length!==1||pe&&(!pe.classList.contains(xe)||pe.classList.contains("flatpickr-disabled")))){for(var De=pe?pe.dateObj.getTime():r.days.firstElementChild.dateObj.getTime(),tt=r.parseDate(r.selectedDates[0],void 0,!0).getTime(),Le=Math.min(De,r.selectedDates[0].getTime()),Ke=Math.max(De,r.selectedDates[0].getTime()),Fe=!1,Ve=0,xt=0,dt=Le;dt<Ke;dt+=loe.DAY)re(new Date(dt),!0)||(Fe=Fe||dt>Le&&dt<Ke,dt<tt&&(!Ve||dt>Ve)?Ve=dt:dt>tt&&(!xt||dt<xt)&&(xt=dt));var Tt=Array.from(r.rContainer.querySelectorAll("*:nth-child(-n+"+r.config.showMonths+") > ."+xe));Tt.forEach(function(Mt){var fr=Mt.dateObj,hr=fr.getTime(),Qr=Ve>0&&hr<Ve||xt>0&&hr>xt;if(Qr){Mt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Rn){Mt.classList.remove(Rn)});return}else if(Fe&&!Qr)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Rn){Mt.classList.remove(Rn)}),pe!==void 0&&(pe.classList.add(De<=r.selectedDates[0].getTime()?"startRange":"endRange"),tt<De&&hr===tt?Mt.classList.add("startRange"):tt>De&&hr===tt&&Mt.classList.add("endRange"),hr>=Ve&&(xt===0||hr<=xt)&&aoe(hr,tt,De)&&Mt.classList.add("inRange"))})}}function Oe(){r.isOpen&&!r.config.static&&!r.config.inline&&fe()}function we(pe,xe){if(xe===void 0&&(xe=r._positionElement),r.isMobile===!0){if(pe){pe.preventDefault();var De=Rs(pe);De&&De.blur()}r.mobileInput!==void 0&&(r.mobileInput.focus(),r.mobileInput.click()),At("onOpen");return}else if(r._input.disabled||r.config.inline)return;var tt=r.isOpen;r.isOpen=!0,tt||(r.calendarContainer.classList.add("open"),r._input.classList.add("active"),At("onOpen"),fe(xe)),r.config.enableTime===!0&&r.config.noCalendar===!0&&r.config.allowInput===!1&&(pe===void 0||!r.timeContainer.contains(pe.relatedTarget))&&setTimeout(function(){return r.hourElement.select()},50)}function ie(pe){return function(xe){var De=r.config["_"+pe+"Date"]=r.parseDate(xe,r.config.dateFormat),tt=r.config["_"+(pe==="min"?"max":"min")+"Date"];De!==void 0&&(r[pe==="min"?"minDateHasTime":"maxDateHasTime"]=De.getHours()>0||De.getMinutes()>0||De.getSeconds()>0),r.selectedDates&&(r.selectedDates=r.selectedDates.filter(function(Le){return re(Le)}),!r.selectedDates.length&&pe==="min"&&h(De),Pe()),r.daysContainer&&(je(),De!==void 0?r.currentYearElement[pe]=De.getFullYear().toString():r.currentYearElement.removeAttribute(pe),r.currentYearElement.disabled=!!tt&&De!==void 0&&tt.getFullYear()===De.getFullYear())}}function Me(){var pe=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],xe=pa(pa({},JSON.parse(JSON.stringify(e.dataset||{}))),t),De={};r.config.parseDate=xe.parseDate,r.config.formatDate=xe.formatDate,Object.defineProperty(r.config,"enable",{get:function(){return r.config._enable},set:function(Tt){r.config._enable=nt(Tt)}}),Object.defineProperty(r.config,"disable",{get:function(){return r.config._disable},set:function(Tt){r.config._disable=nt(Tt)}});var tt=xe.mode==="time";if(!xe.dateFormat&&(xe.enableTime||tt)){var Le=Xi.defaultConfig.dateFormat||Jg.dateFormat;De.dateFormat=xe.noCalendar||tt?"H:i"+(xe.enableSeconds?":S":""):Le+" H:i"+(xe.enableSeconds?":S":"")}if(xe.altInput&&(xe.enableTime||tt)&&!xe.altFormat){var Ke=Xi.defaultConfig.altFormat||Jg.altFormat;De.altFormat=xe.noCalendar||tt?"h:i"+(xe.enableSeconds?":S K":" K"):Ke+(" h:i"+(xe.enableSeconds?":S":"")+" K")}Object.defineProperty(r.config,"minDate",{get:function(){return r.config._minDate},set:ie("min")}),Object.defineProperty(r.config,"maxDate",{get:function(){return r.config._maxDate},set:ie("max")});var Fe=function(Tt){return function(Mt){r.config[Tt==="min"?"_minTime":"_maxTime"]=r.parseDate(Mt,"H:i:S")}};Object.defineProperty(r.config,"minTime",{get:function(){return r.config._minTime},set:Fe("min")}),Object.defineProperty(r.config,"maxTime",{get:function(){return r.config._maxTime},set:Fe("max")}),xe.mode==="time"&&(r.config.noCalendar=!0,r.config.enableTime=!0),Object.assign(r.config,De,xe);for(var Ve=0;Ve<pe.length;Ve++)r.config[pe[Ve]]=r.config[pe[Ve]]===!0||r.config[pe[Ve]]==="true";Vj.filter(function(Tt){return r.config[Tt]!==void 0}).forEach(function(Tt){r.config[Tt]=Yj(r.config[Tt]||[]).map(s)}),r.isMobile=!r.config.disableMobile&&!r.config.inline&&r.config.mode==="single"&&!r.config.disable.length&&!r.config.enable&&!r.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var Ve=0;Ve<r.config.plugins.length;Ve++){var xt=r.config.plugins[Ve](r)||{};for(var dt in xt)Vj.indexOf(dt)>-1?r.config[dt]=Yj(xt[dt]).map(s).concat(r.config[dt]):typeof xe[dt]>"u"&&(r.config[dt]=xt[dt])}xe.altInputClass||(r.config.altInputClass=ke().className+" "+r.config.altInputClass),At("onParseConfig")}function ke(){return r.config.wrap?e.querySelector("[data-input]"):e}function se(){typeof r.config.locale!="object"&&typeof Xi.l10ns[r.config.locale]>"u"&&r.config.errorHandler(new Error("flatpickr: invalid locale "+r.config.locale)),r.l10n=pa(pa({},Xi.l10ns.default),typeof r.config.locale=="object"?r.config.locale:r.config.locale!=="default"?Xi.l10ns[r.config.locale]:void 0),Hp.D="("+r.l10n.weekdays.shorthand.join("|")+")",Hp.l="("+r.l10n.weekdays.longhand.join("|")+")",Hp.M="("+r.l10n.months.shorthand.join("|")+")",Hp.F="("+r.l10n.months.longhand.join("|")+")",Hp.K="("+r.l10n.amPM[0]+"|"+r.l10n.amPM[1]+"|"+r.l10n.amPM[0].toLowerCase()+"|"+r.l10n.amPM[1].toLowerCase()+")";var pe=pa(pa({},t),JSON.parse(JSON.stringify(e.dataset||{})));pe.time_24hr===void 0&&Xi.defaultConfig.time_24hr===void 0&&(r.config.time_24hr=r.l10n.time_24hr),r.formatDate=H$(r),r.parseDate=sE({config:r.config,l10n:r.l10n})}function fe(pe){if(typeof r.config.position=="function")return void r.config.position(r,pe);if(r.calendarContainer!==void 0){At("onPreCalendarPosition");var xe=pe||r._positionElement,De=Array.prototype.reduce.call(r.calendarContainer.children,(function(zt,yr){return zt+yr.offsetHeight}),0),tt=r.calendarContainer.offsetWidth,Le=r.config.position.split(" "),Ke=Le[0],Fe=Le.length>1?Le[1]:null,Ve=xe.getBoundingClientRect(),xt=window.innerHeight-Ve.bottom,dt=Ke==="above"||Ke!=="below"&&xt<De&&Ve.top>De,Tt=window.pageYOffset+Ve.top+(dt?-De-2:xe.offsetHeight+2);if(Ta(r.calendarContainer,"arrowTop",!dt),Ta(r.calendarContainer,"arrowBottom",dt),!r.config.inline){var Mt=window.pageXOffset+Ve.left,fr=!1,hr=!1;Fe==="center"?(Mt-=(tt-Ve.width)/2,fr=!0):Fe==="right"&&(Mt-=tt-Ve.width,hr=!0),Ta(r.calendarContainer,"arrowLeft",!fr&&!hr),Ta(r.calendarContainer,"arrowCenter",fr),Ta(r.calendarContainer,"arrowRight",hr);var Qr=window.document.body.offsetWidth-(window.pageXOffset+Ve.right),Rn=Mt+tt>window.document.body.offsetWidth,to=Qr+tt>window.document.body.offsetWidth;if(Ta(r.calendarContainer,"rightMost",Rn),!r.config.static)if(r.calendarContainer.style.top=Tt+"px",!Rn)r.calendarContainer.style.left=Mt+"px",r.calendarContainer.style.right="auto";else if(!to)r.calendarContainer.style.left="auto",r.calendarContainer.style.right=Qr+"px";else{var Ln=Ie();if(Ln===void 0)return;var vo=window.document.body.offsetWidth,ro=Math.max(0,vo/2-tt/2),ys=".flatpickr-calendar.centerMost:before",zo=".flatpickr-calendar.centerMost:after",$a=Ln.cssRules.length,xa="{left:"+Ve.left+"px;right:auto;}";Ta(r.calendarContainer,"rightMost",!1),Ta(r.calendarContainer,"centerMost",!0),Ln.insertRule(ys+","+zo+xa,$a),r.calendarContainer.style.left=ro+"px",r.calendarContainer.style.right="auto"}}}}function Ie(){for(var pe=null,xe=0;xe<document.styleSheets.length;xe++){var De=document.styleSheets[xe];if(De.cssRules){try{De.cssRules}catch{continue}pe=De;break}}return pe??ce()}function ce(){var pe=document.createElement("style");return document.head.appendChild(pe),pe.sheet}function je(){r.config.noCalendar||r.isMobile||(F(),gt(),A())}function qe(){r._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(r.close,0):r.close()}function Ne(pe){pe.preventDefault(),pe.stopPropagation();var xe=function(Tt){return Tt.classList&&Tt.classList.contains("flatpickr-day")&&!Tt.classList.contains("flatpickr-disabled")&&!Tt.classList.contains("notAllowed")},De=U$(Rs(pe),xe);if(De!==void 0){var tt=De,Le=r.latestSelectedDateObj=new Date(tt.dateObj.getTime()),Ke=(Le.getMonth()<r.currentMonth||Le.getMonth()>r.currentMonth+r.config.showMonths-1)&&r.config.mode!=="range";if(r.selectedDateElem=tt,r.config.mode==="single")r.selectedDates=[Le];else if(r.config.mode==="multiple"){var Fe=Se(Le);Fe?r.selectedDates.splice(parseInt(Fe),1):r.selectedDates.push(Le)}else r.config.mode==="range"&&(r.selectedDates.length===2&&r.clear(!1,!1),r.latestSelectedDateObj=Le,r.selectedDates.push(Le),Ms(Le,r.selectedDates[0],!0)!==0&&r.selectedDates.sort(function(Tt,Mt){return Tt.getTime()-Mt.getTime()}));if(f(),Ke){var Ve=r.currentYear!==Le.getFullYear();r.currentYear=Le.getFullYear(),r.currentMonth=Le.getMonth(),Ve&&(At("onYearChange"),F()),At("onMonthChange")}if(gt(),A(),Pe(),!Ke&&r.config.mode!=="range"&&r.config.showMonths===1?O(tt):r.selectedDateElem!==void 0&&r.hourElement===void 0&&r.selectedDateElem&&r.selectedDateElem.focus(),r.hourElement!==void 0&&r.hourElement!==void 0&&r.hourElement.focus(),r.config.closeOnSelect){var xt=r.config.mode==="single"&&!r.config.enableTime,dt=r.config.mode==="range"&&r.selectedDates.length===2&&!r.config.enableTime;(xt||dt)&&qe()}x()}}var Je={locale:[se,ee],showMonths:[z,l,U],minDate:[w],maxDate:[w],positionElement:[wt],clickOpens:[function(){r.config.clickOpens===!0?(m(r._input,"focus",r.open),m(r._input,"click",r.open)):(r._input.removeEventListener("focus",r.open),r._input.removeEventListener("click",r.open))}]};function vt(pe,xe){if(pe!==null&&typeof pe=="object"){Object.assign(r.config,pe);for(var De in pe)Je[De]!==void 0&&Je[De].forEach(function(tt){return tt()})}else r.config[pe]=xe,Je[pe]!==void 0?Je[pe].forEach(function(tt){return tt()}):Vj.indexOf(pe)>-1&&(r.config[pe]=Yj(xe));r.redraw(),Pe(!0)}function Ge(pe,xe){var De=[];if(pe instanceof Array)De=pe.map(function(tt){return r.parseDate(tt,xe)});else if(pe instanceof Date||typeof pe=="number")De=[r.parseDate(pe,xe)];else if(typeof pe=="string")switch(r.config.mode){case"single":case"time":De=[r.parseDate(pe,xe)];break;case"multiple":De=pe.split(r.config.conjunction).map(function(tt){return r.parseDate(tt,xe)});break;case"range":De=pe.split(r.l10n.rangeSeparator).map(function(tt){return r.parseDate(tt,xe)});break}else r.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(pe)));r.selectedDates=r.config.allowInvalidPreload?De:De.filter(function(tt){return tt instanceof Date&&re(tt,!1)}),r.config.mode==="range"&&r.selectedDates.sort(function(tt,Le){return tt.getTime()-Le.getTime()})}function Ot(pe,xe,De){if(xe===void 0&&(xe=!1),De===void 0&&(De=r.config.dateFormat),pe!==0&&!pe||pe instanceof Array&&pe.length===0)return r.clear(xe);Ge(pe,De),r.latestSelectedDateObj=r.selectedDates[r.selectedDates.length-1],r.redraw(),w(void 0,xe),h(),r.selectedDates.length===0&&r.clear(!1),Pe(xe),xe&&At("onChange")}function nt(pe){return pe.slice().map(function(xe){return typeof xe=="string"||typeof xe=="number"||xe instanceof Date?r.parseDate(xe,void 0,!0):xe&&typeof xe=="object"&&xe.from&&xe.to?{from:r.parseDate(xe.from,void 0),to:r.parseDate(xe.to,void 0)}:xe}).filter(function(xe){return xe})}function Ae(){r.selectedDates=[],r.now=r.parseDate(r.config.now)||new Date;var pe=r.config.defaultDate||((r.input.nodeName==="INPUT"||r.input.nodeName==="TEXTAREA")&&r.input.placeholder&&r.input.value===r.input.placeholder?null:r.input.value);pe&&Ge(pe,r.config.dateFormat),r._initialDate=r.selectedDates.length>0?r.selectedDates[0]:r.config.minDate&&r.config.minDate.getTime()>r.now.getTime()?r.config.minDate:r.config.maxDate&&r.config.maxDate.getTime()<r.now.getTime()?r.config.maxDate:r.now,r.currentYear=r._initialDate.getFullYear(),r.currentMonth=r._initialDate.getMonth(),r.selectedDates.length>0&&(r.latestSelectedDateObj=r.selectedDates[0]),r.config.minTime!==void 0&&(r.config.minTime=r.parseDate(r.config.minTime,"H:i")),r.config.maxTime!==void 0&&(r.config.maxTime=r.parseDate(r.config.maxTime,"H:i")),r.minDateHasTime=!!r.config.minDate&&(r.config.minDate.getHours()>0||r.config.minDate.getMinutes()>0||r.config.minDate.getSeconds()>0),r.maxDateHasTime=!!r.config.maxDate&&(r.config.maxDate.getHours()>0||r.config.maxDate.getMinutes()>0||r.config.maxDate.getSeconds()>0)}function Te(){if(r.input=ke(),!r.input){r.config.errorHandler(new Error("Invalid input element specified"));return}r.input._type=r.input.type,r.input.type="text",r.input.classList.add("flatpickr-input"),r._input=r.input,r.config.altInput&&(r.altInput=pn(r.input.nodeName,r.config.altInputClass),r._input=r.altInput,r.altInput.placeholder=r.input.placeholder,r.altInput.disabled=r.input.disabled,r.altInput.required=r.input.required,r.altInput.tabIndex=r.input.tabIndex,r.altInput.type="text",r.input.setAttribute("type","hidden"),!r.config.static&&r.input.parentNode&&r.input.parentNode.insertBefore(r.altInput,r.input.nextSibling)),r.config.allowInput||r._input.setAttribute("readonly","readonly"),wt()}function wt(){r._positionElement=r.config.positionElement||r._input}function ft(){var pe=r.config.enableTime?r.config.noCalendar?"time":"datetime-local":"date";r.mobileInput=pn("input",r.input.className+" flatpickr-mobile"),r.mobileInput.tabIndex=1,r.mobileInput.type=pe,r.mobileInput.disabled=r.input.disabled,r.mobileInput.required=r.input.required,r.mobileInput.placeholder=r.input.placeholder,r.mobileFormatStr=pe==="datetime-local"?"Y-m-d\\TH:i:S":pe==="date"?"Y-m-d":"H:i:S",r.selectedDates.length>0&&(r.mobileInput.defaultValue=r.mobileInput.value=r.formatDate(r.selectedDates[0],r.mobileFormatStr)),r.config.minDate&&(r.mobileInput.min=r.formatDate(r.config.minDate,"Y-m-d")),r.config.maxDate&&(r.mobileInput.max=r.formatDate(r.config.maxDate,"Y-m-d")),r.input.getAttribute("step")&&(r.mobileInput.step=String(r.input.getAttribute("step"))),r.input.type="hidden",r.altInput!==void 0&&(r.altInput.type="hidden");try{r.input.parentNode&&r.input.parentNode.insertBefore(r.mobileInput,r.input.nextSibling)}catch{}m(r.mobileInput,"change",function(xe){r.setDate(Rs(xe).value,!1,r.mobileFormatStr),At("onChange"),At("onClose")})}function Pt(pe){if(r.isOpen===!0)return r.close();r.open(pe)}function At(pe,xe){if(r.config!==void 0){var De=r.config[pe];if(De!==void 0&&De.length>0)for(var tt=0;De[tt]&&tt<De.length;tt++)De[tt](r.selectedDates,r.input.value,r,xe);pe==="onChange"&&(r.input.dispatchEvent(Ht("change")),r.input.dispatchEvent(Ht("input")))}}function Ht(pe){var xe=document.createEvent("Event");return xe.initEvent(pe,!0,!0),xe}function Se(pe){for(var xe=0;xe<r.selectedDates.length;xe++){var De=r.selectedDates[xe];if(De instanceof Date&&Ms(De,pe)===0)return""+xe}return!1}function ct(pe){return r.config.mode!=="range"||r.selectedDates.length<2?!1:Ms(pe,r.selectedDates[0])>=0&&Ms(pe,r.selectedDates[1])<=0}function gt(){r.config.noCalendar||r.isMobile||!r.monthNav||(r.yearElements.forEach(function(pe,xe){var De=new Date(r.currentYear,r.currentMonth,1);De.setMonth(r.currentMonth+xe),r.config.showMonths>1||r.config.monthSelectorType==="static"?r.monthElements[xe].textContent=B0(De.getMonth(),r.config.shorthandCurrentMonth,r.l10n)+" ":r.monthsDropdownContainer.value=De.getMonth().toString(),pe.value=De.getFullYear().toString()}),r._hidePrevMonthArrow=r.config.minDate!==void 0&&(r.currentYear===r.config.minDate.getFullYear()?r.currentMonth<=r.config.minDate.getMonth():r.currentYear<r.config.minDate.getFullYear()),r._hideNextMonthArrow=r.config.maxDate!==void 0&&(r.currentYear===r.config.maxDate.getFullYear()?r.currentMonth+1>r.config.maxDate.getMonth():r.currentYear>r.config.maxDate.getFullYear()))}function We(pe){var xe=pe||(r.config.altInput?r.config.altFormat:r.config.dateFormat);return r.selectedDates.map(function(De){return r.formatDate(De,xe)}).filter(function(De,tt,Le){return r.config.mode!=="range"||r.config.enableTime||Le.indexOf(De)===tt}).join(r.config.mode!=="range"?r.config.conjunction:r.l10n.rangeSeparator)}function Pe(pe){pe===void 0&&(pe=!0),r.mobileInput!==void 0&&r.mobileFormatStr&&(r.mobileInput.value=r.latestSelectedDateObj!==void 0?r.formatDate(r.latestSelectedDateObj,r.mobileFormatStr):""),r.input.value=We(r.config.dateFormat),r.altInput!==void 0&&(r.altInput.value=We(r.config.altFormat)),pe!==!1&&At("onValueUpdate")}function rt(pe){var xe=Rs(pe),De=r.prevMonthNav.contains(xe),tt=r.nextMonthNav.contains(xe);De||tt?B(De?-1:1):r.yearElements.indexOf(xe)>=0?xe.select():xe.classList.contains("arrowUp")?r.changeYear(r.currentYear+1):xe.classList.contains("arrowDown")&&r.changeYear(r.currentYear-1)}function Ze(pe){pe.preventDefault();var xe=pe.type==="keydown",De=Rs(pe),tt=De;r.amPM!==void 0&&De===r.amPM&&(r.amPM.textContent=r.l10n.amPM[jl(r.amPM.textContent===r.l10n.amPM[0])]);var Le=parseFloat(tt.getAttribute("min")),Ke=parseFloat(tt.getAttribute("max")),Fe=parseFloat(tt.getAttribute("step")),Ve=parseInt(tt.value,10),xt=pe.delta||(xe?pe.which===38?1:-1:0),dt=Ve+Fe*xt;if(typeof tt.value<"u"&&tt.value.length===2){var Tt=tt===r.hourElement,Mt=tt===r.minuteElement;dt<Le?(dt=Ke+dt+jl(!Tt)+(jl(Tt)&&jl(!r.amPM)),Mt&&S(void 0,-1,r.hourElement)):dt>Ke&&(dt=tt===r.hourElement?dt-Ke-jl(!r.amPM):Le,Mt&&S(void 0,1,r.hourElement)),r.amPM&&Tt&&(Fe===1?dt+Ve===23:Math.abs(dt-Ve)>Fe)&&(r.amPM.textContent=r.l10n.amPM[jl(r.amPM.textContent===r.l10n.amPM[0])]),tt.value=ss(dt)}}return o(),r}function em(e,t){for(var r=Array.prototype.slice.call(e).filter(function(s){return s instanceof HTMLElement}),n=[],o=0;o<r.length;o++){var a=r[o];try{if(a.getAttribute("data-fp-omit")!==null)continue;a._flatpickr!==void 0&&(a._flatpickr.destroy(),a._flatpickr=void 0),a._flatpickr=uoe(a,t||{}),n.push(a._flatpickr)}catch(s){console.error(s)}}return n.length===1?n[0]:n}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return em(this,e)},HTMLElement.prototype.flatpickr=function(e){return em([this],e)});var Xi=function(e,t){return typeof e=="string"?em(window.document.querySelectorAll(e),t):e instanceof Node?em([e],t):em(e,t)};Xi.defaultConfig={};Xi.l10ns={en:pa({},ox),default:pa({},ox)};Xi.localize=function(e){Xi.l10ns.default=pa(pa({},Xi.l10ns.default),e)};Xi.setDefaults=function(e){Xi.defaultConfig=pa(pa({},Xi.defaultConfig),e)};Xi.parseDate=sE({});Xi.formatDate=H$({});Xi.compareDates=Ms;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(e){return em(this,e)});Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof e=="string"?parseInt(e,10):e))};typeof window<"u"&&(window.flatpickr=Xi);function T1(e){return String(e).padStart(2,"0")}function MI(e){if(!e)return"";const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":`${t.getFullYear()}-${T1(t.getMonth()+1)}-${T1(t.getDate())}T${T1(t.getHours())}:${T1(t.getMinutes())}`}function DI(e){if(!e.trim())return;const t=new Date(e);return Number.isNaN(t.getTime())?void 0:t}function jf({value:e,onChange:t,style:r,disabled:n,placeholder:o="Select date & time…",hasError:a}){const s=j.useRef(null),l=j.useRef(null);return j.useEffect(()=>{const c=s.current;if(!c)return;const u=Xi(c,{enableTime:!0,time_24hr:!0,dateFormat:"Y-m-d H:i",allowInput:!0,defaultDate:DI(e),onChange:d=>{const f=d[0];t(f?MI(f):"")}});return l.current=u,()=>{u.destroy(),l.current=null}},[]),j.useEffect(()=>{const c=l.current;if(!c)return;const u=c.selectedDates[0],d=u?MI(u):"";if(e===d)return;const f=DI(e);f?c.setDate(f,!1):c.clear(!1)},[e]),j.useEffect(()=>{const c=l.current;if(!c)return;const u=c.input;u.disabled=!!n,c.set("clickOpens",!n)},[n]),i.jsx("input",{ref:s,type:"text",placeholder:o,readOnly:!1,autoComplete:"off",style:{...r,...a?{borderColor:"var(--destructive)"}:{}}})}const da="__unassigned__",jp="__new__",doe=["Presentation","Panel","Keynote","Workshop","Qna","Demo","Debate","Symposium","Other"],foe=["Scheduled","Live","Completed","Cancelled"],poe={Presentation:"panel",Panel:"panel",Keynote:"keynote",Workshop:"workshop",Qna:"networking",Demo:"breakout",Debate:"panel",Symposium:"workshop",Other:"breakout"},hoe={keynote:"Keynote",workshop:"Workshop",panel:"Panel",breakout:"Other",networking:"Qna"},goe={Scheduled:"scheduled",Live:"ongoing",Completed:"completed",Cancelled:"cancelled"},moe={scheduled:"Scheduled",ongoing:"Live",completed:"Completed",cancelled:"Cancelled"};function qg(e){const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const r=n=>String(n).padStart(2,"0");return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())}T${r(t.getHours())}:${r(t.getMinutes())}`}function voe(e){const t=new Date(e);if(Number.isNaN(t.getTime())){const o=new Date;o.setHours(9,0,0,0);const a=new Date(o);return a.setHours(10,0,0,0),{start:qg(o.toISOString()),end:qg(a.toISOString())}}const r=new Date(t);r.setHours(9,0,0,0);const n=new Date(r);return n.setHours(10,0,0,0),{start:qg(r.toISOString()),end:qg(n.toISOString())}}const To={width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",outline:"none",boxSizing:"border-box"};function df({msg:e}){return e?i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",margin:"4px 0 0",fontFamily:"var(--font-noto-sans)"},children:e}):null}function yoe({n:e,state:t}){const r=t==="todo"?"var(--muted)":"var(--primary)";return i.jsx("div",{style:{width:28,height:28,borderRadius:"50%",background:r,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t==="done"?i.jsx(Oi,{size:13,style:{color:"#fff"}}):i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-inter)",color:"#fff",fontWeight:"var(--font-weight-medium)"},children:e})})}function xoe(e){var t;return(t=e==null?void 0:e.speakers)!=null&&t.length?e.speakers.map(r=>typeof r=="object"&&r&&"_id"in r?String(r._id):String(r)):[]}function zI(e,t){if(!e)return"";const r=e[t];return r==null||r===""?"":String(r)}function V$({eventId:e,eventName:t,eventStartIso:r,organizationId:n,tracks:o,initialTrackId:a,session:s,onClose:l,onSuccess:c,onTrackCreated:u}){const d=!!(s!=null&&s._id),f=j.useMemo(()=>voe(r),[r]),h=j.useMemo(()=>{if(!(s!=null&&s.track))return da;const zt=s.track;return typeof zt=="object"&&zt&&"_id"in zt?String(zt._id):String(zt)},[s]),[p,y]=j.useState(1),[m,x]=j.useState(()=>d?new Set([1,2,3,4]):new Set),[b,w]=j.useState(!1),[k,S]=j.useState(null),[_,P]=j.useState(()=>d?h:a===da?da:a&&a!==da?a:o.length?o[0]._id:jp),[O,T]=j.useState(""),[R,I]=j.useState(""),[E,A]=j.useState("general"),[F,L]=j.useState(!1),[z,V]=j.useState({}),[Q,U]=j.useState((s==null?void 0:s.title)||""),[ee,H]=j.useState((s==null?void 0:s.type)&&hoe[s.type]||"Presentation"),[B,M]=j.useState((s==null?void 0:s.status)&&moe[s.status]||"Scheduled"),[$,q]=j.useState(s!=null&&s.startTime?qg(s.startTime):f.start),[Y,K]=j.useState(s!=null&&s.endTime?qg(s.endTime):f.end),[G,re]=j.useState((s==null?void 0:s.description)||""),J=zt=>zt!==!1,[ae,le]=j.useState(()=>s?J(s.audienceFeedbackEnabled):!0),[me,Oe]=j.useState(()=>s?J(s.audienceRatingsEnabled):!0),[we,ie]=j.useState(()=>zI(s??null,"audienceFeedbackForm")),[Me,ke]=j.useState(()=>zI(s??null,"audienceRatingsForm")),[se,fe]=j.useState([]),[Ie,ce]=j.useState(!1),[je,qe]=j.useState([]),[Ne,Je]=j.useState(!0),[vt,Ge]=j.useState(()=>xoe(s)),[Ot,nt]=j.useState(""),[Ae,Te]=j.useState(!1),[wt,ft]=j.useState(""),[Pt,At]=j.useState(""),[Ht,Se]=j.useState(""),[ct,gt]=j.useState(""),[We,Pe]=j.useState(""),[rt,Ze]=j.useState({}),[pe,xe]=j.useState(!1);j.useEffect(()=>{let zt=!1;return(async()=>{var Gr;Je(!0);const yr={limit:500};n&&(yr.organization=n);const Xn=await Ef.list(yr);!zt&&((Gr=Xn.data)!=null&&Gr.speakers)&&qe(Xn.data.speakers),zt||Je(!1)})(),()=>{zt=!0}},[n]),j.useEffect(()=>{const zt=n==null?void 0:n.trim();if(!zt){fe([]);return}let yr=!1;return ce(!0),Ma.list({organization:zt}).then(Xn=>{yr||fe(Xn.filter(Gr=>Gr.type==="feedback"))}).catch(()=>{yr||fe([])}).finally(()=>{yr||ce(!1)}),()=>{yr=!0}},[n]);const De=j.useCallback(zt=>{const yr=je.find(Xn=>Xn._id===zt);return yr?`${yr.firstName} ${yr.lastName}`.trim():`Speaker…${zt.slice(-6)}`},[je]),tt=zt=>{!zt||vt.includes(zt)||Ge(yr=>[...yr,zt])},Le=zt=>Ge(yr=>yr.filter(Xn=>Xn!==zt)),Ke=async()=>{const zt={};if(wt.trim()||(zt.firstName="First name is required."),Pt.trim()||(zt.lastName="Last name is required."),Ht.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(Ht.trim())||(zt.email="Enter a valid email."):zt.email="Email is required.",Ze(zt),Object.keys(zt).length)return;xe(!0);const yr=await Ef.create({firstName:wt.trim(),lastName:Pt.trim(),email:Ht.trim().toLowerCase(),phone:ct.trim()||void 0,title:We.trim()||void 0,...n?{organization:n}:{}});if(xe(!1),yr.error||!yr.data){Ze({email:yr.error||"Could not create speaker"});return}const Xn=yr.data;qe(Gr=>[Xn,...Gr.filter(Ut=>Ut._id!==Xn._id)]),tt(Xn._id),ft(""),At(""),Se(""),gt(""),Pe(""),Ze({}),Te(!1)},[Fe,Ve]=j.useState({}),[xt,dt]=j.useState({}),[Tt,Mt]=j.useState({}),[fr,hr]=j.useState({}),Qr=j.useCallback(()=>{const zt={};return _===jp?zt.track='Choose "Add new track" and fill the form below, or pick an existing track.':_||(zt.track="Select a track."),Ve(zt),Object.keys(zt).length===0},[_]),Rn=j.useCallback(()=>{const zt={};return Q.trim()||(zt.title="Session title is required."),dt(zt),Object.keys(zt).length===0},[Q]),to=j.useCallback(()=>{const zt={};$||(zt.start="Start date and time required."),Y||(zt.end="End date and time required.");const yr=new Date($).getTime(),Xn=new Date(Y).getTime();return $&&Y&&!(Xn>yr)&&(zt.end="End must be after start."),Mt(zt),Object.keys(zt).length===0},[$,Y]),Ln=j.useCallback(()=>(hr({}),!0),[]),vo=j.useCallback(()=>Qr()&&Rn()&&to()&&Ln(),[Qr,Rn,to,Ln]),ro=async()=>{const zt={};if(O.trim()||(zt.name="Track name is required."),V(zt),Object.keys(zt).length)return;L(!0);const yr=await rh.create(e,{name:O.trim(),hall:R.trim()||void 0,trackType:E,status:"active"});if(L(!1),yr.error||!yr.data){V({name:yr.error||"Could not create track"});return}const Xn=yr.data;u(Xn),P(Xn._id),T(""),I(""),V({})},ys=zt=>{zt===1&&!Qr()||zt===2&&!Rn()||zt===3&&!to()||zt===4&&!Ln()||(x(yr=>new Set([...yr,zt])),zt<4&&y(zt+1))},zo=async()=>{if(S(null),_===jp){y(1),Qr();return}if(!vo()){Qr()?Rn()?to()?y(4):y(3):y(2):y(1);return}const zt={title:Q.trim(),description:G.trim()||void 0,type:poe[ee],startTime:new Date($).toISOString(),endTime:new Date(Y).toISOString(),status:goe[B],track:_===da?null:_,speakers:vt,audienceFeedbackEnabled:ae,audienceRatingsEnabled:me,audienceFeedbackForm:ae&&we.trim()||null,audienceRatingsForm:me&&Me.trim()||null};w(!0);const yr=d?await Da.update(s._id,zt):await Da.create(e,zt);if(w(!1),yr.error){S(yr.error);return}c(),l()},$a=[{n:1,title:"Track",subtitle:"Assign this session to a track. You can create a new track inline."},{n:2,title:"Session details",subtitle:"Title, format, and status."},{n:3,title:"Schedule",subtitle:"Start and end date/time."},{n:4,title:"Speakers & notes",subtitle:"Faculty from your organization; add new speakers as needed."}],xa=()=>i.jsx("button",{type:"button",disabled:b,onClick:zo,style:{padding:"6px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:b?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",opacity:b?.85:1},children:b?"Saving…":"Save session"});return i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:l,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:200}}),i.jsxs("div",{style:{position:"fixed",top:0,right:0,height:"100%",width:"min(560px, 100vw)",background:"var(--card)",zIndex:201,display:"flex",flexDirection:"column",boxShadow:"-4px 0 32px rgba(0,0,0,0.18)"},children:[i.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)",flexShrink:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 4px",fontFamily:"var(--font-noto-sans)"},children:t}),i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:d?"Edit session":"New session"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"6px 0 0",fontFamily:"var(--font-noto-sans)"},children:"Complete each section to continue. Top and bottom Save submit the session."})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:[i.jsx("button",{type:"button",onClick:l,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",color:"var(--muted)"},children:i.jsx(er,{size:14})}),i.jsx(xa,{})]})]}),k&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-xs)",marginTop:"10px",fontFamily:"var(--font-noto-sans)"},children:k})]}),i.jsx("div",{style:{flex:1,overflowY:"auto"},children:$a.map(zt=>{const yr=p===zt.n,Xn=m.has(zt.n),Gr=yr?"active":Xn?"done":"todo";return i.jsxs("div",{style:{borderBottom:"1px solid var(--border)"},children:[i.jsxs("button",{type:"button",onClick:()=>y(yr?0:zt.n),style:{width:"100%",display:"flex",alignItems:"center",gap:"12px",padding:"14px 20px",background:"none",border:"none",cursor:"pointer",textAlign:"left"},children:[i.jsx(yoe,{n:zt.n,state:Gr}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:yr?"var(--primary)":"var(--card-foreground)",margin:0},children:zt.title}),!yr&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:0,fontFamily:"var(--font-noto-sans)"},children:zt.subtitle})]}),yr?i.jsx($f,{size:18,style:{color:"var(--muted)"}}):i.jsx(po,{size:18,style:{color:"var(--muted)"}})]}),yr&&i.jsxs("div",{style:{padding:"0 20px 16px 52px"},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 14px",fontFamily:"var(--font-noto-sans)"},children:zt.subtitle}),zt.n===1&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("div",{children:[i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",marginBottom:"6px",fontFamily:"var(--font-noto-sans)"},children:["Track ",i.jsx("span",{style:{color:"var(--destructive)"},children:"*"})]}),i.jsxs("select",{value:_===jp?jp:_,onChange:Ut=>{const $i=Ut.target.value;P($i),Ve({})},style:{...To,cursor:"pointer"},children:[i.jsx("option",{value:da,children:"Unassigned"}),o.map(Ut=>i.jsxs("option",{value:Ut._id,children:[Ut.name,Ut.hall?` · ${Ut.hall}`:""]},Ut._id)),i.jsx("option",{value:jp,children:"+ Add new track"})]}),i.jsx(df,{msg:Fe.track})]}),_===jp&&i.jsxs("div",{style:{padding:"14px",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",background:"var(--secondary)",display:"flex",flexDirection:"column",gap:"10px"},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontWeight:"600",margin:0,fontFamily:"var(--font-noto-sans)"},children:"New track"}),i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",display:"block",marginBottom:"4px",fontFamily:"var(--font-noto-sans)"},children:"Name *"}),i.jsx("input",{value:O,onChange:Ut=>{T(Ut.target.value),z.name&&V({})},placeholder:"Track name",style:To}),i.jsx(df,{msg:z.name})]}),i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",display:"block",marginBottom:"4px",fontFamily:"var(--font-noto-sans)"},children:"Type"}),i.jsxs("select",{value:E,onChange:Ut=>A(Ut.target.value),style:{...To,cursor:"pointer"},children:[i.jsx("option",{value:"general",children:"General"}),i.jsx("option",{value:"workshop",children:"Workshop"}),i.jsx("option",{value:"plenary",children:"Plenary"}),i.jsx("option",{value:"symposium",children:"Symposium"})]})]}),i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",display:"block",marginBottom:"4px",fontFamily:"var(--font-noto-sans)"},children:"Hall / venue"}),i.jsx("input",{value:R,onChange:Ut=>I(Ut.target.value),placeholder:"Optional",style:To})]}),i.jsxs("button",{type:"button",disabled:F,onClick:ro,style:{display:"inline-flex",alignItems:"center",gap:"6px",alignSelf:"flex-start",padding:"6px 12px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:F?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(wr,{size:14})," ",F?"Creating…":"Create track & select"]})]})]}),zt.n===2&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("div",{children:[i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",marginBottom:"6px",fontFamily:"var(--font-noto-sans)"},children:["Title ",i.jsx("span",{style:{color:"var(--destructive)"},children:"*"})]}),i.jsx("input",{value:Q,onChange:Ut=>{U(Ut.target.value),xt.title&&dt({})},placeholder:"Session title",style:To}),i.jsx(df,{msg:xt.title})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",marginBottom:"6px",fontFamily:"var(--font-noto-sans)"},children:"Type"}),i.jsx("select",{value:ee,onChange:Ut=>H(Ut.target.value),style:{...To,cursor:"pointer"},children:doe.map(Ut=>i.jsx("option",{value:Ut,children:Ut},Ut))})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",marginBottom:"6px",fontFamily:"var(--font-noto-sans)"},children:"Status"}),i.jsx("select",{value:B,onChange:Ut=>M(Ut.target.value),style:{...To,cursor:"pointer"},children:foe.map(Ut=>i.jsx("option",{value:Ut,children:Ut},Ut))})]})]})]}),zt.n===3&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("div",{children:[i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",marginBottom:"6px",fontFamily:"var(--font-noto-sans)"},children:["Start ",i.jsx("span",{style:{color:"var(--destructive)"},children:"*"})]}),i.jsx(jf,{value:$,onChange:Ut=>{q(Ut),Tt.start&&Mt({})},style:To,hasError:!!Tt.start,disabled:b}),i.jsx(df,{msg:Tt.start})]}),i.jsxs("div",{children:[i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",marginBottom:"6px",fontFamily:"var(--font-noto-sans)"},children:["End ",i.jsx("span",{style:{color:"var(--destructive)"},children:"*"})]}),i.jsx(jf,{value:Y,onChange:Ut=>{K(Ut),Tt.end&&Mt({})},style:To,hasError:!!Tt.end,disabled:b}),i.jsx(df,{msg:Tt.end})]})]}),zt.n===4&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",marginBottom:"6px",fontFamily:"var(--font-noto-sans)"},children:"Speakers"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 8px",fontFamily:"var(--font-noto-sans)"},children:"Select from your organization's faculty directory or add someone new."}),vt.length>0&&i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px",marginBottom:"10px"},children:vt.map(Ut=>i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 8px 4px 10px",borderRadius:"var(--radius-button)",background:"var(--secondary)",border:"1px solid var(--border)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:[De(Ut),i.jsx("button",{type:"button",onClick:()=>Le(Ut),style:{display:"flex",padding:0,border:"none",background:"none",cursor:"pointer",color:"var(--muted)"},"aria-label":"Remove",children:i.jsx(er,{size:12})})]},Ut))}),Ne?i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"Loading faculty…"}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{position:"relative",marginBottom:"8px"},children:[i.jsx(Pi,{size:14,style:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)",color:"var(--muted)"}}),i.jsx("input",{value:Ot,onChange:Ut=>nt(Ut.target.value),placeholder:"Search by name or email…",style:{...To,paddingLeft:"32px"}})]}),i.jsx("div",{style:{maxHeight:"160px",overflowY:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)"},children:(()=>{const Ut=je.filter(oi=>!vt.includes(oi._id)),$i=Ot.trim().toLowerCase(),yo=Ut.filter(oi=>$i?`${oi.firstName} ${oi.lastName}`.toLowerCase().includes($i)||(oi.email||"").toLowerCase().includes($i):!0);return je.length===0?i.jsx("p",{style:{padding:"12px",fontSize:"var(--text-xs)",color:"var(--muted)",margin:0,fontFamily:"var(--font-noto-sans)"},children:"No speakers in the directory yet. Add one below."}):Ut.length===0?i.jsx("p",{style:{padding:"12px",fontSize:"var(--text-xs)",color:"var(--muted)",margin:0,fontFamily:"var(--font-noto-sans)"},children:"Everyone listed is already on this session. Add a new speaker or remove someone above."}):yo.length===0?i.jsx("p",{style:{padding:"12px",fontSize:"var(--text-xs)",color:"var(--muted)",margin:0,fontFamily:"var(--font-noto-sans)"},children:"No matches. Try another search."}):yo.slice(0,80).map(oi=>i.jsxs("button",{type:"button",onClick:()=>tt(oi._id),style:{width:"100%",textAlign:"left",padding:"8px 12px",border:"none",borderBottom:"1px solid var(--border)",background:"transparent",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},onMouseEnter:xc=>{xc.currentTarget.style.background="var(--secondary)"},onMouseLeave:xc=>{xc.currentTarget.style.background="transparent"},children:[i.jsxs("span",{style:{fontWeight:"var(--font-weight-medium)"},children:[oi.firstName," ",oi.lastName]}),oi.title&&i.jsx("span",{style:{color:"var(--muted)",fontSize:"var(--text-xs)",marginLeft:"6px"},children:oi.title}),i.jsx("span",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)"},children:oi.email})]},oi._id))})()})]}),i.jsxs("button",{type:"button",onClick:()=>{Te(Ut=>!Ut),Ze({})},style:{display:"inline-flex",alignItems:"center",gap:"6px",marginTop:"4px",padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px dashed var(--border)",background:"transparent",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--primary)"},children:[i.jsx(z6,{size:14})," ",Ae?"Hide new speaker form":"Add new speaker"]}),Ae&&i.jsxs("div",{style:{marginTop:"10px",padding:"14px",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",background:"var(--secondary)",display:"flex",flexDirection:"column",gap:"10px"},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontWeight:"600",margin:0,fontFamily:"var(--font-noto-sans)"},children:"New faculty member (saved to your organization)"}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px"},children:[i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",display:"block",marginBottom:"4px",fontFamily:"var(--font-noto-sans)"},children:"First name *"}),i.jsx("input",{value:wt,onChange:Ut=>{ft(Ut.target.value),rt.firstName&&Ze({})},style:To}),i.jsx(df,{msg:rt.firstName})]}),i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",display:"block",marginBottom:"4px",fontFamily:"var(--font-noto-sans)"},children:"Last name *"}),i.jsx("input",{value:Pt,onChange:Ut=>{At(Ut.target.value),rt.lastName&&Ze({})},style:To}),i.jsx(df,{msg:rt.lastName})]})]}),i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",display:"block",marginBottom:"4px",fontFamily:"var(--font-noto-sans)"},children:"Email *"}),i.jsx("input",{type:"email",value:Ht,onChange:Ut=>{Se(Ut.target.value),rt.email&&Ze({})},style:To}),i.jsx(df,{msg:rt.email})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px"},children:[i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",display:"block",marginBottom:"4px",fontFamily:"var(--font-noto-sans)"},children:"Phone"}),i.jsx("input",{value:ct,onChange:Ut=>gt(Ut.target.value),style:To})]}),i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",display:"block",marginBottom:"4px",fontFamily:"var(--font-noto-sans)"},children:"Title / role"}),i.jsx("input",{value:We,onChange:Ut=>Pe(Ut.target.value),placeholder:"e.g. Prof. of Medicine",style:To})]})]}),i.jsxs("button",{type:"button",disabled:pe,onClick:Ke,style:{alignSelf:"flex-start",display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:pe?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:14})," ",pe?"Saving…":"Create & attach to session"]})]})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",marginBottom:"6px",fontFamily:"var(--font-noto-sans)"},children:"Session notes"}),i.jsx("textarea",{value:G,onChange:Ut=>re(Ut.target.value),rows:2,style:{...To,resize:"vertical"},placeholder:"Optional description for this session"})]}),i.jsxs("div",{style:{marginTop:"4px",padding:"14px",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",background:"var(--secondary)",display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontWeight:"600",margin:0,fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:"Attendee session page"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:0,fontFamily:"var(--font-noto-sans)",lineHeight:1.45},children:"Controls whether this session's mobile page shows quick links to feedback and ratings. The event must also have those features turned on in registration settings."}),i.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",cursor:"pointer",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)"},children:[i.jsx("input",{type:"checkbox",checked:ae,onChange:Ut=>{const $i=Ut.target.checked;le($i),$i||ie("")},style:{marginTop:"3px",width:"16px",height:"16px",flexShrink:0}}),i.jsxs("span",{style:{flex:1,minWidth:0},children:[i.jsx("span",{style:{fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)"},children:"Feedback form"}),i.jsx("span",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginTop:"2px"},children:"Show a link to submit event feedback from this session page."})]})]}),ae?i.jsxs("div",{style:{margin:"-4px 0 4px 26px"},children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",marginBottom:"6px",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"Which form?"}),i.jsxs("select",{value:we,onChange:Ut=>ie(Ut.target.value),disabled:Ie,style:{...To,cursor:Ie?"wait":"pointer",maxWidth:"100%"},children:[i.jsx("option",{value:"",children:"Default form"}),se.map(Ut=>i.jsx("option",{value:Ut._id,children:Ut.name},Ut._id))]}),n!=null&&n.trim()?null:i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"6px 0 0",fontFamily:"var(--font-noto-sans)",lineHeight:1.45},children:"Organization is required on the event to load forms from Forms & Workflow → Feedback."})]}):null,i.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"10px",cursor:"pointer",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)"},children:[i.jsx("input",{type:"checkbox",checked:me,onChange:Ut=>{const $i=Ut.target.checked;Oe($i),$i||ke("")},style:{marginTop:"3px",width:"16px",height:"16px",flexShrink:0}}),i.jsxs("span",{style:{flex:1,minWidth:0},children:[i.jsx("span",{style:{fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)"},children:"Ratings section"}),i.jsx("span",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginTop:"2px"},children:"Show a link to rate the event from this session page."})]})]}),me?i.jsxs("div",{style:{margin:"-4px 0 0 26px"},children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",marginBottom:"6px",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"Which form?"}),i.jsxs("select",{value:Me,onChange:Ut=>ke(Ut.target.value),disabled:Ie,style:{...To,cursor:Ie?"wait":"pointer",maxWidth:"100%"},children:[i.jsx("option",{value:"",children:"Default form"}),se.map(Ut=>i.jsx("option",{value:Ut._id,children:Ut.name},Ut._id))]})]}):null]})]}),i.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"16px",paddingTop:"12px",borderTop:"1px solid var(--border)"},children:zt.n<4?i.jsx("button",{type:"button",onClick:()=>ys(zt.n),style:{padding:"6px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:"Next section"}):i.jsx(xa,{})})]})]},zt.n)})}),i.jsxs("div",{style:{padding:"14px 20px",borderTop:"1px solid var(--border)",display:"flex",justifyContent:"flex-end",gap:"10px",flexShrink:0},children:[i.jsx("button",{type:"button",onClick:l,style:{padding:"7px 16px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"Cancel"}),i.jsx(xa,{})]})]})]})}function P1(e){return e==null||Number.isNaN(e)?"—":e.toLocaleString()}function boe({loading:e,participantCount:t,sessionCount:r,quizPollCount:n,pointsAwarded:o,statusCounts:a,upcomingSessionCount:s,pointsRedeemed:l}){const c=qi(),u=c==="mobile"?2:4,d=j.useMemo(()=>{if(e)return;const y=(a==null?void 0:a.checked_in)??0,m=(a==null?void 0:a.confirmed)??0;if(y)return`${y.toLocaleString()} checked in`;if(m)return`${m.toLocaleString()} confirmed`},[e,a]),f=!e&&s!=null&&s>0?`${s} upcoming`:void 0,h=!e&&l!=null&&l>0?`${l.toLocaleString()} redeemed`:void 0,p=[{icon:i.jsx(vi,{size:15}),label:"Participants",value:e?"—":P1(t),trend:d,trendUp:!!(a!=null&&a.checked_in&&a.checked_in>0),accent:"var(--chart-1)"},{icon:i.jsx(Sq,{size:15}),label:"Sessions",value:e?"—":P1(r),trend:f,trendUp:!1,accent:"var(--chart-3)"},{icon:i.jsx(nu,{size:15}),label:"Quizzes & Polls",value:e?"—":P1(n),trend:void 0,trendUp:!1,accent:"var(--chart-4)"},{icon:i.jsx(od,{size:15}),label:"Points Awarded",value:e?"—":P1(o),trend:h,trendUp:!1,accent:"var(--chart-2)"}];return i.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${u}, 1fr)`,gap:c==="mobile"?"10px":"12px"},children:p.map((y,m)=>i.jsxs("div",{style:{background:"var(--card)",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"3px",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopColor:"var(--border)",borderRightColor:"var(--border)",borderBottomColor:"var(--border)",borderLeftColor:y.accent,borderRadius:"var(--radius-card)",padding:c==="mobile"?"14px 14px":"16px 20px",display:"flex",alignItems:"flex-start",gap:"12px"},children:[i.jsx("div",{style:{width:"30px",height:"30px",borderRadius:"var(--radius-button)",background:y.accent+"15",display:"flex",alignItems:"center",justifyContent:"center",color:y.accent,flexShrink:0,marginTop:"2px"},children:y.icon}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:c==="mobile"?"var(--text-xl)":"var(--text-2xl)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.1"},children:y.value}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"3px",lineHeight:"1.3"},children:y.label}),y.trend&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:y.trendUp?"#16a34a":"var(--muted)",marginTop:"6px",lineHeight:"1.2"},children:y.trend})]})]},m))})}const O1={width:"100%",height:"36px",padding:"0 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--foreground)",outline:"none",boxSizing:"border-box"},wg={fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"6px",display:"block"},Xj=i.jsx("span",{style:{color:"var(--destructive)",marginLeft:"2px"},children:"*"}),woe=["Single Choice","Multiple Choice","True / False"];function Soe(e){return!!(e.text.trim()||e.imageUrl)}function BI({onSave:e,onClose:t,initial:r,eventId:n}){const[o,a]=j.useState((r==null?void 0:r.text)??""),[s,l]=j.useState((r==null?void 0:r.type)??"Single Choice"),[c,u]=j.useState((r==null?void 0:r.order)??0),[d,f]=j.useState((r==null?void 0:r.status)??"Active"),[h,p]=j.useState((r==null?void 0:r.imageUrl)??""),[y,m]=j.useState((r==null?void 0:r.options)??[{id:"o1",text:"",isCorrect:!1},{id:"o2",text:"",isCorrect:!1}]),[x,b]=j.useState(()=>{var U;return(r==null?void 0:r.useImagesOptions)??((U=r==null?void 0:r.options)==null?void 0:U.some(ee=>ee.imageUrl))??!1}),[w,k]=j.useState({}),[S,_]=j.useState(null),[P,O]=j.useState(null),T=j.useRef(null),R=()=>m(U=>[...U,{id:`o${Date.now()}`,text:"",isCorrect:!1}]),I=U=>m(ee=>ee.filter(H=>H.id!==U)),E=(U,ee,H)=>m(B=>B.map(M=>M.id!==U?M:ee==="isCorrect"&&H===!0&&s==="Single Choice"?{...M,isCorrect:!0}:{...M,[ee]:H}).map(M=>ee==="isCorrect"&&H===!0&&s==="Single Choice"&&M.id!==U?{...M,isCorrect:!1}:M)),A=async(U,ee)=>{O(null),_(ee);try{const H=await Ys(U,{eventId:n,module:"quiz-polls"});H!=null&&H.url&&(ee==="question"?p(H.url):E(ee,"imageUrl",H.url))}catch(H){O(H instanceof Error?H.message:"Upload failed")}finally{_(null)}},F=U=>{var H;const ee=(H=U.target.files)==null?void 0:H[0];U.target.value="",ee&&A(ee,"question")},L=(U,ee)=>{var B;const H=(B=ee.target.files)==null?void 0:B[0];ee.target.value="",H&&A(H,U)},z=()=>{const U={};return o.trim()||(U.text="Question text is required."),y.filter(Soe).length<2&&(U.options="At least 2 options with text and/or image are required."),k(U),Object.keys(U).length===0},V=()=>{z()&&(e({id:(r==null?void 0:r.id)??`q${Date.now()}`,text:o.trim(),type:s,order:c,status:d,options:y,imageUrl:h.trim()||void 0,useImagesOptions:x}),t())},Q=S==="question";return i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(15,48,114,0.28)",zIndex:200,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",backdropFilter:"blur(2px)"},children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"100%",maxWidth:"580px",maxHeight:"92vh",display:"flex",flexDirection:"column",boxShadow:"var(--elevation-sm)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 24px",borderBottom:"1px solid var(--border)"},children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:r?"Edit Question":"Add Question"}),i.jsx("button",{onClick:t,style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex"},children:i.jsx(er,{size:16})})]}),i.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"20px 24px",display:"flex",flexDirection:"column",gap:"18px"},children:[i.jsxs("div",{children:[i.jsxs("label",{style:wg,children:["Question ",Xj]}),i.jsx("textarea",{value:o,onChange:U=>{a(U.target.value),w.text&&k(ee=>({...ee,text:""}))},rows:3,placeholder:"Enter your question…",style:{...O1,height:"auto",padding:"10px",resize:"vertical",lineHeight:"1.5",borderColor:w.text?"var(--destructive)":"var(--border)"},onFocus:U=>{U.currentTarget.style.borderColor="var(--ring)"},onBlur:U=>{U.currentTarget.style.borderColor=w.text?"var(--destructive)":"var(--border)"}}),w.text&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--destructive)",marginTop:"4px"},children:w.text})]}),i.jsxs("div",{children:[i.jsx("label",{style:wg,children:"Question Image"}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",overflow:"hidden"},children:[i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",padding:"0 14px",height:"36px",background:Q?"var(--border)":"var(--secondary)",cursor:Q?"wait":"pointer",borderRight:"1px solid var(--border)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",whiteSpace:"nowrap",flexShrink:0},children:[i.jsx(R0,{size:13,style:{color:"var(--muted)"}}),Q?"Uploading…":"Choose File",i.jsx("input",{ref:T,type:"file",accept:"image/*",disabled:!!Q,onChange:F,style:{display:"none"}})]}),i.jsx("span",{style:{padding:"0 12px",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0},children:h?"Image attached":"No file chosen"}),h&&i.jsx("button",{type:"button",onClick:()=>p(""),style:{padding:"0 10px",height:"36px",border:"none",background:"transparent",color:"var(--destructive)",fontSize:"var(--text-xs)",cursor:"pointer",flexShrink:0},children:"Remove"})]}),h&&i.jsx("img",{src:h,alt:"",style:{marginTop:"8px",maxWidth:"100%",maxHeight:"160px",borderRadius:"var(--radius-button)",objectFit:"contain",border:"1px solid var(--border)"}}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"4px"},children:"Optional: uploads via media library (S3 / CloudFront)"}),P&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",marginTop:"4px"},children:P})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px"},children:[i.jsxs("div",{children:[i.jsxs("label",{style:wg,children:["Question Type ",Xj]}),i.jsxs("div",{style:{position:"relative"},children:[i.jsx("select",{value:s,onChange:U=>l(U.target.value),style:{...O1,appearance:"none",paddingRight:"28px",cursor:"pointer"},children:woe.map(U=>i.jsx("option",{value:U,children:U},U))}),i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",style:{position:"absolute",right:"10px",top:"50%",transform:"translateY(-50%)",pointerEvents:"none",color:"var(--muted)"},fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:i.jsx("path",{d:"M2 4l4 4 4-4"})})]})]}),i.jsxs("div",{children:[i.jsx("label",{style:wg,children:"Order"}),i.jsx("input",{type:"number",min:0,value:c,onChange:U=>u(Number(U.target.value)),style:O1,onFocus:U=>{U.currentTarget.style.borderColor="var(--ring)"},onBlur:U=>{U.currentTarget.style.borderColor="var(--border)"}})]})]}),i.jsxs("div",{children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},children:[i.jsxs("label",{style:{...wg,marginBottom:0},children:["Options ",Xj]}),i.jsxs("button",{type:"button",onClick:()=>b(U=>!U),style:{display:"flex",alignItems:"center",gap:"6px",background:"none",border:"none",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[i.jsx("span",{style:{width:"14px",height:"14px",borderRadius:"50%",background:x?"var(--primary)":"var(--border)",display:"block",flexShrink:0}}),"Use Images in Options"]})]}),w.options&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--destructive)",marginBottom:"6px"},children:w.options}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:y.map((U,ee)=>i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",padding:x?"10px":"0",border:x?"1px solid var(--border)":"none",borderRadius:"var(--radius-button)",background:x?"var(--secondary)":"transparent"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("input",{type:"text",placeholder:x?`Label / alt text (option ${ee+1})`:`Enter option ${ee+1}`,value:U.text,onChange:H=>E(U.id,"text",H.target.value),style:{...O1,flex:1},onFocus:H=>{H.currentTarget.style.borderColor="var(--ring)"},onBlur:H=>{H.currentTarget.style.borderColor="var(--border)"}}),i.jsxs("button",{type:"button",onClick:()=>E(U.id,"isCorrect",!U.isCorrect),style:{display:"flex",alignItems:"center",gap:"5px",padding:"0 10px",height:"36px",borderRadius:"var(--radius-button)",border:`1px solid ${U.isCorrect?"#16a34a":"var(--border)"}`,background:U.isCorrect?"#f0fdf4":"var(--card)",color:U.isCorrect?"#15803d":"var(--muted)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:U.isCorrect?"var(--font-weight-medium)":"var(--font-weight-normal)",cursor:"pointer",transition:"all 0.12s",whiteSpace:"nowrap",flexShrink:0},children:[U.isCorrect&&i.jsx(Oi,{size:11,strokeWidth:2.5}),"Correct"]}),i.jsx("button",{type:"button",onClick:()=>y.length>2&&I(U.id),disabled:y.length<=2,style:{width:"36px",height:"36px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--radius-button)",border:"none",background:y.length<=2?"var(--border)":"var(--destructive)",color:"#fff",cursor:y.length<=2?"not-allowed":"pointer",flexShrink:0},children:i.jsx(gn,{size:13})})]}),x&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"0 12px",height:"32px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:S===U.id?"var(--border)":"var(--card)",cursor:S===U.id?"wait":"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(R0,{size:12}),S===U.id?"Uploading…":"Option image",i.jsx("input",{type:"file",accept:"image/*",disabled:S===U.id,onChange:H=>L(U.id,H),style:{display:"none"}})]}),U.imageUrl&&i.jsxs(i.Fragment,{children:[i.jsx("img",{src:U.imageUrl,alt:"",style:{width:"48px",height:"48px",objectFit:"cover",borderRadius:"6px",border:"1px solid var(--border)"}}),i.jsx("button",{type:"button",onClick:()=>E(U.id,"imageUrl",""),style:{fontSize:"var(--text-xs)",color:"var(--destructive)",background:"none",border:"none",cursor:"pointer"},children:"Remove image"})]})]})]},U.id))}),i.jsxs("button",{type:"button",onClick:R,style:{display:"inline-flex",alignItems:"center",gap:"5px",marginTop:"10px",padding:"5px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--primary)",background:"transparent",color:"var(--primary)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:[i.jsx(wr,{size:13})," Add Option"]})]}),i.jsxs("div",{children:[i.jsx("label",{style:wg,children:"Status"}),i.jsx("div",{style:{display:"flex",gap:"8px"},children:["Active","Draft"].map(U=>i.jsx("button",{type:"button",onClick:()=>f(U),style:{padding:"6px 16px",borderRadius:"var(--radius-button)",border:`1px solid ${d===U?"var(--primary)":"var(--border)"}`,background:d===U?"var(--accent)":"var(--card)",color:d===U?"var(--primary)":"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:d===U?"var(--font-weight-medium)":"var(--font-weight-normal)",cursor:"pointer"},children:U},U))})]})]}),i.jsxs("div",{style:{padding:"14px 24px",borderTop:"1px solid var(--border)",display:"flex",justifyContent:"flex-end",gap:"8px"},children:[i.jsx("button",{type:"button",onClick:t,style:{padding:"8px 18px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:"Cancel"}),i.jsx("button",{type:"button",onClick:V,style:{padding:"8px 18px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",cursor:"pointer"},children:"Save Question"})]})]})})}const Yu={width:"100%",height:"36px",padding:"0 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--foreground)",outline:"none",boxSizing:"border-box"},joe={fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"5px",display:"block"},W0={fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"4px",lineHeight:"1.45"},koe=i.jsx("span",{style:{color:"var(--destructive)",marginLeft:"2px"},children:"*"}),_oe=["always_live","always_sched","manual","quiz_master"],Coe=[{value:"",label:"-- Select Display Mode --"},{value:"always_live",label:"Always Visible and Live"},{value:"always_sched",label:"Always Visible and Scheduled Live"},{value:"quiz_master",label:"Quiz Master mode (1 question at a time manually)"},{value:"manual",label:"Not Visible and Manual Live"}],lE=["-- Select Status --","Active","Draft"];function nT(){return{title:"",description:"",status:lE[0],displayMode:"",isLive:"No",scheduledStart:"",scheduledEnd:"",timeRestricted:"No",timeLimit:0,showResults:"No",multipleAttempts:"No",rewardQuizPollSubmitted:"",rewardQuizCorrectPerQuestion:"",rewardPollParticipation:""}}function q0(e){if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const r=n=>String(n).padStart(2,"0");return`${t.getFullYear()}-${r(t.getMonth()+1)}-${r(t.getDate())}T${r(t.getHours())}:${r(t.getMinutes())}`}function $0(e){if(!(e!=null&&e.trim()))return;const t=new Date(e).getTime();if(!Number.isNaN(t))return new Date(t).toISOString()}function WI(){const e=new Date;e.setMinutes(0,0,0);const t=new Date(e.getTime()+7200*1e3);return{start:q0(e.toISOString()),end:q0(t.toISOString())}}function Eoe(e){return _oe.includes(e)}function Aoe(e,t){const r=e.settings||{},n=r.rewardRules&&typeof r.rewardRules=="object"?r.rewardRules:{};let o=typeof r.displayMode=="string"?r.displayMode:"";(!o||!Eoe(o))&&(r.startTime&&r.endTime?o="always_sched":o="always_live");const a=o==="always_sched",s=typeof r.status=="string"?r.status:"",l=typeof r.isLive=="boolean"?r.isLive:r.isActive===!0,c=s==="draft"||!s&&typeof r.isLive!="boolean"&&r.isActive===!1;return{form:{title:e.title||"",description:e.description||"",status:c?"Draft":"Active",displayMode:o,isLive:l?"Yes":"No",scheduledStart:a?q0(r.startTime):"",scheduledEnd:a?q0(r.endTime):"",timeRestricted:r.timeRestricted===!0?"Yes":"No",timeLimit:typeof r.timeLimit=="number"&&Number.isFinite(r.timeLimit)?r.timeLimit:0,showResults:r.showResults!==!1?"Yes":"No",multipleAttempts:r.allowMultipleAttempts?"Yes":"No",rewardQuizPollSubmitted:n.quizPollSubmitted!=null&&n.quizPollSubmitted!==""?String(n.quizPollSubmitted):"",rewardQuizCorrectPerQuestion:n.quizCorrectPerQuestion!=null&&n.quizCorrectPerQuestion!==""?String(n.quizCorrectPerQuestion):"",rewardPollParticipation:n.pollParticipation!=null&&n.pollParticipation!==""?String(n.pollParticipation):""},questions:t}}function Sg(e){const t=String(e??"").trim();if(t==="")return;const r=Number(t);return Number.isFinite(r)?r:void 0}function iT(e,t){const r=e.displayMode==="always_sched",n={status:e.status==="Draft"?"draft":"active",isLive:e.isLive==="Yes",displayMode:e.displayMode||"always_live",startTime:r?$0(e.scheduledStart)??null:null,endTime:r?$0(e.scheduledEnd)??null:null,showResults:e.showResults==="Yes",allowMultipleAttempts:e.multipleAttempts==="Yes",timeRestricted:e.timeRestricted==="Yes",timeLimit:Math.max(0,Math.floor(Number(e.timeLimit))||0)},o={};if(t==="quiz"){const a=Sg(e.rewardQuizPollSubmitted),s=Sg(e.rewardQuizCorrectPerQuestion);a!==void 0&&(o.quizPollSubmitted=a),s!==void 0&&(o.quizCorrectPerQuestion=s)}else if(t==="poll"){const a=Sg(e.rewardPollParticipation);a!==void 0&&(o.pollParticipation=a)}else{const a=Sg(e.rewardQuizPollSubmitted),s=Sg(e.rewardQuizCorrectPerQuestion),l=Sg(e.rewardPollParticipation);a!==void 0&&(o.quizPollSubmitted=a),s!==void 0&&(o.quizCorrectPerQuestion=s),l!==void 0&&(o.pollParticipation=l)}return Object.keys(o).length&&(n.rewardRules=o),n}function is({label:e,hint:t,required:r,error:n,children:o}){return i.jsxs("div",{children:[i.jsxs("label",{style:joe,children:[e,r&&koe]}),o,t&&!n&&i.jsx("p",{style:W0,children:t}),n&&i.jsx("p",{style:{...W0,color:"var(--destructive)"},children:n})]})}function jg({value:e,onChange:t,options:r,error:n}){const o=r.map(a=>typeof a=="string"?{value:a,label:a}:a);return i.jsxs("div",{style:{position:"relative"},children:[i.jsx("select",{value:e,onChange:a=>t(a.target.value),style:{...Yu,appearance:"none",paddingRight:"28px",cursor:"pointer",borderColor:n?"var(--destructive)":"var(--border)"},children:o.map(a=>i.jsx("option",{value:a.value,children:a.label},a.value))}),i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",style:{position:"absolute",right:"10px",top:"50%",transform:"translateY(-50%)",pointerEvents:"none",color:"var(--muted)"},fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:i.jsx("path",{d:"M2 4l4 4 4-4"})})]})}function Toe({q:e,index:t,onEdit:r,onDelete:n}){const[o,a]=j.useState(!1);return i.jsxs("div",{onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"12px 14px",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",background:o?"var(--secondary)":"var(--card)",transition:"background 0.12s"},children:[i.jsx("span",{style:{width:"22px",height:"22px",borderRadius:"50%",background:"var(--accent)",color:"var(--primary)",fontSize:"11px",fontFamily:"var(--font-inter)",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:"1px"},children:t+1}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"flex-start"},children:[e.imageUrl&&i.jsx("img",{src:e.imageUrl,alt:"",style:{width:"44px",height:"44px",objectFit:"cover",borderRadius:"6px",border:"1px solid var(--border)",flexShrink:0}}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)",lineHeight:"1.4",marginBottom:"4px",flex:1,minWidth:0},children:e.text})]}),i.jsxs("div",{style:{display:"flex",gap:"6px",flexWrap:"wrap"},children:[i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",padding:"1px 7px",borderRadius:"3px",background:"var(--accent)",color:"var(--accent-foreground)"},children:e.type}),i.jsxs("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[e.options.length," options"]}),e.options.some(s=>s.imageUrl)&&i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"with images"}),i.jsxs("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"#15803d"},children:[e.options.filter(s=>s.isCorrect).length," correct"]})]})]}),i.jsxs("div",{style:{display:"flex",gap:"4px",opacity:o?1:0,transition:"opacity 0.15s",flexShrink:0},children:[i.jsx("button",{type:"button",onClick:r,style:{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",cursor:"pointer"},onMouseEnter:s=>{s.currentTarget.style.borderColor="var(--primary)",s.currentTarget.style.color="var(--primary)"},onMouseLeave:s=>{s.currentTarget.style.borderColor="var(--border)",s.currentTarget.style.color="var(--muted)"},children:i.jsx(Ii,{size:12})}),i.jsx("button",{type:"button",onClick:n,style:{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",cursor:"pointer"},onMouseEnter:s=>{s.currentTarget.style.borderColor="var(--destructive)",s.currentTarget.style.color="var(--destructive)"},onMouseLeave:s=>{s.currentTarget.style.borderColor="var(--border)",s.currentTarget.style.color="var(--muted)"},children:i.jsx(gn,{size:12})})]})]})}function ax({kind:e,initial:t,onClose:r,onSave:n,eventId:o,variant:a="modal"}){const[s,l]=j.useState("settings"),[c,u]=j.useState((t==null?void 0:t.questions)??[]),[d,f]=j.useState(!1),[h,p]=j.useState(null),[y,m]=j.useState({}),[x,b]=j.useState((t==null?void 0:t.form)??nT()),w=e==="poll"?"Poll":"Quiz",k=(A,F)=>{b(L=>({...L,[A]:F})),y[A]&&m(L=>({...L,[A]:""}))},S=()=>{const A={};if(x.title.trim()||(A.title=`${w} title is required.`),x.status===lE[0]&&(A.status="Please select a status."),x.displayMode||(A.displayMode="Please select a display mode."),x.displayMode==="always_sched"){x.scheduledStart.trim()||(A.scheduledStart="Start date & time is required."),x.scheduledEnd.trim()||(A.scheduledEnd="End date & time is required.");const F=new Date(x.scheduledStart).getTime(),L=new Date(x.scheduledEnd).getTime();Number.isFinite(F)&&Number.isFinite(L)&&L<=F&&(A.scheduledEnd="End must be after start.")}return m(A),Object.keys(A).length===0},_=()=>{if(c.length===0){m(A=>({...A,questions:"Add at least one question."}));return}n==null||n({form:x,questions:c})},P=A=>u(F=>[...F,A]),O=A=>u(F=>F.filter(L=>L.id!==A)),T=A=>u(F=>F.map(L=>L.id===A.id?A:L)),R=[{value:"No",label:"No"},{value:"Yes",label:"Yes"}],E=i.jsxs("div",{style:{background:"var(--card)",borderRadius:a==="panel"?0:"var(--radius-card)",width:"100%",maxWidth:a==="panel"?"none":"720px",height:a==="panel"?"100%":void 0,maxHeight:a==="panel"?"100%":"92vh",display:"flex",flexDirection:"column",boxShadow:a==="panel"?"none":"var(--elevation-sm)",minHeight:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 24px",borderBottom:"1px solid var(--border)"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"2px"},children:t?`Edit ${w}`:`Add ${w}`}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Session quiz / poll"})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[s==="questions"&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",onClick:_,style:{padding:"7px 16px",borderRadius:"var(--radius-button)",background:"#16a34a",border:"none",color:"#fff",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",cursor:"pointer"},children:["Save ",w]}),i.jsx("button",{type:"button",onClick:()=>l("settings"),style:{padding:"7px 16px",borderRadius:"var(--radius-button)",background:"var(--secondary)",border:"1px solid var(--border)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:"Back"})]}),s==="settings"&&i.jsx("button",{type:"button",onClick:()=>{S()&&l("questions")},style:{padding:"7px 16px",borderRadius:"var(--radius-button)",background:"#16a34a",border:"none",color:"#fff",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",cursor:"pointer"},children:"Next →"}),i.jsx("button",{type:"button",onClick:r,style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",marginLeft:"4px"},children:i.jsx(er,{size:16})})]})]}),i.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--border)",padding:"0 24px"},children:["settings","questions"].map((A,F)=>i.jsxs("button",{type:"button",onClick:()=>{A==="questions"?S()&&l("questions"):l("settings")},style:{padding:"10px 0",marginRight:"24px",background:"none",border:"none",borderBottom:`2px solid ${s===A?"var(--primary)":"transparent"}`,cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:s===A?"var(--font-weight-medium)":"var(--font-weight-normal)",color:s===A?"var(--primary)":"var(--muted)",display:"flex",alignItems:"center",gap:"6px"},children:[i.jsx("span",{style:{width:"18px",height:"18px",borderRadius:"50%",background:s===A?"var(--primary)":F===1&&c.length>0?"#16a34a":"var(--border)",color:"#fff",fontSize:"10px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:F===1&&c.length>0?c.length:F+1}),A==="settings"?"Settings":"Questions"]},A))}),i.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"20px 24px"},children:[s==="settings"&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[i.jsx(is,{label:`${w} Title`,required:!0,error:y.title,children:i.jsx("input",{value:x.title,onChange:A=>k("title",A.target.value),placeholder:`Enter ${w.toLowerCase()} title`,style:{...Yu,borderColor:y.title?"var(--destructive)":"var(--border)"},onFocus:A=>{A.currentTarget.style.borderColor="var(--ring)"},onBlur:A=>{A.currentTarget.style.borderColor=y.title?"var(--destructive)":"var(--border)"}})}),i.jsx(is,{label:"Description",children:i.jsx("textarea",{value:x.description,onChange:A=>k("description",A.target.value),rows:3,placeholder:"Enter description",style:{...Yu,height:"auto",padding:"10px",resize:"vertical",lineHeight:"1.5"},onFocus:A=>{A.currentTarget.style.borderColor="var(--ring)"},onBlur:A=>{A.currentTarget.style.borderColor="var(--border)"}})}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[i.jsx(is,{label:"Status",required:!0,error:y.status,children:i.jsx(jg,{value:x.status,onChange:A=>k("status",A),options:lE.map(A=>({value:A,label:A})),error:y.status})}),i.jsx(is,{label:"Is Live",hint:'Manually set if this item is currently live. For "Not Visible and Manual Live", set to Yes when you want it live.',children:i.jsx(jg,{value:x.isLive,onChange:A=>k("isLive",A),options:R})})]}),i.jsx(is,{label:"Display Mode",required:!0,hint:"Always Visible and Live: visible and live immediately. Always Visible and Scheduled Live: visible; live window uses start/end below. Quiz Master: one question at a time, advanced manually. Not Visible and Manual Live: hidden until you mark live.",error:y.displayMode,children:i.jsx(jg,{value:x.displayMode,onChange:A=>k("displayMode",A),options:Coe,error:y.displayMode})}),x.displayMode==="always_sched"&&i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[i.jsx(is,{label:"Start date & time",required:!0,error:y.scheduledStart,children:i.jsx(jf,{value:x.scheduledStart,onChange:A=>k("scheduledStart",A),style:Yu,hasError:!!y.scheduledStart})}),i.jsx(is,{label:"End date & time",required:!0,error:y.scheduledEnd,children:i.jsx(jf,{value:x.scheduledEnd,onChange:A=>k("scheduledEnd",A),style:Yu,hasError:!!y.scheduledEnd})})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[i.jsx(is,{label:"Time Restricted",required:!0,hint:"If enabled, enforce a time limit when the user takes the quiz/poll (synced to the database and live clients).",children:i.jsx(jg,{value:x.timeRestricted,onChange:A=>k("timeRestricted",A),options:R})}),i.jsx(is,{label:"Time Limit (seconds)",hint:"Only used if Time Restricted is Yes.",children:i.jsx("input",{type:"number",min:0,value:x.timeLimit,onChange:A=>k("timeLimit",Number(A.target.value)),style:Yu,onFocus:A=>{A.currentTarget.style.borderColor="var(--ring)"},onBlur:A=>{A.currentTarget.style.borderColor="var(--border)"}})})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[i.jsx(is,{label:"Show Results After Submission",required:!0,hint:"Show results/score after submit.",children:i.jsx(jg,{value:x.showResults,onChange:A=>k("showResults",A),options:R})}),i.jsx(is,{label:"Allow Multiple Attempts",required:!0,children:i.jsx(jg,{value:x.multipleAttempts,onChange:A=>k("multipleAttempts",A),options:R})})]}),i.jsxs("div",{style:{borderTop:"1px solid var(--border)",paddingTop:"16px",marginTop:"4px"},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",fontFamily:"var(--font-noto-sans)",marginBottom:"10px",color:"var(--foreground)"},children:"Loyalty points (optional overrides)"}),i.jsx("p",{style:{...W0,marginBottom:"12px"},children:"Leave blank to use session/event defaults. Enter 0 to disable this action for this activity only."}),e==="quiz"?i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[i.jsx(is,{label:"Points per quiz submission",hint:"When a visitor submits this quiz.",children:i.jsx("input",{type:"number",min:0,value:x.rewardQuizPollSubmitted,onChange:A=>k("rewardQuizPollSubmitted",A.target.value),placeholder:"Inherit",style:Yu})}),i.jsx(is,{label:"Points per correct question",hint:"Loyalty only; separate from scoring points per question.",children:i.jsx("input",{type:"number",min:0,value:x.rewardQuizCorrectPerQuestion,onChange:A=>k("rewardQuizCorrectPerQuestion",A.target.value),placeholder:"Inherit",style:Yu})})]}):i.jsx("div",{style:{maxWidth:"360px"},children:i.jsx(is,{label:"Points for poll/survey participation",hint:"When a visitor submits this poll.",children:i.jsx("input",{type:"number",min:0,value:x.rewardPollParticipation,onChange:A=>k("rewardPollParticipation",A.target.value),placeholder:"Inherit",style:Yu})})})]})]}),s==="questions"&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px"},children:[i.jsxs("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[c.length," question",c.length!==1?"s":""," added"]}),i.jsxs("button",{type:"button",onClick:()=>f(!0),style:{display:"flex",alignItems:"center",gap:"5px",padding:"6px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:13})," Add Question"]})]}),y.questions&&i.jsx("p",{style:{...W0,color:"var(--destructive)"},children:y.questions}),c.length===0?i.jsxs("div",{style:{textAlign:"center",padding:"48px 20px",border:"2px dashed var(--border)",borderRadius:"var(--radius-card)"},children:[i.jsx(ib,{size:32,style:{color:"var(--border)",margin:"0 auto 12px"}}),i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"6px"},children:"No questions yet"}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"16px"},children:"Add at least one question."}),i.jsxs("button",{type:"button",onClick:()=>f(!0),style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"7px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:13})," Add First Question"]})]}):i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[c.map((A,F)=>i.jsx(Toe,{q:A,index:F,onEdit:()=>p(A),onDelete:()=>O(A.id)},A.id)),i.jsxs("button",{type:"button",onClick:()=>f(!0),style:{display:"flex",alignItems:"center",gap:"5px",padding:"10px",borderRadius:"var(--radius-card)",border:"2px dashed var(--border)",background:"transparent",color:"var(--muted)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer",justifyContent:"center",transition:"border-color 0.12s, color 0.12s"},onMouseEnter:A=>{A.currentTarget.style.borderColor="var(--primary)",A.currentTarget.style.color="var(--primary)"},onMouseLeave:A=>{A.currentTarget.style.borderColor="var(--border)",A.currentTarget.style.color="var(--muted)"},children:[i.jsx(wr,{size:13})," Add another question"]})]})]})]}),i.jsxs("div",{style:{padding:"14px 24px",borderTop:"1px solid var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[i.jsx("div",{children:s==="questions"&&i.jsx("button",{type:"button",onClick:()=>l("settings"),style:{background:"none",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"← Back"})}),i.jsxs("div",{style:{display:"flex",gap:"8px"},children:[i.jsx("button",{type:"button",onClick:r,style:{padding:"8px 18px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:"Cancel"}),s==="settings"?i.jsx("button",{type:"button",onClick:()=>{S()&&l("questions")},style:{padding:"8px 18px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",cursor:"pointer"},children:"Next: Questions →"}):i.jsxs("button",{type:"button",onClick:_,style:{padding:"8px 18px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",cursor:"pointer"},children:["Save ",w]})]})]})]});return i.jsxs(i.Fragment,{children:[a==="panel"?E:i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(15,48,114,0.28)",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",backdropFilter:"blur(2px)"},children:E}),d&&i.jsx(BI,{eventId:o,onClose:()=>f(!1),onSave:P}),h&&i.jsx(BI,{eventId:o,initial:h,onClose:()=>p(null),onSave:T})]})}var kg={},Zj,qI;function Poe(){return qI||(qI=1,Zj=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Zj}var Jj={},ff={},$I;function Th(){if($I)return ff;$I=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return ff.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},ff.getSymbolTotalCodewords=function(n){return t[n]},ff.getBCHDigit=function(r){let n=0;for(;r!==0;)n++,r>>>=1;return n},ff.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');e=n},ff.isKanjiModeEnabled=function(){return typeof e<"u"},ff.toSJIS=function(n){return e(n)},ff}var e5={},UI;function oT(){return UI||(UI=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},e.from=function(n,o){if(e.isValid(n))return n;try{return t(n)}catch{return o}}})(e5)),e5}var t5,HI;function Ooe(){if(HI)return t5;HI=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const r=Math.floor(t/8);return(this.buffer[r]>>>7-t%8&1)===1},put:function(t,r){for(let n=0;n<r;n++)this.putBit((t>>>r-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),t&&(this.buffer[r]|=128>>>this.length%8),this.length++}},t5=e,t5}var r5,VI;function Ioe(){if(VI)return r5;VI=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,r,n,o){const a=t*this.size+r;this.data[a]=n,o&&(this.reservedBit[a]=!0)},e.prototype.get=function(t,r){return this.data[t*this.size+r]},e.prototype.xor=function(t,r,n){this.data[t*this.size+r]^=n},e.prototype.isReserved=function(t,r){return this.reservedBit[t*this.size+r]},r5=e,r5}var n5={},YI;function Noe(){return YI||(YI=1,(function(e){const t=Th().getSymbolSize;e.getRowColCoords=function(n){if(n===1)return[];const o=Math.floor(n/7)+2,a=t(n),s=a===145?26:Math.ceil((a-13)/(2*o-2))*2,l=[a-7];for(let c=1;c<o-1;c++)l[c]=l[c-1]-s;return l.push(6),l.reverse()},e.getPositions=function(n){const o=[],a=e.getRowColCoords(n),s=a.length;for(let l=0;l<s;l++)for(let c=0;c<s;c++)l===0&&c===0||l===0&&c===s-1||l===s-1&&c===0||o.push([a[l],a[c]]);return o}})(n5)),n5}var i5={},GI;function Roe(){if(GI)return i5;GI=1;const e=Th().getSymbolSize,t=7;return i5.getPositions=function(n){const o=e(n);return[[0,0],[o-t,0],[0,o-t]]},i5}var o5={},KI;function Loe(){return KI||(KI=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(o){return o!=null&&o!==""&&!isNaN(o)&&o>=0&&o<=7},e.from=function(o){return e.isValid(o)?parseInt(o,10):void 0},e.getPenaltyN1=function(o){const a=o.size;let s=0,l=0,c=0,u=null,d=null;for(let f=0;f<a;f++){l=c=0,u=d=null;for(let h=0;h<a;h++){let p=o.get(f,h);p===u?l++:(l>=5&&(s+=t.N1+(l-5)),u=p,l=1),p=o.get(h,f),p===d?c++:(c>=5&&(s+=t.N1+(c-5)),d=p,c=1)}l>=5&&(s+=t.N1+(l-5)),c>=5&&(s+=t.N1+(c-5))}return s},e.getPenaltyN2=function(o){const a=o.size;let s=0;for(let l=0;l<a-1;l++)for(let c=0;c<a-1;c++){const u=o.get(l,c)+o.get(l,c+1)+o.get(l+1,c)+o.get(l+1,c+1);(u===4||u===0)&&s++}return s*t.N2},e.getPenaltyN3=function(o){const a=o.size;let s=0,l=0,c=0;for(let u=0;u<a;u++){l=c=0;for(let d=0;d<a;d++)l=l<<1&2047|o.get(u,d),d>=10&&(l===1488||l===93)&&s++,c=c<<1&2047|o.get(d,u),d>=10&&(c===1488||c===93)&&s++}return s*t.N3},e.getPenaltyN4=function(o){let a=0;const s=o.data.length;for(let c=0;c<s;c++)a+=o.data[c];return Math.abs(Math.ceil(a*100/s/5)-10)*t.N4};function r(n,o,a){switch(n){case e.Patterns.PATTERN000:return(o+a)%2===0;case e.Patterns.PATTERN001:return o%2===0;case e.Patterns.PATTERN010:return a%3===0;case e.Patterns.PATTERN011:return(o+a)%3===0;case e.Patterns.PATTERN100:return(Math.floor(o/2)+Math.floor(a/3))%2===0;case e.Patterns.PATTERN101:return o*a%2+o*a%3===0;case e.Patterns.PATTERN110:return(o*a%2+o*a%3)%2===0;case e.Patterns.PATTERN111:return(o*a%3+(o+a)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}e.applyMask=function(o,a){const s=a.size;for(let l=0;l<s;l++)for(let c=0;c<s;c++)a.isReserved(c,l)||a.xor(c,l,r(o,c,l))},e.getBestMask=function(o,a){const s=Object.keys(e.Patterns).length;let l=0,c=1/0;for(let u=0;u<s;u++){a(u),e.applyMask(u,o);const d=e.getPenaltyN1(o)+e.getPenaltyN2(o)+e.getPenaltyN3(o)+e.getPenaltyN4(o);e.applyMask(u,o),d<c&&(c=d,l=u)}return l}})(o5)),o5}var I1={},QI;function Y$(){if(QI)return I1;QI=1;const e=oT(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return I1.getBlocksCount=function(o,a){switch(a){case e.L:return t[(o-1)*4+0];case e.M:return t[(o-1)*4+1];case e.Q:return t[(o-1)*4+2];case e.H:return t[(o-1)*4+3];default:return}},I1.getTotalCodewordsCount=function(o,a){switch(a){case e.L:return r[(o-1)*4+0];case e.M:return r[(o-1)*4+1];case e.Q:return r[(o-1)*4+2];case e.H:return r[(o-1)*4+3];default:return}},I1}var a5={},sy={},XI;function Foe(){if(XI)return sy;XI=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let n=1;for(let o=0;o<255;o++)e[o]=n,t[n]=o,n<<=1,n&256&&(n^=285);for(let o=255;o<512;o++)e[o]=e[o-255]})(),sy.log=function(n){if(n<1)throw new Error("log("+n+")");return t[n]},sy.exp=function(n){return e[n]},sy.mul=function(n,o){return n===0||o===0?0:e[t[n]+t[o]]},sy}var ZI;function Moe(){return ZI||(ZI=1,(function(e){const t=Foe();e.mul=function(n,o){const a=new Uint8Array(n.length+o.length-1);for(let s=0;s<n.length;s++)for(let l=0;l<o.length;l++)a[s+l]^=t.mul(n[s],o[l]);return a},e.mod=function(n,o){let a=new Uint8Array(n);for(;a.length-o.length>=0;){const s=a[0];for(let c=0;c<o.length;c++)a[c]^=t.mul(o[c],s);let l=0;for(;l<a.length&&a[l]===0;)l++;a=a.slice(l)}return a},e.generateECPolynomial=function(n){let o=new Uint8Array([1]);for(let a=0;a<n;a++)o=e.mul(o,new Uint8Array([1,t.exp(a)]));return o}})(a5)),a5}var s5,JI;function Doe(){if(JI)return s5;JI=1;const e=Moe();function t(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(n){this.degree=n,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const o=new Uint8Array(n.length+this.degree);o.set(n);const a=e.mod(o,this.genPoly),s=this.degree-a.length;if(s>0){const l=new Uint8Array(this.degree);return l.set(a,s),l}return a},s5=t,s5}var l5={},c5={},u5={},eN;function G$(){return eN||(eN=1,u5.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),u5}var Mc={},tN;function K$(){if(tN)return Mc;tN=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
|
||
]))+`;Mc.KANJI=new RegExp(r,"g"),Mc.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Mc.BYTE=new RegExp(n,"g"),Mc.NUMERIC=new RegExp(e,"g"),Mc.ALPHANUMERIC=new RegExp(t,"g");const o=new RegExp("^"+r+"$"),a=new RegExp("^"+e+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Mc.testKanji=function(c){return o.test(c)},Mc.testNumeric=function(c){return a.test(c)},Mc.testAlphanumeric=function(c){return s.test(c)},Mc}var rN;function Ph(){return rN||(rN=1,(function(e){const t=G$(),r=K$();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(a,s){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?a.ccBits[0]:s<27?a.ccBits[1]:a.ccBits[2]},e.getBestModeForData=function(a){return r.testNumeric(a)?e.NUMERIC:r.testAlphanumeric(a)?e.ALPHANUMERIC:r.testKanji(a)?e.KANJI:e.BYTE},e.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},e.isValid=function(a){return a&&a.bit&&a.ccBits};function n(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+o)}}e.from=function(a,s){if(e.isValid(a))return a;try{return n(a)}catch{return s}}})(c5)),c5}var nN;function zoe(){return nN||(nN=1,(function(e){const t=Th(),r=Y$(),n=oT(),o=Ph(),a=G$(),s=7973,l=t.getBCHDigit(s);function c(h,p,y){for(let m=1;m<=40;m++)if(p<=e.getCapacity(m,y,h))return m}function u(h,p){return o.getCharCountIndicator(h,p)+4}function d(h,p){let y=0;return h.forEach(function(m){const x=u(m.mode,p);y+=x+m.getBitsLength()}),y}function f(h,p){for(let y=1;y<=40;y++)if(d(h,y)<=e.getCapacity(y,p,o.MIXED))return y}e.from=function(p,y){return a.isValid(p)?parseInt(p,10):y},e.getCapacity=function(p,y,m){if(!a.isValid(p))throw new Error("Invalid QR Code version");typeof m>"u"&&(m=o.BYTE);const x=t.getSymbolTotalCodewords(p),b=r.getTotalCodewordsCount(p,y),w=(x-b)*8;if(m===o.MIXED)return w;const k=w-u(m,p);switch(m){case o.NUMERIC:return Math.floor(k/10*3);case o.ALPHANUMERIC:return Math.floor(k/11*2);case o.KANJI:return Math.floor(k/13);case o.BYTE:default:return Math.floor(k/8)}},e.getBestVersionForData=function(p,y){let m;const x=n.from(y,n.M);if(Array.isArray(p)){if(p.length>1)return f(p,x);if(p.length===0)return 1;m=p[0]}else m=p;return c(m.mode,m.getLength(),x)},e.getEncodedBits=function(p){if(!a.isValid(p)||p<7)throw new Error("Invalid QR Code version");let y=p<<12;for(;t.getBCHDigit(y)-l>=0;)y^=s<<t.getBCHDigit(y)-l;return p<<12|y}})(l5)),l5}var d5={},iN;function Boe(){if(iN)return d5;iN=1;const e=Th(),t=1335,r=21522,n=e.getBCHDigit(t);return d5.getEncodedBits=function(a,s){const l=a.bit<<3|s;let c=l<<10;for(;e.getBCHDigit(c)-n>=0;)c^=t<<e.getBCHDigit(c)-n;return(l<<10|c)^r},d5}var f5={},p5,oN;function Woe(){if(oN)return p5;oN=1;const e=Ph();function t(r){this.mode=e.NUMERIC,this.data=r.toString()}return t.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(n){let o,a,s;for(o=0;o+3<=this.data.length;o+=3)a=this.data.substr(o,3),s=parseInt(a,10),n.put(s,10);const l=this.data.length-o;l>0&&(a=this.data.substr(o),s=parseInt(a,10),n.put(s,l*3+1))},p5=t,p5}var h5,aN;function qoe(){if(aN)return h5;aN=1;const e=Ph(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(n){this.mode=e.ALPHANUMERIC,this.data=n}return r.getBitsLength=function(o){return 11*Math.floor(o/2)+6*(o%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(o){let a;for(a=0;a+2<=this.data.length;a+=2){let s=t.indexOf(this.data[a])*45;s+=t.indexOf(this.data[a+1]),o.put(s,11)}this.data.length%2&&o.put(t.indexOf(this.data[a]),6)},h5=r,h5}var g5,sN;function $oe(){if(sN)return g5;sN=1;const e=Ph();function t(r){this.mode=e.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return t.getBitsLength=function(n){return n*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){for(let n=0,o=this.data.length;n<o;n++)r.put(this.data[n],8)},g5=t,g5}var m5,lN;function Uoe(){if(lN)return m5;lN=1;const e=Ph(),t=Th();function r(n){this.mode=e.KANJI,this.data=n}return r.getBitsLength=function(o){return o*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(n){let o;for(o=0;o<this.data.length;o++){let a=t.toSJIS(this.data[o]);if(a>=33088&&a<=40956)a-=33088;else if(a>=57408&&a<=60351)a-=49472;else throw new Error("Invalid SJIS character: "+this.data[o]+`
|
||
Make sure your charset is UTF-8`);a=(a>>>8&255)*192+(a&255),n.put(a,13)}},m5=r,m5}var v5={exports:{}},cN;function Hoe(){return cN||(cN=1,(function(e){var t={single_source_shortest_paths:function(r,n,o){var a={},s={};s[n]=0;var l=t.PriorityQueue.make();l.push(n,0);for(var c,u,d,f,h,p,y,m,x;!l.empty();){c=l.pop(),u=c.value,f=c.cost,h=r[u]||{};for(d in h)h.hasOwnProperty(d)&&(p=h[d],y=f+p,m=s[d],x=typeof s[d]>"u",(x||m>y)&&(s[d]=y,l.push(d,y),a[d]=u))}if(typeof o<"u"&&typeof s[o]>"u"){var b=["Could not find a path from ",n," to ",o,"."].join("");throw new Error(b)}return a},extract_shortest_path_from_predecessor_list:function(r,n){for(var o=[],a=n;a;)o.push(a),r[a],a=r[a];return o.reverse(),o},find_path:function(r,n,o){var a=t.single_source_shortest_paths(r,n,o);return t.extract_shortest_path_from_predecessor_list(a,o)},PriorityQueue:{make:function(r){var n=t.PriorityQueue,o={},a;r=r||{};for(a in n)n.hasOwnProperty(a)&&(o[a]=n[a]);return o.queue=[],o.sorter=r.sorter||n.default_sorter,o},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var o={value:r,cost:n};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(v5)),v5.exports}var uN;function Voe(){return uN||(uN=1,(function(e){const t=Ph(),r=Woe(),n=qoe(),o=$oe(),a=Uoe(),s=K$(),l=Th(),c=Hoe();function u(b){return unescape(encodeURIComponent(b)).length}function d(b,w,k){const S=[];let _;for(;(_=b.exec(k))!==null;)S.push({data:_[0],index:_.index,mode:w,length:_[0].length});return S}function f(b){const w=d(s.NUMERIC,t.NUMERIC,b),k=d(s.ALPHANUMERIC,t.ALPHANUMERIC,b);let S,_;return l.isKanjiModeEnabled()?(S=d(s.BYTE,t.BYTE,b),_=d(s.KANJI,t.KANJI,b)):(S=d(s.BYTE_KANJI,t.BYTE,b),_=[]),w.concat(k,S,_).sort(function(O,T){return O.index-T.index}).map(function(O){return{data:O.data,mode:O.mode,length:O.length}})}function h(b,w){switch(w){case t.NUMERIC:return r.getBitsLength(b);case t.ALPHANUMERIC:return n.getBitsLength(b);case t.KANJI:return a.getBitsLength(b);case t.BYTE:return o.getBitsLength(b)}}function p(b){return b.reduce(function(w,k){const S=w.length-1>=0?w[w.length-1]:null;return S&&S.mode===k.mode?(w[w.length-1].data+=k.data,w):(w.push(k),w)},[])}function y(b){const w=[];for(let k=0;k<b.length;k++){const S=b[k];switch(S.mode){case t.NUMERIC:w.push([S,{data:S.data,mode:t.ALPHANUMERIC,length:S.length},{data:S.data,mode:t.BYTE,length:S.length}]);break;case t.ALPHANUMERIC:w.push([S,{data:S.data,mode:t.BYTE,length:S.length}]);break;case t.KANJI:w.push([S,{data:S.data,mode:t.BYTE,length:u(S.data)}]);break;case t.BYTE:w.push([{data:S.data,mode:t.BYTE,length:u(S.data)}])}}return w}function m(b,w){const k={},S={start:{}};let _=["start"];for(let P=0;P<b.length;P++){const O=b[P],T=[];for(let R=0;R<O.length;R++){const I=O[R],E=""+P+R;T.push(E),k[E]={node:I,lastCount:0},S[E]={};for(let A=0;A<_.length;A++){const F=_[A];k[F]&&k[F].node.mode===I.mode?(S[F][E]=h(k[F].lastCount+I.length,I.mode)-h(k[F].lastCount,I.mode),k[F].lastCount+=I.length):(k[F]&&(k[F].lastCount=I.length),S[F][E]=h(I.length,I.mode)+4+t.getCharCountIndicator(I.mode,w))}}_=T}for(let P=0;P<_.length;P++)S[_[P]].end=0;return{map:S,table:k}}function x(b,w){let k;const S=t.getBestModeForData(b);if(k=t.from(w,S),k!==t.BYTE&&k.bit<S.bit)throw new Error('"'+b+'" cannot be encoded with mode '+t.toString(k)+`.
|
||
Suggested mode is: `+t.toString(S));switch(k===t.KANJI&&!l.isKanjiModeEnabled()&&(k=t.BYTE),k){case t.NUMERIC:return new r(b);case t.ALPHANUMERIC:return new n(b);case t.KANJI:return new a(b);case t.BYTE:return new o(b)}}e.fromArray=function(w){return w.reduce(function(k,S){return typeof S=="string"?k.push(x(S,null)):S.data&&k.push(x(S.data,S.mode)),k},[])},e.fromString=function(w,k){const S=f(w,l.isKanjiModeEnabled()),_=y(S),P=m(_,k),O=c.find_path(P.map,"start","end"),T=[];for(let R=1;R<O.length-1;R++)T.push(P.table[O[R]].node);return e.fromArray(p(T))},e.rawSplit=function(w){return e.fromArray(f(w,l.isKanjiModeEnabled()))}})(f5)),f5}var dN;function Yoe(){if(dN)return Jj;dN=1;const e=Th(),t=oT(),r=Ooe(),n=Ioe(),o=Noe(),a=Roe(),s=Loe(),l=Y$(),c=Doe(),u=zoe(),d=Boe(),f=Ph(),h=Voe();function p(P,O){const T=P.size,R=a.getPositions(O);for(let I=0;I<R.length;I++){const E=R[I][0],A=R[I][1];for(let F=-1;F<=7;F++)if(!(E+F<=-1||T<=E+F))for(let L=-1;L<=7;L++)A+L<=-1||T<=A+L||(F>=0&&F<=6&&(L===0||L===6)||L>=0&&L<=6&&(F===0||F===6)||F>=2&&F<=4&&L>=2&&L<=4?P.set(E+F,A+L,!0,!0):P.set(E+F,A+L,!1,!0))}}function y(P){const O=P.size;for(let T=8;T<O-8;T++){const R=T%2===0;P.set(T,6,R,!0),P.set(6,T,R,!0)}}function m(P,O){const T=o.getPositions(O);for(let R=0;R<T.length;R++){const I=T[R][0],E=T[R][1];for(let A=-2;A<=2;A++)for(let F=-2;F<=2;F++)A===-2||A===2||F===-2||F===2||A===0&&F===0?P.set(I+A,E+F,!0,!0):P.set(I+A,E+F,!1,!0)}}function x(P,O){const T=P.size,R=u.getEncodedBits(O);let I,E,A;for(let F=0;F<18;F++)I=Math.floor(F/3),E=F%3+T-8-3,A=(R>>F&1)===1,P.set(I,E,A,!0),P.set(E,I,A,!0)}function b(P,O,T){const R=P.size,I=d.getEncodedBits(O,T);let E,A;for(E=0;E<15;E++)A=(I>>E&1)===1,E<6?P.set(E,8,A,!0):E<8?P.set(E+1,8,A,!0):P.set(R-15+E,8,A,!0),E<8?P.set(8,R-E-1,A,!0):E<9?P.set(8,15-E-1+1,A,!0):P.set(8,15-E-1,A,!0);P.set(R-8,8,1,!0)}function w(P,O){const T=P.size;let R=-1,I=T-1,E=7,A=0;for(let F=T-1;F>0;F-=2)for(F===6&&F--;;){for(let L=0;L<2;L++)if(!P.isReserved(I,F-L)){let z=!1;A<O.length&&(z=(O[A]>>>E&1)===1),P.set(I,F-L,z),E--,E===-1&&(A++,E=7)}if(I+=R,I<0||T<=I){I-=R,R=-R;break}}}function k(P,O,T){const R=new r;T.forEach(function(L){R.put(L.mode.bit,4),R.put(L.getLength(),f.getCharCountIndicator(L.mode,P)),L.write(R)});const I=e.getSymbolTotalCodewords(P),E=l.getTotalCodewordsCount(P,O),A=(I-E)*8;for(R.getLengthInBits()+4<=A&&R.put(0,4);R.getLengthInBits()%8!==0;)R.putBit(0);const F=(A-R.getLengthInBits())/8;for(let L=0;L<F;L++)R.put(L%2?17:236,8);return S(R,P,O)}function S(P,O,T){const R=e.getSymbolTotalCodewords(O),I=l.getTotalCodewordsCount(O,T),E=R-I,A=l.getBlocksCount(O,T),F=R%A,L=A-F,z=Math.floor(R/A),V=Math.floor(E/A),Q=V+1,U=z-V,ee=new c(U);let H=0;const B=new Array(A),M=new Array(A);let $=0;const q=new Uint8Array(P.buffer);for(let J=0;J<A;J++){const ae=J<L?V:Q;B[J]=q.slice(H,H+ae),M[J]=ee.encode(B[J]),H+=ae,$=Math.max($,ae)}const Y=new Uint8Array(R);let K=0,G,re;for(G=0;G<$;G++)for(re=0;re<A;re++)G<B[re].length&&(Y[K++]=B[re][G]);for(G=0;G<U;G++)for(re=0;re<A;re++)Y[K++]=M[re][G];return Y}function _(P,O,T,R){let I;if(Array.isArray(P))I=h.fromArray(P);else if(typeof P=="string"){let z=O;if(!z){const V=h.rawSplit(P);z=u.getBestVersionForData(V,T)}I=h.fromString(P,z||40)}else throw new Error("Invalid data");const E=u.getBestVersionForData(I,T);if(!E)throw new Error("The amount of data is too big to be stored in a QR Code");if(!O)O=E;else if(O<E)throw new Error(`
|
||
The chosen QR Code version cannot contain this amount of data.
|
||
Minimum version required to store current data is: `+E+`.
|
||
`);const A=k(O,T,I),F=e.getSymbolSize(O),L=new n(F);return p(L,O),y(L),m(L,O),b(L,T,0),O>=7&&x(L,O),w(L,A),isNaN(R)&&(R=s.getBestMask(L,b.bind(null,L,T))),s.applyMask(R,L),b(L,T,R),{modules:L,version:O,errorCorrectionLevel:T,maskPattern:R,segments:I}}return Jj.create=function(O,T){if(typeof O>"u"||O==="")throw new Error("No input text");let R=t.M,I,E;return typeof T<"u"&&(R=t.from(T.errorCorrectionLevel,t.M),I=u.from(T.version),E=s.from(T.maskPattern),T.toSJISFunc&&e.setToSJISFunction(T.toSJISFunc)),_(O,I,R,E)},Jj}var y5={},x5={},fN;function Q$(){return fN||(fN=1,(function(e){function t(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(a){return[a,a]}))),n.length===6&&n.push("F","F");const o=parseInt(n.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+n.slice(0,6).join("")}}e.getOptions=function(n){n||(n={}),n.color||(n.color={});const o=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,a=n.width&&n.width>=21?n.width:void 0,s=n.scale||4;return{width:a,scale:a?4:s,margin:o,color:{dark:t(n.color.dark||"#000000ff"),light:t(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},e.getScale=function(n,o){return o.width&&o.width>=n+o.margin*2?o.width/(n+o.margin*2):o.scale},e.getImageWidth=function(n,o){const a=e.getScale(n,o);return Math.floor((n+o.margin*2)*a)},e.qrToImageData=function(n,o,a){const s=o.modules.size,l=o.modules.data,c=e.getScale(s,a),u=Math.floor((s+a.margin*2)*c),d=a.margin*c,f=[a.color.light,a.color.dark];for(let h=0;h<u;h++)for(let p=0;p<u;p++){let y=(h*u+p)*4,m=a.color.light;if(h>=d&&p>=d&&h<u-d&&p<u-d){const x=Math.floor((h-d)/c),b=Math.floor((p-d)/c);m=f[l[x*s+b]?1:0]}n[y++]=m.r,n[y++]=m.g,n[y++]=m.b,n[y]=m.a}}})(x5)),x5}var pN;function Goe(){return pN||(pN=1,(function(e){const t=Q$();function r(o,a,s){o.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=s,a.width=s,a.style.height=s+"px",a.style.width=s+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(a,s,l){let c=l,u=s;typeof c>"u"&&(!s||!s.getContext)&&(c=s,s=void 0),s||(u=n()),c=t.getOptions(c);const d=t.getImageWidth(a.modules.size,c),f=u.getContext("2d"),h=f.createImageData(d,d);return t.qrToImageData(h.data,a,c),r(f,u,d),f.putImageData(h,0,0),u},e.renderToDataURL=function(a,s,l){let c=l;typeof c>"u"&&(!s||!s.getContext)&&(c=s,s=void 0),c||(c={});const u=e.render(a,s,c),d=c.type||"image/png",f=c.rendererOpts||{};return u.toDataURL(d,f.quality)}})(y5)),y5}var b5={},hN;function Koe(){if(hN)return b5;hN=1;const e=Q$();function t(o,a){const s=o.a/255,l=a+'="'+o.hex+'"';return s<1?l+" "+a+'-opacity="'+s.toFixed(2).slice(1)+'"':l}function r(o,a,s){let l=o+a;return typeof s<"u"&&(l+=" "+s),l}function n(o,a,s){let l="",c=0,u=!1,d=0;for(let f=0;f<o.length;f++){const h=Math.floor(f%a),p=Math.floor(f/a);!h&&!u&&(u=!0),o[f]?(d++,f>0&&h>0&&o[f-1]||(l+=u?r("M",h+s,.5+p+s):r("m",c,0),c=0,u=!1),h+1<a&&o[f+1]||(l+=r("h",d),d=0)):c++}return l}return b5.render=function(a,s,l){const c=e.getOptions(s),u=a.modules.size,d=a.modules.data,f=u+c.margin*2,h=c.color.light.a?"<path "+t(c.color.light,"fill")+' d="M0 0h'+f+"v"+f+'H0z"/>':"",p="<path "+t(c.color.dark,"stroke")+' d="'+n(d,u,c.margin)+'"/>',y='viewBox="0 0 '+f+" "+f+'"',x='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+y+' shape-rendering="crispEdges">'+h+p+`</svg>
|
||
`;return typeof l=="function"&&l(null,x),x},b5}var gN;function Qoe(){if(gN)return kg;gN=1;const e=Poe(),t=Yoe(),r=Goe(),n=Koe();function o(a,s,l,c,u){const d=[].slice.call(arguments,1),f=d.length,h=typeof d[f-1]=="function";if(!h&&!e())throw new Error("Callback required as last argument");if(h){if(f<2)throw new Error("Too few arguments provided");f===2?(u=l,l=s,s=c=void 0):f===3&&(s.getContext&&typeof u>"u"?(u=c,c=void 0):(u=c,c=l,l=s,s=void 0))}else{if(f<1)throw new Error("Too few arguments provided");return f===1?(l=s,s=c=void 0):f===2&&!s.getContext&&(c=l,l=s,s=void 0),new Promise(function(p,y){try{const m=t.create(l,c);p(a(m,s,c))}catch(m){y(m)}})}try{const p=t.create(l,c);u(null,a(p,s,c))}catch(p){u(p)}}return kg.create=t.create,kg.toCanvas=o.bind(null,r.render),kg.toDataURL=o.bind(null,r.renderToDataURL),kg.toString=o.bind(null,function(a,s,l){return n.render(a,l)}),kg}var Xoe=Qoe();const Mw=un(Xoe);function Zoe(e){return`https://eventbuzz.live/code/${e}`}function Joe(e,t){return new Promise((r,n)=>{const o=new Image;o.onload=()=>{const a=o.naturalWidth,s=o.naturalHeight,l=32,c=24,u=20,d=28,f=22,h=document.createElement("canvas"),p=h.getContext("2d");if(!p){n(new Error("Canvas not supported"));return}p.font=`bold ${f}px ui-monospace, "Courier New", Courier, monospace`,p.letterSpacing="3px";const y=p.measureText(t).width,m=f+10,x=Math.ceil(Math.max(a+l*2,y+l*2)),b=c+s+u+m+d;h.width=x,h.height=b,p.fillStyle="#ffffff",p.fillRect(0,0,x,b);const w=(x-a)/2;p.drawImage(o,w,c),p.fillStyle="#0f172a",p.font=`bold ${f}px ui-monospace, "Courier New", Courier, monospace`,p.letterSpacing="3px",p.textAlign="center",p.textBaseline="top";const k=c+s+u;p.fillText(t,x/2,k);try{r(h.toDataURL("image/png"))}catch(S){n(S)}},o.onerror=()=>n(new Error("Failed to load QR image")),o.src=e})}function aT({open:e,onClose:t,kind:r,joinCode:n,label:o}){const a=n.trim(),s=a?Zoe(a):"",[l,c]=j.useState(null),[u,d]=j.useState(null),[f,h]=j.useState(!1),[p,y]=j.useState(!1);j.useEffect(()=>{if(!e){c(null),d(null),h(!1);return}if(!s){c(null),d(null);return}let w=!1;return d(null),Mw.toDataURL(s,{width:256,margin:2,color:{dark:"#0f172a",light:"#ffffff"}}).then(k=>{w||c(k)}).catch(()=>{w||d("Could not generate QR code.")}),()=>{w=!0}},[e,s]);const m=()=>{s&&navigator.clipboard.writeText(s).then(()=>{h(!0),window.setTimeout(()=>h(!1),2e3)})},x=async()=>{if(!(!a||!l||p)){y(!0);try{const w=await Joe(l,a),k=document.createElement("a");k.href=w,k.download=`eventbuzz-${r}-${a}.png`,k.click()}catch{const w=document.createElement("a");w.href=l,w.download=`eventbuzz-${r}-${a}.png`,w.click()}finally{y(!1)}}};if(!e)return null;const b=r==="track"?"Track":r==="session"?"Session":"Event";return i.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"agenda-qr-title",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",zIndex:120,display:"flex",alignItems:"center",justifyContent:"center",padding:"16px"},onClick:t,children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"100%",maxWidth:"400px",padding:"20px",boxShadow:"var(--shadow-xl)",border:"1px solid var(--border)"},onClick:w=>w.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",marginBottom:"16px"},children:[i.jsxs("div",{children:[i.jsxs("h2",{id:"agenda-qr-title",style:{fontSize:"var(--text-base)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"4px"},children:[b," QR code"]}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",lineHeight:1.4},children:o}),r==="event"&&a?i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"6px",lineHeight:1.4},children:["Same ",i.jsx("code",{style:{fontSize:"10px"},children:"/code/…"})," flow as sessions: scan resolves session first, then track, then this event."]}):null]}),i.jsx("button",{type:"button",onClick:t,"aria-label":"Close",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",cursor:"pointer",color:"var(--card-foreground)",flexShrink:0},children:i.jsx(er,{size:16})})]}),a?i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{textAlign:"center",marginBottom:"16px"},children:[i.jsx("p",{style:{fontSize:"11px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:"6px"},children:"Code"}),i.jsx("p",{style:{fontFamily:"ui-monospace, monospace",fontSize:"22px",fontWeight:700,letterSpacing:"0.12em",color:"var(--foreground)",userSelect:"all"},children:a})]}),i.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"200px",background:"var(--secondary)",borderRadius:"var(--radius-card)",border:"1px solid var(--border)",marginBottom:"16px"},children:u?i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--destructive)",padding:"16px"},children:u}):l?i.jsx("img",{src:l,alt:`QR code for ${s}`,style:{width:200,height:200,display:"block"}}):i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)"},children:"Generating…"})}),i.jsxs("div",{style:{marginBottom:"12px"},children:[i.jsx("p",{style:{fontSize:"11px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"6px"},children:"Link"}),i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"stretch",flexWrap:"wrap"},children:[i.jsx("input",{readOnly:!0,value:s,onFocus:w=>w.target.select(),style:{flex:1,minWidth:"160px",padding:"8px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",fontSize:"12px",fontFamily:"ui-monospace, monospace",color:"var(--foreground)"}}),i.jsxs("button",{type:"button",onClick:m,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:f?"var(--accent)":"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"},children:[i.jsx(iu,{size:14})," ",f?"Copied":"Copy"]})]})]}),i.jsxs("button",{type:"button",onClick:()=>void x(),disabled:!l||p,style:{width:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"10px 14px",borderRadius:"var(--radius-button)",border:"none",background:l&&!p?"var(--primary)":"var(--muted)",color:l&&!p?"var(--primary-foreground)":"var(--card)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",cursor:l&&!p?"pointer":"not-allowed"},children:[i.jsx(Al,{size:16})," ",p?"Preparing…":"Download PNG (QR + code)"]}),i.jsx("p",{style:{fontSize:"11px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"8px",textAlign:"center",lineHeight:1.4},children:"The saved image includes your code printed below the QR."})]}):i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--destructive)",padding:"12px 0",textAlign:"center",lineHeight:1.5},children:r==="event"?i.jsxs(i.Fragment,{children:["This event has no join code yet. Open the event in the dashboard and save once, or run"," ",i.jsx("code",{style:{fontSize:"11px"},children:"npm run backfill:join-codes"})," in the backend."]}):i.jsxs(i.Fragment,{children:["No join code on this record yet. Reload the agenda after save, or run"," ",i.jsx("code",{style:{fontSize:"11px"},children:"npm run backfill:join-codes"})," in the backend once."]})})]})})}function eae(){const{selectedEventId:e}=eo(),[t,r]=j.useState(null),[n,o]=j.useState(!1),[a,s]=j.useState(!1),[l,c]=j.useState(!1),d=qi()==="mobile",[f,h]=j.useState(void 0);j.useEffect(()=>{if(t!=="qr"||!e){h(void 0);return}h(void 0);let m=!1;return zr.get(e).then(x=>{m||h(x.data??null)}),()=>{m=!0}},[t,e]);const p=m=>{if(m==="live"){if(!n&&!window.confirm("Start broadcasting this event as Live? All participants will be notified."))return;o(x=>!x);return}if(m==="qr"&&!e){window.alert("Select an event from the sidebar first.");return}if(m==="addpoll"){s(!0);return}if(m==="addquiz"){c(!0);return}r(m)},y=[{icon:i.jsx(Rf,{size:d?18:15}),label:"Manage Ratings",id:"ratings"},{icon:i.jsx(Zs,{size:d?18:15}),label:"Manage Feedback",id:"feedback"},{icon:i.jsx(lv,{size:d?18:15}),label:"Generate QR Code",id:"qr"},{icon:i.jsx(Eq,{size:d?18:15}),label:"Go Live",id:"live"},{icon:i.jsx(nu,{size:d?18:15}),label:"Add Poll",id:"addpoll"},{icon:i.jsx(M6,{size:d?18:15}),label:"Add Quiz",id:"addquiz"}];return i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:d?"14px":"14px 16px"},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--muted)",marginBottom:d?"12px":"0"},children:"Quick actions"}),d?i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"8px"},children:y.map(m=>{const x=m.id==="live"&&n;return i.jsxs("button",{onClick:()=>p(m.id),style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"7px",padding:"14px 8px",borderRadius:"var(--radius-card)",borderWidth:"1px",borderStyle:"solid",borderColor:x?"var(--destructive)":"var(--border)",background:x?"var(--destructive)":"var(--secondary)",color:x?"var(--destructive-foreground)":"var(--card-foreground)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",cursor:"pointer",minHeight:"72px"},children:[x&&i.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--destructive-foreground)",display:"block",position:"absolute"}}),i.jsx("span",{style:{color:x?"var(--destructive-foreground)":"var(--primary)",display:"flex"},children:m.icon}),i.jsx("span",{style:{textAlign:"center",lineHeight:"1.3"},children:x?"Stop Live":m.label})]},m.id)})}):i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexWrap:"wrap"},children:[i.jsx("div",{style:{width:"1px",height:"18px",background:"var(--border)",flexShrink:0}}),i.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:y.map(m=>{const x=m.id==="live"&&n;return i.jsxs("button",{onClick:()=>p(m.id),style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 14px",borderRadius:"var(--radius-button)",borderWidth:"1px",borderStyle:"solid",borderColor:x?"var(--destructive)":"var(--border)",background:x?"var(--destructive)":"var(--card)",color:x?"var(--destructive-foreground)":"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",cursor:"pointer",transition:"all 0.15s"},onMouseEnter:b=>{x||(b.currentTarget.style.background="var(--secondary)",b.currentTarget.style.borderColor="var(--primary)",b.currentTarget.style.color="var(--primary)")},onMouseLeave:b=>{x||(b.currentTarget.style.background="var(--card)",b.currentTarget.style.borderColor="var(--border)",b.currentTarget.style.color="var(--card-foreground)")},children:[x&&i.jsx("span",{style:{width:"7px",height:"7px",borderRadius:"50%",background:"var(--destructive-foreground)",display:"block"}}),m.icon,x?"Stop Live":m.label]},m.id)})})]})]}),t==="qr"&&e&&f!==void 0&&i.jsx(aT,{open:!0,onClose:()=>r(null),kind:"event",joinCode:((f==null?void 0:f.joinCode)??"").trim(),label:(f==null?void 0:f.name)??"Event"}),t==="qr"&&e&&f===void 0&&i.jsx("div",{role:"status","aria-live":"polite",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",zIndex:120,display:"flex",alignItems:"center",justifyContent:"center",padding:"16px"},children:i.jsx("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",padding:"24px 32px",border:"1px solid var(--border)",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--muted)"},children:"Loading event…"})}),t&&t!=="qr"&&i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.35)",zIndex:50,display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>r(null),children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"440px",maxWidth:"92vw",boxShadow:"var(--elevation-sm)"},onClick:m=>m.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid var(--border)"},children:[i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:t==="ratings"?"Event Ratings":"Attendee Feedback"}),i.jsx("button",{onClick:()=>r(null),style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",padding:"2px"},children:i.jsx(er,{size:16})})]}),i.jsxs("div",{style:{padding:"20px"},children:[t==="ratings"&&i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[{user:"Dr. Sharma",rating:5,comment:"Excellent conference, very informative!"},{user:"Prof. Mehta",rating:4,comment:"Well organized, good speakers."},{user:"Dr. Patel",rating:5,comment:"Best conference of the year!"}].map((m,x)=>i.jsxs("div",{style:{padding:"12px 14px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:m.user}),i.jsxs("span",{style:{color:"var(--chart-2)",fontSize:"var(--text-sm)"},children:["★".repeat(m.rating),"☆".repeat(5-m.rating)]})]}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:m.comment})]},x))}),t==="feedback"&&i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[{user:"Ananya R.",time:"2h ago",msg:"The morning keynote was excellent."},{user:"Rajesh K.",time:"4h ago",msg:"Please improve the AV setup for Session 3."},{user:"Priya M.",time:"1d ago",msg:"Great networking opportunities. Well done!"}].map((m,x)=>i.jsxs("div",{style:{display:"flex",gap:"10px",padding:"12px 14px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)"},children:[i.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"50%",background:"var(--accent)",color:"var(--accent-foreground)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"var(--text-xs)",fontFamily:"var(--font-inter)",flexShrink:0},children:m.user[0]}),i.jsxs("div",{children:[i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center",marginBottom:"3px"},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:m.user}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:m.time})]}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:m.msg})]})]},x))})]})]})}),a&&i.jsx(ax,{kind:"poll",eventId:e??void 0,onClose:()=>s(!1)}),l&&i.jsx(ax,{kind:"quiz",eventId:e??void 0,onClose:()=>c(!1)})]})}function fv({children:e}){return i.jsx("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"20px",display:"flex",flexDirection:"column",gap:"16px"},children:e})}function pv({icon:e,title:t,color:r}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"var(--radius-button)",background:r+"15",display:"flex",alignItems:"center",justifyContent:"center",color:r},children:e}),i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:t})]}),i.jsxs("button",{style:{display:"flex",alignItems:"center",gap:"3px",background:"none",border:"none",cursor:"pointer",color:"var(--muted)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",padding:"2px 4px"},onMouseEnter:n=>{n.currentTarget.style.color="var(--primary)"},onMouseLeave:n=>{n.currentTarget.style.color="var(--muted)"},children:["View all ",i.jsx(va,{size:12})]})]})}function Py({label:e,pct:t,color:r}){return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:e}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[t,"%"]})]}),i.jsx("div",{style:{height:"4px",background:"var(--border)",borderRadius:"99px",overflow:"hidden"},children:i.jsx("div",{style:{height:"100%",width:`${t}%`,background:r,borderRadius:"99px"}})})]})}function X$({label:e,bg:t,color:r}){return i.jsx("span",{style:{display:"inline-flex",padding:"2px 8px",borderRadius:"4px",background:t,color:r,fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",whiteSpace:"nowrap"},children:e})}function hv({items:e}){return i.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${e.length}, 1fr)`,gap:"1px",background:"var(--border)",borderRadius:"var(--radius-button)",overflow:"hidden"},children:e.map(([t,r])=>i.jsxs("div",{style:{background:"var(--secondary)",padding:"10px 12px",textAlign:"center"},children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.2"},children:t}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"2px"},children:r})]},r))})}function tae(){return i.jsxs(fv,{children:[i.jsx(pv,{icon:i.jsx(ib,{size:15}),title:"Quiz",color:"var(--chart-3)"}),i.jsx(hv,{items:[["4","Active"],["24","Questions"],["71%","Avg Score"]]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[i.jsx(Py,{label:"Pulmonary Anatomy",pct:82,color:"var(--chart-3)"}),i.jsx(Py,{label:"ICS Guidelines 2025",pct:65,color:"var(--chart-3)"}),i.jsx(Py,{label:"COPD Management",pct:90,color:"var(--chart-3)"}),i.jsx(Py,{label:"Respiratory Physiology",pct:45,color:"var(--chart-3)"})]})]})}function rae(){const[e,t]=j.useState(0),r=[{q:"How would you rate the venue?",votes:62,options:[{l:"Excellent",p:50},{l:"Good",p:31},{l:"Average",p:14},{l:"Poor",p:5}]},{q:"Best session of the day?",votes:48,options:[{l:"Keynote Address",p:46},{l:"COPD Workshop",p:29},{l:"Panel Discussion",p:25}]}],n=r[e];return i.jsxs(fv,{children:[i.jsx(pv,{icon:i.jsx(nu,{size:15}),title:"Polls",color:"var(--chart-4)"}),i.jsx(hv,{items:[["6","Active Polls"],["342","Total Votes"]]}),i.jsx("div",{style:{display:"flex",gap:"6px"},children:r.map((o,a)=>i.jsxs("button",{onClick:()=>t(a),style:{flex:1,padding:"5px 0",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:e===a?"var(--primary)":"var(--card)",color:e===a?"#fff":"var(--muted)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:["Poll ",a+1]},a))}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"3px"},children:n.q}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"10px"},children:[n.votes," votes"]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"7px"},children:n.options.map(o=>i.jsx(Py,{label:o.l,pct:o.p,color:"var(--chart-4)"},o.l))})]})]})}function nae(){const e=[{rank:"🥇",name:"Dr. Rajesh Sharma",pts:240},{rank:"🥈",name:"Dr. Priya Mehta",pts:210},{rank:"🥉",name:"Dr. Anil Kumar",pts:185},{rank:"4",name:"Dr. Sunita Patel",pts:160},{rank:"5",name:"Dr. Vikram Singh",pts:145},{rank:"6",name:"Dr. Neha Gupta",pts:130}];return i.jsxs(fv,{children:[i.jsx(pv,{icon:i.jsx(od,{size:15}),title:"Reward Points",color:"var(--chart-2)"}),i.jsx(hv,{items:[["1,240","Total Points"],["18","Earners"]]}),i.jsx("div",{style:{display:"flex",flexDirection:"column"},children:e.map((t,r)=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"7px 0",borderBottom:r<e.length-1?"1px solid var(--border)":"none"},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",width:"20px",textAlign:"center",flexShrink:0},children:t.rank}),i.jsx("span",{style:{flex:1,fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:t.name}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:r<3?"#b45309":"var(--muted)",background:r<3?"#fef9c3":"var(--secondary)",padding:"2px 8px",borderRadius:"99px"},children:t.pts})]},r))})]})}function iae(){const e=[{name:"Home",status:"Published",views:842},{name:"Agenda",status:"Published",views:534},{name:"Speakers",status:"Published",views:298},{name:"Registration",status:"Draft",views:0},{name:"Gallery",status:"Draft",views:0}];return i.jsxs(fv,{children:[i.jsx(pv,{icon:i.jsx(ud,{size:15}),title:"Event Website",color:"var(--chart-1)"}),i.jsx(hv,{items:[["1,842","Total Views"],["5","Pages"],["Live","Status"]]}),i.jsx("div",{style:{display:"flex",flexDirection:"column"},children:e.map((t,r)=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"7px 0",borderBottom:r<e.length-1?"1px solid var(--border)":"none"},children:[i.jsx("span",{style:{flex:1,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:t.name}),i.jsx(X$,{label:t.status,bg:t.status==="Published"?"#dcfce7":"#f3f4f6",color:t.status==="Published"?"#15803d":"#6b7280"}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",minWidth:"28px",textAlign:"right"},children:t.views>0?t.views:"—"})]},r))})]})}function oae(){const e=[{time:"09:00",title:"Opening Keynote",track:"Plenary",typeColor:"#5b21b6",typeBg:"#ede9fe"},{time:"10:30",title:"COPD Management Guidelines 2025",track:"Clinical",typeColor:"#1d4ed8",typeBg:"#dbeafe"},{time:"12:00",title:"Lunch & Networking Break",track:"Break",typeColor:"#6b7280",typeBg:"#f3f4f6"},{time:"13:30",title:"Interstitial Lung Disease Workshop",track:"Workshop",typeColor:"#15803d",typeBg:"#dcfce7"},{time:"15:00",title:"Panel: Future of Respiratory Medicine",track:"Panel",typeColor:"#b91c1c",typeBg:"#fee2e2"}];return i.jsxs(fv,{children:[i.jsx(pv,{icon:i.jsx(Sq,{size:15}),title:"Agenda",color:"var(--chart-5)"}),i.jsx(hv,{items:[["12","Sessions"],["4","Days"],["8","Speakers"]]}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",fontWeight:"var(--font-weight-medium)",marginBottom:"8px",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Today"}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:e.map((t,r)=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"6px 0",borderBottom:r<e.length-1?"1px solid var(--border)":"none"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",flexShrink:0,width:"36px"},children:t.time}),i.jsx("span",{style:{flex:1,fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",lineHeight:"1.3"},children:t.title}),i.jsx(X$,{label:t.track,bg:t.typeBg,color:t.typeColor})]},r))})]})]})}function aae(){const e=[{name:"Dr. Anika Sharma",role:"Delegate",checked:!0,time:"10m"},{name:"Prof. Ravi Kumar",role:"Speaker",checked:!0,time:"25m"},{name:"Dr. Meena Patel",role:"Moderator",checked:!0,time:"1h"},{name:"Dr. Sanjay Gupta",role:"Panelist",checked:!1,time:"2h"},{name:"Dr. Pooja Singh",role:"Delegate",checked:!1,time:"3h"}];return i.jsxs(fv,{children:[i.jsx(pv,{icon:i.jsx(vi,{size:15}),title:"Participants",color:"var(--chart-1)"}),i.jsx(hv,{items:[["26","Registered"],["18","Checked In"],["69%","Rate"]]}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",fontWeight:"var(--font-weight-medium)",marginBottom:"8px",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Recent Activity"}),i.jsx("div",{style:{display:"flex",flexDirection:"column"},children:e.map((t,r)=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"7px 0",borderBottom:r<e.length-1?"1px solid var(--border)":"none"},children:[i.jsx("div",{style:{width:"26px",height:"26px",borderRadius:"50%",background:"var(--accent)",color:"var(--accent-foreground)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"var(--text-xs)",fontFamily:"var(--font-inter)",flexShrink:0},children:t.name.split(" ").slice(1).join("")[0]}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.name}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[t.role," · ",t.time," ago"]})]}),t.checked?i.jsx(iv,{size:14,style:{color:"#16a34a",flexShrink:0}}):i.jsx(ob,{size:14,style:{color:"var(--muted)",flexShrink:0}})]},r))})]})]})}function sae(){const e=qi(),t=e==="mobile"?1:e==="tablet"?2:3;return i.jsxs("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t}, 1fr)`,gap:e==="mobile"?"12px":"16px"},children:[i.jsx(tae,{}),i.jsx(rae,{}),i.jsx(nae,{}),i.jsx(iae,{}),i.jsx(oae,{}),i.jsx(aae,{})]})}var w5,mN;function ms(){if(mN)return w5;mN=1;var e=Array.isArray;return w5=e,w5}var S5,vN;function Z$(){if(vN)return S5;vN=1;var e=typeof h1=="object"&&h1&&h1.Object===Object&&h1;return S5=e,S5}var j5,yN;function au(){if(yN)return j5;yN=1;var e=Z$(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return j5=r,j5}var k5,xN;function ub(){if(xN)return k5;xN=1;var e=au(),t=e.Symbol;return k5=t,k5}var _5,bN;function lae(){if(bN)return _5;bN=1;var e=ub(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,o=e?e.toStringTag:void 0;function a(s){var l=r.call(s,o),c=s[o];try{s[o]=void 0;var u=!0}catch{}var d=n.call(s);return u&&(l?s[o]=c:delete s[o]),d}return _5=a,_5}var C5,wN;function cae(){if(wN)return C5;wN=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return C5=r,C5}var E5,SN;function wd(){if(SN)return E5;SN=1;var e=ub(),t=lae(),r=cae(),n="[object Null]",o="[object Undefined]",a=e?e.toStringTag:void 0;function s(l){return l==null?l===void 0?o:n:a&&a in Object(l)?t(l):r(l)}return E5=s,E5}var A5,jN;function Sd(){if(jN)return A5;jN=1;function e(t){return t!=null&&typeof t=="object"}return A5=e,A5}var T5,kN;function gv(){if(kN)return T5;kN=1;var e=wd(),t=Sd(),r="[object Symbol]";function n(o){return typeof o=="symbol"||t(o)&&e(o)==r}return T5=n,T5}var P5,_N;function sT(){if(_N)return P5;_N=1;var e=ms(),t=gv(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function o(a,s){if(e(a))return!1;var l=typeof a;return l=="number"||l=="symbol"||l=="boolean"||a==null||t(a)?!0:n.test(a)||!r.test(a)||s!=null&&a in Object(s)}return P5=o,P5}var O5,CN;function Hf(){if(CN)return O5;CN=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return O5=e,O5}var I5,EN;function lT(){if(EN)return I5;EN=1;var e=wd(),t=Hf(),r="[object AsyncFunction]",n="[object Function]",o="[object GeneratorFunction]",a="[object Proxy]";function s(l){if(!t(l))return!1;var c=e(l);return c==n||c==o||c==r||c==a}return I5=s,I5}var N5,AN;function uae(){if(AN)return N5;AN=1;var e=au(),t=e["__core-js_shared__"];return N5=t,N5}var R5,TN;function dae(){if(TN)return R5;TN=1;var e=uae(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return R5=r,R5}var L5,PN;function J$(){if(PN)return L5;PN=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return L5=r,L5}var F5,ON;function fae(){if(ON)return F5;ON=1;var e=lT(),t=dae(),r=Hf(),n=J$(),o=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,s=Function.prototype,l=Object.prototype,c=s.toString,u=l.hasOwnProperty,d=RegExp("^"+c.call(u).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function f(h){if(!r(h)||t(h))return!1;var p=e(h)?d:a;return p.test(n(h))}return F5=f,F5}var M5,IN;function pae(){if(IN)return M5;IN=1;function e(t,r){return t==null?void 0:t[r]}return M5=e,M5}var D5,NN;function Oh(){if(NN)return D5;NN=1;var e=fae(),t=pae();function r(n,o){var a=t(n,o);return e(a)?a:void 0}return D5=r,D5}var z5,RN;function Dw(){if(RN)return z5;RN=1;var e=Oh(),t=e(Object,"create");return z5=t,z5}var B5,LN;function hae(){if(LN)return B5;LN=1;var e=Dw();function t(){this.__data__=e?e(null):{},this.size=0}return B5=t,B5}var W5,FN;function gae(){if(FN)return W5;FN=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return W5=e,W5}var q5,MN;function mae(){if(MN)return q5;MN=1;var e=Dw(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function o(a){var s=this.__data__;if(e){var l=s[a];return l===t?void 0:l}return n.call(s,a)?s[a]:void 0}return q5=o,q5}var $5,DN;function vae(){if(DN)return $5;DN=1;var e=Dw(),t=Object.prototype,r=t.hasOwnProperty;function n(o){var a=this.__data__;return e?a[o]!==void 0:r.call(a,o)}return $5=n,$5}var U5,zN;function yae(){if(zN)return U5;zN=1;var e=Dw(),t="__lodash_hash_undefined__";function r(n,o){var a=this.__data__;return this.size+=this.has(n)?0:1,a[n]=e&&o===void 0?t:o,this}return U5=r,U5}var H5,BN;function xae(){if(BN)return H5;BN=1;var e=hae(),t=gae(),r=mae(),n=vae(),o=yae();function a(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var u=s[l];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=o,H5=a,H5}var V5,WN;function bae(){if(WN)return V5;WN=1;function e(){this.__data__=[],this.size=0}return V5=e,V5}var Y5,qN;function cT(){if(qN)return Y5;qN=1;function e(t,r){return t===r||t!==t&&r!==r}return Y5=e,Y5}var G5,$N;function zw(){if($N)return G5;$N=1;var e=cT();function t(r,n){for(var o=r.length;o--;)if(e(r[o][0],n))return o;return-1}return G5=t,G5}var K5,UN;function wae(){if(UN)return K5;UN=1;var e=zw(),t=Array.prototype,r=t.splice;function n(o){var a=this.__data__,s=e(a,o);if(s<0)return!1;var l=a.length-1;return s==l?a.pop():r.call(a,s,1),--this.size,!0}return K5=n,K5}var Q5,HN;function Sae(){if(HN)return Q5;HN=1;var e=zw();function t(r){var n=this.__data__,o=e(n,r);return o<0?void 0:n[o][1]}return Q5=t,Q5}var X5,VN;function jae(){if(VN)return X5;VN=1;var e=zw();function t(r){return e(this.__data__,r)>-1}return X5=t,X5}var Z5,YN;function kae(){if(YN)return Z5;YN=1;var e=zw();function t(r,n){var o=this.__data__,a=e(o,r);return a<0?(++this.size,o.push([r,n])):o[a][1]=n,this}return Z5=t,Z5}var J5,GN;function Bw(){if(GN)return J5;GN=1;var e=bae(),t=wae(),r=Sae(),n=jae(),o=kae();function a(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var u=s[l];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=o,J5=a,J5}var ek,KN;function uT(){if(KN)return ek;KN=1;var e=Oh(),t=au(),r=e(t,"Map");return ek=r,ek}var tk,QN;function _ae(){if(QN)return tk;QN=1;var e=xae(),t=Bw(),r=uT();function n(){this.size=0,this.__data__={hash:new e,map:new(r||t),string:new e}}return tk=n,tk}var rk,XN;function Cae(){if(XN)return rk;XN=1;function e(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}return rk=e,rk}var nk,ZN;function Ww(){if(ZN)return nk;ZN=1;var e=Cae();function t(r,n){var o=r.__data__;return e(n)?o[typeof n=="string"?"string":"hash"]:o.map}return nk=t,nk}var ik,JN;function Eae(){if(JN)return ik;JN=1;var e=Ww();function t(r){var n=e(this,r).delete(r);return this.size-=n?1:0,n}return ik=t,ik}var ok,eR;function Aae(){if(eR)return ok;eR=1;var e=Ww();function t(r){return e(this,r).get(r)}return ok=t,ok}var ak,tR;function Tae(){if(tR)return ak;tR=1;var e=Ww();function t(r){return e(this,r).has(r)}return ak=t,ak}var sk,rR;function Pae(){if(rR)return sk;rR=1;var e=Ww();function t(r,n){var o=e(this,r),a=o.size;return o.set(r,n),this.size+=o.size==a?0:1,this}return sk=t,sk}var lk,nR;function dT(){if(nR)return lk;nR=1;var e=_ae(),t=Eae(),r=Aae(),n=Tae(),o=Pae();function a(s){var l=-1,c=s==null?0:s.length;for(this.clear();++l<c;){var u=s[l];this.set(u[0],u[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=r,a.prototype.has=n,a.prototype.set=o,lk=a,lk}var ck,iR;function eU(){if(iR)return ck;iR=1;var e=dT(),t="Expected a function";function r(n,o){if(typeof n!="function"||o!=null&&typeof o!="function")throw new TypeError(t);var a=function(){var s=arguments,l=o?o.apply(this,s):s[0],c=a.cache;if(c.has(l))return c.get(l);var u=n.apply(this,s);return a.cache=c.set(l,u)||c,u};return a.cache=new(r.Cache||e),a}return r.Cache=e,ck=r,ck}var uk,oR;function Oae(){if(oR)return uk;oR=1;var e=eU(),t=500;function r(n){var o=e(n,function(s){return a.size===t&&a.clear(),s}),a=o.cache;return o}return uk=r,uk}var dk,aR;function Iae(){if(aR)return dk;aR=1;var e=Oae(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=e(function(o){var a=[];return o.charCodeAt(0)===46&&a.push(""),o.replace(t,function(s,l,c,u){a.push(c?u.replace(r,"$1"):l||s)}),a});return dk=n,dk}var fk,sR;function fT(){if(sR)return fk;sR=1;function e(t,r){for(var n=-1,o=t==null?0:t.length,a=Array(o);++n<o;)a[n]=r(t[n],n,t);return a}return fk=e,fk}var pk,lR;function Nae(){if(lR)return pk;lR=1;var e=ub(),t=fT(),r=ms(),n=gv(),o=e?e.prototype:void 0,a=o?o.toString:void 0;function s(l){if(typeof l=="string")return l;if(r(l))return t(l,s)+"";if(n(l))return a?a.call(l):"";var c=l+"";return c=="0"&&1/l==-1/0?"-0":c}return pk=s,pk}var hk,cR;function tU(){if(cR)return hk;cR=1;var e=Nae();function t(r){return r==null?"":e(r)}return hk=t,hk}var gk,uR;function rU(){if(uR)return gk;uR=1;var e=ms(),t=sT(),r=Iae(),n=tU();function o(a,s){return e(a)?a:t(a,s)?[a]:r(n(a))}return gk=o,gk}var mk,dR;function qw(){if(dR)return mk;dR=1;var e=gv();function t(r){if(typeof r=="string"||e(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return mk=t,mk}var vk,fR;function pT(){if(fR)return vk;fR=1;var e=rU(),t=qw();function r(n,o){o=e(o,n);for(var a=0,s=o.length;n!=null&&a<s;)n=n[t(o[a++])];return a&&a==s?n:void 0}return vk=r,vk}var yk,pR;function nU(){if(pR)return yk;pR=1;var e=pT();function t(r,n,o){var a=r==null?void 0:e(r,n);return a===void 0?o:a}return yk=t,yk}var Rae=nU();const Gs=un(Rae);var xk,hR;function Lae(){if(hR)return xk;hR=1;function e(t){return t==null}return xk=e,xk}var Fae=Lae();const Rr=un(Fae);var bk,gR;function Mae(){if(gR)return bk;gR=1;var e=wd(),t=ms(),r=Sd(),n="[object String]";function o(a){return typeof a=="string"||!t(a)&&r(a)&&e(a)==n}return bk=o,bk}var Dae=Mae();const db=un(Dae);var zae=lT();const Ar=un(zae);var Bae=Hf();const mv=un(Bae);var wk={exports:{}},xn={};/**
|
||
* @license React
|
||
* react-is.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var mR;function Wae(){if(mR)return xn;mR=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),y;y=Symbol.for("react.module.reference");function m(x){if(typeof x=="object"&&x!==null){var b=x.$$typeof;switch(b){case e:switch(x=x.type,x){case r:case o:case n:case u:case d:return x;default:switch(x=x&&x.$$typeof,x){case l:case s:case c:case h:case f:case a:return x;default:return b}}case t:return b}}}return xn.ContextConsumer=s,xn.ContextProvider=a,xn.Element=e,xn.ForwardRef=c,xn.Fragment=r,xn.Lazy=h,xn.Memo=f,xn.Portal=t,xn.Profiler=o,xn.StrictMode=n,xn.Suspense=u,xn.SuspenseList=d,xn.isAsyncMode=function(){return!1},xn.isConcurrentMode=function(){return!1},xn.isContextConsumer=function(x){return m(x)===s},xn.isContextProvider=function(x){return m(x)===a},xn.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},xn.isForwardRef=function(x){return m(x)===c},xn.isFragment=function(x){return m(x)===r},xn.isLazy=function(x){return m(x)===h},xn.isMemo=function(x){return m(x)===f},xn.isPortal=function(x){return m(x)===t},xn.isProfiler=function(x){return m(x)===o},xn.isStrictMode=function(x){return m(x)===n},xn.isSuspense=function(x){return m(x)===u},xn.isSuspenseList=function(x){return m(x)===d},xn.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===r||x===o||x===n||x===u||x===d||x===p||typeof x=="object"&&x!==null&&(x.$$typeof===h||x.$$typeof===f||x.$$typeof===a||x.$$typeof===s||x.$$typeof===c||x.$$typeof===y||x.getModuleId!==void 0)},xn.typeOf=m,xn}var vR;function qae(){return vR||(vR=1,wk.exports=Wae()),wk.exports}var $ae=qae(),Sk,yR;function iU(){if(yR)return Sk;yR=1;var e=wd(),t=Sd(),r="[object Number]";function n(o){return typeof o=="number"||t(o)&&e(o)==r}return Sk=n,Sk}var jk,xR;function Uae(){if(xR)return jk;xR=1;var e=iU();function t(r){return e(r)&&r!=+r}return jk=t,jk}var Hae=Uae();const fb=un(Hae);var Vae=iU();const Yae=un(Vae);var Ba=function(t){return t===0?0:t>0?1:-1},Kp=function(t){return db(t)&&t.indexOf("%")===t.length-1},Bt=function(t){return Yae(t)&&!fb(t)},ho=function(t){return Bt(t)||db(t)},Gae=0,vv=function(t){var r=++Gae;return"".concat(t||"").concat(r)},Wa=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Bt(t)&&!db(t))return n;var a;if(Kp(t)){var s=t.indexOf("%");a=r*parseFloat(t.slice(0,s))/100}else a=+t;return fb(a)&&(a=n),o&&a>r&&(a=r),a},xf=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},Kae=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},o=0;o<r;o++)if(!n[t[o]])n[t[o]]=!0;else return!0;return!1},Ws=function(t,r){return Bt(t)&&Bt(r)?function(n){return t+n*(r-t)}:function(){return r}};function U0(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):Gs(n,t))===r})}function tm(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function cE(e){"@babel/helpers - typeof";return cE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cE(e)}var Qae=["viewBox","children"],Xae=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],bR=["points","pathLength"],kk={svg:Qae,polygon:bR,polyline:bR},hT=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],H0=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(j.isValidElement(t)&&(n=t.props),!mv(n))return null;var o={};return Object.keys(n).forEach(function(a){hT.includes(a)&&(o[a]=r||function(s){return n[a](n,s)})}),o},Zae=function(t,r,n){return function(o){return t(r,n,o),null}},hh=function(t,r,n){if(!mv(t)||cE(t)!=="object")return null;var o=null;return Object.keys(t).forEach(function(a){var s=t[a];hT.includes(a)&&typeof s=="function"&&(o||(o={}),o[a]=Zae(s,r,n))}),o},Jae=["children"],ese=["children"];function wR(e,t){if(e==null)return{};var r=tse(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tse(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uE(e){"@babel/helpers - typeof";return uE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uE(e)}var SR={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},ad=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},jR=null,_k=null,gT=function e(t){if(t===jR&&Array.isArray(_k))return _k;var r=[];return j.Children.forEach(t,function(n){Rr(n)||($ae.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),_k=r,jR=t,r};function Ks(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(o){return ad(o)}):n=[ad(t)],gT(e).forEach(function(o){var a=Gs(o,"type.displayName")||Gs(o,"type.name");n.indexOf(a)!==-1&&r.push(o)}),r}function Bs(e,t){var r=Ks(e,t);return r&&r[0]}var kR=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,o=r.height;return!(!Bt(n)||n<=0||!Bt(o)||o<=0)},rse=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],nse=function(t){return t&&t.type&&db(t.type)&&rse.indexOf(t.type)>=0},ise=function(t){return t&&uE(t)==="object"&&"clipDot"in t},ose=function(t,r,n,o){var a,s=(a=kk==null?void 0:kk[o])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!Ar(t)&&(o&&s.includes(r)||Xae.includes(r))||n&&hT.includes(r)},vr=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var o=t;if(j.isValidElement(t)&&(o=t.props),!mv(o))return null;var a={};return Object.keys(o).forEach(function(s){var l;ose((l=o)===null||l===void 0?void 0:l[s],s,r,n)&&(a[s]=o[s])}),a},dE=function e(t,r){if(t===r)return!0;var n=j.Children.count(t);if(n!==j.Children.count(r))return!1;if(n===0)return!0;if(n===1)return _R(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var o=0;o<n;o++){var a=t[o],s=r[o];if(Array.isArray(a)||Array.isArray(s)){if(!e(a,s))return!1}else if(!_R(a,s))return!1}return!0},_R=function(t,r){if(Rr(t)&&Rr(r))return!0;if(!Rr(t)&&!Rr(r)){var n=t.props||{},o=n.children,a=wR(n,Jae),s=r.props||{},l=s.children,c=wR(s,ese);return o&&l?tm(a,c)&&dE(o,l):!o&&!l?tm(a,c):!1}return!1},CR=function(t,r){var n=[],o={};return gT(t).forEach(function(a,s){if(nse(a))n.push(a);else if(a){var l=ad(a.type),c=r[l]||{},u=c.handler,d=c.once;if(u&&(!d||!o[l])){var f=u(a,l,s);n.push(f),o[l]=!0}}}),n},ase=function(t){var r=t&&t.type;return r&&SR[r]?SR[r]:null},sse=function(t,r){return gT(r).indexOf(t)},lse=["children","width","height","viewBox","className","style","title","desc"];function fE(){return fE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fE.apply(this,arguments)}function cse(e,t){if(e==null)return{};var r=use(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function use(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function pE(e){var t=e.children,r=e.width,n=e.height,o=e.viewBox,a=e.className,s=e.style,l=e.title,c=e.desc,u=cse(e,lse),d=o||{width:r,height:n,x:0,y:0},f=Lr("recharts-surface",a);return ze.createElement("svg",fE({},vr(u,!0,"svg"),{className:f,width:r,height:n,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),ze.createElement("title",null,l),ze.createElement("desc",null,c),t)}var dse=["children","className"];function hE(){return hE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hE.apply(this,arguments)}function fse(e,t){if(e==null)return{};var r=pse(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function pse(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var ln=ze.forwardRef(function(e,t){var r=e.children,n=e.className,o=fse(e,dse),a=Lr("recharts-layer",n);return ze.createElement("g",hE({className:a},vr(o,!0),{ref:t}),r)}),ac=function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a]},Ck,ER;function hse(){if(ER)return Ck;ER=1;function e(t,r,n){var o=-1,a=t.length;r<0&&(r=-r>a?0:a+r),n=n>a?a:n,n<0&&(n+=a),a=r>n?0:n-r>>>0,r>>>=0;for(var s=Array(a);++o<a;)s[o]=t[o+r];return s}return Ck=e,Ck}var Ek,AR;function gse(){if(AR)return Ek;AR=1;var e=hse();function t(r,n,o){var a=r.length;return o=o===void 0?a:o,!n&&o>=a?r:e(r,n,o)}return Ek=t,Ek}var Ak,TR;function oU(){if(TR)return Ak;TR=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",o=t+r+n,a="\\ufe0e\\ufe0f",s="\\u200d",l=RegExp("["+s+e+o+a+"]");function c(u){return l.test(u)}return Ak=c,Ak}var Tk,PR;function mse(){if(PR)return Tk;PR=1;function e(t){return t.split("")}return Tk=e,Tk}var Pk,OR;function vse(){if(OR)return Pk;OR=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",o=t+r+n,a="\\ufe0e\\ufe0f",s="["+e+"]",l="["+o+"]",c="\\ud83c[\\udffb-\\udfff]",u="(?:"+l+"|"+c+")",d="[^"+e+"]",f="(?:\\ud83c[\\udde6-\\uddff]){2}",h="[\\ud800-\\udbff][\\udc00-\\udfff]",p="\\u200d",y=u+"?",m="["+a+"]?",x="(?:"+p+"(?:"+[d,f,h].join("|")+")"+m+y+")*",b=m+y+x,w="(?:"+[d+l+"?",l,f,h,s].join("|")+")",k=RegExp(c+"(?="+c+")|"+w+b,"g");function S(_){return _.match(k)||[]}return Pk=S,Pk}var Ok,IR;function yse(){if(IR)return Ok;IR=1;var e=mse(),t=oU(),r=vse();function n(o){return t(o)?r(o):e(o)}return Ok=n,Ok}var Ik,NR;function xse(){if(NR)return Ik;NR=1;var e=gse(),t=oU(),r=yse(),n=tU();function o(a){return function(s){s=n(s);var l=t(s)?r(s):void 0,c=l?l[0]:s.charAt(0),u=l?e(l,1).join(""):s.slice(1);return c[a]()+u}}return Ik=o,Ik}var Nk,RR;function bse(){if(RR)return Nk;RR=1;var e=xse(),t=e("toUpperCase");return Nk=t,Nk}var wse=bse();const $w=un(wse);function Vn(e){return function(){return e}}const aU=Math.cos,V0=Math.sin,gc=Math.sqrt,Y0=Math.PI,Uw=2*Y0,gE=Math.PI,mE=2*gE,Dp=1e-6,Sse=mE-Dp;function sU(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function jse(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return sU;const r=10**t;return function(n){this._+=n[0];for(let o=1,a=n.length;o<a;++o)this._+=Math.round(arguments[o]*r)/r+n[o]}}let kse=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?sU:jse(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,o){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+o}`}bezierCurveTo(t,r,n,o,a,s){this._append`C${+t},${+r},${+n},${+o},${this._x1=+a},${this._y1=+s}`}arcTo(t,r,n,o,a){if(t=+t,r=+r,n=+n,o=+o,a=+a,a<0)throw new Error(`negative radius: ${a}`);let s=this._x1,l=this._y1,c=n-t,u=o-r,d=s-t,f=l-r,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>Dp)if(!(Math.abs(f*c-u*d)>Dp)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-s,y=o-l,m=c*c+u*u,x=p*p+y*y,b=Math.sqrt(m),w=Math.sqrt(h),k=a*Math.tan((gE-Math.acos((m+h-x)/(2*b*w)))/2),S=k/w,_=k/b;Math.abs(S-1)>Dp&&this._append`L${t+S*d},${r+S*f}`,this._append`A${a},${a},0,0,${+(f*p>d*y)},${this._x1=t+_*c},${this._y1=r+_*u}`}}arc(t,r,n,o,a,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(o),c=n*Math.sin(o),u=t+l,d=r+c,f=1^s,h=s?o-a:a-o;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Dp||Math.abs(this._y1-d)>Dp)&&this._append`L${u},${d}`,n&&(h<0&&(h=h%mE+mE),h>Sse?this._append`A${n},${n},0,1,${f},${t-l},${r-c}A${n},${n},0,1,${f},${this._x1=u},${this._y1=d}`:h>Dp&&this._append`A${n},${n},0,${+(h>=gE)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+o}h${-n}Z`}toString(){return this._}};function mT(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new kse(t)}function vT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function lU(e){this._context=e}lU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Hw(e){return new lU(e)}function cU(e){return e[0]}function uU(e){return e[1]}function dU(e,t){var r=Vn(!0),n=null,o=Hw,a=null,s=mT(l);e=typeof e=="function"?e:e===void 0?cU:Vn(e),t=typeof t=="function"?t:t===void 0?uU:Vn(t);function l(c){var u,d=(c=vT(c)).length,f,h=!1,p;for(n==null&&(a=o(p=s())),u=0;u<=d;++u)!(u<d&&r(f=c[u],u,c))===h&&((h=!h)?a.lineStart():a.lineEnd()),h&&a.point(+e(f,u,c),+t(f,u,c));if(p)return a=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:Vn(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:Vn(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:Vn(!!c),l):r},l.curve=function(c){return arguments.length?(o=c,n!=null&&(a=o(n)),l):o},l.context=function(c){return arguments.length?(c==null?n=a=null:a=o(n=c),l):n},l}function N1(e,t,r){var n=null,o=Vn(!0),a=null,s=Hw,l=null,c=mT(u);e=typeof e=="function"?e:e===void 0?cU:Vn(+e),t=typeof t=="function"?t:Vn(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?uU:Vn(+r);function u(f){var h,p,y,m=(f=vT(f)).length,x,b=!1,w,k=new Array(m),S=new Array(m);for(a==null&&(l=s(w=c())),h=0;h<=m;++h){if(!(h<m&&o(x=f[h],h,f))===b)if(b=!b)p=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),y=h-1;y>=p;--y)l.point(k[y],S[y]);l.lineEnd(),l.areaEnd()}b&&(k[h]=+e(x,h,f),S[h]=+t(x,h,f),l.point(n?+n(x,h,f):k[h],r?+r(x,h,f):S[h]))}if(w)return l=null,w+""||null}function d(){return dU().defined(o).curve(s).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Vn(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Vn(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Vn(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Vn(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Vn(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Vn(+f),u):r},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(r)},u.lineX1=function(){return d().x(n).y(t)},u.defined=function(f){return arguments.length?(o=typeof f=="function"?f:Vn(!!f),u):o},u.curve=function(f){return arguments.length?(s=f,a!=null&&(l=s(a)),u):s},u.context=function(f){return arguments.length?(f==null?a=l=null:l=s(a=f),u):a},u}class fU{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function _se(e){return new fU(e,!0)}function Cse(e){return new fU(e,!1)}const yT={draw(e,t){const r=gc(t/Y0);e.moveTo(r,0),e.arc(0,0,r,0,Uw)}},Ese={draw(e,t){const r=gc(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},pU=gc(1/3),Ase=pU*2,Tse={draw(e,t){const r=gc(t/Ase),n=r*pU;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Pse={draw(e,t){const r=gc(t),n=-r/2;e.rect(n,n,r,r)}},Ose=.8908130915292852,hU=V0(Y0/10)/V0(7*Y0/10),Ise=V0(Uw/10)*hU,Nse=-aU(Uw/10)*hU,Rse={draw(e,t){const r=gc(t*Ose),n=Ise*r,o=Nse*r;e.moveTo(0,-r),e.lineTo(n,o);for(let a=1;a<5;++a){const s=Uw*a/5,l=aU(s),c=V0(s);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*o,c*n+l*o)}e.closePath()}},Rk=gc(3),Lse={draw(e,t){const r=-gc(t/(Rk*3));e.moveTo(0,r*2),e.lineTo(-Rk*r,-r),e.lineTo(Rk*r,-r),e.closePath()}},vl=-.5,yl=gc(3)/2,vE=1/gc(12),Fse=(vE/2+1)*3,Mse={draw(e,t){const r=gc(t/Fse),n=r/2,o=r*vE,a=n,s=r*vE+r,l=-a,c=s;e.moveTo(n,o),e.lineTo(a,s),e.lineTo(l,c),e.lineTo(vl*n-yl*o,yl*n+vl*o),e.lineTo(vl*a-yl*s,yl*a+vl*s),e.lineTo(vl*l-yl*c,yl*l+vl*c),e.lineTo(vl*n+yl*o,vl*o-yl*n),e.lineTo(vl*a+yl*s,vl*s-yl*a),e.lineTo(vl*l+yl*c,vl*c-yl*l),e.closePath()}};function Dse(e,t){let r=null,n=mT(o);e=typeof e=="function"?e:Vn(e||yT),t=typeof t=="function"?t:Vn(t===void 0?64:+t);function o(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return o.type=function(a){return arguments.length?(e=typeof a=="function"?a:Vn(a),o):e},o.size=function(a){return arguments.length?(t=typeof a=="function"?a:Vn(+a),o):t},o.context=function(a){return arguments.length?(r=a??null,o):r},o}function G0(){}function K0(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function gU(e){this._context=e}gU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:K0(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:K0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zse(e){return new gU(e)}function mU(e){this._context=e}mU.prototype={areaStart:G0,areaEnd:G0,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:K0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bse(e){return new mU(e)}function vU(e){this._context=e}vU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:K0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Wse(e){return new vU(e)}function yU(e){this._context=e}yU.prototype={areaStart:G0,areaEnd:G0,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function qse(e){return new yU(e)}function LR(e){return e<0?-1:1}function FR(e,t,r){var n=e._x1-e._x0,o=t-e._x1,a=(e._y1-e._y0)/(n||o<0&&-0),s=(r-e._y1)/(o||n<0&&-0),l=(a*o+s*n)/(n+o);return(LR(a)+LR(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(l))||0}function MR(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Lk(e,t,r){var n=e._x0,o=e._y0,a=e._x1,s=e._y1,l=(a-n)/3;e._context.bezierCurveTo(n+l,o+l*t,a-l,s-l*r,a,s)}function Q0(e){this._context=e}Q0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Lk(this,this._t0,MR(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Lk(this,MR(this,r=FR(this,e,t)),r);break;default:Lk(this,this._t0,r=FR(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function xU(e){this._context=new bU(e)}(xU.prototype=Object.create(Q0.prototype)).point=function(e,t){Q0.prototype.point.call(this,t,e)};function bU(e){this._context=e}bU.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,o,a){this._context.bezierCurveTo(t,e,n,r,a,o)}};function $se(e){return new Q0(e)}function Use(e){return new xU(e)}function wU(e){this._context=e}wU.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=DR(e),o=DR(t),a=0,s=1;s<r;++a,++s)this._context.bezierCurveTo(n[0][a],o[0][a],n[1][a],o[1][a],e[s],t[s]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function DR(e){var t,r=e.length-1,n,o=new Array(r),a=new Array(r),s=new Array(r);for(o[0]=0,a[0]=2,s[0]=e[0]+2*e[1],t=1;t<r-1;++t)o[t]=1,a[t]=4,s[t]=4*e[t]+2*e[t+1];for(o[r-1]=2,a[r-1]=7,s[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=o[t]/a[t-1],a[t]-=n,s[t]-=n*s[t-1];for(o[r-1]=s[r-1]/a[r-1],t=r-2;t>=0;--t)o[t]=(s[t]-o[t+1])/a[t];for(a[r-1]=(e[r]+o[r-1])/2,t=0;t<r-1;++t)a[t]=2*e[t+1]-o[t+1];return[o,a]}function Hse(e){return new wU(e)}function Vw(e,t){this._context=e,this._t=t}Vw.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Vse(e){return new Vw(e,.5)}function Yse(e){return new Vw(e,0)}function Gse(e){return new Vw(e,1)}function xm(e,t){if((s=e.length)>1)for(var r=1,n,o,a=e[t[0]],s,l=a.length;r<s;++r)for(o=a,a=e[t[r]],n=0;n<l;++n)a[n][1]+=a[n][0]=isNaN(o[n][1])?o[n][0]:o[n][1]}function yE(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function Kse(e,t){return e[t]}function Qse(e){const t=[];return t.key=e,t}function Xse(){var e=Vn([]),t=yE,r=xm,n=Kse;function o(a){var s=Array.from(e.apply(this,arguments),Qse),l,c=s.length,u=-1,d;for(const f of a)for(l=0,++u;l<c;++l)(s[l][u]=[0,+n(f,s[l].key,u,a)]).data=f;for(l=0,d=vT(t(s));l<c;++l)s[d[l]].index=l;return r(s,d),s}return o.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Vn(Array.from(a)),o):e},o.value=function(a){return arguments.length?(n=typeof a=="function"?a:Vn(+a),o):n},o.order=function(a){return arguments.length?(t=a==null?yE:typeof a=="function"?a:Vn(Array.from(a)),o):t},o.offset=function(a){return arguments.length?(r=a??xm,o):r},o}function Zse(e,t){if((n=e.length)>0){for(var r,n,o=0,a=e[0].length,s;o<a;++o){for(s=r=0;r<n;++r)s+=e[r][o][1]||0;if(s)for(r=0;r<n;++r)e[r][o][1]/=s}xm(e,t)}}function Jse(e,t){if((o=e.length)>0){for(var r=0,n=e[t[0]],o,a=n.length;r<a;++r){for(var s=0,l=0;s<o;++s)l+=e[s][r][1]||0;n[r][1]+=n[r][0]=-l/2}xm(e,t)}}function ele(e,t){if(!(!((s=e.length)>0)||!((a=(o=e[t[0]]).length)>0))){for(var r=0,n=1,o,a,s;n<a;++n){for(var l=0,c=0,u=0;l<s;++l){for(var d=e[t[l]],f=d[n][1]||0,h=d[n-1][1]||0,p=(f-h)/2,y=0;y<l;++y){var m=e[t[y]],x=m[n][1]||0,b=m[n-1][1]||0;p+=x-b}c+=f,u+=p*f}o[n-1][1]+=o[n-1][0]=r,c&&(r-=u/c)}o[n-1][1]+=o[n-1][0]=r,xm(e,t)}}function sx(e){"@babel/helpers - typeof";return sx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sx(e)}var tle=["type","size","sizeType"];function xE(){return xE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xE.apply(this,arguments)}function zR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function BR(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zR(Object(r),!0).forEach(function(n){rle(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rle(e,t,r){return t=nle(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nle(e){var t=ile(e,"string");return sx(t)=="symbol"?t:t+""}function ile(e,t){if(sx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(sx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ole(e,t){if(e==null)return{};var r=ale(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ale(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var SU={symbolCircle:yT,symbolCross:Ese,symbolDiamond:Tse,symbolSquare:Pse,symbolStar:Rse,symbolTriangle:Lse,symbolWye:Mse},sle=Math.PI/180,lle=function(t){var r="symbol".concat($w(t));return SU[r]||yT},cle=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var o=18*sle;return 1.25*t*t*(Math.tan(o)-Math.tan(o*2)*Math.pow(Math.tan(o),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},ule=function(t,r){SU["symbol".concat($w(t))]=r},xT=function(t){var r=t.type,n=r===void 0?"circle":r,o=t.size,a=o===void 0?64:o,s=t.sizeType,l=s===void 0?"area":s,c=ole(t,tle),u=BR(BR({},c),{},{type:n,size:a,sizeType:l}),d=function(){var x=lle(n),b=Dse().type(x).size(cle(a,l,n));return b()},f=u.className,h=u.cx,p=u.cy,y=vr(u,!0);return h===+h&&p===+p&&a===+a?ze.createElement("path",xE({},y,{className:Lr("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};xT.registerSymbol=ule;function bm(e){"@babel/helpers - typeof";return bm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bm(e)}function bE(){return bE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bE.apply(this,arguments)}function WR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function dle(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WR(Object(r),!0).forEach(function(n){lx(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WR(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ple(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,kU(n.key),n)}}function hle(e,t,r){return t&&ple(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function gle(e,t,r){return t=X0(t),mle(e,jU()?Reflect.construct(t,r||[],X0(e).constructor):t.apply(e,r))}function mle(e,t){if(t&&(bm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vle(e)}function vle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jU=function(){return!!e})()}function X0(e){return X0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},X0(e)}function yle(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wE(e,t)}function wE(e,t){return wE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},wE(e,t)}function lx(e,t,r){return t=kU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kU(e){var t=xle(e,"string");return bm(t)=="symbol"?t:t+""}function xle(e,t){if(bm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(bm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var xl=32,bT=(function(e){function t(){return fle(this,t),gle(this,t,arguments)}return yle(t,e),hle(t,[{key:"renderIcon",value:function(n){var o=this.props.inactiveColor,a=xl/2,s=xl/6,l=xl/3,c=n.inactive?o:n.color;if(n.type==="plainline")return ze.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:a,x2:xl,y2:a,className:"recharts-legend-icon"});if(n.type==="line")return ze.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(l,`
|
||
A`).concat(s,",").concat(s,",0,1,1,").concat(2*l,",").concat(a,`
|
||
H`).concat(xl,"M").concat(2*l,",").concat(a,`
|
||
A`).concat(s,",").concat(s,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(n.type==="rect")return ze.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(xl/8,"h").concat(xl,"v").concat(xl*3/4,"h").concat(-xl,"z"),className:"recharts-legend-icon"});if(ze.isValidElement(n.legendIcon)){var u=dle({},n);return delete u.legendIcon,ze.cloneElement(n.legendIcon,u)}return ze.createElement(xT,{fill:c,cx:a,cy:a,size:xl,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,o=this.props,a=o.payload,s=o.iconSize,l=o.layout,c=o.formatter,u=o.inactiveColor,d={x:0,y:0,width:xl,height:xl},f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(p,y){var m=p.formatter||c,x=Lr(lx(lx({"recharts-legend-item":!0},"legend-item-".concat(y),!0),"inactive",p.inactive));if(p.type==="none")return null;var b=Ar(p.value)?null:p.value;ac(!Ar(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var w=p.inactive?u:p.color;return ze.createElement("li",bE({className:x,style:f,key:"legend-item-".concat(y)},hh(n.props,p,y)),ze.createElement(pE,{width:s,height:s,viewBox:d,style:h},n.renderIcon(p)),ze.createElement("span",{className:"recharts-legend-item-text",style:{color:w}},m?m(b,p,y):b))})}},{key:"render",value:function(){var n=this.props,o=n.payload,a=n.layout,s=n.align;if(!o||!o.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?s:"left"};return ze.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])})(j.PureComponent);lx(bT,"displayName","Legend");lx(bT,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Fk,qR;function ble(){if(qR)return Fk;qR=1;var e=Bw();function t(){this.__data__=new e,this.size=0}return Fk=t,Fk}var Mk,$R;function wle(){if($R)return Mk;$R=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Mk=e,Mk}var Dk,UR;function Sle(){if(UR)return Dk;UR=1;function e(t){return this.__data__.get(t)}return Dk=e,Dk}var zk,HR;function jle(){if(HR)return zk;HR=1;function e(t){return this.__data__.has(t)}return zk=e,zk}var Bk,VR;function kle(){if(VR)return Bk;VR=1;var e=Bw(),t=uT(),r=dT(),n=200;function o(a,s){var l=this.__data__;if(l instanceof e){var c=l.__data__;if(!t||c.length<n-1)return c.push([a,s]),this.size=++l.size,this;l=this.__data__=new r(c)}return l.set(a,s),this.size=l.size,this}return Bk=o,Bk}var Wk,YR;function _U(){if(YR)return Wk;YR=1;var e=Bw(),t=ble(),r=wle(),n=Sle(),o=jle(),a=kle();function s(l){var c=this.__data__=new e(l);this.size=c.size}return s.prototype.clear=t,s.prototype.delete=r,s.prototype.get=n,s.prototype.has=o,s.prototype.set=a,Wk=s,Wk}var qk,GR;function _le(){if(GR)return qk;GR=1;var e="__lodash_hash_undefined__";function t(r){return this.__data__.set(r,e),this}return qk=t,qk}var $k,KR;function Cle(){if(KR)return $k;KR=1;function e(t){return this.__data__.has(t)}return $k=e,$k}var Uk,QR;function CU(){if(QR)return Uk;QR=1;var e=dT(),t=_le(),r=Cle();function n(o){var a=-1,s=o==null?0:o.length;for(this.__data__=new e;++a<s;)this.add(o[a])}return n.prototype.add=n.prototype.push=t,n.prototype.has=r,Uk=n,Uk}var Hk,XR;function EU(){if(XR)return Hk;XR=1;function e(t,r){for(var n=-1,o=t==null?0:t.length;++n<o;)if(r(t[n],n,t))return!0;return!1}return Hk=e,Hk}var Vk,ZR;function AU(){if(ZR)return Vk;ZR=1;function e(t,r){return t.has(r)}return Vk=e,Vk}var Yk,JR;function TU(){if(JR)return Yk;JR=1;var e=CU(),t=EU(),r=AU(),n=1,o=2;function a(s,l,c,u,d,f){var h=c&n,p=s.length,y=l.length;if(p!=y&&!(h&&y>p))return!1;var m=f.get(s),x=f.get(l);if(m&&x)return m==l&&x==s;var b=-1,w=!0,k=c&o?new e:void 0;for(f.set(s,l),f.set(l,s);++b<p;){var S=s[b],_=l[b];if(u)var P=h?u(_,S,b,l,s,f):u(S,_,b,s,l,f);if(P!==void 0){if(P)continue;w=!1;break}if(k){if(!t(l,function(O,T){if(!r(k,T)&&(S===O||d(S,O,c,u,f)))return k.push(T)})){w=!1;break}}else if(!(S===_||d(S,_,c,u,f))){w=!1;break}}return f.delete(s),f.delete(l),w}return Yk=a,Yk}var Gk,eL;function Ele(){if(eL)return Gk;eL=1;var e=au(),t=e.Uint8Array;return Gk=t,Gk}var Kk,tL;function Ale(){if(tL)return Kk;tL=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(o,a){n[++r]=[a,o]}),n}return Kk=e,Kk}var Qk,rL;function wT(){if(rL)return Qk;rL=1;function e(t){var r=-1,n=Array(t.size);return t.forEach(function(o){n[++r]=o}),n}return Qk=e,Qk}var Xk,nL;function Tle(){if(nL)return Xk;nL=1;var e=ub(),t=Ele(),r=cT(),n=TU(),o=Ale(),a=wT(),s=1,l=2,c="[object Boolean]",u="[object Date]",d="[object Error]",f="[object Map]",h="[object Number]",p="[object RegExp]",y="[object Set]",m="[object String]",x="[object Symbol]",b="[object ArrayBuffer]",w="[object DataView]",k=e?e.prototype:void 0,S=k?k.valueOf:void 0;function _(P,O,T,R,I,E,A){switch(T){case w:if(P.byteLength!=O.byteLength||P.byteOffset!=O.byteOffset)return!1;P=P.buffer,O=O.buffer;case b:return!(P.byteLength!=O.byteLength||!E(new t(P),new t(O)));case c:case u:case h:return r(+P,+O);case d:return P.name==O.name&&P.message==O.message;case p:case m:return P==O+"";case f:var F=o;case y:var L=R&s;if(F||(F=a),P.size!=O.size&&!L)return!1;var z=A.get(P);if(z)return z==O;R|=l,A.set(P,O);var V=n(F(P),F(O),R,I,E,A);return A.delete(P),V;case x:if(S)return S.call(P)==S.call(O)}return!1}return Xk=_,Xk}var Zk,iL;function PU(){if(iL)return Zk;iL=1;function e(t,r){for(var n=-1,o=r.length,a=t.length;++n<o;)t[a+n]=r[n];return t}return Zk=e,Zk}var Jk,oL;function Ple(){if(oL)return Jk;oL=1;var e=PU(),t=ms();function r(n,o,a){var s=o(n);return t(n)?s:e(s,a(n))}return Jk=r,Jk}var e_,aL;function Ole(){if(aL)return e_;aL=1;function e(t,r){for(var n=-1,o=t==null?0:t.length,a=0,s=[];++n<o;){var l=t[n];r(l,n,t)&&(s[a++]=l)}return s}return e_=e,e_}var t_,sL;function Ile(){if(sL)return t_;sL=1;function e(){return[]}return t_=e,t_}var r_,lL;function Nle(){if(lL)return r_;lL=1;var e=Ole(),t=Ile(),r=Object.prototype,n=r.propertyIsEnumerable,o=Object.getOwnPropertySymbols,a=o?function(s){return s==null?[]:(s=Object(s),e(o(s),function(l){return n.call(s,l)}))}:t;return r_=a,r_}var n_,cL;function Rle(){if(cL)return n_;cL=1;function e(t,r){for(var n=-1,o=Array(t);++n<t;)o[n]=r(n);return o}return n_=e,n_}var i_,uL;function Lle(){if(uL)return i_;uL=1;var e=wd(),t=Sd(),r="[object Arguments]";function n(o){return t(o)&&e(o)==r}return i_=n,i_}var o_,dL;function ST(){if(dL)return o_;dL=1;var e=Lle(),t=Sd(),r=Object.prototype,n=r.hasOwnProperty,o=r.propertyIsEnumerable,a=e((function(){return arguments})())?e:function(s){return t(s)&&n.call(s,"callee")&&!o.call(s,"callee")};return o_=a,o_}var Oy={exports:{}},a_,fL;function Fle(){if(fL)return a_;fL=1;function e(){return!1}return a_=e,a_}Oy.exports;var pL;function OU(){return pL||(pL=1,(function(e,t){var r=au(),n=Fle(),o=t&&!t.nodeType&&t,a=o&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===o,l=s?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;e.exports=u})(Oy,Oy.exports)),Oy.exports}var s_,hL;function jT(){if(hL)return s_;hL=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function r(n,o){var a=typeof n;return o=o??e,!!o&&(a=="number"||a!="symbol"&&t.test(n))&&n>-1&&n%1==0&&n<o}return s_=r,s_}var l_,gL;function kT(){if(gL)return l_;gL=1;var e=9007199254740991;function t(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return l_=t,l_}var c_,mL;function Mle(){if(mL)return c_;mL=1;var e=wd(),t=kT(),r=Sd(),n="[object Arguments]",o="[object Array]",a="[object Boolean]",s="[object Date]",l="[object Error]",c="[object Function]",u="[object Map]",d="[object Number]",f="[object Object]",h="[object RegExp]",p="[object Set]",y="[object String]",m="[object WeakMap]",x="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",k="[object Float64Array]",S="[object Int8Array]",_="[object Int16Array]",P="[object Int32Array]",O="[object Uint8Array]",T="[object Uint8ClampedArray]",R="[object Uint16Array]",I="[object Uint32Array]",E={};E[w]=E[k]=E[S]=E[_]=E[P]=E[O]=E[T]=E[R]=E[I]=!0,E[n]=E[o]=E[x]=E[a]=E[b]=E[s]=E[l]=E[c]=E[u]=E[d]=E[f]=E[h]=E[p]=E[y]=E[m]=!1;function A(F){return r(F)&&t(F.length)&&!!E[e(F)]}return c_=A,c_}var u_,vL;function IU(){if(vL)return u_;vL=1;function e(t){return function(r){return t(r)}}return u_=e,u_}var Iy={exports:{}};Iy.exports;var yL;function Dle(){return yL||(yL=1,(function(e,t){var r=Z$(),n=t&&!t.nodeType&&t,o=n&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===n,s=a&&r.process,l=(function(){try{var c=o&&o.require&&o.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}})();e.exports=l})(Iy,Iy.exports)),Iy.exports}var d_,xL;function NU(){if(xL)return d_;xL=1;var e=Mle(),t=IU(),r=Dle(),n=r&&r.isTypedArray,o=n?t(n):e;return d_=o,d_}var f_,bL;function zle(){if(bL)return f_;bL=1;var e=Rle(),t=ST(),r=ms(),n=OU(),o=jT(),a=NU(),s=Object.prototype,l=s.hasOwnProperty;function c(u,d){var f=r(u),h=!f&&t(u),p=!f&&!h&&n(u),y=!f&&!h&&!p&&a(u),m=f||h||p||y,x=m?e(u.length,String):[],b=x.length;for(var w in u)(d||l.call(u,w))&&!(m&&(w=="length"||p&&(w=="offset"||w=="parent")||y&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||o(w,b)))&&x.push(w);return x}return f_=c,f_}var p_,wL;function Ble(){if(wL)return p_;wL=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,o=typeof n=="function"&&n.prototype||e;return r===o}return p_=t,p_}var h_,SL;function RU(){if(SL)return h_;SL=1;function e(t,r){return function(n){return t(r(n))}}return h_=e,h_}var g_,jL;function Wle(){if(jL)return g_;jL=1;var e=RU(),t=e(Object.keys,Object);return g_=t,g_}var m_,kL;function qle(){if(kL)return m_;kL=1;var e=Ble(),t=Wle(),r=Object.prototype,n=r.hasOwnProperty;function o(a){if(!e(a))return t(a);var s=[];for(var l in Object(a))n.call(a,l)&&l!="constructor"&&s.push(l);return s}return m_=o,m_}var v_,_L;function pb(){if(_L)return v_;_L=1;var e=lT(),t=kT();function r(n){return n!=null&&t(n.length)&&!e(n)}return v_=r,v_}var y_,CL;function Yw(){if(CL)return y_;CL=1;var e=zle(),t=qle(),r=pb();function n(o){return r(o)?e(o):t(o)}return y_=n,y_}var x_,EL;function $le(){if(EL)return x_;EL=1;var e=Ple(),t=Nle(),r=Yw();function n(o){return e(o,r,t)}return x_=n,x_}var b_,AL;function Ule(){if(AL)return b_;AL=1;var e=$le(),t=1,r=Object.prototype,n=r.hasOwnProperty;function o(a,s,l,c,u,d){var f=l&t,h=e(a),p=h.length,y=e(s),m=y.length;if(p!=m&&!f)return!1;for(var x=p;x--;){var b=h[x];if(!(f?b in s:n.call(s,b)))return!1}var w=d.get(a),k=d.get(s);if(w&&k)return w==s&&k==a;var S=!0;d.set(a,s),d.set(s,a);for(var _=f;++x<p;){b=h[x];var P=a[b],O=s[b];if(c)var T=f?c(O,P,b,s,a,d):c(P,O,b,a,s,d);if(!(T===void 0?P===O||u(P,O,l,c,d):T)){S=!1;break}_||(_=b=="constructor")}if(S&&!_){var R=a.constructor,I=s.constructor;R!=I&&"constructor"in a&&"constructor"in s&&!(typeof R=="function"&&R instanceof R&&typeof I=="function"&&I instanceof I)&&(S=!1)}return d.delete(a),d.delete(s),S}return b_=o,b_}var w_,TL;function Hle(){if(TL)return w_;TL=1;var e=Oh(),t=au(),r=e(t,"DataView");return w_=r,w_}var S_,PL;function Vle(){if(PL)return S_;PL=1;var e=Oh(),t=au(),r=e(t,"Promise");return S_=r,S_}var j_,OL;function LU(){if(OL)return j_;OL=1;var e=Oh(),t=au(),r=e(t,"Set");return j_=r,j_}var k_,IL;function Yle(){if(IL)return k_;IL=1;var e=Oh(),t=au(),r=e(t,"WeakMap");return k_=r,k_}var __,NL;function Gle(){if(NL)return __;NL=1;var e=Hle(),t=uT(),r=Vle(),n=LU(),o=Yle(),a=wd(),s=J$(),l="[object Map]",c="[object Object]",u="[object Promise]",d="[object Set]",f="[object WeakMap]",h="[object DataView]",p=s(e),y=s(t),m=s(r),x=s(n),b=s(o),w=a;return(e&&w(new e(new ArrayBuffer(1)))!=h||t&&w(new t)!=l||r&&w(r.resolve())!=u||n&&w(new n)!=d||o&&w(new o)!=f)&&(w=function(k){var S=a(k),_=S==c?k.constructor:void 0,P=_?s(_):"";if(P)switch(P){case p:return h;case y:return l;case m:return u;case x:return d;case b:return f}return S}),__=w,__}var C_,RL;function Kle(){if(RL)return C_;RL=1;var e=_U(),t=TU(),r=Tle(),n=Ule(),o=Gle(),a=ms(),s=OU(),l=NU(),c=1,u="[object Arguments]",d="[object Array]",f="[object Object]",h=Object.prototype,p=h.hasOwnProperty;function y(m,x,b,w,k,S){var _=a(m),P=a(x),O=_?d:o(m),T=P?d:o(x);O=O==u?f:O,T=T==u?f:T;var R=O==f,I=T==f,E=O==T;if(E&&s(m)){if(!s(x))return!1;_=!0,R=!1}if(E&&!R)return S||(S=new e),_||l(m)?t(m,x,b,w,k,S):r(m,x,O,b,w,k,S);if(!(b&c)){var A=R&&p.call(m,"__wrapped__"),F=I&&p.call(x,"__wrapped__");if(A||F){var L=A?m.value():m,z=F?x.value():x;return S||(S=new e),k(L,z,b,w,S)}}return E?(S||(S=new e),n(m,x,b,w,k,S)):!1}return C_=y,C_}var E_,LL;function _T(){if(LL)return E_;LL=1;var e=Kle(),t=Sd();function r(n,o,a,s,l){return n===o?!0:n==null||o==null||!t(n)&&!t(o)?n!==n&&o!==o:e(n,o,a,s,r,l)}return E_=r,E_}var A_,FL;function Qle(){if(FL)return A_;FL=1;var e=_U(),t=_T(),r=1,n=2;function o(a,s,l,c){var u=l.length,d=u,f=!c;if(a==null)return!d;for(a=Object(a);u--;){var h=l[u];if(f&&h[2]?h[1]!==a[h[0]]:!(h[0]in a))return!1}for(;++u<d;){h=l[u];var p=h[0],y=a[p],m=h[1];if(f&&h[2]){if(y===void 0&&!(p in a))return!1}else{var x=new e;if(c)var b=c(y,m,p,a,s,x);if(!(b===void 0?t(m,y,r|n,c,x):b))return!1}}return!0}return A_=o,A_}var T_,ML;function FU(){if(ML)return T_;ML=1;var e=Hf();function t(r){return r===r&&!e(r)}return T_=t,T_}var P_,DL;function Xle(){if(DL)return P_;DL=1;var e=FU(),t=Yw();function r(n){for(var o=t(n),a=o.length;a--;){var s=o[a],l=n[s];o[a]=[s,l,e(l)]}return o}return P_=r,P_}var O_,zL;function MU(){if(zL)return O_;zL=1;function e(t,r){return function(n){return n==null?!1:n[t]===r&&(r!==void 0||t in Object(n))}}return O_=e,O_}var I_,BL;function Zle(){if(BL)return I_;BL=1;var e=Qle(),t=Xle(),r=MU();function n(o){var a=t(o);return a.length==1&&a[0][2]?r(a[0][0],a[0][1]):function(s){return s===o||e(s,o,a)}}return I_=n,I_}var N_,WL;function Jle(){if(WL)return N_;WL=1;function e(t,r){return t!=null&&r in Object(t)}return N_=e,N_}var R_,qL;function ece(){if(qL)return R_;qL=1;var e=rU(),t=ST(),r=ms(),n=jT(),o=kT(),a=qw();function s(l,c,u){c=e(c,l);for(var d=-1,f=c.length,h=!1;++d<f;){var p=a(c[d]);if(!(h=l!=null&&u(l,p)))break;l=l[p]}return h||++d!=f?h:(f=l==null?0:l.length,!!f&&o(f)&&n(p,f)&&(r(l)||t(l)))}return R_=s,R_}var L_,$L;function tce(){if($L)return L_;$L=1;var e=Jle(),t=ece();function r(n,o){return n!=null&&t(n,o,e)}return L_=r,L_}var F_,UL;function rce(){if(UL)return F_;UL=1;var e=_T(),t=nU(),r=tce(),n=sT(),o=FU(),a=MU(),s=qw(),l=1,c=2;function u(d,f){return n(d)&&o(f)?a(s(d),f):function(h){var p=t(h,d);return p===void 0&&p===f?r(h,d):e(f,p,l|c)}}return F_=u,F_}var M_,HL;function yv(){if(HL)return M_;HL=1;function e(t){return t}return M_=e,M_}var D_,VL;function nce(){if(VL)return D_;VL=1;function e(t){return function(r){return r==null?void 0:r[t]}}return D_=e,D_}var z_,YL;function ice(){if(YL)return z_;YL=1;var e=pT();function t(r){return function(n){return e(n,r)}}return z_=t,z_}var B_,GL;function oce(){if(GL)return B_;GL=1;var e=nce(),t=ice(),r=sT(),n=qw();function o(a){return r(a)?e(n(a)):t(a)}return B_=o,B_}var W_,KL;function su(){if(KL)return W_;KL=1;var e=Zle(),t=rce(),r=yv(),n=ms(),o=oce();function a(s){return typeof s=="function"?s:s==null?r:typeof s=="object"?n(s)?t(s[0],s[1]):e(s):o(s)}return W_=a,W_}var q_,QL;function DU(){if(QL)return q_;QL=1;function e(t,r,n,o){for(var a=t.length,s=n+(o?1:-1);o?s--:++s<a;)if(r(t[s],s,t))return s;return-1}return q_=e,q_}var $_,XL;function ace(){if(XL)return $_;XL=1;function e(t){return t!==t}return $_=e,$_}var U_,ZL;function sce(){if(ZL)return U_;ZL=1;function e(t,r,n){for(var o=n-1,a=t.length;++o<a;)if(t[o]===r)return o;return-1}return U_=e,U_}var H_,JL;function lce(){if(JL)return H_;JL=1;var e=DU(),t=ace(),r=sce();function n(o,a,s){return a===a?r(o,a,s):e(o,t,s)}return H_=n,H_}var V_,eF;function cce(){if(eF)return V_;eF=1;var e=lce();function t(r,n){var o=r==null?0:r.length;return!!o&&e(r,n,0)>-1}return V_=t,V_}var Y_,tF;function uce(){if(tF)return Y_;tF=1;function e(t,r,n){for(var o=-1,a=t==null?0:t.length;++o<a;)if(n(r,t[o]))return!0;return!1}return Y_=e,Y_}var G_,rF;function dce(){if(rF)return G_;rF=1;function e(){}return G_=e,G_}var K_,nF;function fce(){if(nF)return K_;nF=1;var e=LU(),t=dce(),r=wT(),n=1/0,o=e&&1/r(new e([,-0]))[1]==n?function(a){return new e(a)}:t;return K_=o,K_}var Q_,iF;function pce(){if(iF)return Q_;iF=1;var e=CU(),t=cce(),r=uce(),n=AU(),o=fce(),a=wT(),s=200;function l(c,u,d){var f=-1,h=t,p=c.length,y=!0,m=[],x=m;if(d)y=!1,h=r;else if(p>=s){var b=u?null:o(c);if(b)return a(b);y=!1,h=n,x=new e}else x=u?[]:m;e:for(;++f<p;){var w=c[f],k=u?u(w):w;if(w=d||w!==0?w:0,y&&k===k){for(var S=x.length;S--;)if(x[S]===k)continue e;u&&x.push(k),m.push(w)}else h(x,k,d)||(x!==m&&x.push(k),m.push(w))}return m}return Q_=l,Q_}var X_,oF;function hce(){if(oF)return X_;oF=1;var e=su(),t=pce();function r(n,o){return n&&n.length?t(n,e(o,2)):[]}return X_=r,X_}var gce=hce();const aF=un(gce);function zU(e,t,r){return t===!0?aF(e,r):Ar(t)?aF(e,t):e}function wm(e){"@babel/helpers - typeof";return wm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wm(e)}var mce=["ref"];function sF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function qu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sF(Object(r),!0).forEach(function(n){Gw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sF(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lF(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,WU(n.key),n)}}function yce(e,t,r){return t&&lF(e.prototype,t),r&&lF(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function xce(e,t,r){return t=Z0(t),bce(e,BU()?Reflect.construct(t,r||[],Z0(e).constructor):t.apply(e,r))}function bce(e,t){if(t&&(wm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wce(e)}function wce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function BU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(BU=function(){return!!e})()}function Z0(e){return Z0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Z0(e)}function Sce(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&SE(e,t)}function SE(e,t){return SE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},SE(e,t)}function Gw(e,t,r){return t=WU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WU(e){var t=jce(e,"string");return wm(t)=="symbol"?t:t+""}function jce(e,t){if(wm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(wm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function kce(e,t){if(e==null)return{};var r=_ce(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _ce(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Cce(e){return e.value}function Ece(e,t){if(ze.isValidElement(e))return ze.cloneElement(e,t);if(typeof e=="function")return ze.createElement(e,t);t.ref;var r=kce(t,mce);return ze.createElement(bT,r)}var cF=1,Af=(function(e){function t(){var r;vce(this,t);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return r=xce(this,t,[].concat(o)),Gw(r,"lastBoundingBox",{width:-1,height:-1}),r}return Sce(t,e),yce(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,o=this.getBBox();o?(Math.abs(o.width-this.lastBoundingBox.width)>cF||Math.abs(o.height-this.lastBoundingBox.height)>cF)&&(this.lastBoundingBox.width=o.width,this.lastBoundingBox.height=o.height,n&&n(o)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?qu({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var o=this.props,a=o.layout,s=o.align,l=o.verticalAlign,c=o.margin,u=o.chartWidth,d=o.chartHeight,f,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(s==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();f={left:((u||0)-p.width)/2}}else f=s==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var y=this.getBBoxSnapshot();h={top:((d||0)-y.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return qu(qu({},f),h)}},{key:"render",value:function(){var n=this,o=this.props,a=o.content,s=o.width,l=o.height,c=o.wrapperStyle,u=o.payloadUniqBy,d=o.payload,f=qu(qu({position:"absolute",width:s||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return ze.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){n.wrapperNode=p}},Ece(a,qu(qu({},this.props),{},{payload:zU(d,u,Cce)})))}}],[{key:"getWithHeight",value:function(n,o){var a=qu(qu({},this.defaultProps),n.props),s=a.layout;return s==="vertical"&&Bt(n.props.height)?{height:n.props.height}:s==="horizontal"?{width:n.props.width||o}:null}}])})(j.PureComponent);Gw(Af,"displayName","Legend");Gw(Af,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Z_,uF;function Ace(){if(uF)return Z_;uF=1;var e=ub(),t=ST(),r=ms(),n=e?e.isConcatSpreadable:void 0;function o(a){return r(a)||t(a)||!!(n&&a&&a[n])}return Z_=o,Z_}var J_,dF;function qU(){if(dF)return J_;dF=1;var e=PU(),t=Ace();function r(n,o,a,s,l){var c=-1,u=n.length;for(a||(a=t),l||(l=[]);++c<u;){var d=n[c];o>0&&a(d)?o>1?r(d,o-1,a,s,l):e(l,d):s||(l[l.length]=d)}return l}return J_=r,J_}var eC,fF;function Tce(){if(fF)return eC;fF=1;function e(t){return function(r,n,o){for(var a=-1,s=Object(r),l=o(r),c=l.length;c--;){var u=l[t?c:++a];if(n(s[u],u,s)===!1)break}return r}}return eC=e,eC}var tC,pF;function Pce(){if(pF)return tC;pF=1;var e=Tce(),t=e();return tC=t,tC}var rC,hF;function $U(){if(hF)return rC;hF=1;var e=Pce(),t=Yw();function r(n,o){return n&&e(n,o,t)}return rC=r,rC}var nC,gF;function Oce(){if(gF)return nC;gF=1;var e=pb();function t(r,n){return function(o,a){if(o==null)return o;if(!e(o))return r(o,a);for(var s=o.length,l=n?s:-1,c=Object(o);(n?l--:++l<s)&&a(c[l],l,c)!==!1;);return o}}return nC=t,nC}var iC,mF;function CT(){if(mF)return iC;mF=1;var e=$U(),t=Oce(),r=t(e);return iC=r,iC}var oC,vF;function UU(){if(vF)return oC;vF=1;var e=CT(),t=pb();function r(n,o){var a=-1,s=t(n)?Array(n.length):[];return e(n,function(l,c,u){s[++a]=o(l,c,u)}),s}return oC=r,oC}var aC,yF;function Ice(){if(yF)return aC;yF=1;function e(t,r){var n=t.length;for(t.sort(r);n--;)t[n]=t[n].value;return t}return aC=e,aC}var sC,xF;function Nce(){if(xF)return sC;xF=1;var e=gv();function t(r,n){if(r!==n){var o=r!==void 0,a=r===null,s=r===r,l=e(r),c=n!==void 0,u=n===null,d=n===n,f=e(n);if(!u&&!f&&!l&&r>n||l&&c&&d&&!u&&!f||a&&c&&d||!o&&d||!s)return 1;if(!a&&!l&&!f&&r<n||f&&o&&s&&!a&&!l||u&&o&&s||!c&&s||!d)return-1}return 0}return sC=t,sC}var lC,bF;function Rce(){if(bF)return lC;bF=1;var e=Nce();function t(r,n,o){for(var a=-1,s=r.criteria,l=n.criteria,c=s.length,u=o.length;++a<c;){var d=e(s[a],l[a]);if(d){if(a>=u)return d;var f=o[a];return d*(f=="desc"?-1:1)}}return r.index-n.index}return lC=t,lC}var cC,wF;function Lce(){if(wF)return cC;wF=1;var e=fT(),t=pT(),r=su(),n=UU(),o=Ice(),a=IU(),s=Rce(),l=yv(),c=ms();function u(d,f,h){f.length?f=e(f,function(m){return c(m)?function(x){return t(x,m.length===1?m[0]:m)}:m}):f=[l];var p=-1;f=e(f,a(r));var y=n(d,function(m,x,b){var w=e(f,function(k){return k(m)});return{criteria:w,index:++p,value:m}});return o(y,function(m,x){return s(m,x,h)})}return cC=u,cC}var uC,SF;function Fce(){if(SF)return uC;SF=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return uC=e,uC}var dC,jF;function Mce(){if(jF)return dC;jF=1;var e=Fce(),t=Math.max;function r(n,o,a){return o=t(o===void 0?n.length-1:o,0),function(){for(var s=arguments,l=-1,c=t(s.length-o,0),u=Array(c);++l<c;)u[l]=s[o+l];l=-1;for(var d=Array(o+1);++l<o;)d[l]=s[l];return d[o]=a(u),e(n,this,d)}}return dC=r,dC}var fC,kF;function Dce(){if(kF)return fC;kF=1;function e(t){return function(){return t}}return fC=e,fC}var pC,_F;function HU(){if(_F)return pC;_F=1;var e=Oh(),t=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return pC=t,pC}var hC,CF;function zce(){if(CF)return hC;CF=1;var e=Dce(),t=HU(),r=yv(),n=t?function(o,a){return t(o,"toString",{configurable:!0,enumerable:!1,value:e(a),writable:!0})}:r;return hC=n,hC}var gC,EF;function Bce(){if(EF)return gC;EF=1;var e=800,t=16,r=Date.now;function n(o){var a=0,s=0;return function(){var l=r(),c=t-(l-s);if(s=l,c>0){if(++a>=e)return arguments[0]}else a=0;return o.apply(void 0,arguments)}}return gC=n,gC}var mC,AF;function Wce(){if(AF)return mC;AF=1;var e=zce(),t=Bce(),r=t(e);return mC=r,mC}var vC,TF;function qce(){if(TF)return vC;TF=1;var e=yv(),t=Mce(),r=Wce();function n(o,a){return r(t(o,a,e),o+"")}return vC=n,vC}var yC,PF;function Kw(){if(PF)return yC;PF=1;var e=cT(),t=pb(),r=jT(),n=Hf();function o(a,s,l){if(!n(l))return!1;var c=typeof s;return(c=="number"?t(l)&&r(s,l.length):c=="string"&&s in l)?e(l[s],a):!1}return yC=o,yC}var xC,OF;function $ce(){if(OF)return xC;OF=1;var e=qU(),t=Lce(),r=qce(),n=Kw(),o=r(function(a,s){if(a==null)return[];var l=s.length;return l>1&&n(a,s[0],s[1])?s=[]:l>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),t(a,e(s,1),[])});return xC=o,xC}var Uce=$ce();const ET=un(Uce);function cx(e){"@babel/helpers - typeof";return cx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cx(e)}function jE(){return jE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jE.apply(this,arguments)}function Hce(e,t){return Kce(e)||Gce(e,t)||Yce(e,t)||Vce()}function Vce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yce(e,t){if(e){if(typeof e=="string")return IF(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return IF(e,t)}}function IF(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Gce(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function Kce(e){if(Array.isArray(e))return e}function NF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function bC(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?NF(Object(r),!0).forEach(function(n){Qce(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):NF(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qce(e,t,r){return t=Xce(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xce(e){var t=Zce(e,"string");return cx(t)=="symbol"?t:t+""}function Zce(e,t){if(cx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(cx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Jce(e){return Array.isArray(e)&&ho(e[0])&&ho(e[1])?e.join(" ~ "):e}var eue=function(t){var r=t.separator,n=r===void 0?" : ":r,o=t.contentStyle,a=o===void 0?{}:o,s=t.itemStyle,l=s===void 0?{}:s,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,h=t.itemSorter,p=t.wrapperClassName,y=t.labelClassName,m=t.label,x=t.labelFormatter,b=t.accessibilityLayer,w=b===void 0?!1:b,k=function(){if(d&&d.length){var A={padding:0,margin:0},F=(h?ET(d,h):d).map(function(L,z){if(L.type==="none")return null;var V=bC({display:"block",paddingTop:4,paddingBottom:4,color:L.color||"#000"},l),Q=L.formatter||f||Jce,U=L.value,ee=L.name,H=U,B=ee;if(Q&&H!=null&&B!=null){var M=Q(U,ee,L,z,d);if(Array.isArray(M)){var $=Hce(M,2);H=$[0],B=$[1]}else H=M}return ze.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(z),style:V},ho(B)?ze.createElement("span",{className:"recharts-tooltip-item-name"},B):null,ho(B)?ze.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,ze.createElement("span",{className:"recharts-tooltip-item-value"},H),ze.createElement("span",{className:"recharts-tooltip-item-unit"},L.unit||""))});return ze.createElement("ul",{className:"recharts-tooltip-item-list",style:A},F)}return null},S=bC({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),_=bC({margin:0},u),P=!Rr(m),O=P?m:"",T=Lr("recharts-default-tooltip",p),R=Lr("recharts-tooltip-label",y);P&&x&&d!==void 0&&d!==null&&(O=x(m,d));var I=w?{role:"status","aria-live":"assertive"}:{};return ze.createElement("div",jE({className:T,style:S},I),ze.createElement("p",{className:R,style:_},ze.isValidElement(O)?O:"".concat(O)),k())};function ux(e){"@babel/helpers - typeof";return ux=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ux(e)}function R1(e,t,r){return t=tue(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tue(e){var t=rue(e,"string");return ux(t)=="symbol"?t:t+""}function rue(e,t){if(ux(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(ux(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ly="recharts-tooltip-wrapper",nue={visibility:"hidden"};function iue(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return Lr(ly,R1(R1(R1(R1({},"".concat(ly,"-right"),Bt(r)&&t&&Bt(t.x)&&r>=t.x),"".concat(ly,"-left"),Bt(r)&&t&&Bt(t.x)&&r<t.x),"".concat(ly,"-bottom"),Bt(n)&&t&&Bt(t.y)&&n>=t.y),"".concat(ly,"-top"),Bt(n)&&t&&Bt(t.y)&&n<t.y))}function RF(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,o=e.offsetTopLeft,a=e.position,s=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(a&&Bt(a[n]))return a[n];var d=r[n]-l-o,f=r[n]+o;if(t[n])return s[n]?d:f;if(s[n]){var h=d,p=c[n];return h<p?Math.max(f,c[n]):Math.max(d,c[n])}var y=f+l,m=c[n]+u;return y>m?Math.max(d,c[n]):Math.max(f,c[n])}function oue(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function aue(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,o=e.position,a=e.reverseDirection,s=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return s.height>0&&s.width>0&&r?(d=RF({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:o,reverseDirection:a,tooltipDimension:s.width,viewBox:c,viewBoxDimension:c.width}),f=RF({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:o,reverseDirection:a,tooltipDimension:s.height,viewBox:c,viewBoxDimension:c.height}),u=oue({translateX:d,translateY:f,useTranslate3d:l})):u=nue,{cssProperties:u,cssClasses:iue({translateX:d,translateY:f,coordinate:r})}}function Sm(e){"@babel/helpers - typeof";return Sm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sm(e)}function LF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function FF(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?LF(Object(r),!0).forEach(function(n){_E(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):LF(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lue(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,YU(n.key),n)}}function cue(e,t,r){return t&&lue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function uue(e,t,r){return t=J0(t),due(e,VU()?Reflect.construct(t,r||[],J0(e).constructor):t.apply(e,r))}function due(e,t){if(t&&(Sm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fue(e)}function fue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function VU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(VU=function(){return!!e})()}function J0(e){return J0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},J0(e)}function pue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kE(e,t)}function kE(e,t){return kE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},kE(e,t)}function _E(e,t,r){return t=YU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YU(e){var t=hue(e,"string");return Sm(t)=="symbol"?t:t+""}function hue(e,t){if(Sm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Sm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var MF=1,gue=(function(e){function t(){var r;sue(this,t);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return r=uue(this,t,[].concat(o)),_E(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),_E(r,"handleKeyDown",function(s){if(s.key==="Escape"){var l,c,u,d;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=r.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),r}return pue(t,e),cue(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>MF||Math.abs(n.height-this.state.lastBoundingBox.height)>MF)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,o;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((o=this.props.coordinate)===null||o===void 0?void 0:o.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,o=this.props,a=o.active,s=o.allowEscapeViewBox,l=o.animationDuration,c=o.animationEasing,u=o.children,d=o.coordinate,f=o.hasPayload,h=o.isAnimationActive,p=o.offset,y=o.position,m=o.reverseDirection,x=o.useTranslate3d,b=o.viewBox,w=o.wrapperStyle,k=aue({allowEscapeViewBox:s,coordinate:d,offsetTopLeft:p,position:y,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:b}),S=k.cssClasses,_=k.cssProperties,P=FF(FF({transition:h&&a?"transform ".concat(l,"ms ").concat(c):void 0},_),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&f?"visible":"hidden",position:"absolute",top:0,left:0},w);return ze.createElement("div",{tabIndex:-1,className:S,style:P,ref:function(T){n.wrapperNode=T}},u)}}])})(j.PureComponent),mue=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Ih={isSsr:mue()};function jm(e){"@babel/helpers - typeof";return jm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jm(e)}function DF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function zF(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DF(Object(r),!0).forEach(function(n){AT(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DF(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yue(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,KU(n.key),n)}}function xue(e,t,r){return t&&yue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function bue(e,t,r){return t=e2(t),wue(e,GU()?Reflect.construct(t,r||[],e2(e).constructor):t.apply(e,r))}function wue(e,t){if(t&&(jm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sue(e)}function Sue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GU=function(){return!!e})()}function e2(e){return e2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},e2(e)}function jue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&CE(e,t)}function CE(e,t){return CE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},CE(e,t)}function AT(e,t,r){return t=KU(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KU(e){var t=kue(e,"string");return jm(t)=="symbol"?t:t+""}function kue(e,t){if(jm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(jm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function _ue(e){return e.dataKey}function Cue(e,t){return ze.isValidElement(e)?ze.cloneElement(e,t):typeof e=="function"?ze.createElement(e,t):ze.createElement(eue,t)}var kl=(function(e){function t(){return vue(this,t),bue(this,t,arguments)}return jue(t,e),xue(t,[{key:"render",value:function(){var n=this,o=this.props,a=o.active,s=o.allowEscapeViewBox,l=o.animationDuration,c=o.animationEasing,u=o.content,d=o.coordinate,f=o.filterNull,h=o.isAnimationActive,p=o.offset,y=o.payload,m=o.payloadUniqBy,x=o.position,b=o.reverseDirection,w=o.useTranslate3d,k=o.viewBox,S=o.wrapperStyle,_=y??[];f&&_.length&&(_=zU(y.filter(function(O){return O.value!=null&&(O.hide!==!0||n.props.includeHidden)}),m,_ue));var P=_.length>0;return ze.createElement(gue,{allowEscapeViewBox:s,animationDuration:l,animationEasing:c,isAnimationActive:h,active:a,coordinate:d,hasPayload:P,offset:p,position:x,reverseDirection:b,useTranslate3d:w,viewBox:k,wrapperStyle:S},Cue(u,zF(zF({},this.props),{},{payload:_})))}}])})(j.PureComponent);AT(kl,"displayName","Tooltip");AT(kl,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ih.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var wC,BF;function Eue(){if(BF)return wC;BF=1;var e=au(),t=function(){return e.Date.now()};return wC=t,wC}var SC,WF;function Aue(){if(WF)return SC;WF=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return SC=t,SC}var jC,qF;function Tue(){if(qF)return jC;qF=1;var e=Aue(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return jC=r,jC}var kC,$F;function QU(){if($F)return kC;$F=1;var e=Tue(),t=Hf(),r=gv(),n=NaN,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;function c(u){if(typeof u=="number")return u;if(r(u))return n;if(t(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=t(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=e(u);var f=a.test(u);return f||s.test(u)?l(u.slice(2),f?2:8):o.test(u)?n:+u}return kC=c,kC}var _C,UF;function Pue(){if(UF)return _C;UF=1;var e=Hf(),t=Eue(),r=QU(),n="Expected a function",o=Math.max,a=Math.min;function s(l,c,u){var d,f,h,p,y,m,x=0,b=!1,w=!1,k=!0;if(typeof l!="function")throw new TypeError(n);c=r(c)||0,e(u)&&(b=!!u.leading,w="maxWait"in u,h=w?o(r(u.maxWait)||0,c):h,k="trailing"in u?!!u.trailing:k);function S(F){var L=d,z=f;return d=f=void 0,x=F,p=l.apply(z,L),p}function _(F){return x=F,y=setTimeout(T,c),b?S(F):p}function P(F){var L=F-m,z=F-x,V=c-L;return w?a(V,h-z):V}function O(F){var L=F-m,z=F-x;return m===void 0||L>=c||L<0||w&&z>=h}function T(){var F=t();if(O(F))return R(F);y=setTimeout(T,P(F))}function R(F){return y=void 0,k&&d?S(F):(d=f=void 0,p)}function I(){y!==void 0&&clearTimeout(y),x=0,d=m=f=y=void 0}function E(){return y===void 0?p:R(t())}function A(){var F=t(),L=O(F);if(d=arguments,f=this,m=F,L){if(y===void 0)return _(m);if(w)return clearTimeout(y),y=setTimeout(T,c),S(m)}return y===void 0&&(y=setTimeout(T,c)),p}return A.cancel=I,A.flush=E,A}return _C=s,_C}var CC,HF;function Oue(){if(HF)return CC;HF=1;var e=Pue(),t=Hf(),r="Expected a function";function n(o,a,s){var l=!0,c=!0;if(typeof o!="function")throw new TypeError(r);return t(s)&&(l="leading"in s?!!s.leading:l,c="trailing"in s?!!s.trailing:c),e(o,a,{leading:l,maxWait:a,trailing:c})}return CC=n,CC}var Iue=Oue();const XU=un(Iue);function dx(e){"@babel/helpers - typeof";return dx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dx(e)}function VF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function L1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?VF(Object(r),!0).forEach(function(n){Nue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VF(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Nue(e,t,r){return t=Rue(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rue(e){var t=Lue(e,"string");return dx(t)=="symbol"?t:t+""}function Lue(e,t){if(dx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(dx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fue(e,t){return Bue(e)||zue(e,t)||Due(e,t)||Mue()}function Mue(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Due(e,t){if(e){if(typeof e=="string")return YF(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return YF(e,t)}}function YF(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function zue(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function Bue(e){if(Array.isArray(e))return e}var EC=j.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,o=n===void 0?{width:-1,height:-1}:n,a=e.width,s=a===void 0?"100%":a,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,h=e.maxHeight,p=e.children,y=e.debounce,m=y===void 0?0:y,x=e.id,b=e.className,w=e.onResize,k=e.style,S=k===void 0?{}:k,_=j.useRef(null),P=j.useRef();P.current=w,j.useImperativeHandle(t,function(){return Object.defineProperty(_.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),_.current},configurable:!0})});var O=j.useState({containerWidth:o.width,containerHeight:o.height}),T=Fue(O,2),R=T[0],I=T[1],E=j.useCallback(function(F,L){I(function(z){var V=Math.round(F),Q=Math.round(L);return z.containerWidth===V&&z.containerHeight===Q?z:{containerWidth:V,containerHeight:Q}})},[]);j.useEffect(function(){var F=function(ee){var H,B=ee[0].contentRect,M=B.width,$=B.height;E(M,$),(H=P.current)===null||H===void 0||H.call(P,M,$)};m>0&&(F=XU(F,m,{trailing:!0,leading:!1}));var L=new ResizeObserver(F),z=_.current.getBoundingClientRect(),V=z.width,Q=z.height;return E(V,Q),L.observe(_.current),function(){L.disconnect()}},[E,m]);var A=j.useMemo(function(){var F=R.containerWidth,L=R.containerHeight;if(F<0||L<0)return null;ac(Kp(s)||Kp(c),`The width(%s) and height(%s) are both fixed numbers,
|
||
maybe you don't need to use a ResponsiveContainer.`,s,c),ac(!r||r>0,"The aspect(%s) must be greater than zero.",r);var z=Kp(s)?F:s,V=Kp(c)?L:c;r&&r>0&&(z?V=z/r:V&&(z=V*r),h&&V>h&&(V=h)),ac(z>0||V>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
||
please check the style of container, or the props width(%s) and height(%s),
|
||
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
||
height and width.`,z,V,s,c,d,f,r);var Q=!Array.isArray(p)&&ad(p.type).endsWith("Chart");return ze.Children.map(p,function(U){return ze.isValidElement(U)?j.cloneElement(U,L1({width:z,height:V},Q?{style:L1({height:"100%",width:"100%",maxHeight:V,maxWidth:z},U.props.style)}:{})):U})},[r,p,c,h,f,d,R,s]);return ze.createElement("div",{id:x?"".concat(x):void 0,className:Lr("recharts-responsive-container",b),style:L1(L1({},S),{},{width:s,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:_},A)}),Qw=function(t){return null};Qw.displayName="Cell";function fx(e){"@babel/helpers - typeof";return fx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fx(e)}function GF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function EE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?GF(Object(r),!0).forEach(function(n){Wue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):GF(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Wue(e,t,r){return t=que(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function que(e){var t=$ue(e,"string");return fx(t)=="symbol"?t:t+""}function $ue(e,t){if(fx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(fx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _g={widthCache:{},cacheCount:0},Uue=2e3,Hue={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},KF="recharts_measurement_span";function Vue(e){var t=EE({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var By=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ih.isSsr)return{width:0,height:0};var n=Vue(r),o=JSON.stringify({text:t,copyStyle:n});if(_g.widthCache[o])return _g.widthCache[o];try{var a=document.getElementById(KF);a||(a=document.createElement("span"),a.setAttribute("id",KF),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var s=EE(EE({},Hue),n);Object.assign(a.style,s),a.textContent="".concat(t);var l=a.getBoundingClientRect(),c={width:l.width,height:l.height};return _g.widthCache[o]=c,++_g.cacheCount>Uue&&(_g.cacheCount=0,_g.widthCache={}),c}catch{return{width:0,height:0}}},Yue=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function px(e){"@babel/helpers - typeof";return px=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},px(e)}function t2(e,t){return Xue(e)||Que(e,t)||Kue(e,t)||Gue()}function Gue(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kue(e,t){if(e){if(typeof e=="string")return QF(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return QF(e,t)}}function QF(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Que(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function Xue(e){if(Array.isArray(e))return e}function Zue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XF(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ede(n.key),n)}}function Jue(e,t,r){return t&&XF(e.prototype,t),r&&XF(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ede(e){var t=tde(e,"string");return px(t)=="symbol"?t:t+""}function tde(e,t){if(px(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(px(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var ZF=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,JF=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,rde=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,nde=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,ZU={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},ide=Object.keys(ZU),$g="NaN";function ode(e,t){return e*ZU[t]}var F1=(function(){function e(t,r){Zue(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!rde.test(r)&&(this.num=NaN,this.unit=""),ide.includes(r)&&(this.num=ode(t,r),this.unit="px")}return Jue(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,o=(n=nde.exec(r))!==null&&n!==void 0?n:[],a=t2(o,3),s=a[1],l=a[2];return new e(parseFloat(s),l??"")}}])})();function JU(e){if(e.includes($g))return $g;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=ZF.exec(t))!==null&&r!==void 0?r:[],o=t2(n,4),a=o[1],s=o[2],l=o[3],c=F1.parse(a??""),u=F1.parse(l??""),d=s==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return $g;t=t.replace(ZF,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=JF.exec(t))!==null&&f!==void 0?f:[],p=t2(h,4),y=p[1],m=p[2],x=p[3],b=F1.parse(y??""),w=F1.parse(x??""),k=m==="+"?b.add(w):b.subtract(w);if(k.isNaN())return $g;t=t.replace(JF,k.toString())}return t}var eM=/\(([^()]*)\)/;function ade(e){for(var t=e;t.includes("(");){var r=eM.exec(t),n=t2(r,2),o=n[1];t=t.replace(eM,JU(o))}return t}function sde(e){var t=e.replace(/\s+/g,"");return t=ade(t),t=JU(t),t}function lde(e){try{return sde(e)}catch{return $g}}function AC(e){var t=lde(e.slice(5,-1));return t===$g?"":t}var cde=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],ude=["dx","dy","angle","className","breakAll"];function AE(){return AE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AE.apply(this,arguments)}function tM(e,t){if(e==null)return{};var r=dde(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function dde(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function rM(e,t){return gde(e)||hde(e,t)||pde(e,t)||fde()}function fde(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pde(e,t){if(e){if(typeof e=="string")return nM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nM(e,t)}}function nM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hde(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function gde(e){if(Array.isArray(e))return e}var eH=/[ \f\n\r\t\v\u2028\u2029]+/,tH=function(t){var r=t.children,n=t.breakAll,o=t.style;try{var a=[];Rr(r)||(n?a=r.toString().split(""):a=r.toString().split(eH));var s=a.map(function(c){return{word:c,width:By(c,o).width}}),l=n?0:By(" ",o).width;return{wordsWithComputedWidth:s,spaceWidth:l}}catch{return null}},mde=function(t,r,n,o,a){var s=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=Bt(s),f=l,h=function(){var z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return z.reduce(function(V,Q){var U=Q.word,ee=Q.width,H=V[V.length-1];if(H&&(o==null||a||H.width+ee+n<Number(o)))H.words.push(U),H.width+=ee+n;else{var B={words:[U],width:ee};V.push(B)}return V},[])},p=h(r),y=function(z){return z.reduce(function(V,Q){return V.width>Q.width?V:Q})};if(!d)return p;for(var m="…",x=function(z){var V=f.slice(0,z),Q=tH({breakAll:u,style:c,children:V+m}).wordsWithComputedWidth,U=h(Q),ee=U.length>s||y(U).width>Number(o);return[ee,U]},b=0,w=f.length-1,k=0,S;b<=w&&k<=f.length-1;){var _=Math.floor((b+w)/2),P=_-1,O=x(P),T=rM(O,2),R=T[0],I=T[1],E=x(_),A=rM(E,1),F=A[0];if(!R&&!F&&(b=_+1),R&&F&&(w=_-1),!R&&F){S=I;break}k++}return S||p},iM=function(t){var r=Rr(t)?[]:t.toString().split(eH);return[{words:r}]},vde=function(t){var r=t.width,n=t.scaleToFit,o=t.children,a=t.style,s=t.breakAll,l=t.maxLines;if((r||n)&&!Ih.isSsr){var c,u,d=tH({breakAll:s,children:o,style:a});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return iM(o);return mde({breakAll:s,children:o,maxLines:l,style:a},c,u,r,n)}return iM(o)},oM="#808080",gh=function(t){var r=t.x,n=r===void 0?0:r,o=t.y,a=o===void 0?0:o,s=t.lineHeight,l=s===void 0?"1em":s,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,h=t.textAnchor,p=h===void 0?"start":h,y=t.verticalAnchor,m=y===void 0?"end":y,x=t.fill,b=x===void 0?oM:x,w=tM(t,cde),k=j.useMemo(function(){return vde({breakAll:w.breakAll,children:w.children,maxLines:w.maxLines,scaleToFit:f,style:w.style,width:w.width})},[w.breakAll,w.children,w.maxLines,f,w.style,w.width]),S=w.dx,_=w.dy,P=w.angle,O=w.className,T=w.breakAll,R=tM(w,ude);if(!ho(n)||!ho(a))return null;var I=n+(Bt(S)?S:0),E=a+(Bt(_)?_:0),A;switch(m){case"start":A=AC("calc(".concat(u,")"));break;case"middle":A=AC("calc(".concat((k.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:A=AC("calc(".concat(k.length-1," * -").concat(l,")"));break}var F=[];if(f){var L=k[0].width,z=w.width;F.push("scale(".concat((Bt(z)?z/L:1)/L,")"))}return P&&F.push("rotate(".concat(P,", ").concat(I,", ").concat(E,")")),F.length&&(R.transform=F.join(" ")),ze.createElement("text",AE({},vr(R,!0),{x:I,y:E,className:Lr("recharts-text",O),textAnchor:p,fill:b.includes("url")?oM:b}),k.map(function(V,Q){var U=V.words.join(T?"":" ");return ze.createElement("tspan",{x:I,dy:Q===0?A:l,key:"".concat(U,"-").concat(Q)},U)}))};function Tf(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function yde(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function TT(e){let t,r,n;e.length!==2?(t=Tf,r=(l,c)=>Tf(e(l),c),n=(l,c)=>e(l)-c):(t=e===Tf||e===yde?e:xde,r=e,n=e);function o(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function s(l,c,u=0,d=l.length){const f=o(l,c,u,d-1);return f>u&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:o,center:s,right:a}}function xde(){return 0}function rH(e){return e===null?NaN:+e}function*bde(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const wde=TT(Tf),hb=wde.right;TT(rH).center;class aM extends Map{constructor(t,r=kde){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,o]of t)this.set(n,o)}get(t){return super.get(sM(this,t))}has(t){return super.has(sM(this,t))}set(t,r){return super.set(Sde(this,t),r)}delete(t){return super.delete(jde(this,t))}}function sM({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function Sde({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function jde({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function kde(e){return e!==null&&typeof e=="object"?e.valueOf():e}function _de(e=Tf){if(e===Tf)return nH;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function nH(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Cde=Math.sqrt(50),Ede=Math.sqrt(10),Ade=Math.sqrt(2);function r2(e,t,r){const n=(t-e)/Math.max(0,r),o=Math.floor(Math.log10(n)),a=n/Math.pow(10,o),s=a>=Cde?10:a>=Ede?5:a>=Ade?2:1;let l,c,u;return o<0?(u=Math.pow(10,-o)/s,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,o)*s,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?r2(e,t,r*2):[l,c,u]}function TE(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[o,a,s]=n?r2(t,e,r):r2(e,t,r);if(!(a>=o))return[];const l=a-o+1,c=new Array(l);if(n)if(s<0)for(let u=0;u<l;++u)c[u]=(a-u)/-s;else for(let u=0;u<l;++u)c[u]=(a-u)*s;else if(s<0)for(let u=0;u<l;++u)c[u]=(o+u)/-s;else for(let u=0;u<l;++u)c[u]=(o+u)*s;return c}function PE(e,t,r){return t=+t,e=+e,r=+r,r2(e,t,r)[2]}function OE(e,t,r){t=+t,e=+e,r=+r;const n=t<e,o=n?PE(t,e,r):PE(e,t,r);return(n?-1:1)*(o<0?1/-o:o)}function lM(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function cM(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function iH(e,t,r=0,n=1/0,o){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(o=o===void 0?nH:_de(o);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),p=Math.max(r,Math.floor(t-u*f/c+h)),y=Math.min(n,Math.floor(t+(c-u)*f/c+h));iH(e,t,p,y,o)}const a=e[t];let s=r,l=n;for(cy(e,r,t),o(e[n],a)>0&&cy(e,r,n);s<l;){for(cy(e,s,l),++s,--l;o(e[s],a)<0;)++s;for(;o(e[l],a)>0;)--l}o(e[r],a)===0?cy(e,r,l):(++l,cy(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function cy(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function Tde(e,t,r){if(e=Float64Array.from(bde(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return cM(e);if(t>=1)return lM(e);var n,o=(n-1)*t,a=Math.floor(o),s=lM(iH(e,a).subarray(0,a+1)),l=cM(e.subarray(a+1));return s+(l-s)*(o-a)}}function Pde(e,t,r=rH){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,o=(n-1)*t,a=Math.floor(o),s=+r(e[a],a,e),l=+r(e[a+1],a+1,e);return s+(l-s)*(o-a)}}function Ode(e,t,r){e=+e,t=+t,r=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+r;for(var n=-1,o=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(o);++n<o;)a[n]=e+n*r;return a}function Rl(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function jd(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const IE=Symbol("implicit");function PT(){var e=new aM,t=[],r=[],n=IE;function o(a){let s=e.get(a);if(s===void 0){if(n!==IE)return n;e.set(a,s=t.push(a)-1)}return r[s%r.length]}return o.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new aM;for(const s of a)e.has(s)||e.set(s,t.push(s)-1);return o},o.range=function(a){return arguments.length?(r=Array.from(a),o):r.slice()},o.unknown=function(a){return arguments.length?(n=a,o):n},o.copy=function(){return PT(t,r).unknown(n)},Rl.apply(o,arguments),o}function hx(){var e=PT().unknown(void 0),t=e.domain,r=e.range,n=0,o=1,a,s,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,p=o<n,y=p?o:n,m=p?n:o;a=(m-y)/Math.max(1,h-c+u*2),l&&(a=Math.floor(a)),y+=(m-y-a*(h-c))*d,s=a*(1-c),l&&(y=Math.round(y),s=Math.round(s));var x=Ode(h).map(function(b){return y+a*b});return r(p?x.reverse():x)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([n,o]=h,n=+n,o=+o,f()):[n,o]},e.rangeRound=function(h){return[n,o]=h,n=+n,o=+o,l=!0,f()},e.bandwidth=function(){return s},e.step=function(){return a},e.round=function(h){return arguments.length?(l=!!h,f()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},e.copy=function(){return hx(t(),[n,o]).round(l).paddingInner(c).paddingOuter(u).align(d)},Rl.apply(f(),arguments)}function oH(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return oH(t())},e}function Wy(){return oH(hx.apply(null,arguments).paddingInner(1))}function OT(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function aH(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function gb(){}var gx=.7,n2=1/gx,rm="\\s*([+-]?\\d+)\\s*",mx="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ide=/^#([0-9a-f]{3,8})$/,Nde=new RegExp(`^rgb\\(${rm},${rm},${rm}\\)$`),Rde=new RegExp(`^rgb\\(${Qc},${Qc},${Qc}\\)$`),Lde=new RegExp(`^rgba\\(${rm},${rm},${rm},${mx}\\)$`),Fde=new RegExp(`^rgba\\(${Qc},${Qc},${Qc},${mx}\\)$`),Mde=new RegExp(`^hsl\\(${mx},${Qc},${Qc}\\)$`),Dde=new RegExp(`^hsla\\(${mx},${Qc},${Qc},${mx}\\)$`),uM={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};OT(gb,vx,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:dM,formatHex:dM,formatHex8:zde,formatHsl:Bde,formatRgb:fM,toString:fM});function dM(){return this.rgb().formatHex()}function zde(){return this.rgb().formatHex8()}function Bde(){return sH(this).formatHsl()}function fM(){return this.rgb().formatRgb()}function vx(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Ide.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?pM(t):r===3?new cs(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?M1(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?M1(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Nde.exec(e))?new cs(t[1],t[2],t[3],1):(t=Rde.exec(e))?new cs(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Lde.exec(e))?M1(t[1],t[2],t[3],t[4]):(t=Fde.exec(e))?M1(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Mde.exec(e))?mM(t[1],t[2]/100,t[3]/100,1):(t=Dde.exec(e))?mM(t[1],t[2]/100,t[3]/100,t[4]):uM.hasOwnProperty(e)?pM(uM[e]):e==="transparent"?new cs(NaN,NaN,NaN,0):null}function pM(e){return new cs(e>>16&255,e>>8&255,e&255,1)}function M1(e,t,r,n){return n<=0&&(e=t=r=NaN),new cs(e,t,r,n)}function Wde(e){return e instanceof gb||(e=vx(e)),e?(e=e.rgb(),new cs(e.r,e.g,e.b,e.opacity)):new cs}function NE(e,t,r,n){return arguments.length===1?Wde(e):new cs(e,t,r,n??1)}function cs(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}OT(cs,NE,aH(gb,{brighter(e){return e=e==null?n2:Math.pow(n2,e),new cs(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?gx:Math.pow(gx,e),new cs(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new cs(nh(this.r),nh(this.g),nh(this.b),i2(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:hM,formatHex:hM,formatHex8:qde,formatRgb:gM,toString:gM}));function hM(){return`#${Qp(this.r)}${Qp(this.g)}${Qp(this.b)}`}function qde(){return`#${Qp(this.r)}${Qp(this.g)}${Qp(this.b)}${Qp((isNaN(this.opacity)?1:this.opacity)*255)}`}function gM(){const e=i2(this.opacity);return`${e===1?"rgb(":"rgba("}${nh(this.r)}, ${nh(this.g)}, ${nh(this.b)}${e===1?")":`, ${e})`}`}function i2(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nh(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Qp(e){return e=nh(e),(e<16?"0":"")+e.toString(16)}function mM(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new tc(e,t,r,n)}function sH(e){if(e instanceof tc)return new tc(e.h,e.s,e.l,e.opacity);if(e instanceof gb||(e=vx(e)),!e)return new tc;if(e instanceof tc)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,o=Math.min(t,r,n),a=Math.max(t,r,n),s=NaN,l=a-o,c=(a+o)/2;return l?(t===a?s=(r-n)/l+(r<n)*6:r===a?s=(n-t)/l+2:s=(t-r)/l+4,l/=c<.5?a+o:2-a-o,s*=60):l=c>0&&c<1?0:s,new tc(s,l,c,e.opacity)}function $de(e,t,r,n){return arguments.length===1?sH(e):new tc(e,t,r,n??1)}function tc(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}OT(tc,$de,aH(gb,{brighter(e){return e=e==null?n2:Math.pow(n2,e),new tc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?gx:Math.pow(gx,e),new tc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,o=2*r-n;return new cs(TC(e>=240?e-240:e+120,o,n),TC(e,o,n),TC(e<120?e+240:e-120,o,n),this.opacity)},clamp(){return new tc(vM(this.h),D1(this.s),D1(this.l),i2(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=i2(this.opacity);return`${e===1?"hsl(":"hsla("}${vM(this.h)}, ${D1(this.s)*100}%, ${D1(this.l)*100}%${e===1?")":`, ${e})`}`}}));function vM(e){return e=(e||0)%360,e<0?e+360:e}function D1(e){return Math.max(0,Math.min(1,e||0))}function TC(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const IT=e=>()=>e;function Ude(e,t){return function(r){return e+r*t}}function Hde(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function Vde(e){return(e=+e)==1?lH:function(t,r){return r-t?Hde(t,r,e):IT(isNaN(t)?r:t)}}function lH(e,t){var r=t-e;return r?Ude(e,r):IT(isNaN(e)?t:e)}const yM=(function e(t){var r=Vde(t);function n(o,a){var s=r((o=NE(o)).r,(a=NE(a)).r),l=r(o.g,a.g),c=r(o.b,a.b),u=lH(o.opacity,a.opacity);return function(d){return o.r=s(d),o.g=l(d),o.b=c(d),o.opacity=u(d),o+""}}return n.gamma=e,n})(1);function Yde(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),o;return function(a){for(o=0;o<r;++o)n[o]=e[o]*(1-a)+t[o]*a;return n}}function Gde(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Kde(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,o=new Array(n),a=new Array(r),s;for(s=0;s<n;++s)o[s]=xv(e[s],t[s]);for(;s<r;++s)a[s]=t[s];return function(l){for(s=0;s<n;++s)a[s]=o[s](l);return a}}function Qde(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function o2(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function Xde(e,t){var r={},n={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?r[o]=xv(e[o],t[o]):n[o]=t[o];return function(a){for(o in r)n[o]=r[o](a);return n}}var RE=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,PC=new RegExp(RE.source,"g");function Zde(e){return function(){return e}}function Jde(e){return function(t){return e(t)+""}}function efe(e,t){var r=RE.lastIndex=PC.lastIndex=0,n,o,a,s=-1,l=[],c=[];for(e=e+"",t=t+"";(n=RE.exec(e))&&(o=PC.exec(t));)(a=o.index)>r&&(a=t.slice(r,a),l[s]?l[s]+=a:l[++s]=a),(n=n[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,c.push({i:s,x:o2(n,o)})),r=PC.lastIndex;return r<t.length&&(a=t.slice(r),l[s]?l[s]+=a:l[++s]=a),l.length<2?c[0]?Jde(c[0].x):Zde(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function xv(e,t){var r=typeof t,n;return t==null||r==="boolean"?IT(t):(r==="number"?o2:r==="string"?(n=vx(t))?(t=n,yM):efe:t instanceof vx?yM:t instanceof Date?Qde:Gde(t)?Yde:Array.isArray(t)?Kde:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Xde:o2)(e,t)}function NT(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function tfe(e,t){t===void 0&&(t=e,e=xv);for(var r=0,n=t.length-1,o=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(o,o=t[++r]);return function(s){var l=Math.max(0,Math.min(n-1,Math.floor(s*=n)));return a[l](s-l)}}function rfe(e){return function(){return e}}function a2(e){return+e}var xM=[0,1];function qa(e){return e}function LE(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:rfe(isNaN(t)?NaN:.5)}function nfe(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function ife(e,t,r){var n=e[0],o=e[1],a=t[0],s=t[1];return o<n?(n=LE(o,n),a=r(s,a)):(n=LE(n,o),a=r(a,s)),function(l){return a(n(l))}}function ofe(e,t,r){var n=Math.min(e.length,t.length)-1,o=new Array(n),a=new Array(n),s=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<n;)o[s]=LE(e[s],e[s+1]),a[s]=r(t[s],t[s+1]);return function(l){var c=hb(e,l,1,n)-1;return a[c](o[c](l))}}function mb(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Xw(){var e=xM,t=xM,r=xv,n,o,a,s=qa,l,c,u;function d(){var h=Math.min(e.length,t.length);return s!==qa&&(s=nfe(e[0],e[h-1])),l=h>2?ofe:ife,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?a:(c||(c=l(e.map(n),t,r)))(n(s(h)))}return f.invert=function(h){return s(o((u||(u=l(t,e.map(n),o2)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,a2),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=NT,d()},f.clamp=function(h){return arguments.length?(s=h?!0:qa,d()):s!==qa},f.interpolate=function(h){return arguments.length?(r=h,d()):r},f.unknown=function(h){return arguments.length?(a=h,f):a},function(h,p){return n=h,o=p,d()}}function RT(){return Xw()(qa,qa)}function afe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function s2(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function km(e){return e=s2(Math.abs(e)),e?e[1]:NaN}function sfe(e,t){return function(r,n){for(var o=r.length,a=[],s=0,l=e[0],c=0;o>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),a.push(r.substring(o-=l,o+l)),!((c+=l+1)>n));)l=e[s=(s+1)%e.length];return a.reverse().join(t)}}function lfe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var cfe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function yx(e){if(!(t=cfe.exec(e)))throw new Error("invalid format: "+e);var t;return new LT({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}yx.prototype=LT.prototype;function LT(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}LT.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ufe(e){e:for(var t=e.length,r=1,n=-1,o;r<t;++r)switch(e[r]){case".":n=o=r;break;case"0":n===0&&(n=r),o=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(o+1):e}var l2;function dfe(e,t){var r=s2(e,t);if(!r)return l2=void 0,e.toPrecision(t);var n=r[0],o=r[1],a=o-(l2=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,s=n.length;return a===s?n:a>s?n+new Array(a-s+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+s2(e,Math.max(0,t+a-1))[0]}function bM(e,t){var r=s2(e,t);if(!r)return e+"";var n=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+new Array(o-n.length+2).join("0")}const wM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:afe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>bM(e*100,t),r:bM,s:dfe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function SM(e){return e}var jM=Array.prototype.map,kM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ffe(e){var t=e.grouping===void 0||e.thousands===void 0?SM:sfe(jM.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",o=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?SM:lfe(jM.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f,h){f=yx(f);var p=f.fill,y=f.align,m=f.sign,x=f.symbol,b=f.zero,w=f.width,k=f.comma,S=f.precision,_=f.trim,P=f.type;P==="n"?(k=!0,P="g"):wM[P]||(S===void 0&&(S=12),_=!0,P="g"),(b||p==="0"&&y==="=")&&(b=!0,p="0",y="=");var O=(h&&h.prefix!==void 0?h.prefix:"")+(x==="$"?r:x==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():""),T=(x==="$"?n:/[%p]/.test(P)?s:"")+(h&&h.suffix!==void 0?h.suffix:""),R=wM[P],I=/[defgprs%]/.test(P);S=S===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function E(A){var F=O,L=T,z,V,Q;if(P==="c")L=R(A)+L,A="";else{A=+A;var U=A<0||1/A<0;if(A=isNaN(A)?c:R(Math.abs(A),S),_&&(A=ufe(A)),U&&+A==0&&m!=="+"&&(U=!1),F=(U?m==="("?m:l:m==="-"||m==="("?"":m)+F,L=(P==="s"&&!isNaN(A)&&l2!==void 0?kM[8+l2/3]:"")+L+(U&&m==="("?")":""),I){for(z=-1,V=A.length;++z<V;)if(Q=A.charCodeAt(z),48>Q||Q>57){L=(Q===46?o+A.slice(z+1):A.slice(z))+L,A=A.slice(0,z);break}}}k&&!b&&(A=t(A,1/0));var ee=F.length+A.length+L.length,H=ee<w?new Array(w-ee+1).join(p):"";switch(k&&b&&(A=t(H+A,H.length?w-L.length:1/0),H=""),y){case"<":A=F+A+L+H;break;case"=":A=F+H+A+L;break;case"^":A=H.slice(0,ee=H.length>>1)+F+A+L+H.slice(ee);break;default:A=H+F+A+L;break}return a(A)}return E.toString=function(){return f+""},E}function d(f,h){var p=Math.max(-8,Math.min(8,Math.floor(km(h)/3)))*3,y=Math.pow(10,-p),m=u((f=yx(f),f.type="f",f),{suffix:kM[8+p/3]});return function(x){return m(y*x)}}return{format:u,formatPrefix:d}}var z1,FT,cH;pfe({thousands:",",grouping:[3],currency:["$",""]});function pfe(e){return z1=ffe(e),FT=z1.format,cH=z1.formatPrefix,z1}function hfe(e){return Math.max(0,-km(Math.abs(e)))}function gfe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(km(t)/3)))*3-km(Math.abs(e)))}function mfe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,km(t)-km(e))+1}function uH(e,t,r,n){var o=OE(e,t,r),a;switch(n=yx(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=gfe(o,s))&&(n.precision=a),cH(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=mfe(o,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=hfe(o))&&(n.precision=a-(n.type==="%")*2);break}}return FT(n)}function Vf(e){var t=e.domain;return e.ticks=function(r){var n=t();return TE(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var o=t();return uH(o[0],o[o.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),o=0,a=n.length-1,s=n[o],l=n[a],c,u,d=10;for(l<s&&(u=s,s=l,l=u,u=o,o=a,a=u);d-- >0;){if(u=PE(s,l,r),u===c)return n[o]=s,n[a]=l,t(n);if(u>0)s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u;else if(u<0)s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function c2(){var e=RT();return e.copy=function(){return mb(e,c2())},Rl.apply(e,arguments),Vf(e)}function dH(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,a2),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return dH(e).unknown(t)},e=arguments.length?Array.from(e,a2):[0,1],Vf(r)}function fH(e,t){e=e.slice();var r=0,n=e.length-1,o=e[r],a=e[n],s;return a<o&&(s=r,r=n,n=s,s=o,o=a,a=s),e[r]=t.floor(o),e[n]=t.ceil(a),e}function _M(e){return Math.log(e)}function CM(e){return Math.exp(e)}function vfe(e){return-Math.log(-e)}function yfe(e){return-Math.exp(-e)}function xfe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function bfe(e){return e===10?xfe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function wfe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function EM(e){return(t,r)=>-e(-t,r)}function MT(e){const t=e(_M,CM),r=t.domain;let n=10,o,a;function s(){return o=wfe(n),a=bfe(n),r()[0]<0?(o=EM(o),a=EM(a),e(vfe,yfe)):e(_M,CM),t}return t.base=function(l){return arguments.length?(n=+l,s()):n},t.domain=function(l){return arguments.length?(r(l),s()):r()},t.ticks=l=>{const c=r();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=o(u),p=o(d),y,m;const x=l==null?10:+l;let b=[];if(!(n%1)&&p-h<x){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(y=1;y<n;++y)if(m=h<0?y/a(-h):y*a(h),!(m<u)){if(m>d)break;b.push(m)}}else for(;h<=p;++h)for(y=n-1;y>=1;--y)if(m=h>0?y/a(-h):y*a(h),!(m<u)){if(m>d)break;b.push(m)}b.length*2<x&&(b=TE(u,d,x))}else b=TE(h,p,Math.min(p-h,x)).map(a);return f?b.reverse():b},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=yx(c)).precision==null&&(c.trim=!0),c=FT(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return d=>{let f=d/a(Math.round(o(d)));return f*n<n-.5&&(f*=n),f<=u?c(d):""}},t.nice=()=>r(fH(r(),{floor:l=>a(Math.floor(o(l))),ceil:l=>a(Math.ceil(o(l)))})),t}function pH(){const e=MT(Xw()).domain([1,10]);return e.copy=()=>mb(e,pH()).base(e.base()),Rl.apply(e,arguments),e}function AM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function TM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function DT(e){var t=1,r=e(AM(t),TM(t));return r.constant=function(n){return arguments.length?e(AM(t=+n),TM(t)):t},Vf(r)}function hH(){var e=DT(Xw());return e.copy=function(){return mb(e,hH()).constant(e.constant())},Rl.apply(e,arguments)}function PM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Sfe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function jfe(e){return e<0?-e*e:e*e}function zT(e){var t=e(qa,qa),r=1;function n(){return r===1?e(qa,qa):r===.5?e(Sfe,jfe):e(PM(r),PM(1/r))}return t.exponent=function(o){return arguments.length?(r=+o,n()):r},Vf(t)}function BT(){var e=zT(Xw());return e.copy=function(){return mb(e,BT()).exponent(e.exponent())},Rl.apply(e,arguments),e}function kfe(){return BT.apply(null,arguments).exponent(.5)}function OM(e){return Math.sign(e)*e*e}function _fe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function gH(){var e=RT(),t=[0,1],r=!1,n;function o(a){var s=_fe(e(a));return isNaN(s)?n:r?Math.round(s):s}return o.invert=function(a){return e.invert(OM(a))},o.domain=function(a){return arguments.length?(e.domain(a),o):e.domain()},o.range=function(a){return arguments.length?(e.range((t=Array.from(a,a2)).map(OM)),o):t.slice()},o.rangeRound=function(a){return o.range(a).round(!0)},o.round=function(a){return arguments.length?(r=!!a,o):r},o.clamp=function(a){return arguments.length?(e.clamp(a),o):e.clamp()},o.unknown=function(a){return arguments.length?(n=a,o):n},o.copy=function(){return gH(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Rl.apply(o,arguments),Vf(o)}function mH(){var e=[],t=[],r=[],n;function o(){var s=0,l=Math.max(1,t.length);for(r=new Array(l-1);++s<l;)r[s-1]=Pde(e,s/l);return a}function a(s){return s==null||isNaN(s=+s)?n:t[hb(r,s)]}return a.invertExtent=function(s){var l=t.indexOf(s);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},a.domain=function(s){if(!arguments.length)return e.slice();e=[];for(let l of s)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Tf),o()},a.range=function(s){return arguments.length?(t=Array.from(s),o()):t.slice()},a.unknown=function(s){return arguments.length?(n=s,a):n},a.quantiles=function(){return r.slice()},a.copy=function(){return mH().domain(e).range(t).unknown(n)},Rl.apply(a,arguments)}function vH(){var e=0,t=1,r=1,n=[.5],o=[0,1],a;function s(c){return c!=null&&c<=c?o[hb(n,c,0,r)]:a}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return s}return s.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},s.range=function(c){return arguments.length?(r=(o=Array.from(c)).length-1,l()):o.slice()},s.invertExtent=function(c){var u=o.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=r?[n[r-1],t]:[n[u-1],n[u]]},s.unknown=function(c){return arguments.length&&(a=c),s},s.thresholds=function(){return n.slice()},s.copy=function(){return vH().domain([e,t]).range(o).unknown(a)},Rl.apply(Vf(s),arguments)}function yH(){var e=[.5],t=[0,1],r,n=1;function o(a){return a!=null&&a<=a?t[hb(e,a,0,n)]:r}return o.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),o):e.slice()},o.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),o):t.slice()},o.invertExtent=function(a){var s=t.indexOf(a);return[e[s-1],e[s]]},o.unknown=function(a){return arguments.length?(r=a,o):r},o.copy=function(){return yH().domain(e).range(t).unknown(r)},Rl.apply(o,arguments)}const OC=new Date,IC=new Date;function mo(e,t,r,n){function o(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return o.floor=a=>(e(a=new Date(+a)),a),o.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),o.round=a=>{const s=o(a),l=o.ceil(a);return a-s<l-a?s:l},o.offset=(a,s)=>(t(a=new Date(+a),s==null?1:Math.floor(s)),a),o.range=(a,s,l)=>{const c=[];if(a=o.ceil(a),l=l==null?1:Math.floor(l),!(a<s)||!(l>0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(u<a&&a<s);return c},o.filter=a=>mo(s=>{if(s>=s)for(;e(s),!a(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!a(s););else for(;--l>=0;)for(;t(s,1),!a(s););}),r&&(o.count=(a,s)=>(OC.setTime(+a),IC.setTime(+s),e(OC),e(IC),Math.floor(r(OC,IC))),o.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?o.filter(n?s=>n(s)%a===0:s=>o.count(0,s)%a===0):o)),o}const u2=mo(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);u2.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?mo(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):u2);u2.range;const Ju=1e3,Cl=Ju*60,ed=Cl*60,dd=ed*24,WT=dd*7,IM=dd*30,NC=dd*365,Xp=mo(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ju)},(e,t)=>(t-e)/Ju,e=>e.getUTCSeconds());Xp.range;const qT=mo(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ju)},(e,t)=>{e.setTime(+e+t*Cl)},(e,t)=>(t-e)/Cl,e=>e.getMinutes());qT.range;const $T=mo(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Cl)},(e,t)=>(t-e)/Cl,e=>e.getUTCMinutes());$T.range;const UT=mo(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ju-e.getMinutes()*Cl)},(e,t)=>{e.setTime(+e+t*ed)},(e,t)=>(t-e)/ed,e=>e.getHours());UT.range;const HT=mo(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ed)},(e,t)=>(t-e)/ed,e=>e.getUTCHours());HT.range;const vb=mo(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Cl)/dd,e=>e.getDate()-1);vb.range;const Zw=mo(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/dd,e=>e.getUTCDate()-1);Zw.range;const xH=mo(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/dd,e=>Math.floor(e/dd));xH.range;function Nh(e){return mo(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Cl)/WT)}const Jw=Nh(0),d2=Nh(1),Cfe=Nh(2),Efe=Nh(3),_m=Nh(4),Afe=Nh(5),Tfe=Nh(6);Jw.range;d2.range;Cfe.range;Efe.range;_m.range;Afe.range;Tfe.range;function Rh(e){return mo(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/WT)}const eS=Rh(0),f2=Rh(1),Pfe=Rh(2),Ofe=Rh(3),Cm=Rh(4),Ife=Rh(5),Nfe=Rh(6);eS.range;f2.range;Pfe.range;Ofe.range;Cm.range;Ife.range;Nfe.range;const VT=mo(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());VT.range;const YT=mo(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());YT.range;const fd=mo(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());fd.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:mo(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});fd.range;const pd=mo(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());pd.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:mo(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});pd.range;function bH(e,t,r,n,o,a){const s=[[Xp,1,Ju],[Xp,5,5*Ju],[Xp,15,15*Ju],[Xp,30,30*Ju],[a,1,Cl],[a,5,5*Cl],[a,15,15*Cl],[a,30,30*Cl],[o,1,ed],[o,3,3*ed],[o,6,6*ed],[o,12,12*ed],[n,1,dd],[n,2,2*dd],[r,1,WT],[t,1,IM],[t,3,3*IM],[e,1,NC]];function l(u,d,f){const h=d<u;h&&([u,d]=[d,u]);const p=f&&typeof f.range=="function"?f:c(u,d,f),y=p?p.range(u,+d+1):[];return h?y.reverse():y}function c(u,d,f){const h=Math.abs(d-u)/f,p=TT(([,,x])=>x).right(s,h);if(p===s.length)return e.every(OE(u/NC,d/NC,f));if(p===0)return u2.every(Math.max(OE(u,d,f),1));const[y,m]=s[h/s[p-1][2]<s[p][2]/h?p-1:p];return y.every(m)}return[l,c]}const[Rfe,Lfe]=bH(pd,YT,eS,xH,HT,$T),[Ffe,Mfe]=bH(fd,VT,Jw,vb,UT,qT);function RC(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function LC(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function uy(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function Dfe(e){var t=e.dateTime,r=e.date,n=e.time,o=e.periods,a=e.days,s=e.shortDays,l=e.months,c=e.shortMonths,u=dy(o),d=fy(o),f=dy(a),h=fy(a),p=dy(s),y=fy(s),m=dy(l),x=fy(l),b=dy(c),w=fy(c),k={a:Q,A:U,b:ee,B:H,c:null,d:DM,e:DM,f:spe,g:vpe,G:xpe,H:ipe,I:ope,j:ape,L:wH,m:lpe,M:cpe,p:B,q:M,Q:WM,s:qM,S:upe,u:dpe,U:fpe,V:ppe,w:hpe,W:gpe,x:null,X:null,y:mpe,Y:ype,Z:bpe,"%":BM},S={a:$,A:q,b:Y,B:K,c:null,d:zM,e:zM,f:kpe,g:Rpe,G:Fpe,H:wpe,I:Spe,j:jpe,L:jH,m:_pe,M:Cpe,p:G,q:re,Q:WM,s:qM,S:Epe,u:Ape,U:Tpe,V:Ppe,w:Ope,W:Ipe,x:null,X:null,y:Npe,Y:Lpe,Z:Mpe,"%":BM},_={a:I,A:E,b:A,B:F,c:L,d:FM,e:FM,f:epe,g:LM,G:RM,H:MM,I:MM,j:Qfe,L:Jfe,m:Kfe,M:Xfe,p:R,q:Gfe,Q:rpe,s:npe,S:Zfe,u:$fe,U:Ufe,V:Hfe,w:qfe,W:Vfe,x:z,X:V,y:LM,Y:RM,Z:Yfe,"%":tpe};k.x=P(r,k),k.X=P(n,k),k.c=P(t,k),S.x=P(r,S),S.X=P(n,S),S.c=P(t,S);function P(J,ae){return function(le){var me=[],Oe=-1,we=0,ie=J.length,Me,ke,se;for(le instanceof Date||(le=new Date(+le));++Oe<ie;)J.charCodeAt(Oe)===37&&(me.push(J.slice(we,Oe)),(ke=NM[Me=J.charAt(++Oe)])!=null?Me=J.charAt(++Oe):ke=Me==="e"?" ":"0",(se=ae[Me])&&(Me=se(le,ke)),me.push(Me),we=Oe+1);return me.push(J.slice(we,Oe)),me.join("")}}function O(J,ae){return function(le){var me=uy(1900,void 0,1),Oe=T(me,J,le+="",0),we,ie;if(Oe!=le.length)return null;if("Q"in me)return new Date(me.Q);if("s"in me)return new Date(me.s*1e3+("L"in me?me.L:0));if(ae&&!("Z"in me)&&(me.Z=0),"p"in me&&(me.H=me.H%12+me.p*12),me.m===void 0&&(me.m="q"in me?me.q:0),"V"in me){if(me.V<1||me.V>53)return null;"w"in me||(me.w=1),"Z"in me?(we=LC(uy(me.y,0,1)),ie=we.getUTCDay(),we=ie>4||ie===0?f2.ceil(we):f2(we),we=Zw.offset(we,(me.V-1)*7),me.y=we.getUTCFullYear(),me.m=we.getUTCMonth(),me.d=we.getUTCDate()+(me.w+6)%7):(we=RC(uy(me.y,0,1)),ie=we.getDay(),we=ie>4||ie===0?d2.ceil(we):d2(we),we=vb.offset(we,(me.V-1)*7),me.y=we.getFullYear(),me.m=we.getMonth(),me.d=we.getDate()+(me.w+6)%7)}else("W"in me||"U"in me)&&("w"in me||(me.w="u"in me?me.u%7:"W"in me?1:0),ie="Z"in me?LC(uy(me.y,0,1)).getUTCDay():RC(uy(me.y,0,1)).getDay(),me.m=0,me.d="W"in me?(me.w+6)%7+me.W*7-(ie+5)%7:me.w+me.U*7-(ie+6)%7);return"Z"in me?(me.H+=me.Z/100|0,me.M+=me.Z%100,LC(me)):RC(me)}}function T(J,ae,le,me){for(var Oe=0,we=ae.length,ie=le.length,Me,ke;Oe<we;){if(me>=ie)return-1;if(Me=ae.charCodeAt(Oe++),Me===37){if(Me=ae.charAt(Oe++),ke=_[Me in NM?ae.charAt(Oe++):Me],!ke||(me=ke(J,le,me))<0)return-1}else if(Me!=le.charCodeAt(me++))return-1}return me}function R(J,ae,le){var me=u.exec(ae.slice(le));return me?(J.p=d.get(me[0].toLowerCase()),le+me[0].length):-1}function I(J,ae,le){var me=p.exec(ae.slice(le));return me?(J.w=y.get(me[0].toLowerCase()),le+me[0].length):-1}function E(J,ae,le){var me=f.exec(ae.slice(le));return me?(J.w=h.get(me[0].toLowerCase()),le+me[0].length):-1}function A(J,ae,le){var me=b.exec(ae.slice(le));return me?(J.m=w.get(me[0].toLowerCase()),le+me[0].length):-1}function F(J,ae,le){var me=m.exec(ae.slice(le));return me?(J.m=x.get(me[0].toLowerCase()),le+me[0].length):-1}function L(J,ae,le){return T(J,t,ae,le)}function z(J,ae,le){return T(J,r,ae,le)}function V(J,ae,le){return T(J,n,ae,le)}function Q(J){return s[J.getDay()]}function U(J){return a[J.getDay()]}function ee(J){return c[J.getMonth()]}function H(J){return l[J.getMonth()]}function B(J){return o[+(J.getHours()>=12)]}function M(J){return 1+~~(J.getMonth()/3)}function $(J){return s[J.getUTCDay()]}function q(J){return a[J.getUTCDay()]}function Y(J){return c[J.getUTCMonth()]}function K(J){return l[J.getUTCMonth()]}function G(J){return o[+(J.getUTCHours()>=12)]}function re(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var ae=P(J+="",k);return ae.toString=function(){return J},ae},parse:function(J){var ae=O(J+="",!1);return ae.toString=function(){return J},ae},utcFormat:function(J){var ae=P(J+="",S);return ae.toString=function(){return J},ae},utcParse:function(J){var ae=O(J+="",!0);return ae.toString=function(){return J},ae}}}var NM={"-":"",_:" ",0:"0"},Do=/^\s*\d+/,zfe=/^%/,Bfe=/[\\^$*+?|[\]().{}]/g;function cn(e,t,r){var n=e<0?"-":"",o=(n?-e:e)+"",a=o.length;return n+(a<r?new Array(r-a+1).join(t)+o:o)}function Wfe(e){return e.replace(Bfe,"\\$&")}function dy(e){return new RegExp("^(?:"+e.map(Wfe).join("|")+")","i")}function fy(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function qfe(e,t,r){var n=Do.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function $fe(e,t,r){var n=Do.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Ufe(e,t,r){var n=Do.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Hfe(e,t,r){var n=Do.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Vfe(e,t,r){var n=Do.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function RM(e,t,r){var n=Do.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function LM(e,t,r){var n=Do.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Yfe(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Gfe(e,t,r){var n=Do.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Kfe(e,t,r){var n=Do.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function FM(e,t,r){var n=Do.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function Qfe(e,t,r){var n=Do.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function MM(e,t,r){var n=Do.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Xfe(e,t,r){var n=Do.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function Zfe(e,t,r){var n=Do.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function Jfe(e,t,r){var n=Do.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function epe(e,t,r){var n=Do.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function tpe(e,t,r){var n=zfe.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function rpe(e,t,r){var n=Do.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function npe(e,t,r){var n=Do.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function DM(e,t){return cn(e.getDate(),t,2)}function ipe(e,t){return cn(e.getHours(),t,2)}function ope(e,t){return cn(e.getHours()%12||12,t,2)}function ape(e,t){return cn(1+vb.count(fd(e),e),t,3)}function wH(e,t){return cn(e.getMilliseconds(),t,3)}function spe(e,t){return wH(e,t)+"000"}function lpe(e,t){return cn(e.getMonth()+1,t,2)}function cpe(e,t){return cn(e.getMinutes(),t,2)}function upe(e,t){return cn(e.getSeconds(),t,2)}function dpe(e){var t=e.getDay();return t===0?7:t}function fpe(e,t){return cn(Jw.count(fd(e)-1,e),t,2)}function SH(e){var t=e.getDay();return t>=4||t===0?_m(e):_m.ceil(e)}function ppe(e,t){return e=SH(e),cn(_m.count(fd(e),e)+(fd(e).getDay()===4),t,2)}function hpe(e){return e.getDay()}function gpe(e,t){return cn(d2.count(fd(e)-1,e),t,2)}function mpe(e,t){return cn(e.getFullYear()%100,t,2)}function vpe(e,t){return e=SH(e),cn(e.getFullYear()%100,t,2)}function ype(e,t){return cn(e.getFullYear()%1e4,t,4)}function xpe(e,t){var r=e.getDay();return e=r>=4||r===0?_m(e):_m.ceil(e),cn(e.getFullYear()%1e4,t,4)}function bpe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+cn(t/60|0,"0",2)+cn(t%60,"0",2)}function zM(e,t){return cn(e.getUTCDate(),t,2)}function wpe(e,t){return cn(e.getUTCHours(),t,2)}function Spe(e,t){return cn(e.getUTCHours()%12||12,t,2)}function jpe(e,t){return cn(1+Zw.count(pd(e),e),t,3)}function jH(e,t){return cn(e.getUTCMilliseconds(),t,3)}function kpe(e,t){return jH(e,t)+"000"}function _pe(e,t){return cn(e.getUTCMonth()+1,t,2)}function Cpe(e,t){return cn(e.getUTCMinutes(),t,2)}function Epe(e,t){return cn(e.getUTCSeconds(),t,2)}function Ape(e){var t=e.getUTCDay();return t===0?7:t}function Tpe(e,t){return cn(eS.count(pd(e)-1,e),t,2)}function kH(e){var t=e.getUTCDay();return t>=4||t===0?Cm(e):Cm.ceil(e)}function Ppe(e,t){return e=kH(e),cn(Cm.count(pd(e),e)+(pd(e).getUTCDay()===4),t,2)}function Ope(e){return e.getUTCDay()}function Ipe(e,t){return cn(f2.count(pd(e)-1,e),t,2)}function Npe(e,t){return cn(e.getUTCFullYear()%100,t,2)}function Rpe(e,t){return e=kH(e),cn(e.getUTCFullYear()%100,t,2)}function Lpe(e,t){return cn(e.getUTCFullYear()%1e4,t,4)}function Fpe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Cm(e):Cm.ceil(e),cn(e.getUTCFullYear()%1e4,t,4)}function Mpe(){return"+0000"}function BM(){return"%"}function WM(e){return+e}function qM(e){return Math.floor(+e/1e3)}var Cg,_H,CH;Dpe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Dpe(e){return Cg=Dfe(e),_H=Cg.format,Cg.parse,CH=Cg.utcFormat,Cg.utcParse,Cg}function zpe(e){return new Date(e)}function Bpe(e){return e instanceof Date?+e:+new Date(+e)}function GT(e,t,r,n,o,a,s,l,c,u){var d=RT(),f=d.invert,h=d.domain,p=u(".%L"),y=u(":%S"),m=u("%I:%M"),x=u("%I %p"),b=u("%a %d"),w=u("%b %d"),k=u("%B"),S=u("%Y");function _(P){return(c(P)<P?p:l(P)<P?y:s(P)<P?m:a(P)<P?x:n(P)<P?o(P)<P?b:w:r(P)<P?k:S)(P)}return d.invert=function(P){return new Date(f(P))},d.domain=function(P){return arguments.length?h(Array.from(P,Bpe)):h().map(zpe)},d.ticks=function(P){var O=h();return e(O[0],O[O.length-1],P??10)},d.tickFormat=function(P,O){return O==null?_:u(O)},d.nice=function(P){var O=h();return(!P||typeof P.range!="function")&&(P=t(O[0],O[O.length-1],P??10)),P?h(fH(O,P)):d},d.copy=function(){return mb(d,GT(e,t,r,n,o,a,s,l,c,u))},d}function Wpe(){return Rl.apply(GT(Ffe,Mfe,fd,VT,Jw,vb,UT,qT,Xp,_H).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function qpe(){return Rl.apply(GT(Rfe,Lfe,pd,YT,eS,Zw,HT,$T,Xp,CH).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function tS(){var e=0,t=1,r,n,o,a,s=qa,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:s(o===0?.5:(f=(a(f)-r)*o,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,r=a(e=+e),n=a(t=+t),o=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(s=f,u):s};function d(f){return function(h){var p,y;return arguments.length?([p,y]=h,s=f(p,y),u):[s(0),s(1)]}}return u.range=d(xv),u.rangeRound=d(NT),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return a=f,r=f(e),n=f(t),o=r===n?0:1/(n-r),u}}function Yf(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function EH(){var e=Vf(tS()(qa));return e.copy=function(){return Yf(e,EH())},jd.apply(e,arguments)}function AH(){var e=MT(tS()).domain([1,10]);return e.copy=function(){return Yf(e,AH()).base(e.base())},jd.apply(e,arguments)}function TH(){var e=DT(tS());return e.copy=function(){return Yf(e,TH()).constant(e.constant())},jd.apply(e,arguments)}function KT(){var e=zT(tS());return e.copy=function(){return Yf(e,KT()).exponent(e.exponent())},jd.apply(e,arguments)}function $pe(){return KT.apply(null,arguments).exponent(.5)}function PH(){var e=[],t=qa;function r(n){if(n!=null&&!isNaN(n=+n))return t((hb(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let o of n)o!=null&&!isNaN(o=+o)&&e.push(o);return e.sort(Tf),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,o)=>t(o/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(o,a)=>Tde(e,a/n))},r.copy=function(){return PH(t).domain(e)},jd.apply(r,arguments)}function rS(){var e=0,t=.5,r=1,n=1,o,a,s,l,c,u=qa,d,f=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+d(m))-a)*(n*m<n*a?l:c),u(f?Math.max(0,Math.min(1,m)):m))}p.domain=function(m){return arguments.length?([e,t,r]=m,o=d(e=+e),a=d(t=+t),s=d(r=+r),l=o===a?0:.5/(a-o),c=a===s?0:.5/(s-a),n=a<o?-1:1,p):[e,t,r]},p.clamp=function(m){return arguments.length?(f=!!m,p):f},p.interpolator=function(m){return arguments.length?(u=m,p):u};function y(m){return function(x){var b,w,k;return arguments.length?([b,w,k]=x,u=tfe(m,[b,w,k]),p):[u(0),u(.5),u(1)]}}return p.range=y(xv),p.rangeRound=y(NT),p.unknown=function(m){return arguments.length?(h=m,p):h},function(m){return d=m,o=m(e),a=m(t),s=m(r),l=o===a?0:.5/(a-o),c=a===s?0:.5/(s-a),n=a<o?-1:1,p}}function OH(){var e=Vf(rS()(qa));return e.copy=function(){return Yf(e,OH())},jd.apply(e,arguments)}function IH(){var e=MT(rS()).domain([.1,1,10]);return e.copy=function(){return Yf(e,IH()).base(e.base())},jd.apply(e,arguments)}function NH(){var e=DT(rS());return e.copy=function(){return Yf(e,NH()).constant(e.constant())},jd.apply(e,arguments)}function QT(){var e=zT(rS());return e.copy=function(){return Yf(e,QT()).exponent(e.exponent())},jd.apply(e,arguments)}function Upe(){return QT.apply(null,arguments).exponent(.5)}const $M=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:hx,scaleDiverging:OH,scaleDivergingLog:IH,scaleDivergingPow:QT,scaleDivergingSqrt:Upe,scaleDivergingSymlog:NH,scaleIdentity:dH,scaleImplicit:IE,scaleLinear:c2,scaleLog:pH,scaleOrdinal:PT,scalePoint:Wy,scalePow:BT,scaleQuantile:mH,scaleQuantize:vH,scaleRadial:gH,scaleSequential:EH,scaleSequentialLog:AH,scaleSequentialPow:KT,scaleSequentialQuantile:PH,scaleSequentialSqrt:$pe,scaleSequentialSymlog:TH,scaleSqrt:kfe,scaleSymlog:hH,scaleThreshold:yH,scaleTime:Wpe,scaleUtc:qpe,tickFormat:uH},Symbol.toStringTag,{value:"Module"}));var FC,UM;function nS(){if(UM)return FC;UM=1;var e=gv();function t(r,n,o){for(var a=-1,s=r.length;++a<s;){var l=r[a],c=n(l);if(c!=null&&(u===void 0?c===c&&!e(c):o(c,u)))var u=c,d=l}return d}return FC=t,FC}var MC,HM;function RH(){if(HM)return MC;HM=1;function e(t,r){return t>r}return MC=e,MC}var DC,VM;function Hpe(){if(VM)return DC;VM=1;var e=nS(),t=RH(),r=yv();function n(o){return o&&o.length?e(o,r,t):void 0}return DC=n,DC}var Vpe=Hpe();const iS=un(Vpe);var zC,YM;function LH(){if(YM)return zC;YM=1;function e(t,r){return t<r}return zC=e,zC}var BC,GM;function Ype(){if(GM)return BC;GM=1;var e=nS(),t=LH(),r=yv();function n(o){return o&&o.length?e(o,r,t):void 0}return BC=n,BC}var Gpe=Ype();const oS=un(Gpe);var WC,KM;function Kpe(){if(KM)return WC;KM=1;var e=fT(),t=su(),r=UU(),n=ms();function o(a,s){var l=n(a)?e:r;return l(a,t(s,3))}return WC=o,WC}var qC,QM;function Qpe(){if(QM)return qC;QM=1;var e=qU(),t=Kpe();function r(n,o){return e(t(n,o),1)}return qC=r,qC}var Xpe=Qpe();const Zpe=un(Xpe);var $C,XM;function FH(){if(XM)return $C;XM=1;var e=_T();function t(r,n){return e(r,n)}return $C=t,$C}var Jpe=FH();const yb=un(Jpe);var bv=1e9,ehe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},ZT,ui=!0,Ol="[DecimalError] ",ih=Ol+"Invalid argument: ",XT=Ol+"Exponent out of range: ",wv=Math.floor,zp=Math.pow,the=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,$s,Io=1e7,ni=7,MH=9007199254740991,p2=wv(MH/ni),Zt={};Zt.absoluteValue=Zt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Zt.comparedTo=Zt.cmp=function(e){var t,r,n,o,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(n=a.d.length,o=e.d.length,t=0,r=n<o?n:o;t<r;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return n===o?0:n>o^a.s<0?1:-1};Zt.decimalPlaces=Zt.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ni;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Zt.dividedBy=Zt.div=function(e){return sd(this,new this.constructor(e))};Zt.dividedToIntegerBy=Zt.idiv=function(e){var t=this,r=t.constructor;return Bn(sd(t,new r(e),0,1),r.precision)};Zt.equals=Zt.eq=function(e){return!this.cmp(e)};Zt.exponent=function(){return Ji(this)};Zt.greaterThan=Zt.gt=function(e){return this.cmp(e)>0};Zt.greaterThanOrEqualTo=Zt.gte=function(e){return this.cmp(e)>=0};Zt.isInteger=Zt.isint=function(){return this.e>this.d.length-2};Zt.isNegative=Zt.isneg=function(){return this.s<0};Zt.isPositive=Zt.ispos=function(){return this.s>0};Zt.isZero=function(){return this.s===0};Zt.lessThan=Zt.lt=function(e){return this.cmp(e)<0};Zt.lessThanOrEqualTo=Zt.lte=function(e){return this.cmp(e)<1};Zt.logarithm=Zt.log=function(e){var t,r=this,n=r.constructor,o=n.precision,a=o+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq($s))throw Error(Ol+"NaN");if(r.s<1)throw Error(Ol+(r.s?"NaN":"-Infinity"));return r.eq($s)?new n(0):(ui=!1,t=sd(xx(r,a),xx(e,a),a),ui=!0,Bn(t,o))};Zt.minus=Zt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?BH(t,e):DH(t,(e.s=-e.s,e))};Zt.modulo=Zt.mod=function(e){var t,r=this,n=r.constructor,o=n.precision;if(e=new n(e),!e.s)throw Error(Ol+"NaN");return r.s?(ui=!1,t=sd(r,e,0,1).times(e),ui=!0,r.minus(t)):Bn(new n(r),o)};Zt.naturalExponential=Zt.exp=function(){return zH(this)};Zt.naturalLogarithm=Zt.ln=function(){return xx(this)};Zt.negated=Zt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Zt.plus=Zt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?DH(t,e):BH(t,(e.s=-e.s,e))};Zt.precision=Zt.sd=function(e){var t,r,n,o=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ih+e);if(t=Ji(o)+1,n=o.d.length-1,r=n*ni+1,n=o.d[n],n){for(;n%10==0;n/=10)r--;for(n=o.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Zt.squareRoot=Zt.sqrt=function(){var e,t,r,n,o,a,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Ol+"NaN")}for(e=Ji(l),ui=!1,o=Math.sqrt(+l),o==0||o==1/0?(t=Vc(l.d),(t.length+e)%2==0&&(t+="0"),o=Math.sqrt(t),e=wv((e+1)/2)-(e<0||e%2),o==1/0?t="5e"+e:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(o.toString()),r=c.precision,o=s=r+3;;)if(a=n,n=a.plus(sd(l,a,s+2)).times(.5),Vc(a.d).slice(0,s)===(t=Vc(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),o==s&&t=="4999"){if(Bn(a,r+1,0),a.times(a).eq(l)){n=a;break}}else if(t!="9999")break;s+=4}return ui=!0,Bn(n,r)};Zt.times=Zt.mul=function(e){var t,r,n,o,a,s,l,c,u,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,r=d.e+e.e,c=h.length,u=p.length,c<u&&(a=h,h=p,p=a,s=c,c=u,u=s),a=[],s=c+u,n=s;n--;)a.push(0);for(n=u;--n>=0;){for(t=0,o=c+n;o>n;)l=a[o]+p[n]*h[o-n-1]+t,a[o--]=l%Io|0,t=l/Io|0;a[o]=(a[o]+t)%Io|0}for(;!a[--s];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,ui?Bn(e,f.precision):e};Zt.toDecimalPlaces=Zt.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Jc(e,0,bv),t===void 0?t=n.rounding:Jc(t,0,8),Bn(r,e+Ji(r)+1,t))};Zt.toExponential=function(e,t){var r,n=this,o=n.constructor;return e===void 0?r=mh(n,!0):(Jc(e,0,bv),t===void 0?t=o.rounding:Jc(t,0,8),n=Bn(new o(n),e+1,t),r=mh(n,!0,e+1)),r};Zt.toFixed=function(e,t){var r,n,o=this,a=o.constructor;return e===void 0?mh(o):(Jc(e,0,bv),t===void 0?t=a.rounding:Jc(t,0,8),n=Bn(new a(o),e+Ji(o)+1,t),r=mh(n.abs(),!1,e+Ji(n)+1),o.isneg()&&!o.isZero()?"-"+r:r)};Zt.toInteger=Zt.toint=function(){var e=this,t=e.constructor;return Bn(new t(e),Ji(e)+1,t.rounding)};Zt.toNumber=function(){return+this};Zt.toPower=Zt.pow=function(e){var t,r,n,o,a,s,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c($s);if(l=new c(l),!l.s){if(e.s<1)throw Error(Ol+"Infinity");return l}if(l.eq($s))return l;if(n=c.precision,e.eq($s))return Bn(l,n);if(t=e.e,r=e.d.length-1,s=t>=r,a=l.s,s){if((r=d<0?-d:d)<=MH){for(o=new c($s),t=Math.ceil(n/ni+4),ui=!1;r%2&&(o=o.times(l),JM(o.d,t)),r=wv(r/2),r!==0;)l=l.times(l),JM(l.d,t);return ui=!0,e.s<0?new c($s).div(o):Bn(o,n)}}else if(a<0)throw Error(Ol+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,ui=!1,o=e.times(xx(l,n+u)),ui=!0,o=zH(o),o.s=a,o};Zt.toPrecision=function(e,t){var r,n,o=this,a=o.constructor;return e===void 0?(r=Ji(o),n=mh(o,r<=a.toExpNeg||r>=a.toExpPos)):(Jc(e,1,bv),t===void 0?t=a.rounding:Jc(t,0,8),o=Bn(new a(o),e,t),r=Ji(o),n=mh(o,e<=r||r<=a.toExpNeg,e)),n};Zt.toSignificantDigits=Zt.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Jc(e,1,bv),t===void 0?t=n.rounding:Jc(t,0,8)),Bn(new n(r),e,t)};Zt.toString=Zt.valueOf=Zt.val=Zt.toJSON=Zt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Ji(e),r=e.constructor;return mh(e,t<=r.toExpNeg||t>=r.toExpPos)};function DH(e,t){var r,n,o,a,s,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),ui?Bn(t,f):t;if(c=e.d,u=t.d,s=e.e,o=t.e,c=c.slice(),a=s-o,a){for(a<0?(n=c,a=-a,l=u.length):(n=u,o=s,l=c.length),s=Math.ceil(f/ni),l=s>l?s+1:l+1,a>l&&(a=l,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,n=u,u=c,c=n),r=0;a;)r=(c[--a]=c[a]+u[a]+r)/Io|0,c[a]%=Io;for(r&&(c.unshift(r),++o),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=o,ui?Bn(t,f):t}function Jc(e,t,r){if(e!==~~e||e<t||e>r)throw Error(ih+e)}function Vc(e){var t,r,n,o=e.length-1,a="",s=e[0];if(o>0){for(a+=s,t=1;t<o;t++)n=e[t]+"",r=ni-n.length,r&&(a+=yf(r)),a+=n;s=e[t],n=s+"",r=ni-n.length,r&&(a+=yf(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return a+s}var sd=(function(){function e(n,o){var a,s=0,l=n.length;for(n=n.slice();l--;)a=n[l]*o+s,n[l]=a%Io|0,s=a/Io|0;return s&&n.unshift(s),n}function t(n,o,a,s){var l,c;if(a!=s)c=a>s?1:-1;else for(l=c=0;l<a;l++)if(n[l]!=o[l]){c=n[l]>o[l]?1:-1;break}return c}function r(n,o,a){for(var s=0;a--;)n[a]-=s,s=n[a]<o[a]?1:0,n[a]=s*Io+n[a]-o[a];for(;!n[0]&&n.length>1;)n.shift()}return function(n,o,a,s){var l,c,u,d,f,h,p,y,m,x,b,w,k,S,_,P,O,T,R=n.constructor,I=n.s==o.s?1:-1,E=n.d,A=o.d;if(!n.s)return new R(n);if(!o.s)throw Error(Ol+"Division by zero");for(c=n.e-o.e,O=A.length,_=E.length,p=new R(I),y=p.d=[],u=0;A[u]==(E[u]||0);)++u;if(A[u]>(E[u]||0)&&--c,a==null?w=a=R.precision:s?w=a+(Ji(n)-Ji(o))+1:w=a,w<0)return new R(0);if(w=w/ni+2|0,u=0,O==1)for(d=0,A=A[0],w++;(u<_||d)&&w--;u++)k=d*Io+(E[u]||0),y[u]=k/A|0,d=k%A|0;else{for(d=Io/(A[0]+1)|0,d>1&&(A=e(A,d),E=e(E,d),O=A.length,_=E.length),S=O,m=E.slice(0,O),x=m.length;x<O;)m[x++]=0;T=A.slice(),T.unshift(0),P=A[0],A[1]>=Io/2&&++P;do d=0,l=t(A,m,O,x),l<0?(b=m[0],O!=x&&(b=b*Io+(m[1]||0)),d=b/P|0,d>1?(d>=Io&&(d=Io-1),f=e(A,d),h=f.length,x=m.length,l=t(f,m,h,x),l==1&&(d--,r(f,O<h?T:A,h))):(d==0&&(l=d=1),f=A.slice()),h=f.length,h<x&&f.unshift(0),r(m,f,x),l==-1&&(x=m.length,l=t(A,m,O,x),l<1&&(d++,r(m,O<x?T:A,x))),x=m.length):l===0&&(d++,m=[0]),y[u++]=d,l&&m[0]?m[x++]=E[S]||0:(m=[E[S]],x=1);while((S++<_||m[0]!==void 0)&&w--)}return y[0]||y.shift(),p.e=c,Bn(p,s?a+Ji(p)+1:a)}})();function zH(e,t){var r,n,o,a,s,l,c=0,u=0,d=e.constructor,f=d.precision;if(Ji(e)>16)throw Error(XT+Ji(e));if(!e.s)return new d($s);for(ui=!1,l=f,s=new d(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(n=Math.log(zp(2,u))/Math.LN10*2+5|0,l+=n,r=o=a=new d($s),d.precision=l;;){if(o=Bn(o.times(e),l),r=r.times(++c),s=a.plus(sd(o,r,l)),Vc(s.d).slice(0,l)===Vc(a.d).slice(0,l)){for(;u--;)a=Bn(a.times(a),l);return d.precision=f,t==null?(ui=!0,Bn(a,f)):a}a=s}}function Ji(e){for(var t=e.e*ni,r=e.d[0];r>=10;r/=10)t++;return t}function UC(e,t,r){if(t>e.LN10.sd())throw ui=!0,r&&(e.precision=r),Error(Ol+"LN10 precision limit exceeded");return Bn(new e(e.LN10),t)}function yf(e){for(var t="";e--;)t+="0";return t}function xx(e,t){var r,n,o,a,s,l,c,u,d,f=1,h=10,p=e,y=p.d,m=p.constructor,x=m.precision;if(p.s<1)throw Error(Ol+(p.s?"NaN":"-Infinity"));if(p.eq($s))return new m(0);if(t==null?(ui=!1,u=x):u=t,p.eq(10))return t==null&&(ui=!0),UC(m,u);if(u+=h,m.precision=u,r=Vc(y),n=r.charAt(0),a=Ji(p),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=Vc(p.d),n=r.charAt(0),f++;a=Ji(p),n>1?(p=new m("0."+r),a++):p=new m(n+"."+r.slice(1))}else return c=UC(m,u+2,x).times(a+""),p=xx(new m(n+"."+r.slice(1)),u-h).plus(c),m.precision=x,t==null?(ui=!0,Bn(p,x)):p;for(l=s=p=sd(p.minus($s),p.plus($s),u),d=Bn(p.times(p),u),o=3;;){if(s=Bn(s.times(d),u),c=l.plus(sd(s,new m(o),u)),Vc(c.d).slice(0,u)===Vc(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(UC(m,u+2,x).times(a+""))),l=sd(l,new m(f),u),m.precision=x,t==null?(ui=!0,Bn(l,x)):l;l=c,o+=2}}function ZM(e,t){var r,n,o;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(o=t.length;t.charCodeAt(o-1)===48;)--o;if(t=t.slice(n,o),t){if(o-=n,r=r-n-1,e.e=wv(r/ni),e.d=[],n=(r+1)%ni,r<0&&(n+=ni),n<o){for(n&&e.d.push(+t.slice(0,n)),o-=ni;n<o;)e.d.push(+t.slice(n,n+=ni));t=t.slice(n),n=ni-t.length}else n-=o;for(;n--;)t+="0";if(e.d.push(+t),ui&&(e.e>p2||e.e<-p2))throw Error(XT+r)}else e.s=0,e.e=0,e.d=[0];return e}function Bn(e,t,r){var n,o,a,s,l,c,u,d,f=e.d;for(s=1,a=f[0];a>=10;a/=10)s++;if(n=t-s,n<0)n+=ni,o=t,u=f[d=0];else{if(d=Math.ceil((n+1)/ni),a=f.length,d>=a)return e;for(u=a=f[d],s=1;a>=10;a/=10)s++;n%=ni,o=n-ni+s}if(r!==void 0&&(a=zp(10,s-o-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?o>0?u/zp(10,s-o):0:f[d-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(a=Ji(e),f.length=1,t=t-a-1,f[0]=zp(10,(ni-t%ni)%ni),e.e=wv(-t/ni)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=d,a=1,d--):(f.length=d+1,a=zp(10,ni-n),f[d]=o>0?(u/zp(10,s-o)%zp(10,o)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==Io&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=Io)break;f[d--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(ui&&(e.e>p2||e.e<-p2))throw Error(XT+Ji(e));return e}function BH(e,t){var r,n,o,a,s,l,c,u,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),ui?Bn(t,p):t;if(c=e.d,f=t.d,n=t.e,u=e.e,c=c.slice(),s=u-n,s){for(d=s<0,d?(r=c,s=-s,l=f.length):(r=f,n=u,l=c.length),o=Math.max(Math.ceil(p/ni),l)+2,s>o&&(s=o,r.length=1),r.reverse(),o=s;o--;)r.push(0);r.reverse()}else{for(o=c.length,l=f.length,d=o<l,d&&(l=o),o=0;o<l;o++)if(c[o]!=f[o]){d=c[o]<f[o];break}s=0}for(d&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,o=f.length-l;o>0;--o)c[l++]=0;for(o=f.length;o>s;){if(c[--o]<f[o]){for(a=o;a&&c[--a]===0;)c[a]=Io-1;--c[a],c[o]+=Io}c[o]-=f[o]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,ui?Bn(t,p):t):new h(0)}function mh(e,t,r){var n,o=Ji(e),a=Vc(e.d),s=a.length;return t?(r&&(n=r-s)>0?a=a.charAt(0)+"."+a.slice(1)+yf(n):s>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(o<0?"e":"e+")+o):o<0?(a="0."+yf(-o-1)+a,r&&(n=r-s)>0&&(a+=yf(n))):o>=s?(a+=yf(o+1-s),r&&(n=r-o-1)>0&&(a=a+"."+yf(n))):((n=o+1)<s&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-s)>0&&(o+1===s&&(a+="."),a+=yf(n))),e.s<0?"-"+a:a}function JM(e,t){if(e.length>t)return e.length=t,!0}function WH(e){var t,r,n;function o(a){var s=this;if(!(s instanceof o))return new o(a);if(s.constructor=o,a instanceof o){s.s=a.s,s.e=a.e,s.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(ih+a);if(a>0)s.s=1;else if(a<0)a=-a,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(a===~~a&&a<1e7){s.e=0,s.d=[a];return}return ZM(s,a.toString())}else if(typeof a!="string")throw Error(ih+a);if(a.charCodeAt(0)===45?(a=a.slice(1),s.s=-1):s.s=1,the.test(a))ZM(s,a);else throw Error(ih+a)}if(o.prototype=Zt,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.clone=WH,o.config=o.set=rhe,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return o.config(e),o}function rhe(e){if(!e||typeof e!="object")throw Error(Ol+"Object expected");var t,r,n,o=["precision",1,bv,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<o.length;t+=3)if((n=e[r=o[t]])!==void 0)if(wv(n)===n&&n>=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(ih+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ih+r+": "+n);return this}var ZT=WH(ehe);$s=new ZT(1);const Nn=ZT;function nhe(e){return she(e)||ahe(e)||ohe(e)||ihe()}function ihe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ohe(e,t){if(e){if(typeof e=="string")return FE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return FE(e,t)}}function ahe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function she(e){if(Array.isArray(e))return FE(e)}function FE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var lhe=function(t){return t},qH={},$H=function(t){return t===qH},eD=function(t){return function r(){return arguments.length===0||arguments.length===1&&$H(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},che=function e(t,r){return t===1?r:eD(function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];var s=o.filter(function(l){return l!==qH}).length;return s>=t?r.apply(void 0,o):e(t-s,eD(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=o.map(function(f){return $H(f)?c.shift():f});return r.apply(void 0,nhe(d).concat(c))}))})},aS=function(t){return che(t.length,t)},ME=function(t,r){for(var n=[],o=t;o<r;++o)n[o-t]=o;return n},uhe=aS(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),dhe=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return lhe;var o=r.reverse(),a=o[0],s=o.slice(1);return function(){return s.reduce(function(l,c){return c(l)},a.apply(void 0,arguments))}},DE=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},UH=function(t){var r=null,n=null;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return r&&a.every(function(l,c){return l===r[c]})||(r=a,n=t.apply(void 0,a)),n}};function fhe(e){var t;return e===0?t=1:t=Math.floor(new Nn(e).abs().log(10).toNumber())+1,t}function phe(e,t,r){for(var n=new Nn(e),o=0,a=[];n.lt(t)&&o<1e5;)a.push(n.toNumber()),n=n.add(r),o++;return a}var hhe=aS(function(e,t,r){var n=+e,o=+t;return n+r*(o-n)}),ghe=aS(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),mhe=aS(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const sS={rangeStep:phe,getDigitCount:fhe,interpolateNumber:hhe,uninterpolateNumber:ghe,uninterpolateTruncation:mhe};function zE(e){return xhe(e)||yhe(e)||HH(e)||vhe()}function vhe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yhe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function xhe(e){if(Array.isArray(e))return BE(e)}function bx(e,t){return She(e)||whe(e,t)||HH(e,t)||bhe()}function bhe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HH(e,t){if(e){if(typeof e=="string")return BE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return BE(e,t)}}function BE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function whe(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,o=!1,a=void 0;try{for(var s=e[Symbol.iterator](),l;!(n=(l=s.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){o=!0,a=c}finally{try{!n&&s.return!=null&&s.return()}finally{if(o)throw a}}return r}}function She(e){if(Array.isArray(e))return e}function VH(e){var t=bx(e,2),r=t[0],n=t[1],o=r,a=n;return r>n&&(o=n,a=r),[o,a]}function YH(e,t,r){if(e.lte(0))return new Nn(0);var n=sS.getDigitCount(e.toNumber()),o=new Nn(10).pow(n),a=e.div(o),s=n!==1?.05:.1,l=new Nn(Math.ceil(a.div(s).toNumber())).add(r).mul(s),c=l.mul(o);return t?c:new Nn(Math.ceil(c))}function jhe(e,t,r){var n=1,o=new Nn(e);if(!o.isint()&&r){var a=Math.abs(e);a<1?(n=new Nn(10).pow(sS.getDigitCount(e)-1),o=new Nn(Math.floor(o.div(n).toNumber())).mul(n)):a>1&&(o=new Nn(Math.floor(e)))}else e===0?o=new Nn(Math.floor((t-1)/2)):r||(o=new Nn(Math.floor(e)));var s=Math.floor((t-1)/2),l=dhe(uhe(function(c){return o.add(new Nn(c-s).mul(n)).toNumber()}),ME);return l(0,t)}function GH(e,t,r,n){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Nn(0),tickMin:new Nn(0),tickMax:new Nn(0)};var a=YH(new Nn(t).sub(e).div(r-1),n,o),s;e<=0&&t>=0?s=new Nn(0):(s=new Nn(e).add(t).div(2),s=s.sub(new Nn(s).mod(a)));var l=Math.ceil(s.sub(e).div(a).toNumber()),c=Math.ceil(new Nn(t).sub(s).div(a).toNumber()),u=l+c+1;return u>r?GH(e,t,r,n,o+1):(u<r&&(c=t>0?c+(r-u):c,l=t>0?l:l+(r-u)),{step:a,tickMin:s.sub(new Nn(l).mul(a)),tickMax:s.add(new Nn(c).mul(a))})}function khe(e){var t=bx(e,2),r=t[0],n=t[1],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(o,2),l=VH([r,n]),c=bx(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(zE(ME(0,o-1).map(function(){return 1/0}))):[].concat(zE(ME(0,o-1).map(function(){return-1/0})),[d]);return r>n?DE(f):f}if(u===d)return jhe(u,o,a);var h=GH(u,d,s,a),p=h.step,y=h.tickMin,m=h.tickMax,x=sS.rangeStep(y,m.add(new Nn(.1).mul(p)),p);return r>n?DE(x):x}function _he(e,t){var r=bx(e,2),n=r[0],o=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=VH([n,o]),l=bx(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[n,o];if(c===u)return[c];var d=Math.max(t,2),f=YH(new Nn(u).sub(c).div(d-1),a,0),h=[].concat(zE(sS.rangeStep(new Nn(c),new Nn(u).sub(new Nn(.99).mul(f)),f)),[u]);return n>o?DE(h):h}var Che=UH(khe),Ehe=UH(_he),Ahe="Invariant failed";function vh(e,t){throw new Error(Ahe)}var The=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Em(e){"@babel/helpers - typeof";return Em=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Em(e)}function h2(){return h2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},h2.apply(this,arguments)}function Phe(e,t){return Rhe(e)||Nhe(e,t)||Ihe(e,t)||Ohe()}function Ohe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ihe(e,t){if(e){if(typeof e=="string")return tD(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tD(e,t)}}function tD(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Nhe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function Rhe(e){if(Array.isArray(e))return e}function Lhe(e,t){if(e==null)return{};var r=Fhe(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Fhe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Mhe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dhe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,XH(n.key),n)}}function zhe(e,t,r){return t&&Dhe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bhe(e,t,r){return t=g2(t),Whe(e,KH()?Reflect.construct(t,r||[],g2(e).constructor):t.apply(e,r))}function Whe(e,t){if(t&&(Em(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qhe(e)}function qhe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KH=function(){return!!e})()}function g2(e){return g2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},g2(e)}function $he(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&WE(e,t)}function WE(e,t){return WE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},WE(e,t)}function QH(e,t,r){return t=XH(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XH(e){var t=Uhe(e,"string");return Em(t)=="symbol"?t:t+""}function Uhe(e,t){if(Em(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Em(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var xb=(function(e){function t(){return Mhe(this,t),Bhe(this,t,arguments)}return $he(t,e),zhe(t,[{key:"render",value:function(){var n=this.props,o=n.offset,a=n.layout,s=n.width,l=n.dataKey,c=n.data,u=n.dataPointFormatter,d=n.xAxis,f=n.yAxis,h=Lhe(n,The),p=vr(h,!1);this.props.direction==="x"&&d.type!=="number"&&vh();var y=c.map(function(m){var x=u(m,l),b=x.x,w=x.y,k=x.value,S=x.errorVal;if(!S)return null;var _=[],P,O;if(Array.isArray(S)){var T=Phe(S,2);P=T[0],O=T[1]}else P=O=S;if(a==="vertical"){var R=d.scale,I=w+o,E=I+s,A=I-s,F=R(k-P),L=R(k+O);_.push({x1:L,y1:E,x2:L,y2:A}),_.push({x1:F,y1:I,x2:L,y2:I}),_.push({x1:F,y1:E,x2:F,y2:A})}else if(a==="horizontal"){var z=f.scale,V=b+o,Q=V-s,U=V+s,ee=z(k-P),H=z(k+O);_.push({x1:Q,y1:H,x2:U,y2:H}),_.push({x1:V,y1:ee,x2:V,y2:H}),_.push({x1:Q,y1:ee,x2:U,y2:ee})}return ze.createElement(ln,h2({className:"recharts-errorBar",key:"bar-".concat(_.map(function(B){return"".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))},p),_.map(function(B){return ze.createElement("line",h2({},B,{key:"line-".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))}))});return ze.createElement(ln,{className:"recharts-errorBars"},y)}}])})(ze.Component);QH(xb,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});QH(xb,"displayName","ErrorBar");function wx(e){"@babel/helpers - typeof";return wx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wx(e)}function rD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function kp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rD(Object(r),!0).forEach(function(n){Hhe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Hhe(e,t,r){return t=Vhe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vhe(e){var t=Yhe(e,"string");return wx(t)=="symbol"?t:t+""}function Yhe(e,t){if(wx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(wx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ZH=function(t){var r=t.children,n=t.formattedGraphicalItems,o=t.legendWidth,a=t.legendContent,s=Bs(r,Af);if(!s)return null;var l=Af.defaultProps,c=l!==void 0?kp(kp({},l),s.props):{},u;return s.props&&s.props.payload?u=s.props&&s.props.payload:a==="children"?u=(n||[]).reduce(function(d,f){var h=f.item,p=f.props,y=p.sectors||p.data||[];return d.concat(y.map(function(m){return{type:s.props.iconType||h.props.legendType,value:m.name,color:m.fill,payload:m}}))},[]):u=(n||[]).map(function(d){var f=d.item,h=f.type.defaultProps,p=h!==void 0?kp(kp({},h),f.props):{},y=p.dataKey,m=p.name,x=p.legendType,b=p.hide;return{inactive:b,dataKey:y,type:c.iconType||x||"square",color:JT(f),value:m||y,payload:p}}),kp(kp(kp({},c),Af.getWithHeight(s,o)),{},{payload:u,item:s})};function Sx(e){"@babel/helpers - typeof";return Sx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sx(e)}function nD(e){return Xhe(e)||Qhe(e)||Khe(e)||Ghe()}function Ghe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Khe(e,t){if(e){if(typeof e=="string")return qE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qE(e,t)}}function Qhe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Xhe(e){if(Array.isArray(e))return qE(e)}function qE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function iD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ai(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iD(Object(r),!0).forEach(function(n){nm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nm(e,t,r){return t=Zhe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zhe(e){var t=Jhe(e,"string");return Sx(t)=="symbol"?t:t+""}function Jhe(e,t){if(Sx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Sx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uo(e,t,r){return Rr(e)||Rr(t)?r:ho(t)?Gs(e,t,r):Ar(t)?t(e):r}function qy(e,t,r,n){var o=Zpe(e,function(l){return uo(l,t)});if(r==="number"){var a=o.filter(function(l){return Bt(l)||parseFloat(l)});return a.length?[oS(a),iS(a)]:[1/0,-1/0]}var s=n?o.filter(function(l){return!Rr(l)}):o;return s.map(function(l){return ho(l)||l instanceof Date?l:""})}var ege=function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,s=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var c=a.range,u=0;u<l;u++){var d=u>0?o[u-1].coordinate:o[l-1].coordinate,f=o[u].coordinate,h=u>=l-1?o[0].coordinate:o[u+1].coordinate,p=void 0;if(Ba(f-d)!==Ba(h-f)){var y=[];if(Ba(h-f)===Ba(c[1]-c[0])){p=h;var m=f+c[1]-c[0];y[0]=Math.min(m,(m+d)/2),y[1]=Math.max(m,(m+d)/2)}else{p=d;var x=h+c[1]-c[0];y[0]=Math.min(f,(x+f)/2),y[1]=Math.max(f,(x+f)/2)}var b=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>b[0]&&t<=b[1]||t>=y[0]&&t<=y[1]){s=o[u].index;break}}else{var w=Math.min(d,h),k=Math.max(d,h);if(t>(w+f)/2&&t<=(k+f)/2){s=o[u].index;break}}}else for(var S=0;S<l;S++)if(S===0&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S>0&&S<l-1&&t>(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===l-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){s=n[S].index;break}return s},JT=function(t){var r,n=t,o=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Ai(Ai({},t.type.defaultProps),t.props):t.props,s=a.stroke,l=a.fill,c;switch(o){case"Line":c=s;break;case"Area":case"Radar":c=s&&s!=="none"?s:l;break;default:c=l;break}return c},tge=function(t){var r=t.barSize,n=t.totalSize,o=t.stackGroups,a=o===void 0?{}:o;if(!a)return{};for(var s={},l=Object.keys(a),c=0,u=l.length;c<u;c++)for(var d=a[l[c]].stackGroups,f=Object.keys(d),h=0,p=f.length;h<p;h++){var y=d[f[h]],m=y.items,x=y.cateAxisId,b=m.filter(function(O){return ad(O.type).indexOf("Bar")>=0});if(b&&b.length){var w=b[0].type.defaultProps,k=w!==void 0?Ai(Ai({},w),b[0].props):b[0].props,S=k.barSize,_=k[x];s[_]||(s[_]=[]);var P=Rr(S)?r:S;s[_].push({item:b[0],stackList:b.slice(1),barSize:Rr(P)?void 0:Wa(P,n,0)})}}return s},rge=function(t){var r=t.barGap,n=t.barCategoryGap,o=t.bandSize,a=t.sizeList,s=a===void 0?[]:a,l=t.maxBarSize,c=s.length;if(c<1)return null;var u=Wa(r,o,0,!0),d,f=[];if(s[0].barSize===+s[0].barSize){var h=!1,p=o/c,y=s.reduce(function(S,_){return S+_.barSize||0},0);y+=(c-1)*u,y>=o&&(y-=(c-1)*u,u=0),y>=o&&p>0&&(h=!0,p*=.9,y=c*p);var m=(o-y)/2>>0,x={offset:m-u,size:0};d=s.reduce(function(S,_){var P={item:_.item,position:{offset:x.offset+x.size+u,size:h?p:_.barSize}},O=[].concat(nD(S),[P]);return x=O[O.length-1].position,_.stackList&&_.stackList.length&&_.stackList.forEach(function(T){O.push({item:T,position:x})}),O},f)}else{var b=Wa(n,o,0,!0);o-2*b-(c-1)*u<=0&&(u=0);var w=(o-2*b-(c-1)*u)/c;w>1&&(w>>=0);var k=l===+l?Math.min(w,l):w;d=s.reduce(function(S,_,P){var O=[].concat(nD(S),[{item:_.item,position:{offset:b+(w+u)*P+(w-k)/2,size:k}}]);return _.stackList&&_.stackList.length&&_.stackList.forEach(function(T){O.push({item:T,position:O[O.length-1].position})}),O},f)}return d},nge=function(t,r,n,o){var a=n.children,s=n.width,l=n.margin,c=s-(l.left||0)-(l.right||0),u=ZH({children:a,legendWidth:c});if(u){var d=o||{},f=d.width,h=d.height,p=u.align,y=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&y==="middle")&&p!=="center"&&Bt(t[p]))return Ai(Ai({},t),{},nm({},p,t[p]+(f||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&y!=="middle"&&Bt(t[y]))return Ai(Ai({},t),{},nm({},y,t[y]+(h||0)))}return t},ige=function(t,r,n){return Rr(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},JH=function(t,r,n,o,a){var s=r.props.children,l=Ks(s,xb).filter(function(u){return ige(o,a,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=uo(d,n);if(Rr(f))return u;var h=Array.isArray(f)?[oS(f),iS(f)]:[f,f],p=c.reduce(function(y,m){var x=uo(d,m,0),b=h[0]-Math.abs(Array.isArray(x)?x[0]:x),w=h[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(b,y[0]),Math.max(w,y[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},oge=function(t,r,n,o,a){var s=r.map(function(l){return JH(t,l,n,a,o)}).filter(function(l){return!Rr(l)});return s&&s.length?s.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},eV=function(t,r,n,o,a){var s=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&JH(t,c,u,o)||qy(t,u,n,a)});if(n==="number")return s.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return s.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},tV=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},rV=function(t,r,n,o){if(o)return t.map(function(c){return c.coordinate});var a,s,l=t.map(function(c){return c.coordinate===r&&(a=!0),c.coordinate===n&&(s=!0),c.coordinate});return a||l.push(r),s||l.push(n),l},td=function(t,r,n){if(!t)return null;var o=t.scale,a=t.duplicateDomain,s=t.type,l=t.range,c=t.realScaleType==="scaleBand"?o.bandwidth()/2:2,u=(r||n)&&s==="category"&&o.bandwidth?o.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?Ba(l[0]-l[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=a?a.indexOf(f):f;return{coordinate:o(h)+u,value:f,offset:u}});return d.filter(function(f){return!fb(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:o(f)+u,value:f,index:h,offset:u}}):o.ticks&&!n?o.ticks(t.tickCount).map(function(f){return{coordinate:o(f)+u,value:f,offset:u}}):o.domain().map(function(f,h){return{coordinate:o(f)+u,value:a?a[f]:f,index:h,offset:u}})},HC=new WeakMap,B1=function(t,r){if(typeof r!="function")return t;HC.has(t)||HC.set(t,new WeakMap);var n=HC.get(t);if(n.has(r))return n.get(r);var o=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,o),o},nV=function(t,r,n){var o=t.scale,a=t.type,s=t.layout,l=t.axisType;if(o==="auto")return s==="radial"&&l==="radiusAxis"?{scale:hx(),realScaleType:"band"}:s==="radial"&&l==="angleAxis"?{scale:c2(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Wy(),realScaleType:"point"}:a==="category"?{scale:hx(),realScaleType:"band"}:{scale:c2(),realScaleType:"linear"};if(db(o)){var c="scale".concat($w(o));return{scale:($M[c]||Wy)(),realScaleType:$M[c]?c:"point"}}return Ar(o)?{scale:o}:{scale:Wy(),realScaleType:"point"}},oD=1e-4,iV=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,o=t.range(),a=Math.min(o[0],o[1])-oD,s=Math.max(o[0],o[1])+oD,l=t(r[0]),c=t(r[n-1]);(l<a||l>s||c<a||c>s)&&t.domain([r[0],r[n-1]])}},age=function(t,r){if(!t)return null;for(var n=0,o=t.length;n<o;n++)if(t[n].item===r)return t[n].position;return null},sge=function(t,r){if(!r||r.length!==2||!Bt(r[0])||!Bt(r[1]))return t;var n=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]),a=[t[0],t[1]];return(!Bt(t[0])||t[0]<n)&&(a[0]=n),(!Bt(t[1])||t[1]>o)&&(a[1]=o),a[0]>o&&(a[0]=o),a[1]<n&&(a[1]=n),a},lge=function(t){var r=t.length;if(!(r<=0))for(var n=0,o=t[0].length;n<o;++n)for(var a=0,s=0,l=0;l<r;++l){var c=fb(t[l][n][1])?t[l][n][0]:t[l][n][1];c>=0?(t[l][n][0]=a,t[l][n][1]=a+c,a=t[l][n][1]):(t[l][n][0]=s,t[l][n][1]=s+c,s=t[l][n][1])}},cge=function(t){var r=t.length;if(!(r<=0))for(var n=0,o=t[0].length;n<o;++n)for(var a=0,s=0;s<r;++s){var l=fb(t[s][n][1])?t[s][n][0]:t[s][n][1];l>=0?(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1]):(t[s][n][0]=0,t[s][n][1]=0)}},uge={sign:lge,expand:Zse,none:xm,silhouette:Jse,wiggle:ele,positive:cge},dge=function(t,r,n){var o=r.map(function(l){return l.props.dataKey}),a=uge[n],s=Xse().keys(o).value(function(l,c){return+uo(l,c,0)}).order(yE).offset(a);return s(t)},fge=function(t,r,n,o,a,s){if(!t)return null;var l=s?r.reverse():r,c={},u=l.reduce(function(f,h){var p,y=(p=h.type)!==null&&p!==void 0&&p.defaultProps?Ai(Ai({},h.type.defaultProps),h.props):h.props,m=y.stackId,x=y.hide;if(x)return f;var b=y[n],w=f[b]||{hasStack:!1,stackGroups:{}};if(ho(m)){var k=w.stackGroups[m]||{numericAxisId:n,cateAxisId:o,items:[]};k.items.push(h),w.hasStack=!0,w.stackGroups[m]=k}else w.stackGroups[vv("_stackId_")]={numericAxisId:n,cateAxisId:o,items:[h]};return Ai(Ai({},f),{},nm({},b,w))},c),d={};return Object.keys(u).reduce(function(f,h){var p=u[h];if(p.hasStack){var y={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,x){var b=p.stackGroups[x];return Ai(Ai({},m),{},nm({},x,{numericAxisId:n,cateAxisId:o,items:b.items,stackedData:dge(t,b.items,a)}))},y)}return Ai(Ai({},f),{},nm({},h,p))},d)},oV=function(t,r){var n=r.realScaleType,o=r.type,a=r.tickCount,s=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(a&&o==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=Che(u,a,l);return t.domain([oS(d),iS(d)]),{niceTicks:d}}if(a&&o==="number"){var f=t.domain(),h=Ehe(f,a,l);return{niceTicks:h}}return null};function aD(e){var t=e.axis,r=e.ticks,n=e.bandSize,o=e.entry,a=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Rr(o[t.dataKey])){var l=U0(r,"value",o[t.dataKey]);if(l)return l.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var c=uo(o,Rr(s)?t.dataKey:s);return Rr(c)?null:t.scale(c)}var sD=function(t){var r=t.axis,n=t.ticks,o=t.offset,a=t.bandSize,s=t.entry,l=t.index;if(r.type==="category")return n[l]?n[l].coordinate+o:null;var c=uo(s,r.dataKey,r.domain[l]);return Rr(c)?null:r.scale(c)-a/2+o},pge=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var o=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return o<=0&&a>=0?0:a<0?a:o}return n[0]},hge=function(t,r){var n,o=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ai(Ai({},t.type.defaultProps),t.props):t.props,a=o.stackId;if(ho(a)){var s=r[a];if(s){var l=s.items.indexOf(t);return l>=0?s.stackedData[l]:null}}return null},gge=function(t){return t.reduce(function(r,n){return[oS(n.concat([r[0]]).filter(Bt)),iS(n.concat([r[1]]).filter(Bt))]},[1/0,-1/0])},aV=function(t,r,n){return Object.keys(t).reduce(function(o,a){var s=t[a],l=s.stackedData,c=l.reduce(function(u,d){var f=gge(d.slice(r,n+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],o[0]),Math.max(c[1],o[1])]},[1/0,-1/0]).map(function(o){return o===1/0||o===-1/0?0:o})},lD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,cD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,$E=function(t,r,n){if(Ar(t))return t(r,n);if(!Array.isArray(t))return r;var o=[];if(Bt(t[0]))o[0]=n?t[0]:Math.min(t[0],r[0]);else if(lD.test(t[0])){var a=+lD.exec(t[0])[1];o[0]=r[0]-a}else Ar(t[0])?o[0]=t[0](r[0]):o[0]=r[0];if(Bt(t[1]))o[1]=n?t[1]:Math.max(t[1],r[1]);else if(cD.test(t[1])){var s=+cD.exec(t[1])[1];o[1]=r[1]+s}else Ar(t[1])?o[1]=t[1](r[1]):o[1]=r[1];return o},m2=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var o=t.scale.bandwidth();if(!n||o>0)return o}if(t&&r&&r.length>=2){for(var a=ET(r,function(f){return f.coordinate}),s=1/0,l=1,c=a.length;l<c;l++){var u=a[l],d=a[l-1];s=Math.min((u.coordinate||0)-(d.coordinate||0),s)}return s===1/0?0:s}return n?void 0:0},uD=function(t,r,n){return!t||!t.length||yb(t,Gs(n,"type.defaultProps.domain"))?r:t},sV=function(t,r){var n=t.type.defaultProps?Ai(Ai({},t.type.defaultProps),t.props):t.props,o=n.dataKey,a=n.name,s=n.unit,l=n.formatter,c=n.tooltipType,u=n.chartType,d=n.hide;return Ai(Ai({},vr(t,!1)),{},{dataKey:o,unit:s,formatter:l,name:a||o,color:JT(t),value:uo(r,o),type:c,payload:r,chartType:u,hide:d})};function jx(e){"@babel/helpers - typeof";return jx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jx(e)}function dD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Gu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dD(Object(r),!0).forEach(function(n){lV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function lV(e,t,r){return t=mge(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mge(e){var t=vge(e,"string");return jx(t)=="symbol"?t:t+""}function vge(e,t){if(jx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(jx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yge(e,t){return Sge(e)||wge(e,t)||bge(e,t)||xge()}function xge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bge(e,t){if(e){if(typeof e=="string")return fD(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fD(e,t)}}function fD(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function wge(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function Sge(e){if(Array.isArray(e))return e}var v2=Math.PI/180,jge=function(t){return t*180/Math.PI},Kn=function(t,r,n,o){return{x:t+Math.cos(-v2*o)*n,y:r+Math.sin(-v2*o)*n}},cV=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},kge=function(t,r,n,o,a){var s=t.width,l=t.height,c=t.startAngle,u=t.endAngle,d=Wa(t.cx,s,s/2),f=Wa(t.cy,l,l/2),h=cV(s,l,n),p=Wa(t.innerRadius,h,0),y=Wa(t.outerRadius,h,h*.8),m=Object.keys(r);return m.reduce(function(x,b){var w=r[b],k=w.domain,S=w.reversed,_;if(Rr(w.range))o==="angleAxis"?_=[c,u]:o==="radiusAxis"&&(_=[p,y]),S&&(_=[_[1],_[0]]);else{_=w.range;var P=_,O=yge(P,2);c=O[0],u=O[1]}var T=nV(w,a),R=T.realScaleType,I=T.scale;I.domain(k).range(_),iV(I);var E=oV(I,Gu(Gu({},w),{},{realScaleType:R})),A=Gu(Gu(Gu({},w),E),{},{range:_,radius:y,realScaleType:R,scale:I,cx:d,cy:f,innerRadius:p,outerRadius:y,startAngle:c,endAngle:u});return Gu(Gu({},x),{},lV({},b,A))},{})},_ge=function(t,r){var n=t.x,o=t.y,a=r.x,s=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(o-s,2))},Cge=function(t,r){var n=t.x,o=t.y,a=r.cx,s=r.cy,l=_ge({x:n,y:o},{x:a,y:s});if(l<=0)return{radius:l};var c=(n-a)/l,u=Math.acos(c);return o>s&&(u=2*Math.PI-u),{radius:l,angle:jge(u),angleInRadian:u}},Ege=function(t){var r=t.startAngle,n=t.endAngle,o=Math.floor(r/360),a=Math.floor(n/360),s=Math.min(o,a);return{startAngle:r-s*360,endAngle:n-s*360}},Age=function(t,r){var n=r.startAngle,o=r.endAngle,a=Math.floor(n/360),s=Math.floor(o/360),l=Math.min(a,s);return t+l*360},pD=function(t,r){var n=t.x,o=t.y,a=Cge({x:n,y:o},r),s=a.radius,l=a.angle,c=r.innerRadius,u=r.outerRadius;if(s<c||s>u)return!1;if(s===0)return!0;var d=Ege(r),f=d.startAngle,h=d.endAngle,p=l,y;if(f<=h){for(;p>h;)p-=360;for(;p<f;)p+=360;y=p>=f&&p<=h}else{for(;p>f;)p-=360;for(;p<h;)p+=360;y=p>=h&&p<=f}return y?Gu(Gu({},r),{},{radius:s,angle:Age(p,r)}):null},uV=function(t){return!j.isValidElement(t)&&!Ar(t)&&typeof t!="boolean"?t.className:""};function kx(e){"@babel/helpers - typeof";return kx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kx(e)}var Tge=["offset"];function Pge(e){return Rge(e)||Nge(e)||Ige(e)||Oge()}function Oge(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ige(e,t){if(e){if(typeof e=="string")return UE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return UE(e,t)}}function Nge(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Rge(e){if(Array.isArray(e))return UE(e)}function UE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Lge(e,t){if(e==null)return{};var r=Fge(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Fge(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function hD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function lo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hD(Object(r),!0).forEach(function(n){Mge(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mge(e,t,r){return t=Dge(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dge(e){var t=zge(e,"string");return kx(t)=="symbol"?t:t+""}function zge(e,t){if(kx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(kx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _x(){return _x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_x.apply(this,arguments)}var Bge=function(t){var r=t.value,n=t.formatter,o=Rr(t.children)?r:t.children;return Ar(n)?n(o):o},Wge=function(t,r){var n=Ba(r-t),o=Math.min(Math.abs(r-t),360);return n*o},qge=function(t,r,n){var o=t.position,a=t.viewBox,s=t.offset,l=t.className,c=a,u=c.cx,d=c.cy,f=c.innerRadius,h=c.outerRadius,p=c.startAngle,y=c.endAngle,m=c.clockWise,x=(f+h)/2,b=Wge(p,y),w=b>=0?1:-1,k,S;o==="insideStart"?(k=p+w*s,S=m):o==="insideEnd"?(k=y-w*s,S=!m):o==="end"&&(k=y+w*s,S=m),S=b<=0?S:!S;var _=Kn(u,d,x,k),P=Kn(u,d,x,k+(S?1:-1)*359),O="M".concat(_.x,",").concat(_.y,`
|
||
A`).concat(x,",").concat(x,",0,1,").concat(S?0:1,`,
|
||
`).concat(P.x,",").concat(P.y),T=Rr(t.id)?vv("recharts-radial-line-"):t.id;return ze.createElement("text",_x({},n,{dominantBaseline:"central",className:Lr("recharts-radial-bar-label",l)}),ze.createElement("defs",null,ze.createElement("path",{id:T,d:O})),ze.createElement("textPath",{xlinkHref:"#".concat(T)},r))},$ge=function(t){var r=t.viewBox,n=t.offset,o=t.position,a=r,s=a.cx,l=a.cy,c=a.innerRadius,u=a.outerRadius,d=a.startAngle,f=a.endAngle,h=(d+f)/2;if(o==="outside"){var p=Kn(s,l,u+n,h),y=p.x,m=p.y;return{x:y,y:m,textAnchor:y>=s?"start":"end",verticalAnchor:"middle"}}if(o==="center")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(o==="centerTop")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"start"};if(o==="centerBottom")return{x:s,y:l,textAnchor:"middle",verticalAnchor:"end"};var x=(c+u)/2,b=Kn(s,l,x,h),w=b.x,k=b.y;return{x:w,y:k,textAnchor:"middle",verticalAnchor:"middle"}},Uge=function(t){var r=t.viewBox,n=t.parentViewBox,o=t.offset,a=t.position,s=r,l=s.x,c=s.y,u=s.width,d=s.height,f=d>=0?1:-1,h=f*o,p=f>0?"end":"start",y=f>0?"start":"end",m=u>=0?1:-1,x=m*o,b=m>0?"end":"start",w=m>0?"start":"end";if(a==="top"){var k={x:l+u/2,y:c-f*o,textAnchor:"middle",verticalAnchor:p};return lo(lo({},k),n?{height:Math.max(c-n.y,0),width:u}:{})}if(a==="bottom"){var S={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:y};return lo(lo({},S),n?{height:Math.max(n.y+n.height-(c+d),0),width:u}:{})}if(a==="left"){var _={x:l-x,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return lo(lo({},_),n?{width:Math.max(_.x-n.x,0),height:d}:{})}if(a==="right"){var P={x:l+u+x,y:c+d/2,textAnchor:w,verticalAnchor:"middle"};return lo(lo({},P),n?{width:Math.max(n.x+n.width-P.x,0),height:d}:{})}var O=n?{width:u,height:d}:{};return a==="insideLeft"?lo({x:l+x,y:c+d/2,textAnchor:w,verticalAnchor:"middle"},O):a==="insideRight"?lo({x:l+u-x,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},O):a==="insideTop"?lo({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:y},O):a==="insideBottom"?lo({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:p},O):a==="insideTopLeft"?lo({x:l+x,y:c+h,textAnchor:w,verticalAnchor:y},O):a==="insideTopRight"?lo({x:l+u-x,y:c+h,textAnchor:b,verticalAnchor:y},O):a==="insideBottomLeft"?lo({x:l+x,y:c+d-h,textAnchor:w,verticalAnchor:p},O):a==="insideBottomRight"?lo({x:l+u-x,y:c+d-h,textAnchor:b,verticalAnchor:p},O):mv(a)&&(Bt(a.x)||Kp(a.x))&&(Bt(a.y)||Kp(a.y))?lo({x:l+Wa(a.x,u),y:c+Wa(a.y,d),textAnchor:"end",verticalAnchor:"end"},O):lo({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},O)},Hge=function(t){return"cx"in t&&Bt(t.cx)};function Fo(e){var t=e.offset,r=t===void 0?5:t,n=Lge(e,Tge),o=lo({offset:r},n),a=o.viewBox,s=o.position,l=o.value,c=o.children,u=o.content,d=o.className,f=d===void 0?"":d,h=o.textBreakAll;if(!a||Rr(l)&&Rr(c)&&!j.isValidElement(u)&&!Ar(u))return null;if(j.isValidElement(u))return j.cloneElement(u,o);var p;if(Ar(u)){if(p=j.createElement(u,o),j.isValidElement(p))return p}else p=Bge(o);var y=Hge(a),m=vr(o,!0);if(y&&(s==="insideStart"||s==="insideEnd"||s==="end"))return qge(o,p,m);var x=y?$ge(o):Uge(o);return ze.createElement(gh,_x({className:Lr("recharts-label",f)},m,x,{breakAll:h}),p)}Fo.displayName="Label";var dV=function(t){var r=t.cx,n=t.cy,o=t.angle,a=t.startAngle,s=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,p=t.top,y=t.left,m=t.width,x=t.height,b=t.clockWise,w=t.labelViewBox;if(w)return w;if(Bt(m)&&Bt(x)){if(Bt(f)&&Bt(h))return{x:f,y:h,width:m,height:x};if(Bt(p)&&Bt(y))return{x:p,y,width:m,height:x}}return Bt(f)&&Bt(h)?{x:f,y:h,width:0,height:0}:Bt(r)&&Bt(n)?{cx:r,cy:n,startAngle:a||o||0,endAngle:s||o||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:b}:t.viewBox?t.viewBox:{}},Vge=function(t,r){return t?t===!0?ze.createElement(Fo,{key:"label-implicit",viewBox:r}):ho(t)?ze.createElement(Fo,{key:"label-implicit",viewBox:r,value:t}):j.isValidElement(t)?t.type===Fo?j.cloneElement(t,{key:"label-implicit",viewBox:r}):ze.createElement(Fo,{key:"label-implicit",content:t,viewBox:r}):Ar(t)?ze.createElement(Fo,{key:"label-implicit",content:t,viewBox:r}):mv(t)?ze.createElement(Fo,_x({viewBox:r},t,{key:"label-implicit"})):null:null},Yge=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var o=t.children,a=dV(t),s=Ks(o,Fo).map(function(c,u){return j.cloneElement(c,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return s;var l=Vge(t.label,r||a);return[l].concat(Pge(s))};Fo.parseViewBox=dV;Fo.renderCallByParent=Yge;var VC,gD;function Gge(){if(gD)return VC;gD=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return VC=e,VC}var Kge=Gge();const Qge=un(Kge);function Cx(e){"@babel/helpers - typeof";return Cx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cx(e)}var Xge=["valueAccessor"],Zge=["data","dataKey","clockWise","id","textBreakAll"];function Jge(e){return nme(e)||rme(e)||tme(e)||eme()}function eme(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tme(e,t){if(e){if(typeof e=="string")return HE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return HE(e,t)}}function rme(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nme(e){if(Array.isArray(e))return HE(e)}function HE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function y2(){return y2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},y2.apply(this,arguments)}function mD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function vD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mD(Object(r),!0).forEach(function(n){ime(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ime(e,t,r){return t=ome(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ome(e){var t=ame(e,"string");return Cx(t)=="symbol"?t:t+""}function ame(e,t){if(Cx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Cx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yD(e,t){if(e==null)return{};var r=sme(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sme(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var lme=function(t){return Array.isArray(t.value)?Qge(t.value):t.value};function ld(e){var t=e.valueAccessor,r=t===void 0?lme:t,n=yD(e,Xge),o=n.data,a=n.dataKey,s=n.clockWise,l=n.id,c=n.textBreakAll,u=yD(n,Zge);return!o||!o.length?null:ze.createElement(ln,{className:"recharts-label-list"},o.map(function(d,f){var h=Rr(a)?r(d,f):uo(d&&d.payload,a),p=Rr(l)?{}:{id:"".concat(l,"-").concat(f)};return ze.createElement(Fo,y2({},vr(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:Fo.parseViewBox(Rr(s)?d:vD(vD({},d),{},{clockWise:s})),key:"label-".concat(f),index:f}))}))}ld.displayName="LabelList";function cme(e,t){return e?e===!0?ze.createElement(ld,{key:"labelList-implicit",data:t}):ze.isValidElement(e)||Ar(e)?ze.createElement(ld,{key:"labelList-implicit",data:t,content:e}):mv(e)?ze.createElement(ld,y2({data:t},e,{key:"labelList-implicit"})):null:null}function ume(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,o=Ks(n,ld).map(function(s,l){return j.cloneElement(s,{data:t,key:"labelList-".concat(l)})});if(!r)return o;var a=cme(e.label,t);return[a].concat(Jge(o))}ld.renderCallByParent=ume;function Ex(e){"@babel/helpers - typeof";return Ex=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ex(e)}function VE(){return VE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},VE.apply(this,arguments)}function xD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function bD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xD(Object(r),!0).forEach(function(n){dme(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dme(e,t,r){return t=fme(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fme(e){var t=pme(e,"string");return Ex(t)=="symbol"?t:t+""}function pme(e,t){if(Ex(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ex(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hme=function(t,r){var n=Ba(r-t),o=Math.min(Math.abs(r-t),359.999);return n*o},W1=function(t){var r=t.cx,n=t.cy,o=t.radius,a=t.angle,s=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+o,f=Math.asin(c/d)/v2,h=u?a:a+s*f,p=Kn(r,n,d,h),y=Kn(r,n,o,h),m=u?a-s*f:a,x=Kn(r,n,d*Math.cos(f*v2),m);return{center:p,circleTangency:y,lineTangency:x,theta:f}},fV=function(t){var r=t.cx,n=t.cy,o=t.innerRadius,a=t.outerRadius,s=t.startAngle,l=t.endAngle,c=hme(s,l),u=s+c,d=Kn(r,n,a,s),f=Kn(r,n,a,u),h="M ".concat(d.x,",").concat(d.y,`
|
||
A `).concat(a,",").concat(a,`,0,
|
||
`).concat(+(Math.abs(c)>180),",").concat(+(s>u),`,
|
||
`).concat(f.x,",").concat(f.y,`
|
||
`);if(o>0){var p=Kn(r,n,o,s),y=Kn(r,n,o,u);h+="L ".concat(y.x,",").concat(y.y,`
|
||
A `).concat(o,",").concat(o,`,0,
|
||
`).concat(+(Math.abs(c)>180),",").concat(+(s<=u),`,
|
||
`).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},gme=function(t){var r=t.cx,n=t.cy,o=t.innerRadius,a=t.outerRadius,s=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=Ba(d-u),h=W1({cx:r,cy:n,radius:a,angle:u,sign:f,cornerRadius:s,cornerIsExternal:c}),p=h.circleTangency,y=h.lineTangency,m=h.theta,x=W1({cx:r,cy:n,radius:a,angle:d,sign:-f,cornerRadius:s,cornerIsExternal:c}),b=x.circleTangency,w=x.lineTangency,k=x.theta,S=c?Math.abs(u-d):Math.abs(u-d)-m-k;if(S<0)return l?"M ".concat(y.x,",").concat(y.y,`
|
||
a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0
|
||
a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0
|
||
`):fV({cx:r,cy:n,innerRadius:o,outerRadius:a,startAngle:u,endAngle:d});var _="M ".concat(y.x,",").concat(y.y,`
|
||
A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(p.x,",").concat(p.y,`
|
||
A`).concat(a,",").concat(a,",0,").concat(+(S>180),",").concat(+(f<0),",").concat(b.x,",").concat(b.y,`
|
||
A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(w.x,",").concat(w.y,`
|
||
`);if(o>0){var P=W1({cx:r,cy:n,radius:o,angle:u,sign:f,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),O=P.circleTangency,T=P.lineTangency,R=P.theta,I=W1({cx:r,cy:n,radius:o,angle:d,sign:-f,isExternal:!0,cornerRadius:s,cornerIsExternal:c}),E=I.circleTangency,A=I.lineTangency,F=I.theta,L=c?Math.abs(u-d):Math.abs(u-d)-R-F;if(L<0&&s===0)return"".concat(_,"L").concat(r,",").concat(n,"Z");_+="L".concat(A.x,",").concat(A.y,`
|
||
A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(E.x,",").concat(E.y,`
|
||
A`).concat(o,",").concat(o,",0,").concat(+(L>180),",").concat(+(f>0),",").concat(O.x,",").concat(O.y,`
|
||
A`).concat(s,",").concat(s,",0,0,").concat(+(f<0),",").concat(T.x,",").concat(T.y,"Z")}else _+="L".concat(r,",").concat(n,"Z");return _},mme={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},pV=function(t){var r=bD(bD({},mme),t),n=r.cx,o=r.cy,a=r.innerRadius,s=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,d=r.startAngle,f=r.endAngle,h=r.className;if(s<a||d===f)return null;var p=Lr("recharts-sector",h),y=s-a,m=Wa(l,y,0,!0),x;return m>0&&Math.abs(d-f)<360?x=gme({cx:n,cy:o,innerRadius:a,outerRadius:s,cornerRadius:Math.min(m,y/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):x=fV({cx:n,cy:o,innerRadius:a,outerRadius:s,startAngle:d,endAngle:f}),ze.createElement("path",VE({},vr(r,!0),{className:p,d:x,role:"img"}))};function Ax(e){"@babel/helpers - typeof";return Ax=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ax(e)}function YE(){return YE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},YE.apply(this,arguments)}function wD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function SD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wD(Object(r),!0).forEach(function(n){vme(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vme(e,t,r){return t=yme(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yme(e){var t=xme(e,"string");return Ax(t)=="symbol"?t:t+""}function xme(e,t){if(Ax(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ax(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jD={curveBasisClosed:Bse,curveBasisOpen:Wse,curveBasis:zse,curveBumpX:_se,curveBumpY:Cse,curveLinearClosed:qse,curveLinear:Hw,curveMonotoneX:$se,curveMonotoneY:Use,curveNatural:Hse,curveStep:Vse,curveStepAfter:Gse,curveStepBefore:Yse},q1=function(t){return t.x===+t.x&&t.y===+t.y},py=function(t){return t.x},hy=function(t){return t.y},bme=function(t,r){if(Ar(t))return t;var n="curve".concat($w(t));return(n==="curveMonotone"||n==="curveBump")&&r?jD["".concat(n).concat(r==="vertical"?"Y":"X")]:jD[n]||Hw},wme=function(t){var r=t.type,n=r===void 0?"linear":r,o=t.points,a=o===void 0?[]:o,s=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=bme(n,l),f=u?a.filter(function(m){return q1(m)}):a,h;if(Array.isArray(s)){var p=u?s.filter(function(m){return q1(m)}):s,y=f.map(function(m,x){return SD(SD({},m),{},{base:p[x]})});return l==="vertical"?h=N1().y(hy).x1(py).x0(function(m){return m.base.x}):h=N1().x(py).y1(hy).y0(function(m){return m.base.y}),h.defined(q1).curve(d),h(y)}return l==="vertical"&&Bt(s)?h=N1().y(hy).x1(py).x0(s):Bt(s)?h=N1().x(py).y1(hy).y0(s):h=dU().x(py).y(hy),h.defined(q1).curve(d),h(f)},x2=function(t){var r=t.className,n=t.points,o=t.path,a=t.pathRef;if((!n||!n.length)&&!o)return null;var s=n&&n.length?wme(t):o;return ze.createElement("path",YE({},vr(t,!1),H0(t),{className:Lr("recharts-curve",r),d:s,ref:a}))},YC={exports:{}},GC,kD;function Sme(){if(kD)return GC;kD=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return GC=e,GC}var KC,_D;function jme(){if(_D)return KC;_D=1;var e=Sme();function t(){}function r(){}return r.resetWarningCache=t,KC=function(){function n(s,l,c,u,d,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}n.isRequired=n;function o(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return a.PropTypes=a,a},KC}var CD;function kme(){return CD||(CD=1,YC.exports=jme()()),YC.exports}var _me=kme();const bn=un(_me),{getOwnPropertyNames:Cme,getOwnPropertySymbols:Eme}=Object,{hasOwnProperty:Ame}=Object.prototype;function QC(e,t){return function(n,o,a){return e(n,o,a)&&t(n,o,a)}}function $1(e){return function(r,n,o){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,o);const{cache:a}=o,s=a.get(r),l=a.get(n);if(s&&l)return s===n&&l===r;a.set(r,n),a.set(n,r);const c=e(r,n,o);return a.delete(r),a.delete(n),c}}function Tme(e){return e!=null?e[Symbol.toStringTag]:void 0}function ED(e){return Cme(e).concat(Eme(e))}const Pme=Object.hasOwn||((e,t)=>Ame.call(e,t));function Lh(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Ome="__v",Ime="__o",Nme="_owner",{getOwnPropertyDescriptor:AD,keys:TD}=Object;function Rme(e,t){return e.byteLength===t.byteLength&&b2(new Uint8Array(e),new Uint8Array(t))}function Lme(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function Fme(e,t){return e.byteLength===t.byteLength&&b2(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Mme(e,t){return Lh(e.getTime(),t.getTime())}function Dme(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function zme(e,t){return e===t}function PD(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const o=new Array(n),a=e.entries();let s,l,c=0;for(;(s=a.next())&&!s.done;){const u=t.entries();let d=!1,f=0;for(;(l=u.next())&&!l.done;){if(o[f]){f++;continue}const h=s.value,p=l.value;if(r.equals(h[0],p[0],c,f,e,t,r)&&r.equals(h[1],p[1],h[0],p[0],e,t,r)){d=o[f]=!0;break}f++}if(!d)return!1;c++}return!0}const Bme=Lh;function Wme(e,t,r){const n=TD(e);let o=n.length;if(TD(t).length!==o)return!1;for(;o-- >0;)if(!hV(e,t,r,n[o]))return!1;return!0}function gy(e,t,r){const n=ED(e);let o=n.length;if(ED(t).length!==o)return!1;let a,s,l;for(;o-- >0;)if(a=n[o],!hV(e,t,r,a)||(s=AD(e,a),l=AD(t,a),(s||l)&&(!s||!l||s.configurable!==l.configurable||s.enumerable!==l.enumerable||s.writable!==l.writable)))return!1;return!0}function qme(e,t){return Lh(e.valueOf(),t.valueOf())}function $me(e,t){return e.source===t.source&&e.flags===t.flags}function OD(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const o=new Array(n),a=e.values();let s,l;for(;(s=a.next())&&!s.done;){const c=t.values();let u=!1,d=0;for(;(l=c.next())&&!l.done;){if(!o[d]&&r.equals(s.value,l.value,s.value,l.value,e,t,r)){u=o[d]=!0;break}d++}if(!u)return!1}return!0}function b2(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function Ume(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function hV(e,t,r,n){return(n===Nme||n===Ime||n===Ome)&&(e.$$typeof||t.$$typeof)?!0:Pme(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const Hme="[object ArrayBuffer]",Vme="[object Arguments]",Yme="[object Boolean]",Gme="[object DataView]",Kme="[object Date]",Qme="[object Error]",Xme="[object Map]",Zme="[object Number]",Jme="[object Object]",eve="[object RegExp]",tve="[object Set]",rve="[object String]",nve={"[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},ive="[object URL]",ove=Object.prototype.toString;function ave({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:o,areFunctionsEqual:a,areMapsEqual:s,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:f,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:y}){return function(x,b,w){if(x===b)return!0;if(x==null||b==null)return!1;const k=typeof x;if(k!==typeof b)return!1;if(k!=="object")return k==="number"?l(x,b,w):k==="function"?a(x,b,w):!1;const S=x.constructor;if(S!==b.constructor)return!1;if(S===Object)return c(x,b,w);if(Array.isArray(x))return t(x,b,w);if(S===Date)return n(x,b,w);if(S===RegExp)return d(x,b,w);if(S===Map)return s(x,b,w);if(S===Set)return f(x,b,w);const _=ove.call(x);if(_===Kme)return n(x,b,w);if(_===eve)return d(x,b,w);if(_===Xme)return s(x,b,w);if(_===tve)return f(x,b,w);if(_===Jme)return typeof x.then!="function"&&typeof b.then!="function"&&c(x,b,w);if(_===ive)return p(x,b,w);if(_===Qme)return o(x,b,w);if(_===Vme)return c(x,b,w);if(nve[_])return h(x,b,w);if(_===Hme)return e(x,b,w);if(_===Gme)return r(x,b,w);if(_===Yme||_===Zme||_===rve)return u(x,b,w);if(y){let P=y[_];if(!P){const O=Tme(x);O&&(P=y[O])}if(P)return P(x,b,w)}return!1}}function sve({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:Rme,areArraysEqual:r?gy:Lme,areDataViewsEqual:Fme,areDatesEqual:Mme,areErrorsEqual:Dme,areFunctionsEqual:zme,areMapsEqual:r?QC(PD,gy):PD,areNumbersEqual:Bme,areObjectsEqual:r?gy:Wme,arePrimitiveWrappersEqual:qme,areRegExpsEqual:$me,areSetsEqual:r?QC(OD,gy):OD,areTypedArraysEqual:r?QC(b2,gy):b2,areUrlsEqual:Ume,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const o=$1(n.areArraysEqual),a=$1(n.areMapsEqual),s=$1(n.areObjectsEqual),l=$1(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:l})}return n}function lve(e){return function(t,r,n,o,a,s,l){return e(t,r,l)}}function cve({circular:e,comparator:t,createState:r,equals:n,strict:o}){if(r)return function(l,c){const{cache:u=e?new WeakMap:void 0,meta:d}=r();return t(l,c,{cache:u,equals:n,meta:d,strict:o})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:n,meta:void 0,strict:o})};const a={cache:void 0,equals:n,meta:void 0,strict:o};return function(l,c){return t(l,c,a)}}const uve=Gf();Gf({strict:!0});Gf({circular:!0});Gf({circular:!0,strict:!0});Gf({createInternalComparator:()=>Lh});Gf({strict:!0,createInternalComparator:()=>Lh});Gf({circular:!0,createInternalComparator:()=>Lh});Gf({circular:!0,createInternalComparator:()=>Lh,strict:!0});function Gf(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:o=!1}=e,a=sve(e),s=ave(a),l=r?r(s):lve(s);return cve({circular:t,comparator:s,createState:n,equals:l,strict:o})}function dve(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function ID(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function o(a){r<0&&(r=a),a-r>t?(e(a),r=-1):dve(o)};requestAnimationFrame(n)}function GE(e){"@babel/helpers - typeof";return GE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},GE(e)}function fve(e){return mve(e)||gve(e)||hve(e)||pve()}function pve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hve(e,t){if(e){if(typeof e=="string")return ND(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ND(e,t)}}function ND(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function gve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mve(e){if(Array.isArray(e))return e}function vve(){var e={},t=function(){return null},r=!1,n=function o(a){if(!r){if(Array.isArray(a)){if(!a.length)return;var s=a,l=fve(s),c=l[0],u=l.slice(1);if(typeof c=="number"){ID(o.bind(null,u),c);return}o(c),ID(o.bind(null,u));return}GE(a)==="object"&&(e=a,t(e)),typeof a=="function"&&a()}};return{stop:function(){r=!0},start:function(a){r=!1,n(a)},subscribe:function(a){return t=a,function(){t=function(){return null}}}}}function Tx(e){"@babel/helpers - typeof";return Tx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tx(e)}function RD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function LD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?RD(Object(r),!0).forEach(function(n){gV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):RD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gV(e,t,r){return t=yve(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yve(e){var t=xve(e,"string");return Tx(t)==="symbol"?t:String(t)}function xve(e,t){if(Tx(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Tx(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bve=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,o){return n.filter(function(a){return o.includes(a)})})},wve=function(t){return t},Sve=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},$y=function(t,r){return Object.keys(r).reduce(function(n,o){return LD(LD({},n),{},gV({},o,t(o,r[o])))},{})},FD=function(t,r,n){return t.map(function(o){return"".concat(Sve(o)," ").concat(r,"ms ").concat(n)}).join(",")};function jve(e,t){return Cve(e)||_ve(e,t)||mV(e,t)||kve()}function kve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _ve(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function Cve(e){if(Array.isArray(e))return e}function Eve(e){return Pve(e)||Tve(e)||mV(e)||Ave()}function Ave(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mV(e,t){if(e){if(typeof e=="string")return KE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return KE(e,t)}}function Tve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Pve(e){if(Array.isArray(e))return KE(e)}function KE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var w2=1e-4,vV=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},yV=function(t,r){return t.map(function(n,o){return n*Math.pow(r,o)}).reduce(function(n,o){return n+o})},MD=function(t,r){return function(n){var o=vV(t,r);return yV(o,n)}},Ove=function(t,r){return function(n){var o=vV(t,r),a=[].concat(Eve(o.map(function(s,l){return s*l}).slice(1)),[0]);return yV(a,n)}},DD=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var o=r[0],a=r[1],s=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":o=0,a=0,s=1,l=1;break;case"ease":o=.25,a=.1,s=.25,l=1;break;case"ease-in":o=.42,a=0,s=1,l=1;break;case"ease-out":o=.42,a=0,s=.58,l=1;break;case"ease-in-out":o=0,a=0,s=.58,l=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(x){return parseFloat(x)}),d=jve(u,4);o=d[0],a=d[1],s=d[2],l=d[3]}}}var f=MD(o,s),h=MD(a,l),p=Ove(o,s),y=function(b){return b>1?1:b<0?0:b},m=function(b){for(var w=b>1?1:b,k=w,S=0;S<8;++S){var _=f(k)-w,P=p(k);if(Math.abs(_-w)<w2||P<w2)return h(k);k=y(k-_/P)}return h(k)};return m.isStepper=!1,m},Ive=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,o=t.damping,a=o===void 0?8:o,s=t.dt,l=s===void 0?17:s,c=function(d,f,h){var p=-(d-f)*n,y=h*a,m=h+(p-y)*l/1e3,x=h*l/1e3+d;return Math.abs(x-f)<w2&&Math.abs(m)<w2?[f,0]:[x,m]};return c.isStepper=!0,c.dt=l,c},Nve=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var o=r[0];if(typeof o=="string")switch(o){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return DD(o);case"spring":return Ive();default:if(o.split("(")[0]==="cubic-bezier")return DD(o)}return typeof o=="function"?o:null};function Px(e){"@babel/helpers - typeof";return Px=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Px(e)}function zD(e){return Fve(e)||Lve(e)||xV(e)||Rve()}function Rve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Fve(e){if(Array.isArray(e))return XE(e)}function BD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Qo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?BD(Object(r),!0).forEach(function(n){QE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function QE(e,t,r){return t=Mve(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mve(e){var t=Dve(e,"string");return Px(t)==="symbol"?t:String(t)}function Dve(e,t){if(Px(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Px(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zve(e,t){return qve(e)||Wve(e,t)||xV(e,t)||Bve()}function Bve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xV(e,t){if(e){if(typeof e=="string")return XE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return XE(e,t)}}function XE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wve(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function qve(e){if(Array.isArray(e))return e}var S2=function(t,r,n){return t+(r-t)*n},ZE=function(t){var r=t.from,n=t.to;return r!==n},$ve=function e(t,r,n){var o=$y(function(a,s){if(ZE(s)){var l=t(s.from,s.to,s.velocity),c=zve(l,2),u=c[0],d=c[1];return Qo(Qo({},s),{},{from:u,velocity:d})}return s},r);return n<1?$y(function(a,s){return ZE(s)?Qo(Qo({},s),{},{velocity:S2(s.velocity,o[a].velocity,n),from:S2(s.from,o[a].from,n)}):s},r):e(t,o,n-1)};const Uve=(function(e,t,r,n,o){var a=bve(e,t),s=a.reduce(function(x,b){return Qo(Qo({},x),{},QE({},b,[e[b],t[b]]))},{}),l=a.reduce(function(x,b){return Qo(Qo({},x),{},QE({},b,{from:e[b],velocity:0,to:t[b]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return $y(function(b,w){return w.from},l)},p=function(){return!Object.values(l).filter(ZE).length},y=function(b){u||(u=b);var w=b-u,k=w/r.dt;l=$ve(r,l,k),o(Qo(Qo(Qo({},e),t),h())),u=b,p()||(c=requestAnimationFrame(f))},m=function(b){d||(d=b);var w=(b-d)/n,k=$y(function(_,P){return S2.apply(void 0,zD(P).concat([r(w)]))},s);if(o(Qo(Qo(Qo({},e),t),k)),w<1)c=requestAnimationFrame(f);else{var S=$y(function(_,P){return S2.apply(void 0,zD(P).concat([r(1)]))},s);o(Qo(Qo(Qo({},e),t),S))}};return f=r.isStepper?y:m,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}});function Am(e){"@babel/helpers - typeof";return Am=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Am(e)}var Hve=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Vve(e,t){if(e==null)return{};var r=Yve(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Yve(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}function XC(e){return Xve(e)||Qve(e)||Kve(e)||Gve()}function Gve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kve(e,t){if(e){if(typeof e=="string")return JE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return JE(e,t)}}function Qve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Xve(e){if(Array.isArray(e))return JE(e)}function JE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function WD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Kl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?WD(Object(r),!0).forEach(function(n){Ny(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):WD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ny(e,t,r){return t=bV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jve(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,bV(n.key),n)}}function eye(e,t,r){return t&&Jve(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function bV(e){var t=tye(e,"string");return Am(t)==="symbol"?t:String(t)}function tye(e,t){if(Am(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Am(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rye(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eA(e,t)}function eA(e,t){return eA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},eA(e,t)}function nye(e){var t=iye();return function(){var n=j2(e),o;if(t){var a=j2(this).constructor;o=Reflect.construct(n,arguments,a)}else o=n.apply(this,arguments);return tA(this,o)}}function tA(e,t){if(t&&(Am(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rA(e)}function rA(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iye(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function j2(e){return j2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},j2(e)}var eu=(function(e){rye(r,e);var t=nye(r);function r(n,o){var a;Zve(this,r),a=t.call(this,n,o);var s=a.props,l=s.isActive,c=s.attributeName,u=s.from,d=s.to,f=s.steps,h=s.children,p=s.duration;if(a.handleStyleChange=a.handleStyleChange.bind(rA(a)),a.changeStyle=a.changeStyle.bind(rA(a)),!l||p<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:d}),tA(a);if(f&&f.length)a.state={style:f[0].style};else if(u){if(typeof h=="function")return a.state={style:u},tA(a);a.state={style:c?Ny({},c,u):u}}else a.state={style:{}};return a}return eye(r,[{key:"componentDidMount",value:function(){var o=this.props,a=o.isActive,s=o.canBegin;this.mounted=!0,!(!a||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(o){var a=this.props,s=a.isActive,l=a.canBegin,c=a.attributeName,u=a.shouldReAnimate,d=a.to,f=a.from,h=this.state.style;if(l){if(!s){var p={style:c?Ny({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(p);return}if(!(uve(o.to,d)&&o.canBegin&&o.isActive)){var y=!o.canBegin||!o.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=y||u?f:o.to;if(this.state&&h){var x={style:c?Ny({},c,m):m};(c&&h[c]!==m||!c&&h!==m)&&this.setState(x)}this.runAnimation(Kl(Kl({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var o=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),o&&o()}},{key:"handleStyleChange",value:function(o){this.changeStyle(o)}},{key:"changeStyle",value:function(o){this.mounted&&this.setState({style:o})}},{key:"runJSAnimation",value:function(o){var a=this,s=o.from,l=o.to,c=o.duration,u=o.easing,d=o.begin,f=o.onAnimationEnd,h=o.onAnimationStart,p=Uve(s,l,Nve(u),c,this.changeStyle),y=function(){a.stopJSAnimation=p()};this.manager.start([h,d,y,c,f])}},{key:"runStepAnimation",value:function(o){var a=this,s=o.steps,l=o.begin,c=o.onAnimationStart,u=s[0],d=u.style,f=u.duration,h=f===void 0?0:f,p=function(m,x,b){if(b===0)return m;var w=x.duration,k=x.easing,S=k===void 0?"ease":k,_=x.style,P=x.properties,O=x.onAnimationEnd,T=b>0?s[b-1]:x,R=P||Object.keys(_);if(typeof S=="function"||S==="spring")return[].concat(XC(m),[a.runJSAnimation.bind(a,{from:T.style,to:_,duration:w,easing:S}),w]);var I=FD(R,w,S),E=Kl(Kl(Kl({},T.style),_),{},{transition:I});return[].concat(XC(m),[E,w,O]).filter(wve)};return this.manager.start([c].concat(XC(s.reduce(p,[d,Math.max(h,l)])),[o.onAnimationEnd]))}},{key:"runAnimation",value:function(o){this.manager||(this.manager=vve());var a=o.begin,s=o.duration,l=o.attributeName,c=o.to,u=o.easing,d=o.onAnimationStart,f=o.onAnimationEnd,h=o.steps,p=o.children,y=this.manager;if(this.unSubscribe=y.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(o);return}if(h.length>1){this.runStepAnimation(o);return}var m=l?Ny({},l,c):c,x=FD(Object.keys(m),s,u);y.start([d,a,Kl(Kl({},m),{},{transition:x}),s,f])}},{key:"render",value:function(){var o=this.props,a=o.children;o.begin;var s=o.duration;o.attributeName,o.easing;var l=o.isActive;o.steps,o.from,o.to,o.canBegin,o.onAnimationEnd,o.shouldReAnimate,o.onAnimationReStart;var c=Vve(o,Hve),u=j.Children.count(a),d=this.state.style;if(typeof a=="function")return a(d);if(!l||u===0||s<=0)return a;var f=function(p){var y=p.props,m=y.style,x=m===void 0?{}:m,b=y.className,w=j.cloneElement(p,Kl(Kl({},c),{},{style:Kl(Kl({},x),d),className:b}));return w};return u===1?f(j.Children.only(a)):ze.createElement("div",null,j.Children.map(a,function(h){return f(h)}))}}]),r})(j.PureComponent);eu.displayName="Animate";eu.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};eu.propTypes={from:bn.oneOfType([bn.object,bn.string]),to:bn.oneOfType([bn.object,bn.string]),attributeName:bn.string,duration:bn.number,begin:bn.number,easing:bn.oneOfType([bn.string,bn.func]),steps:bn.arrayOf(bn.shape({duration:bn.number.isRequired,style:bn.object.isRequired,easing:bn.oneOfType([bn.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),bn.func]),properties:bn.arrayOf("string"),onAnimationEnd:bn.func})),children:bn.oneOfType([bn.node,bn.func]),isActive:bn.bool,canBegin:bn.bool,onAnimationEnd:bn.func,shouldReAnimate:bn.bool,onAnimationStart:bn.func,onAnimationReStart:bn.func};function Ox(e){"@babel/helpers - typeof";return Ox=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ox(e)}function k2(){return k2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},k2.apply(this,arguments)}function oye(e,t){return cye(e)||lye(e,t)||sye(e,t)||aye()}function aye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sye(e,t){if(e){if(typeof e=="string")return qD(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qD(e,t)}}function qD(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function lye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function cye(e){if(Array.isArray(e))return e}function $D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function UD(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$D(Object(r),!0).forEach(function(n){uye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$D(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uye(e,t,r){return t=dye(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dye(e){var t=fye(e,"string");return Ox(t)=="symbol"?t:t+""}function fye(e,t){if(Ox(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ox(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var HD=function(t,r,n,o,a){var s=Math.min(Math.abs(n)/2,Math.abs(o)/2),l=o>=0?1:-1,c=n>=0?1:-1,u=o>=0&&n>=0||o<0&&n<0?1:0,d;if(s>0&&a instanceof Array){for(var f=[0,0,0,0],h=0,p=4;h<p;h++)f[h]=a[h]>s?s:a[h];d="M".concat(t,",").concat(r+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(r)),d+="L ".concat(t+n-c*f[1],",").concat(r),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
|
||
`).concat(t+n,",").concat(r+l*f[1])),d+="L ".concat(t+n,",").concat(r+o-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
|
||
`).concat(t+n-c*f[2],",").concat(r+o)),d+="L ".concat(t+c*f[3],",").concat(r+o),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
|
||
`).concat(t,",").concat(r+o-l*f[3])),d+="Z"}else if(s>0&&a===+a&&a>0){var y=Math.min(s,a);d="M ".concat(t,",").concat(r+l*y,`
|
||
A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(t+c*y,",").concat(r,`
|
||
L `).concat(t+n-c*y,",").concat(r,`
|
||
A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(t+n,",").concat(r+l*y,`
|
||
L `).concat(t+n,",").concat(r+o-l*y,`
|
||
A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(t+n-c*y,",").concat(r+o,`
|
||
L `).concat(t+c*y,",").concat(r+o,`
|
||
A `).concat(y,",").concat(y,",0,0,").concat(u,",").concat(t,",").concat(r+o-l*y," Z")}else d="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(o," h ").concat(-n," Z");return d},pye=function(t,r){if(!t||!r)return!1;var n=t.x,o=t.y,a=r.x,s=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(a,a+l),d=Math.max(a,a+l),f=Math.min(s,s+c),h=Math.max(s,s+c);return n>=u&&n<=d&&o>=f&&o<=h}return!1},hye={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},eP=function(t){var r=UD(UD({},hye),t),n=j.useRef(),o=j.useState(-1),a=oye(o,2),s=a[0],l=a[1];j.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&l(S)}catch{}},[]);var c=r.x,u=r.y,d=r.width,f=r.height,h=r.radius,p=r.className,y=r.animationEasing,m=r.animationDuration,x=r.animationBegin,b=r.isAnimationActive,w=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var k=Lr("recharts-rectangle",p);return w?ze.createElement(eu,{canBegin:s>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:m,animationEasing:y,isActive:w},function(S){var _=S.width,P=S.height,O=S.x,T=S.y;return ze.createElement(eu,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:m,isActive:b,easing:y},ze.createElement("path",k2({},vr(r,!0),{className:k,d:HD(O,T,_,P,h),ref:n})))}):ze.createElement("path",k2({},vr(r,!0),{className:k,d:HD(c,u,d,f,h)}))},gye=["points","className","baseLinePoints","connectNulls"];function Ug(){return Ug=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ug.apply(this,arguments)}function mye(e,t){if(e==null)return{};var r=vye(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function vye(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function VD(e){return wye(e)||bye(e)||xye(e)||yye()}function yye(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xye(e,t){if(e){if(typeof e=="string")return nA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nA(e,t)}}function bye(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wye(e){if(Array.isArray(e))return nA(e)}function nA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var YD=function(t){return t&&t.x===+t.x&&t.y===+t.y},Sye=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){YD(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),YD(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Uy=function(t,r){var n=Sye(t);r&&(n=[n.reduce(function(a,s){return[].concat(VD(a),VD(s))},[])]);var o=n.map(function(a){return a.reduce(function(s,l,c){return"".concat(s).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return n.length===1?"".concat(o,"Z"):o},jye=function(t,r,n){var o=Uy(t,n);return"".concat(o.slice(-1)==="Z"?o.slice(0,-1):o,"L").concat(Uy(r.reverse(),n).slice(1))},kye=function(t){var r=t.points,n=t.className,o=t.baseLinePoints,a=t.connectNulls,s=mye(t,gye);if(!r||!r.length)return null;var l=Lr("recharts-polygon",n);if(o&&o.length){var c=s.stroke&&s.stroke!=="none",u=jye(r,o,a);return ze.createElement("g",{className:l},ze.createElement("path",Ug({},vr(s,!0),{fill:u.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:u})),c?ze.createElement("path",Ug({},vr(s,!0),{fill:"none",d:Uy(r,a)})):null,c?ze.createElement("path",Ug({},vr(s,!0),{fill:"none",d:Uy(o,a)})):null)}var d=Uy(r,a);return ze.createElement("path",Ug({},vr(s,!0),{fill:d.slice(-1)==="Z"?s.fill:"none",className:l,d}))};function iA(){return iA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iA.apply(this,arguments)}var lS=function(t){var r=t.cx,n=t.cy,o=t.r,a=t.className,s=Lr("recharts-dot",a);return r===+r&&n===+n&&o===+o?ze.createElement("circle",iA({},vr(t,!1),H0(t),{className:s,cx:r,cy:n,r:o})):null};function Ix(e){"@babel/helpers - typeof";return Ix=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ix(e)}var _ye=["x","y","top","left","width","height","className"];function oA(){return oA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oA.apply(this,arguments)}function GD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Cye(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?GD(Object(r),!0).forEach(function(n){Eye(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):GD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Eye(e,t,r){return t=Aye(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Aye(e){var t=Tye(e,"string");return Ix(t)=="symbol"?t:t+""}function Tye(e,t){if(Ix(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ix(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pye(e,t){if(e==null)return{};var r=Oye(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Oye(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Iye=function(t,r,n,o,a,s){return"M".concat(t,",").concat(a,"v").concat(o,"M").concat(s,",").concat(r,"h").concat(n)},Nye=function(t){var r=t.x,n=r===void 0?0:r,o=t.y,a=o===void 0?0:o,s=t.top,l=s===void 0?0:s,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,h=t.height,p=h===void 0?0:h,y=t.className,m=Pye(t,_ye),x=Cye({x:n,y:a,top:l,left:u,width:f,height:p},m);return!Bt(n)||!Bt(a)||!Bt(f)||!Bt(p)||!Bt(l)||!Bt(u)?null:ze.createElement("path",oA({},vr(x,!0),{className:Lr("recharts-cross",y),d:Iye(n,a,f,p,l,u)}))},ZC,KD;function Rye(){if(KD)return ZC;KD=1;var e=nS(),t=RH(),r=su();function n(o,a){return o&&o.length?e(o,r(a,2),t):void 0}return ZC=n,ZC}var Lye=Rye();const Fye=un(Lye);var JC,QD;function Mye(){if(QD)return JC;QD=1;var e=nS(),t=su(),r=LH();function n(o,a){return o&&o.length?e(o,t(a,2),r):void 0}return JC=n,JC}var Dye=Mye();const zye=un(Dye);var Bye=["cx","cy","angle","ticks","axisLine"],Wye=["ticks","tick","angle","tickFormatter","stroke"];function Tm(e){"@babel/helpers - typeof";return Tm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tm(e)}function Hy(){return Hy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hy.apply(this,arguments)}function XD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function _p(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?XD(Object(r),!0).forEach(function(n){cS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XD(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ZD(e,t){if(e==null)return{};var r=qye(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qye(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function $ye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JD(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,SV(n.key),n)}}function Uye(e,t,r){return t&&JD(e.prototype,t),r&&JD(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hye(e,t,r){return t=_2(t),Vye(e,wV()?Reflect.construct(t,r||[],_2(e).constructor):t.apply(e,r))}function Vye(e,t){if(t&&(Tm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yye(e)}function Yye(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wV=function(){return!!e})()}function _2(e){return _2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_2(e)}function Gye(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&aA(e,t)}function aA(e,t){return aA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},aA(e,t)}function cS(e,t,r){return t=SV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SV(e){var t=Kye(e,"string");return Tm(t)=="symbol"?t:t+""}function Kye(e,t){if(Tm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Tm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uS=(function(e){function t(){return $ye(this,t),Hye(this,t,arguments)}return Gye(t,e),Uye(t,[{key:"getTickValueCoord",value:function(n){var o=n.coordinate,a=this.props,s=a.angle,l=a.cx,c=a.cy;return Kn(l,c,o,s)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,o;switch(n){case"left":o="end";break;case"right":o="start";break;default:o="middle";break}return o}},{key:"getViewBox",value:function(){var n=this.props,o=n.cx,a=n.cy,s=n.angle,l=n.ticks,c=Fye(l,function(d){return d.coordinate||0}),u=zye(l,function(d){return d.coordinate||0});return{cx:o,cy:a,startAngle:s,endAngle:s,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,o=n.cx,a=n.cy,s=n.angle,l=n.ticks,c=n.axisLine,u=ZD(n,Bye),d=l.reduce(function(y,m){return[Math.min(y[0],m.coordinate),Math.max(y[1],m.coordinate)]},[1/0,-1/0]),f=Kn(o,a,d[0],s),h=Kn(o,a,d[1],s),p=_p(_p(_p({},vr(u,!1)),{},{fill:"none"},vr(c,!1)),{},{x1:f.x,y1:f.y,x2:h.x,y2:h.y});return ze.createElement("line",Hy({className:"recharts-polar-radius-axis-line"},p))}},{key:"renderTicks",value:function(){var n=this,o=this.props,a=o.ticks,s=o.tick,l=o.angle,c=o.tickFormatter,u=o.stroke,d=ZD(o,Wye),f=this.getTickTextAnchor(),h=vr(d,!1),p=vr(s,!1),y=a.map(function(m,x){var b=n.getTickValueCoord(m),w=_p(_p(_p(_p({textAnchor:f,transform:"rotate(".concat(90-l,", ").concat(b.x,", ").concat(b.y,")")},h),{},{stroke:"none",fill:u},p),{},{index:x},b),{},{payload:m});return ze.createElement(ln,Hy({className:Lr("recharts-polar-radius-axis-tick",uV(s)),key:"tick-".concat(m.coordinate)},hh(n.props,m,x)),t.renderTickItem(s,w,c?c(m.value,x):m.value))});return ze.createElement(ln,{className:"recharts-polar-radius-axis-ticks"},y)}},{key:"render",value:function(){var n=this.props,o=n.ticks,a=n.axisLine,s=n.tick;return!o||!o.length?null:ze.createElement(ln,{className:Lr("recharts-polar-radius-axis",this.props.className)},a&&this.renderAxisLine(),s&&this.renderTicks(),Fo.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,o,a){var s;return ze.isValidElement(n)?s=ze.cloneElement(n,o):Ar(n)?s=n(o):s=ze.createElement(gh,Hy({},o,{className:"recharts-polar-radius-axis-tick-value"}),a),s}}])})(j.PureComponent);cS(uS,"displayName","PolarRadiusAxis");cS(uS,"axisType","radiusAxis");cS(uS,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Pm(e){"@babel/helpers - typeof";return Pm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pm(e)}function Vp(){return Vp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vp.apply(this,arguments)}function ez(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Cp(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ez(Object(r),!0).forEach(function(n){dS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ez(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tz(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,kV(n.key),n)}}function Xye(e,t,r){return t&&tz(e.prototype,t),r&&tz(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zye(e,t,r){return t=C2(t),Jye(e,jV()?Reflect.construct(t,r||[],C2(e).constructor):t.apply(e,r))}function Jye(e,t){if(t&&(Pm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return exe(e)}function exe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jV=function(){return!!e})()}function C2(e){return C2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},C2(e)}function txe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sA(e,t)}function sA(e,t){return sA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},sA(e,t)}function dS(e,t,r){return t=kV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kV(e){var t=rxe(e,"string");return Pm(t)=="symbol"?t:t+""}function rxe(e,t){if(Pm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Pm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nxe=Math.PI/180,rz=1e-5,fS=(function(e){function t(){return Qye(this,t),Zye(this,t,arguments)}return txe(t,e),Xye(t,[{key:"getTickLineCoord",value:function(n){var o=this.props,a=o.cx,s=o.cy,l=o.radius,c=o.orientation,u=o.tickSize,d=u||8,f=Kn(a,s,l,n.coordinate),h=Kn(a,s,l+(c==="inner"?-1:1)*d,n.coordinate);return{x1:f.x,y1:f.y,x2:h.x,y2:h.y}}},{key:"getTickTextAnchor",value:function(n){var o=this.props.orientation,a=Math.cos(-n.coordinate*nxe),s;return a>rz?s=o==="outer"?"start":"end":a<-rz?s=o==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var n=this.props,o=n.cx,a=n.cy,s=n.radius,l=n.axisLine,c=n.axisLineType,u=Cp(Cp({},vr(this.props,!1)),{},{fill:"none"},vr(l,!1));if(c==="circle")return ze.createElement(lS,Vp({className:"recharts-polar-angle-axis-line"},u,{cx:o,cy:a,r:s}));var d=this.props.ticks,f=d.map(function(h){return Kn(o,a,s,h.coordinate)});return ze.createElement(kye,Vp({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var n=this,o=this.props,a=o.ticks,s=o.tick,l=o.tickLine,c=o.tickFormatter,u=o.stroke,d=vr(this.props,!1),f=vr(s,!1),h=Cp(Cp({},d),{},{fill:"none"},vr(l,!1)),p=a.map(function(y,m){var x=n.getTickLineCoord(y),b=n.getTickTextAnchor(y),w=Cp(Cp(Cp({textAnchor:b},d),{},{stroke:"none",fill:u},f),{},{index:m,payload:y,x:x.x2,y:x.y2});return ze.createElement(ln,Vp({className:Lr("recharts-polar-angle-axis-tick",uV(s)),key:"tick-".concat(y.coordinate)},hh(n.props,y,m)),l&&ze.createElement("line",Vp({className:"recharts-polar-angle-axis-tick-line"},h,x)),s&&t.renderTickItem(s,w,c?c(y.value,m):y.value))});return ze.createElement(ln,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,o=n.ticks,a=n.radius,s=n.axisLine;return a<=0||!o||!o.length?null:ze.createElement(ln,{className:Lr("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,o,a){var s;return ze.isValidElement(n)?s=ze.cloneElement(n,o):Ar(n)?s=n(o):s=ze.createElement(gh,Vp({},o,{className:"recharts-polar-angle-axis-tick-value"}),a),s}}])})(j.PureComponent);dS(fS,"displayName","PolarAngleAxis");dS(fS,"axisType","angleAxis");dS(fS,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var e4,nz;function ixe(){if(nz)return e4;nz=1;var e=RU(),t=e(Object.getPrototypeOf,Object);return e4=t,e4}var t4,iz;function oxe(){if(iz)return t4;iz=1;var e=wd(),t=ixe(),r=Sd(),n="[object Object]",o=Function.prototype,a=Object.prototype,s=o.toString,l=a.hasOwnProperty,c=s.call(Object);function u(d){if(!r(d)||e(d)!=n)return!1;var f=t(d);if(f===null)return!0;var h=l.call(f,"constructor")&&f.constructor;return typeof h=="function"&&h instanceof h&&s.call(h)==c}return t4=u,t4}var axe=oxe();const sxe=un(axe);var r4,oz;function lxe(){if(oz)return r4;oz=1;var e=wd(),t=Sd(),r="[object Boolean]";function n(o){return o===!0||o===!1||t(o)&&e(o)==r}return r4=n,r4}var cxe=lxe();const uxe=un(cxe);function Nx(e){"@babel/helpers - typeof";return Nx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nx(e)}function E2(){return E2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},E2.apply(this,arguments)}function dxe(e,t){return gxe(e)||hxe(e,t)||pxe(e,t)||fxe()}function fxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pxe(e,t){if(e){if(typeof e=="string")return az(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return az(e,t)}}function az(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hxe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function gxe(e){if(Array.isArray(e))return e}function sz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function lz(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sz(Object(r),!0).forEach(function(n){mxe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sz(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mxe(e,t,r){return t=vxe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vxe(e){var t=yxe(e,"string");return Nx(t)=="symbol"?t:t+""}function yxe(e,t){if(Nx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Nx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cz=function(t,r,n,o,a){var s=n-o,l;return l="M ".concat(t,",").concat(r),l+="L ".concat(t+n,",").concat(r),l+="L ".concat(t+n-s/2,",").concat(r+a),l+="L ".concat(t+n-s/2-o,",").concat(r+a),l+="L ".concat(t,",").concat(r," Z"),l},xxe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},bxe=function(t){var r=lz(lz({},xxe),t),n=j.useRef(),o=j.useState(-1),a=dxe(o,2),s=a[0],l=a[1];j.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var k=n.current.getTotalLength();k&&l(k)}catch{}},[]);var c=r.x,u=r.y,d=r.upperWidth,f=r.lowerWidth,h=r.height,p=r.className,y=r.animationEasing,m=r.animationDuration,x=r.animationBegin,b=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var w=Lr("recharts-trapezoid",p);return b?ze.createElement(eu,{canBegin:s>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:m,animationEasing:y,isActive:b},function(k){var S=k.upperWidth,_=k.lowerWidth,P=k.height,O=k.x,T=k.y;return ze.createElement(eu,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:m,easing:y},ze.createElement("path",E2({},vr(r,!0),{className:w,d:cz(O,T,S,_,P),ref:n})))}):ze.createElement("g",null,ze.createElement("path",E2({},vr(r,!0),{className:w,d:cz(c,u,d,f,h)})))},wxe=["option","shapeType","propTransformer","activeClassName","isActive"];function Rx(e){"@babel/helpers - typeof";return Rx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rx(e)}function Sxe(e,t){if(e==null)return{};var r=jxe(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jxe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function A2(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uz(Object(r),!0).forEach(function(n){kxe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uz(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kxe(e,t,r){return t=_xe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _xe(e){var t=Cxe(e,"string");return Rx(t)=="symbol"?t:t+""}function Cxe(e,t){if(Rx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Rx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Exe(e,t){return A2(A2({},t),e)}function Axe(e,t){return e==="symbols"}function dz(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return ze.createElement(eP,r);case"trapezoid":return ze.createElement(bxe,r);case"sector":return ze.createElement(pV,r);case"symbols":if(Axe(t))return ze.createElement(xT,r);break;default:return null}}function Txe(e){return j.isValidElement(e)?e.props:e}function _V(e){var t=e.option,r=e.shapeType,n=e.propTransformer,o=n===void 0?Exe:n,a=e.activeClassName,s=a===void 0?"recharts-active-shape":a,l=e.isActive,c=Sxe(e,wxe),u;if(j.isValidElement(t))u=j.cloneElement(t,A2(A2({},c),Txe(t)));else if(Ar(t))u=t(c);else if(sxe(t)&&!uxe(t)){var d=o(t,c);u=ze.createElement(dz,{shapeType:r,elementProps:d})}else{var f=c;u=ze.createElement(dz,{shapeType:r,elementProps:f})}return l?ze.createElement(ln,{className:s},u):u}function pS(e,t){return t!=null&&"trapezoids"in e.props}function hS(e,t){return t!=null&&"sectors"in e.props}function Lx(e,t){return t!=null&&"points"in e.props}function Pxe(e,t){var r,n,o=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,a=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return o&&a}function Oxe(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function Ixe(e,t){var r=e.x===t.x,n=e.y===t.y,o=e.z===t.z;return r&&n&&o}function Nxe(e,t){var r;return pS(e,t)?r=Pxe:hS(e,t)?r=Oxe:Lx(e,t)&&(r=Ixe),r}function Rxe(e,t){var r;return pS(e,t)?r="trapezoids":hS(e,t)?r="sectors":Lx(e,t)&&(r="points"),r}function Lxe(e,t){if(pS(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(hS(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return Lx(e,t)?t.payload:{}}function Fxe(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,o=Rxe(r,t),a=Lxe(r,t),s=n.filter(function(c,u){var d=yb(a,c),f=r.props[o].filter(function(y){var m=Nxe(r,t);return m(y,t)}),h=r.props[o].indexOf(f[f.length-1]),p=u===h;return d&&p}),l=n.indexOf(s[s.length-1]);return l}var v0;function Om(e){"@babel/helpers - typeof";return Om=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Om(e)}function Hg(){return Hg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hg.apply(this,arguments)}function fz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Hn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fz(Object(r),!0).forEach(function(n){_l(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fz(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mxe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pz(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,EV(n.key),n)}}function Dxe(e,t,r){return t&&pz(e.prototype,t),r&&pz(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function zxe(e,t,r){return t=T2(t),Bxe(e,CV()?Reflect.construct(t,r||[],T2(e).constructor):t.apply(e,r))}function Bxe(e,t){if(t&&(Om(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wxe(e)}function Wxe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function CV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CV=function(){return!!e})()}function T2(e){return T2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},T2(e)}function qxe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lA(e,t)}function lA(e,t){return lA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},lA(e,t)}function _l(e,t,r){return t=EV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EV(e){var t=$xe(e,"string");return Om(t)=="symbol"?t:t+""}function $xe(e,t){if(Om(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Om(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var kd=(function(e){function t(r){var n;return Mxe(this,t),n=zxe(this,t,[r]),_l(n,"pieRef",null),_l(n,"sectorRefs",[]),_l(n,"id",vv("recharts-pie-")),_l(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Ar(o)&&o()}),_l(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Ar(o)&&o()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return qxe(t,e),Dxe(t,[{key:"isActiveIndex",value:function(n){var o=this.props.activeIndex;return Array.isArray(o)?o.indexOf(n)!==-1:n===o}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.label,l=a.labelLine,c=a.dataKey,u=a.valueKey,d=vr(this.props,!1),f=vr(s,!1),h=vr(l,!1),p=s&&s.offsetRadius||20,y=n.map(function(m,x){var b=(m.startAngle+m.endAngle)/2,w=Kn(m.cx,m.cy,m.outerRadius+p,b),k=Hn(Hn(Hn(Hn({},d),m),{},{stroke:"none"},f),{},{index:x,textAnchor:t.getTextAnchor(w.x,m.cx)},w),S=Hn(Hn(Hn(Hn({},d),m),{},{fill:"none",stroke:m.fill},h),{},{index:x,points:[Kn(m.cx,m.cy,m.outerRadius,b),w]}),_=c;return Rr(c)&&Rr(u)?_="value":Rr(c)&&(_=u),ze.createElement(ln,{key:"label-".concat(m.startAngle,"-").concat(m.endAngle,"-").concat(m.midAngle,"-").concat(x)},l&&t.renderLabelLineItem(l,S,"line"),t.renderLabelItem(s,k,uo(m,_)))});return ze.createElement(ln,{className:"recharts-pie-labels"},y)}},{key:"renderSectorsStatically",value:function(n){var o=this,a=this.props,s=a.activeShape,l=a.blendStroke,c=a.inactiveShape;return n.map(function(u,d){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&n.length!==1)return null;var f=o.isActiveIndex(d),h=c&&o.hasActiveIndex()?c:null,p=f?s:h,y=Hn(Hn({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return ze.createElement(ln,Hg({ref:function(x){x&&!o.sectorRefs.includes(x)&&o.sectorRefs.push(x)},tabIndex:-1,className:"recharts-pie-sector"},hh(o.props,u,d),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(d)}),ze.createElement(_V,Hg({option:p,isActive:f,shapeType:"sector"},y)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,o=this.props,a=o.sectors,s=o.isAnimationActive,l=o.animationBegin,c=o.animationDuration,u=o.animationEasing,d=o.animationId,f=this.state,h=f.prevSectors,p=f.prevIsAnimationActive;return ze.createElement(eu,{begin:l,duration:c,isActive:s,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d,"-").concat(p),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(y){var m=y.t,x=[],b=a&&a[0],w=b.startAngle;return a.forEach(function(k,S){var _=h&&h[S],P=S>0?Gs(k,"paddingAngle",0):0;if(_){var O=Ws(_.endAngle-_.startAngle,k.endAngle-k.startAngle),T=Hn(Hn({},k),{},{startAngle:w+P,endAngle:w+O(m)+P});x.push(T),w=T.endAngle}else{var R=k.endAngle,I=k.startAngle,E=Ws(0,R-I),A=E(m),F=Hn(Hn({},k),{},{startAngle:w+P,endAngle:w+A+P});x.push(F),w=F.endAngle}}),ze.createElement(ln,null,n.renderSectorsStatically(x))})}},{key:"attachKeyboardHandlers",value:function(n){var o=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var s=++o.state.sectorToFocus%o.sectorRefs.length;o.sectorRefs[s].focus(),o.setState({sectorToFocus:s});break}case"ArrowRight":{var l=--o.state.sectorToFocus<0?o.sectorRefs.length-1:o.state.sectorToFocus%o.sectorRefs.length;o.sectorRefs[l].focus(),o.setState({sectorToFocus:l});break}case"Escape":{o.sectorRefs[o.state.sectorToFocus].blur(),o.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,o=n.sectors,a=n.isAnimationActive,s=this.state.prevSectors;return a&&o&&o.length&&(!s||!yb(s,o))?this.renderSectorsWithAnimation():this.renderSectorsStatically(o)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,o=this.props,a=o.hide,s=o.sectors,l=o.className,c=o.label,u=o.cx,d=o.cy,f=o.innerRadius,h=o.outerRadius,p=o.isAnimationActive,y=this.state.isAnimationFinished;if(a||!s||!s.length||!Bt(u)||!Bt(d)||!Bt(f)||!Bt(h))return null;var m=Lr("recharts-pie",l);return ze.createElement(ln,{tabIndex:this.props.rootTabIndex,className:m,ref:function(b){n.pieRef=b}},this.renderSectors(),c&&this.renderLabels(s),Fo.renderCallByParent(this.props,null,!1),(!p||y)&&ld.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,o){return o.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==o.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:o.curSectors,isAnimationFinished:!0}:n.sectors!==o.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,o){return n>o?"start":n<o?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,o,a){if(ze.isValidElement(n))return ze.cloneElement(n,o);if(Ar(n))return n(o);var s=Lr("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return ze.createElement(x2,Hg({},o,{key:a,type:"linear",className:s}))}},{key:"renderLabelItem",value:function(n,o,a){if(ze.isValidElement(n))return ze.cloneElement(n,o);var s=a;if(Ar(n)&&(s=n(o),ze.isValidElement(s)))return s;var l=Lr("recharts-pie-label-text",typeof n!="boolean"&&!Ar(n)?n.className:"");return ze.createElement(gh,Hg({},o,{alignmentBaseline:"middle",className:l}),s)}}])})(j.PureComponent);v0=kd;_l(kd,"displayName","Pie");_l(kd,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!Ih.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});_l(kd,"parseDeltaAngle",function(e,t){var r=Ba(t-e),n=Math.min(Math.abs(t-e),360);return r*n});_l(kd,"getRealPieData",function(e){var t=e.data,r=e.children,n=vr(e,!1),o=Ks(r,Qw);return t&&t.length?t.map(function(a,s){return Hn(Hn(Hn({payload:a},n),a),o&&o[s]&&o[s].props)}):o&&o.length?o.map(function(a){return Hn(Hn({},n),a.props)}):[]});_l(kd,"parseCoordinateOfPie",function(e,t){var r=t.top,n=t.left,o=t.width,a=t.height,s=cV(o,a),l=n+Wa(e.cx,o,o/2),c=r+Wa(e.cy,a,a/2),u=Wa(e.innerRadius,s,0),d=Wa(e.outerRadius,s,s*.8),f=e.maxRadius||Math.sqrt(o*o+a*a)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:d,maxRadius:f}});_l(kd,"getComposedData",function(e){var t=e.item,r=e.offset,n=t.type.defaultProps!==void 0?Hn(Hn({},t.type.defaultProps),t.props):t.props,o=v0.getRealPieData(n);if(!o||!o.length)return null;var a=n.cornerRadius,s=n.startAngle,l=n.endAngle,c=n.paddingAngle,u=n.dataKey,d=n.nameKey,f=n.valueKey,h=n.tooltipType,p=Math.abs(n.minAngle),y=v0.parseCoordinateOfPie(n,r),m=v0.parseDeltaAngle(s,l),x=Math.abs(m),b=u;Rr(u)&&Rr(f)?(ac(!1,`Use "dataKey" to specify the value of pie,
|
||
the props "valueKey" will be deprecated in 1.1.0`),b="value"):Rr(u)&&(ac(!1,`Use "dataKey" to specify the value of pie,
|
||
the props "valueKey" will be deprecated in 1.1.0`),b=f);var w=o.filter(function(T){return uo(T,b,0)!==0}).length,k=(x>=360?w:w-1)*c,S=x-w*p-k,_=o.reduce(function(T,R){var I=uo(R,b,0);return T+(Bt(I)?I:0)},0),P;if(_>0){var O;P=o.map(function(T,R){var I=uo(T,b,0),E=uo(T,d,R),A=(Bt(I)?I:0)/_,F;R?F=O.endAngle+Ba(m)*c*(I!==0?1:0):F=s;var L=F+Ba(m)*((I!==0?p:0)+A*S),z=(F+L)/2,V=(y.innerRadius+y.outerRadius)/2,Q=[{name:E,value:I,payload:T,dataKey:b,type:h}],U=Kn(y.cx,y.cy,V,z);return O=Hn(Hn(Hn({percent:A,cornerRadius:a,name:E,tooltipPayload:Q,midAngle:z,middleRadius:V,tooltipPosition:U},T),y),{},{value:uo(T,b),startAngle:F,endAngle:L,payload:T,paddingAngle:Ba(m)*c}),O})}return Hn(Hn({},y),{},{sectors:P,data:o})});var n4,hz;function Uxe(){if(hz)return n4;hz=1;var e=Math.ceil,t=Math.max;function r(n,o,a,s){for(var l=-1,c=t(e((o-n)/(a||1)),0),u=Array(c);c--;)u[s?c:++l]=n,n+=a;return u}return n4=r,n4}var i4,gz;function AV(){if(gz)return i4;gz=1;var e=QU(),t=1/0,r=17976931348623157e292;function n(o){if(!o)return o===0?o:0;if(o=e(o),o===t||o===-t){var a=o<0?-1:1;return a*r}return o===o?o:0}return i4=n,i4}var o4,mz;function Hxe(){if(mz)return o4;mz=1;var e=Uxe(),t=Kw(),r=AV();function n(o){return function(a,s,l){return l&&typeof l!="number"&&t(a,s,l)&&(s=l=void 0),a=r(a),s===void 0?(s=a,a=0):s=r(s),l=l===void 0?a<s?1:-1:r(l),e(a,s,l,o)}}return o4=n,o4}var a4,vz;function Vxe(){if(vz)return a4;vz=1;var e=Hxe(),t=e();return a4=t,a4}var Yxe=Vxe();const P2=un(Yxe);function Fx(e){"@babel/helpers - typeof";return Fx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fx(e)}function yz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function xz(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yz(Object(r),!0).forEach(function(n){TV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yz(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TV(e,t,r){return t=Gxe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gxe(e){var t=Kxe(e,"string");return Fx(t)=="symbol"?t:t+""}function Kxe(e,t){if(Fx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qxe=["Webkit","Moz","O","ms"],Xxe=function(t,r){var n=t.replace(/(\w)/,function(a){return a.toUpperCase()}),o=Qxe.reduce(function(a,s){return xz(xz({},a),{},TV({},s+n,r))},{});return o[t]=r,o};function Im(e){"@babel/helpers - typeof";return Im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Im(e)}function O2(){return O2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},O2.apply(this,arguments)}function bz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function s4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bz(Object(r),!0).forEach(function(n){zs(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bz(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zxe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wz(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,OV(n.key),n)}}function Jxe(e,t,r){return t&&wz(e.prototype,t),r&&wz(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ebe(e,t,r){return t=I2(t),tbe(e,PV()?Reflect.construct(t,r||[],I2(e).constructor):t.apply(e,r))}function tbe(e,t){if(t&&(Im(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rbe(e)}function rbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function PV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(PV=function(){return!!e})()}function I2(e){return I2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},I2(e)}function nbe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cA(e,t)}function cA(e,t){return cA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},cA(e,t)}function zs(e,t,r){return t=OV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OV(e){var t=ibe(e,"string");return Im(t)=="symbol"?t:t+""}function ibe(e,t){if(Im(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Im(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var obe=function(t){var r=t.data,n=t.startIndex,o=t.endIndex,a=t.x,s=t.width,l=t.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=Wy().domain(P2(0,c)).range([a,a+s-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(o),scale:u,scaleValues:d}},Sz=function(t){return t.changedTouches&&!!t.changedTouches.length},Nm=(function(e){function t(r){var n;return Zxe(this,t),n=ebe(this,t,[r]),zs(n,"handleDrag",function(o){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(o):n.state.isSlideMoving&&n.handleSlideDrag(o)}),zs(n,"handleTouchMove",function(o){o.changedTouches!=null&&o.changedTouches.length>0&&n.handleDrag(o.changedTouches[0])}),zs(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var o=n.props,a=o.endIndex,s=o.onDragEnd,l=o.startIndex;s==null||s({endIndex:a,startIndex:l})}),n.detachDragEndListener()}),zs(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),zs(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),zs(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),zs(n,"handleSlideDragStart",function(o){var a=Sz(o)?o.changedTouches[0]:o;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return nbe(t,e),Jxe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var o=n.startX,a=n.endX,s=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(o,a),h=Math.max(o,a),p=t.getIndexInRange(s,f),y=t.getIndexInRange(s,h);return{startIndex:p-p%c,endIndex:y===d?d:y-y%c}}},{key:"getTextOfTick",value:function(n){var o=this.props,a=o.data,s=o.tickFormatter,l=o.dataKey,c=uo(a[n],l,n);return Ar(s)?s(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var o=this.state,a=o.slideMoveStartX,s=o.startX,l=o.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,p=c.endIndex,y=c.onChange,m=n.pageX-a;m>0?m=Math.min(m,u+d-f-l,u+d-f-s):m<0&&(m=Math.max(m,u-s,u-l));var x=this.getIndex({startX:s+m,endX:l+m});(x.startIndex!==h||x.endIndex!==p)&&y&&y(x),this.setState({startX:s+m,endX:l+m,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,o){var a=Sz(o)?o.changedTouches[0]:o;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var o=this.state,a=o.brushMoveStartX,s=o.movingTravellerId,l=o.endX,c=o.startX,u=this.state[s],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,y=d.onChange,m=d.gap,x=d.data,b={startX:this.state.startX,endX:this.state.endX},w=n.pageX-a;w>0?w=Math.min(w,f+h-p-u):w<0&&(w=Math.max(w,f-u)),b[s]=u+w;var k=this.getIndex(b),S=k.startIndex,_=k.endIndex,P=function(){var T=x.length-1;return s==="startX"&&(l>c?S%m===0:_%m===0)||l<c&&_===T||s==="endX"&&(l>c?_%m===0:S%m===0)||l>c&&_===T};this.setState(zs(zs({},s,u+w),"brushMoveStartX",n.pageX),function(){y&&P()&&y(k)})}},{key:"handleTravellerMoveKeyboard",value:function(n,o){var a=this,s=this.state,l=s.scaleValues,c=s.startX,u=s.endX,d=this.state[o],f=l.indexOf(d);if(f!==-1){var h=f+n;if(!(h===-1||h>=l.length)){var p=l[h];o==="startX"&&p>=u||o==="endX"&&p<=c||this.setState(zs({},o,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,o=n.x,a=n.y,s=n.width,l=n.height,c=n.fill,u=n.stroke;return ze.createElement("rect",{stroke:u,fill:c,x:o,y:a,width:s,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,o=n.x,a=n.y,s=n.width,l=n.height,c=n.data,u=n.children,d=n.padding,f=j.Children.only(u);return f?ze.cloneElement(f,{x:o,y:a,width:s,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,o){var a,s,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,p=c.ariaLabel,y=c.data,m=c.startIndex,x=c.endIndex,b=Math.max(n,this.props.x),w=s4(s4({},vr(this.props,!1)),{},{x:b,y:u,width:d,height:f}),k=p||"Min value: ".concat((a=y[m])===null||a===void 0?void 0:a.name,", Max value: ").concat((s=y[x])===null||s===void 0?void 0:s.name);return ze.createElement(ln,{tabIndex:0,role:"slider","aria-label":k,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[o],onTouchStart:this.travellerDragStartHandlers[o],onKeyDown:function(_){["ArrowLeft","ArrowRight"].includes(_.key)&&(_.preventDefault(),_.stopPropagation(),l.handleTravellerMoveKeyboard(_.key==="ArrowRight"?1:-1,o))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,w))}},{key:"renderSlide",value:function(n,o){var a=this.props,s=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,d=Math.min(n,o)+u,f=Math.max(Math.abs(o-n)-u,0);return ze.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:s,width:f,height:l})}},{key:"renderText",value:function(){var n=this.props,o=n.startIndex,a=n.endIndex,s=n.y,l=n.height,c=n.travellerWidth,u=n.stroke,d=this.state,f=d.startX,h=d.endX,p=5,y={pointerEvents:"none",fill:u};return ze.createElement(ln,{className:"recharts-brush-texts"},ze.createElement(gh,O2({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:s+l/2},y),this.getTextOfTick(o)),ze.createElement(gh,O2({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+p,y:s+l/2},y),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,o=n.data,a=n.className,s=n.children,l=n.x,c=n.y,u=n.width,d=n.height,f=n.alwaysShowText,h=this.state,p=h.startX,y=h.endX,m=h.isTextActive,x=h.isSlideMoving,b=h.isTravellerMoving,w=h.isTravellerFocused;if(!o||!o.length||!Bt(l)||!Bt(c)||!Bt(u)||!Bt(d)||u<=0||d<=0)return null;var k=Lr("recharts-brush",a),S=ze.Children.count(s)===1,_=Xxe("userSelect","none");return ze.createElement(ln,{className:k,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:_},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,y),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(y,"endX"),(m||x||b||w||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var o=n.x,a=n.y,s=n.width,l=n.height,c=n.stroke,u=Math.floor(a+l/2)-1;return ze.createElement(ze.Fragment,null,ze.createElement("rect",{x:o,y:a,width:s,height:l,fill:c,stroke:"none"}),ze.createElement("line",{x1:o+1,y1:u,x2:o+s-1,y2:u,fill:"none",stroke:"#fff"}),ze.createElement("line",{x1:o+1,y1:u+2,x2:o+s-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,o){var a;return ze.isValidElement(n)?a=ze.cloneElement(n,o):Ar(n)?a=n(o):a=t.renderDefaultTraveller(o),a}},{key:"getDerivedStateFromProps",value:function(n,o){var a=n.data,s=n.width,l=n.x,c=n.travellerWidth,u=n.updateId,d=n.startIndex,f=n.endIndex;if(a!==o.prevData||u!==o.prevUpdateId)return s4({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s},a&&a.length?obe({data:a,width:s,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(o.scale&&(s!==o.prevWidth||l!==o.prevX||c!==o.prevTravellerWidth)){o.scale.range([l,l+s-c]);var h=o.scale.domain().map(function(p){return o.scale(p)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s,startX:o.scale(n.startIndex),endX:o.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,o){for(var a=n.length,s=0,l=a-1;l-s>1;){var c=Math.floor((s+l)/2);n[c]>o?l=c:s=c}return o>=n[l]?l:s}}])})(j.PureComponent);zs(Nm,"displayName","Brush");zs(Nm,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var l4,jz;function abe(){if(jz)return l4;jz=1;var e=CT();function t(r,n){var o;return e(r,function(a,s,l){return o=n(a,s,l),!o}),!!o}return l4=t,l4}var c4,kz;function sbe(){if(kz)return c4;kz=1;var e=EU(),t=su(),r=abe(),n=ms(),o=Kw();function a(s,l,c){var u=n(s)?e:r;return c&&o(s,l,c)&&(l=void 0),u(s,t(l,3))}return c4=a,c4}var lbe=sbe();const cbe=un(lbe);var Xc=function(t,r){var n=t.alwaysShow,o=t.ifOverflow;return n&&(o="extendDomain"),o===r},u4,_z;function ube(){if(_z)return u4;_z=1;var e=HU();function t(r,n,o){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:o,writable:!0}):r[n]=o}return u4=t,u4}var d4,Cz;function dbe(){if(Cz)return d4;Cz=1;var e=ube(),t=$U(),r=su();function n(o,a){var s={};return a=r(a,3),t(o,function(l,c,u){e(s,c,a(l,c,u))}),s}return d4=n,d4}var fbe=dbe();const pbe=un(fbe);var f4,Ez;function hbe(){if(Ez)return f4;Ez=1;function e(t,r){for(var n=-1,o=t==null?0:t.length;++n<o;)if(!r(t[n],n,t))return!1;return!0}return f4=e,f4}var p4,Az;function gbe(){if(Az)return p4;Az=1;var e=CT();function t(r,n){var o=!0;return e(r,function(a,s,l){return o=!!n(a,s,l),o}),o}return p4=t,p4}var h4,Tz;function mbe(){if(Tz)return h4;Tz=1;var e=hbe(),t=gbe(),r=su(),n=ms(),o=Kw();function a(s,l,c){var u=n(s)?e:t;return c&&o(s,l,c)&&(l=void 0),u(s,r(l,3))}return h4=a,h4}var vbe=mbe();const IV=un(vbe);var ybe=["x","y"];function Mx(e){"@babel/helpers - typeof";return Mx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mx(e)}function uA(){return uA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uA.apply(this,arguments)}function Pz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function my(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Pz(Object(r),!0).forEach(function(n){xbe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pz(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xbe(e,t,r){return t=bbe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bbe(e){var t=wbe(e,"string");return Mx(t)=="symbol"?t:t+""}function wbe(e,t){if(Mx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Mx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sbe(e,t){if(e==null)return{};var r=jbe(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jbe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function kbe(e,t){var r=e.x,n=e.y,o=Sbe(e,ybe),a="".concat(r),s=parseInt(a,10),l="".concat(n),c=parseInt(l,10),u="".concat(t.height||o.height),d=parseInt(u,10),f="".concat(t.width||o.width),h=parseInt(f,10);return my(my(my(my(my({},t),o),s?{x:s}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function Oz(e){return ze.createElement(_V,uA({shapeType:"rectangle",propTransformer:kbe,activeClassName:"recharts-active-bar"},e))}var _be=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,o){if(typeof t=="number")return t;var a=typeof n=="number";return a?t(n,o):(a||vh(),r)}},Cbe=["value","background"],NV;function Rm(e){"@babel/helpers - typeof";return Rm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rm(e)}function Ebe(e,t){if(e==null)return{};var r=Abe(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Abe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function N2(){return N2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},N2.apply(this,arguments)}function Iz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Qi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Iz(Object(r),!0).forEach(function(n){kf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Iz(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nz(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,LV(n.key),n)}}function Pbe(e,t,r){return t&&Nz(e.prototype,t),r&&Nz(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Obe(e,t,r){return t=R2(t),Ibe(e,RV()?Reflect.construct(t,r||[],R2(e).constructor):t.apply(e,r))}function Ibe(e,t){if(t&&(Rm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nbe(e)}function Nbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RV=function(){return!!e})()}function R2(e){return R2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},R2(e)}function Rbe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dA(e,t)}function dA(e,t){return dA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},dA(e,t)}function kf(e,t,r){return t=LV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LV(e){var t=Lbe(e,"string");return Rm(t)=="symbol"?t:t+""}function Lbe(e,t){if(Rm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Rm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Ff=(function(e){function t(){var r;Tbe(this,t);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return r=Obe(this,t,[].concat(o)),kf(r,"state",{isAnimationFinished:!1}),kf(r,"id",vv("recharts-bar-")),kf(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),s&&s()}),kf(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),s&&s()}),r}return Rbe(t,e),Pbe(t,[{key:"renderRectanglesStatically",value:function(n){var o=this,a=this.props,s=a.shape,l=a.dataKey,c=a.activeIndex,u=a.activeBar,d=vr(this.props,!1);return n&&n.map(function(f,h){var p=h===c,y=p?u:s,m=Qi(Qi(Qi({},d),f),{},{isActive:p,option:y,index:h,dataKey:l,onAnimationStart:o.handleAnimationStart,onAnimationEnd:o.handleAnimationEnd});return ze.createElement(ln,N2({className:"recharts-bar-rectangle"},hh(o.props,f,h),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(h)}),ze.createElement(Oz,m))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,o=this.props,a=o.data,s=o.layout,l=o.isAnimationActive,c=o.animationBegin,u=o.animationDuration,d=o.animationEasing,f=o.animationId,h=this.state.prevData;return ze.createElement(eu,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var y=p.t,m=a.map(function(x,b){var w=h&&h[b];if(w){var k=Ws(w.x,x.x),S=Ws(w.y,x.y),_=Ws(w.width,x.width),P=Ws(w.height,x.height);return Qi(Qi({},x),{},{x:k(y),y:S(y),width:_(y),height:P(y)})}if(s==="horizontal"){var O=Ws(0,x.height),T=O(y);return Qi(Qi({},x),{},{y:x.y+x.height-T,height:T})}var R=Ws(0,x.width),I=R(y);return Qi(Qi({},x),{},{width:I})});return ze.createElement(ln,null,n.renderRectanglesStatically(m))})}},{key:"renderRectangles",value:function(){var n=this.props,o=n.data,a=n.isAnimationActive,s=this.state.prevData;return a&&o&&o.length&&(!s||!yb(s,o))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(o)}},{key:"renderBackground",value:function(){var n=this,o=this.props,a=o.data,s=o.dataKey,l=o.activeIndex,c=vr(this.props.background,!1);return a.map(function(u,d){u.value;var f=u.background,h=Ebe(u,Cbe);if(!f)return null;var p=Qi(Qi(Qi(Qi(Qi({},h),{},{fill:"#eee"},f),c),hh(n.props,u,d)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:s,index:d,className:"recharts-bar-background-rectangle"});return ze.createElement(Oz,N2({key:"background-bar-".concat(d),option:n.props.background,isActive:d===l},p))})}},{key:"renderErrorBar",value:function(n,o){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.data,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=Ks(d,xb);if(!f)return null;var h=u==="vertical"?s[0].height/2:s[0].width/2,p=function(x,b){var w=Array.isArray(x.value)?x.value[1]:x.value;return{x:x.x,y:x.y,value:w,errorVal:uo(x,b)}},y={clipPath:n?"url(#clipPath-".concat(o,")"):null};return ze.createElement(ln,y,f.map(function(m){return ze.cloneElement(m,{key:"error-bar-".concat(o,"-").concat(m.props.dataKey),data:s,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:p})}))}},{key:"render",value:function(){var n=this.props,o=n.hide,a=n.data,s=n.className,l=n.xAxis,c=n.yAxis,u=n.left,d=n.top,f=n.width,h=n.height,p=n.isAnimationActive,y=n.background,m=n.id;if(o||!a||!a.length)return null;var x=this.state.isAnimationFinished,b=Lr("recharts-bar",s),w=l&&l.allowDataOverflow,k=c&&c.allowDataOverflow,S=w||k,_=Rr(m)?this.id:m;return ze.createElement(ln,{className:b},w||k?ze.createElement("defs",null,ze.createElement("clipPath",{id:"clipPath-".concat(_)},ze.createElement("rect",{x:w?u:u-f/2,y:k?d:d-h/2,width:w?f:f*2,height:k?h:h*2}))):null,ze.createElement(ln,{className:"recharts-bar-rectangles",clipPath:S?"url(#clipPath-".concat(_,")"):null},y?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(S,_),(!p||x)&&ld.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(n,o){return n.animationId!==o.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:o.curData}:n.data!==o.curData?{curData:n.data}:null}}])})(j.PureComponent);NV=Ff;kf(Ff,"displayName","Bar");kf(Ff,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Ih.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});kf(Ff,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,o=e.bandSize,a=e.xAxis,s=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=age(n,r);if(!p)return null;var y=t.layout,m=r.type.defaultProps,x=m!==void 0?Qi(Qi({},m),r.props):r.props,b=x.dataKey,w=x.children,k=x.minPointSize,S=y==="horizontal"?s:a,_=u?S.scale.domain():null,P=pge({numericAxis:S}),O=Ks(w,Qw),T=f.map(function(R,I){var E,A,F,L,z,V;u?E=sge(u[d+I],_):(E=uo(R,b),Array.isArray(E)||(E=[P,E]));var Q=_be(k,NV.defaultProps.minPointSize)(E[1],I);if(y==="horizontal"){var U,ee=[s.scale(E[0]),s.scale(E[1])],H=ee[0],B=ee[1];A=sD({axis:a,ticks:l,bandSize:o,offset:p.offset,entry:R,index:I}),F=(U=B??H)!==null&&U!==void 0?U:void 0,L=p.size;var M=H-B;if(z=Number.isNaN(M)?0:M,V={x:A,y:s.y,width:L,height:s.height},Math.abs(Q)>0&&Math.abs(z)<Math.abs(Q)){var $=Ba(z||Q)*(Math.abs(Q)-Math.abs(z));F-=$,z+=$}}else{var q=[a.scale(E[0]),a.scale(E[1])],Y=q[0],K=q[1];if(A=Y,F=sD({axis:s,ticks:c,bandSize:o,offset:p.offset,entry:R,index:I}),L=K-Y,z=p.size,V={x:a.x,y:F,width:a.width,height:z},Math.abs(Q)>0&&Math.abs(L)<Math.abs(Q)){var G=Ba(L||Q)*(Math.abs(Q)-Math.abs(L));L+=G}}return Qi(Qi(Qi({},R),{},{x:A,y:F,width:L,height:z,value:u?E:E[1],payload:R,background:V},O&&O[I]&&O[I].props),{},{tooltipPayload:[sV(r,R)],tooltipPosition:{x:A+L/2,y:F+z/2}})});return Qi({data:T,layout:y},h)});function Dx(e){"@babel/helpers - typeof";return Dx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dx(e)}function Fbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rz(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,FV(n.key),n)}}function Mbe(e,t,r){return t&&Rz(e.prototype,t),r&&Rz(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Jl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lz(Object(r),!0).forEach(function(n){gS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lz(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gS(e,t,r){return t=FV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function FV(e){var t=Dbe(e,"string");return Dx(t)=="symbol"?t:t+""}function Dbe(e,t){if(Dx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Dx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MV=function(t,r,n,o,a){var s=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(r),f={left:n.left,leftMirror:n.left,right:s-n.right,rightMirror:s-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},h=!!Bs(u,Ff);return d.reduce(function(p,y){var m=r[y],x=m.orientation,b=m.domain,w=m.padding,k=w===void 0?{}:w,S=m.mirror,_=m.reversed,P="".concat(x).concat(S?"Mirror":""),O,T,R,I,E;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var A=b[1]-b[0],F=1/0,L=m.categoricalDomain.sort();if(L.forEach(function(q,Y){Y>0&&(F=Math.min((q||0)-(L[Y-1]||0),F))}),Number.isFinite(F)){var z=F/A,V=m.layout==="vertical"?n.height:n.width;if(m.padding==="gap"&&(O=z*V/2),m.padding==="no-gap"){var Q=Wa(t.barCategoryGap,z*V),U=z*V/2;O=U-Q-(U-Q)/V*Q}}}o==="xAxis"?T=[n.left+(k.left||0)+(O||0),n.left+n.width-(k.right||0)-(O||0)]:o==="yAxis"?T=c==="horizontal"?[n.top+n.height-(k.bottom||0),n.top+(k.top||0)]:[n.top+(k.top||0)+(O||0),n.top+n.height-(k.bottom||0)-(O||0)]:T=m.range,_&&(T=[T[1],T[0]]);var ee=nV(m,a,h),H=ee.scale,B=ee.realScaleType;H.domain(b).range(T),iV(H);var M=oV(H,Jl(Jl({},m),{},{realScaleType:B}));o==="xAxis"?(E=x==="top"&&!S||x==="bottom"&&S,R=n.left,I=f[P]-E*m.height):o==="yAxis"&&(E=x==="left"&&!S||x==="right"&&S,R=f[P]-E*m.width,I=n.top);var $=Jl(Jl(Jl({},m),M),{},{realScaleType:B,x:R,y:I,scale:H,width:o==="xAxis"?n.width:m.width,height:o==="yAxis"?n.height:m.height});return $.bandSize=m2($,M),!m.hide&&o==="xAxis"?f[P]+=(E?-1:1)*$.height:m.hide||(f[P]+=(E?-1:1)*$.width),Jl(Jl({},p),{},gS({},y,$))},{})},DV=function(t,r){var n=t.x,o=t.y,a=r.x,s=r.y;return{x:Math.min(n,a),y:Math.min(o,s),width:Math.abs(a-n),height:Math.abs(s-o)}},zbe=function(t){var r=t.x1,n=t.y1,o=t.x2,a=t.y2;return DV({x:r,y:n},{x:o,y:a})},zV=(function(){function e(t){Fbe(this,e),this.scale=t}return Mbe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+s}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(o){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),o=n[0],a=n[n.length-1];return o<=a?r>=o&&r<=a:r>=a&&r<=o}}],[{key:"create",value:function(r){return new e(r)}}])})();gS(zV,"EPS",1e-4);var tP=function(t){var r=Object.keys(t).reduce(function(n,o){return Jl(Jl({},n),{},gS({},o,zV.create(t[o])))},{});return Jl(Jl({},r),{},{apply:function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=a.bandAware,l=a.position;return pbe(o,function(c,u){return r[u].apply(c,{bandAware:s,position:l})})},isInRange:function(o){return IV(o,function(a,s){return r[s].isInRange(a)})}})};function Bbe(e){return(e%180+180)%180}var Wbe=function(t){var r=t.width,n=t.height,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Bbe(o),s=a*Math.PI/180,l=Math.atan(n/r),c=s>l&&s<Math.PI-l?n/Math.sin(s):r/Math.cos(s);return Math.abs(c)},g4,Fz;function qbe(){if(Fz)return g4;Fz=1;var e=su(),t=pb(),r=Yw();function n(o){return function(a,s,l){var c=Object(a);if(!t(a)){var u=e(s,3);a=r(a),s=function(f){return u(c[f],f,c)}}var d=o(a,s,l);return d>-1?c[u?a[d]:d]:void 0}}return g4=n,g4}var m4,Mz;function $be(){if(Mz)return m4;Mz=1;var e=AV();function t(r){var n=e(r),o=n%1;return n===n?o?n-o:n:0}return m4=t,m4}var v4,Dz;function Ube(){if(Dz)return v4;Dz=1;var e=DU(),t=su(),r=$be(),n=Math.max;function o(a,s,l){var c=a==null?0:a.length;if(!c)return-1;var u=l==null?0:r(l);return u<0&&(u=n(c+u,0)),e(a,t(s,3),u)}return v4=o,v4}var y4,zz;function Hbe(){if(zz)return y4;zz=1;var e=qbe(),t=Ube(),r=e(t);return y4=r,y4}var Vbe=Hbe();const Ybe=un(Vbe);var Gbe=eU();const Kbe=un(Gbe);var Qbe=Kbe(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),rP=j.createContext(void 0),nP=j.createContext(void 0),BV=j.createContext(void 0),WV=j.createContext({}),qV=j.createContext(void 0),$V=j.createContext(0),UV=j.createContext(0),Bz=function(t){var r=t.state,n=r.xAxisMap,o=r.yAxisMap,a=r.offset,s=t.clipPathId,l=t.children,c=t.width,u=t.height,d=Qbe(a);return ze.createElement(rP.Provider,{value:n},ze.createElement(nP.Provider,{value:o},ze.createElement(WV.Provider,{value:a},ze.createElement(BV.Provider,{value:d},ze.createElement(qV.Provider,{value:s},ze.createElement($V.Provider,{value:u},ze.createElement(UV.Provider,{value:c},l)))))))},Xbe=function(){return j.useContext(qV)},HV=function(t){var r=j.useContext(rP);r==null&&vh();var n=r[t];return n==null&&vh(),n},Zbe=function(){var t=j.useContext(rP);return xf(t)},Jbe=function(){var t=j.useContext(nP),r=Ybe(t,function(n){return IV(n.domain,Number.isFinite)});return r||xf(t)},VV=function(t){var r=j.useContext(nP);r==null&&vh();var n=r[t];return n==null&&vh(),n},e1e=function(){var t=j.useContext(BV);return t},t1e=function(){return j.useContext(WV)},iP=function(){return j.useContext(UV)},oP=function(){return j.useContext($V)};function Lm(e){"@babel/helpers - typeof";return Lm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lm(e)}function r1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n1e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,GV(n.key),n)}}function i1e(e,t,r){return t&&n1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function o1e(e,t,r){return t=L2(t),a1e(e,YV()?Reflect.construct(t,r||[],L2(e).constructor):t.apply(e,r))}function a1e(e,t){if(t&&(Lm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s1e(e)}function s1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(YV=function(){return!!e})()}function L2(e){return L2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},L2(e)}function l1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fA(e,t)}function fA(e,t){return fA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},fA(e,t)}function Wz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function qz(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wz(Object(r),!0).forEach(function(n){aP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wz(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aP(e,t,r){return t=GV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GV(e){var t=c1e(e,"string");return Lm(t)=="symbol"?t:t+""}function c1e(e,t){if(Lm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Lm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function u1e(e,t){return h1e(e)||p1e(e,t)||f1e(e,t)||d1e()}function d1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f1e(e,t){if(e){if(typeof e=="string")return $z(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $z(e,t)}}function $z(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p1e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function h1e(e){if(Array.isArray(e))return e}function pA(){return pA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pA.apply(this,arguments)}var g1e=function(t,r){var n;return ze.isValidElement(t)?n=ze.cloneElement(t,r):Ar(t)?n=t(r):n=ze.createElement("line",pA({},r,{className:"recharts-reference-line-line"})),n},m1e=function(t,r,n,o,a,s,l,c,u){var d=a.x,f=a.y,h=a.width,p=a.height;if(n){var y=u.y,m=t.y.apply(y,{position:s});if(Xc(u,"discard")&&!t.y.isInRange(m))return null;var x=[{x:d+h,y:m},{x:d,y:m}];return c==="left"?x.reverse():x}if(r){var b=u.x,w=t.x.apply(b,{position:s});if(Xc(u,"discard")&&!t.x.isInRange(w))return null;var k=[{x:w,y:f+p},{x:w,y:f}];return l==="top"?k.reverse():k}if(o){var S=u.segment,_=S.map(function(P){return t.apply(P,{position:s})});return Xc(u,"discard")&&cbe(_,function(P){return!t.isInRange(P)})?null:_}return null};function v1e(e){var t=e.x,r=e.y,n=e.segment,o=e.xAxisId,a=e.yAxisId,s=e.shape,l=e.className,c=e.alwaysShow,u=Xbe(),d=HV(o),f=VV(a),h=e1e();if(!u||!h)return null;ac(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=tP({x:d.scale,y:f.scale}),y=ho(t),m=ho(r),x=n&&n.length===2,b=m1e(p,y,m,x,h,e.position,d.orientation,f.orientation,e);if(!b)return null;var w=u1e(b,2),k=w[0],S=k.x,_=k.y,P=w[1],O=P.x,T=P.y,R=Xc(e,"hidden")?"url(#".concat(u,")"):void 0,I=qz(qz({clipPath:R},vr(e,!0)),{},{x1:S,y1:_,x2:O,y2:T});return ze.createElement(ln,{className:Lr("recharts-reference-line",l)},g1e(s,I),Fo.renderCallByParent(e,zbe({x1:S,y1:_,x2:O,y2:T})))}var sP=(function(e){function t(){return r1e(this,t),o1e(this,t,arguments)}return l1e(t,e),i1e(t,[{key:"render",value:function(){return ze.createElement(v1e,this.props)}}])})(ze.Component);aP(sP,"displayName","ReferenceLine");aP(sP,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function hA(){return hA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hA.apply(this,arguments)}function Fm(e){"@babel/helpers - typeof";return Fm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fm(e)}function Uz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Hz(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Uz(Object(r),!0).forEach(function(n){mS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Uz(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function y1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x1e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,QV(n.key),n)}}function b1e(e,t,r){return t&&x1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function w1e(e,t,r){return t=F2(t),S1e(e,KV()?Reflect.construct(t,r||[],F2(e).constructor):t.apply(e,r))}function S1e(e,t){if(t&&(Fm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return j1e(e)}function j1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KV=function(){return!!e})()}function F2(e){return F2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},F2(e)}function k1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gA(e,t)}function gA(e,t){return gA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},gA(e,t)}function mS(e,t,r){return t=QV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function QV(e){var t=_1e(e,"string");return Fm(t)=="symbol"?t:t+""}function _1e(e,t){if(Fm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Fm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var C1e=function(t){var r=t.x,n=t.y,o=t.xAxis,a=t.yAxis,s=tP({x:o.scale,y:a.scale}),l=s.apply({x:r,y:n},{bandAware:!0});return Xc(t,"discard")&&!s.isInRange(l)?null:l},vS=(function(e){function t(){return y1e(this,t),w1e(this,t,arguments)}return k1e(t,e),b1e(t,[{key:"render",value:function(){var n=this.props,o=n.x,a=n.y,s=n.r,l=n.alwaysShow,c=n.clipPathId,u=ho(o),d=ho(a);if(ac(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=C1e(this.props);if(!f)return null;var h=f.x,p=f.y,y=this.props,m=y.shape,x=y.className,b=Xc(this.props,"hidden")?"url(#".concat(c,")"):void 0,w=Hz(Hz({clipPath:b},vr(this.props,!0)),{},{cx:h,cy:p});return ze.createElement(ln,{className:Lr("recharts-reference-dot",x)},t.renderDot(m,w),Fo.renderCallByParent(this.props,{x:h-s,y:p-s,width:2*s,height:2*s}))}}])})(ze.Component);mS(vS,"displayName","ReferenceDot");mS(vS,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});mS(vS,"renderDot",function(e,t){var r;return ze.isValidElement(e)?r=ze.cloneElement(e,t):Ar(e)?r=e(t):r=ze.createElement(lS,hA({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function mA(){return mA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mA.apply(this,arguments)}function Mm(e){"@babel/helpers - typeof";return Mm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mm(e)}function Vz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Yz(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Vz(Object(r),!0).forEach(function(n){yS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vz(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function E1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A1e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ZV(n.key),n)}}function T1e(e,t,r){return t&&A1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function P1e(e,t,r){return t=M2(t),O1e(e,XV()?Reflect.construct(t,r||[],M2(e).constructor):t.apply(e,r))}function O1e(e,t){if(t&&(Mm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return I1e(e)}function I1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function XV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(XV=function(){return!!e})()}function M2(e){return M2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},M2(e)}function N1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vA(e,t)}function vA(e,t){return vA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},vA(e,t)}function yS(e,t,r){return t=ZV(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZV(e){var t=R1e(e,"string");return Mm(t)=="symbol"?t:t+""}function R1e(e,t){if(Mm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Mm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var L1e=function(t,r,n,o,a){var s=a.x1,l=a.x2,c=a.y1,u=a.y2,d=a.xAxis,f=a.yAxis;if(!d||!f)return null;var h=tP({x:d.scale,y:f.scale}),p={x:t?h.x.apply(s,{position:"start"}):h.x.rangeMin,y:n?h.y.apply(c,{position:"start"}):h.y.rangeMin},y={x:r?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:o?h.y.apply(u,{position:"end"}):h.y.rangeMax};return Xc(a,"discard")&&(!h.isInRange(p)||!h.isInRange(y))?null:DV(p,y)},xS=(function(e){function t(){return E1e(this,t),P1e(this,t,arguments)}return N1e(t,e),T1e(t,[{key:"render",value:function(){var n=this.props,o=n.x1,a=n.x2,s=n.y1,l=n.y2,c=n.className,u=n.alwaysShow,d=n.clipPathId;ac(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=ho(o),h=ho(a),p=ho(s),y=ho(l),m=this.props.shape;if(!f&&!h&&!p&&!y&&!m)return null;var x=L1e(f,h,p,y,this.props);if(!x&&!m)return null;var b=Xc(this.props,"hidden")?"url(#".concat(d,")"):void 0;return ze.createElement(ln,{className:Lr("recharts-reference-area",c)},t.renderRect(m,Yz(Yz({clipPath:b},vr(this.props,!0)),x)),Fo.renderCallByParent(this.props,x))}}])})(ze.Component);yS(xS,"displayName","ReferenceArea");yS(xS,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});yS(xS,"renderRect",function(e,t){var r;return ze.isValidElement(e)?r=ze.cloneElement(e,t):Ar(e)?r=e(t):r=ze.createElement(eP,mA({},t,{className:"recharts-reference-area-rect"})),r});function JV(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],o=0;o<e.length;o+=t)n.push(e[o]);return n}function F1e(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return Wbe(n,r)}function M1e(e,t,r){var n=r==="width",o=e.x,a=e.y,s=e.width,l=e.height;return t===1?{start:n?o:a,end:n?o+s:a+l}:{start:n?o+s:a+l,end:n?o:a}}function D2(e,t,r,n,o){if(e*t<e*n||e*t>e*o)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-o)<=0}function D1e(e,t){return JV(e,t+1)}function z1e(e,t,r,n,o){for(var a=(n||[]).slice(),s=t.start,l=t.end,c=0,u=1,d=s,f=function(){var y=n==null?void 0:n[c];if(y===void 0)return{v:JV(n,u)};var m=c,x,b=function(){return x===void 0&&(x=r(y,m)),x},w=y.coordinate,k=c===0||D2(e,w,b,d,l);k||(c=0,d=s,u+=1),k&&(d=w+e*(b()/2+o),c+=u)},h;u<=a.length;)if(h=f(),h)return h.v;return[]}function zx(e){"@babel/helpers - typeof";return zx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zx(e)}function Gz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function fa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gz(Object(r),!0).forEach(function(n){B1e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gz(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function B1e(e,t,r){return t=W1e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function W1e(e){var t=q1e(e,"string");return zx(t)=="symbol"?t:t+""}function q1e(e,t){if(zx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(zx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $1e(e,t,r,n,o){for(var a=(n||[]).slice(),s=a.length,l=t.start,c=t.end,u=function(h){var p=a[h],y,m=function(){return y===void 0&&(y=r(p,h)),y};if(h===s-1){var x=e*(p.coordinate+e*m()/2-c);a[h]=p=fa(fa({},p),{},{tickCoord:x>0?p.coordinate-x*e:p.coordinate})}else a[h]=p=fa(fa({},p),{},{tickCoord:p.coordinate});var b=D2(e,p.tickCoord,m,l,c);b&&(c=p.tickCoord-e*(m()/2+o),a[h]=fa(fa({},p),{},{isShow:!0}))},d=s-1;d>=0;d--)u(d);return a}function U1e(e,t,r,n,o,a){var s=(n||[]).slice(),l=s.length,c=t.start,u=t.end;if(a){var d=n[l-1],f=r(d,l-1),h=e*(d.coordinate+e*f/2-u);s[l-1]=d=fa(fa({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=D2(e,d.tickCoord,function(){return f},c,u);p&&(u=d.tickCoord-e*(f/2+o),s[l-1]=fa(fa({},d),{},{isShow:!0}))}for(var y=a?l-1:l,m=function(w){var k=s[w],S,_=function(){return S===void 0&&(S=r(k,w)),S};if(w===0){var P=e*(k.coordinate-e*_()/2-c);s[w]=k=fa(fa({},k),{},{tickCoord:P<0?k.coordinate-P*e:k.coordinate})}else s[w]=k=fa(fa({},k),{},{tickCoord:k.coordinate});var O=D2(e,k.tickCoord,_,c,u);O&&(c=k.tickCoord+e*(_()/2+o),s[w]=fa(fa({},k),{},{isShow:!0}))},x=0;x<y;x++)m(x);return s}function lP(e,t,r){var n=e.tick,o=e.ticks,a=e.viewBox,s=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!o||!o.length||!n)return[];if(Bt(c)||Ih.isSsr)return D1e(o,typeof c=="number"&&Bt(c)?c:0);var h=[],p=l==="top"||l==="bottom"?"width":"height",y=d&&p==="width"?By(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},m=function(k,S){var _=Ar(u)?u(k.value,S):k.value;return p==="width"?F1e(By(_,{fontSize:t,letterSpacing:r}),y,f):By(_,{fontSize:t,letterSpacing:r})[p]},x=o.length>=2?Ba(o[1].coordinate-o[0].coordinate):1,b=M1e(a,x,p);return c==="equidistantPreserveStart"?z1e(x,b,m,o,s):(c==="preserveStart"||c==="preserveStartEnd"?h=U1e(x,b,m,o,s,c==="preserveStartEnd"):h=$1e(x,b,m,o,s),h.filter(function(w){return w.isShow}))}var H1e=["viewBox"],V1e=["viewBox"],Y1e=["ticks"];function Dm(e){"@babel/helpers - typeof";return Dm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dm(e)}function Vg(){return Vg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vg.apply(this,arguments)}function Kz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Pa(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Kz(Object(r),!0).forEach(function(n){cP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kz(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function x4(e,t){if(e==null)return{};var r=G1e(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function G1e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function K1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qz(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,tY(n.key),n)}}function Q1e(e,t,r){return t&&Qz(e.prototype,t),r&&Qz(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function X1e(e,t,r){return t=z2(t),Z1e(e,eY()?Reflect.construct(t,r||[],z2(e).constructor):t.apply(e,r))}function Z1e(e,t){if(t&&(Dm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return J1e(e)}function J1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eY=function(){return!!e})()}function z2(e){return z2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},z2(e)}function e0e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yA(e,t)}function yA(e,t){return yA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},yA(e,t)}function cP(e,t,r){return t=tY(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tY(e){var t=t0e(e,"string");return Dm(t)=="symbol"?t:t+""}function t0e(e,t){if(Dm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Dm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Sv=(function(e){function t(r){var n;return K1e(this,t),n=X1e(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return e0e(t,e),Q1e(t,[{key:"shouldComponentUpdate",value:function(n,o){var a=n.viewBox,s=x4(n,H1e),l=this.props,c=l.viewBox,u=x4(l,V1e);return!tm(a,c)||!tm(s,u)||!tm(o,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var o=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];o&&this.setState({fontSize:window.getComputedStyle(o).fontSize,letterSpacing:window.getComputedStyle(o).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var o=this.props,a=o.x,s=o.y,l=o.width,c=o.height,u=o.orientation,d=o.tickSize,f=o.mirror,h=o.tickMargin,p,y,m,x,b,w,k=f?-1:1,S=n.tickSize||d,_=Bt(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":p=y=n.coordinate,x=s+ +!f*c,m=x-k*S,w=m-k*h,b=_;break;case"left":m=x=n.coordinate,y=a+ +!f*l,p=y-k*S,b=p-k*h,w=_;break;case"right":m=x=n.coordinate,y=a+ +f*l,p=y+k*S,b=p+k*h,w=_;break;default:p=y=n.coordinate,x=s+ +f*c,m=x+k*S,w=m+k*h,b=_;break}return{line:{x1:p,y1:m,x2:y,y2:x},tick:{x:b,y:w}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,o=n.orientation,a=n.mirror,s;switch(o){case"left":s=a?"start":"end";break;case"right":s=a?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,o=n.orientation,a=n.mirror,s="end";switch(o){case"left":case"right":s="middle";break;case"top":s=a?"start":"end";break;default:s=a?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var n=this.props,o=n.x,a=n.y,s=n.width,l=n.height,c=n.orientation,u=n.mirror,d=n.axisLine,f=Pa(Pa(Pa({},vr(this.props,!1)),vr(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=Pa(Pa({},f),{},{x1:o,y1:a+h*l,x2:o+s,y2:a+h*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);f=Pa(Pa({},f),{},{x1:o+p*s,y1:a,x2:o+p*s,y2:a+l})}return ze.createElement("line",Vg({},f,{className:Lr("recharts-cartesian-axis-line",Gs(d,"className"))}))}},{key:"renderTicks",value:function(n,o,a){var s=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,h=l.unit,p=lP(Pa(Pa({},this.props),{},{ticks:n}),o,a),y=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),x=vr(this.props,!1),b=vr(d,!1),w=Pa(Pa({},x),{},{fill:"none"},vr(c,!1)),k=p.map(function(S,_){var P=s.getTickLineCoord(S),O=P.line,T=P.tick,R=Pa(Pa(Pa(Pa({textAnchor:y,verticalAnchor:m},x),{},{stroke:"none",fill:u},b),T),{},{index:_,payload:S,visibleTicksCount:p.length,tickFormatter:f});return ze.createElement(ln,Vg({className:"recharts-cartesian-axis-tick",key:"tick-".concat(S.value,"-").concat(S.coordinate,"-").concat(S.tickCoord)},hh(s.props,S,_)),c&&ze.createElement("line",Vg({},w,O,{className:Lr("recharts-cartesian-axis-tick-line",Gs(c,"className"))})),d&&t.renderTickItem(d,R,"".concat(Ar(f)?f(S.value,_):S.value).concat(h||"")))});return ze.createElement("g",{className:"recharts-cartesian-axis-ticks"},k)}},{key:"render",value:function(){var n=this,o=this.props,a=o.axisLine,s=o.width,l=o.height,c=o.ticksGenerator,u=o.className,d=o.hide;if(d)return null;var f=this.props,h=f.ticks,p=x4(f,Y1e),y=h;return Ar(c)&&(y=h&&h.length>0?c(this.props):c(p)),s<=0||l<=0||!y||!y.length?null:ze.createElement(ln,{className:Lr("recharts-cartesian-axis",u),ref:function(x){n.layerReference=x}},a&&this.renderAxisLine(),this.renderTicks(y,this.state.fontSize,this.state.letterSpacing),Fo.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,o,a){var s;return ze.isValidElement(n)?s=ze.cloneElement(n,o):Ar(n)?s=n(o):s=ze.createElement(gh,Vg({},o,{className:"recharts-cartesian-axis-tick-value"}),a),s}}])})(j.Component);cP(Sv,"displayName","CartesianAxis");cP(Sv,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var r0e=["x1","y1","x2","y2","key"],n0e=["offset"];function yh(e){"@babel/helpers - typeof";return yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yh(e)}function Xz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ha(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xz(Object(r),!0).forEach(function(n){i0e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xz(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function i0e(e,t,r){return t=o0e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o0e(e){var t=a0e(e,"string");return yh(t)=="symbol"?t:t+""}function a0e(e,t){if(yh(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(yh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zp(){return Zp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zp.apply(this,arguments)}function Zz(e,t){if(e==null)return{};var r=s0e(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function s0e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var l0e=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,o=t.x,a=t.y,s=t.width,l=t.height,c=t.ry;return ze.createElement("rect",{x:o,y:a,ry:c,width:s,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function rY(e,t){var r;if(ze.isValidElement(e))r=ze.cloneElement(e,t);else if(Ar(e))r=e(t);else{var n=t.x1,o=t.y1,a=t.x2,s=t.y2,l=t.key,c=Zz(t,r0e),u=vr(c,!1);u.offset;var d=Zz(u,n0e);r=ze.createElement("line",Zp({},d,{x1:n,y1:o,x2:a,y2:s,fill:"none",key:l}))}return r}function c0e(e){var t=e.x,r=e.width,n=e.horizontal,o=n===void 0?!0:n,a=e.horizontalPoints;if(!o||!a||!a.length)return null;var s=a.map(function(l,c){var u=ha(ha({},e),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return rY(o,u)});return ze.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function u0e(e){var t=e.y,r=e.height,n=e.vertical,o=n===void 0?!0:n,a=e.verticalPoints;if(!o||!a||!a.length)return null;var s=a.map(function(l,c){var u=ha(ha({},e),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return rY(o,u)});return ze.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function d0e(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,o=e.y,a=e.width,s=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(h){return Math.round(h+o-o)}).sort(function(h,p){return h-p});o!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var y=!d[p+1],m=y?o+s-h:d[p+1]-h;if(m<=0)return null;var x=p%t.length;return ze.createElement("rect",{key:"react-".concat(p),y:h,x:n,height:m,width:a,stroke:"none",fill:t[x],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return ze.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function f0e(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,o=e.fillOpacity,a=e.x,s=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var d=u.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var y=!d[p+1],m=y?a+l-h:d[p+1]-h;if(m<=0)return null;var x=p%n.length;return ze.createElement("rect",{key:"react-".concat(p),x:h,y:s,width:m,height:c,stroke:"none",fill:n[x],fillOpacity:o,className:"recharts-cartesian-grid-bg"})});return ze.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var p0e=function(t,r){var n=t.xAxis,o=t.width,a=t.height,s=t.offset;return rV(lP(ha(ha(ha({},Sv.defaultProps),n),{},{ticks:td(n,!0),viewBox:{x:0,y:0,width:o,height:a}})),s.left,s.left+s.width,r)},h0e=function(t,r){var n=t.yAxis,o=t.width,a=t.height,s=t.offset;return rV(lP(ha(ha(ha({},Sv.defaultProps),n),{},{ticks:td(n,!0),viewBox:{x:0,y:0,width:o,height:a}})),s.top,s.top+s.height,r)},Eg={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function xA(e){var t,r,n,o,a,s,l=iP(),c=oP(),u=t1e(),d=ha(ha({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Eg.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Eg.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Eg.horizontal,horizontalFill:(o=e.horizontalFill)!==null&&o!==void 0?o:Eg.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:Eg.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:Eg.verticalFill,x:Bt(e.x)?e.x:u.left,y:Bt(e.y)?e.y:u.top,width:Bt(e.width)?e.width:u.width,height:Bt(e.height)?e.height:u.height}),f=d.x,h=d.y,p=d.width,y=d.height,m=d.syncWithTicks,x=d.horizontalValues,b=d.verticalValues,w=Zbe(),k=Jbe();if(!Bt(p)||p<=0||!Bt(y)||y<=0||!Bt(f)||f!==+f||!Bt(h)||h!==+h)return null;var S=d.verticalCoordinatesGenerator||p0e,_=d.horizontalCoordinatesGenerator||h0e,P=d.horizontalPoints,O=d.verticalPoints;if((!P||!P.length)&&Ar(_)){var T=x&&x.length,R=_({yAxis:k?ha(ha({},k),{},{ticks:T?x:k.ticks}):void 0,width:l,height:c,offset:u},T?!0:m);ac(Array.isArray(R),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(yh(R),"]")),Array.isArray(R)&&(P=R)}if((!O||!O.length)&&Ar(S)){var I=b&&b.length,E=S({xAxis:w?ha(ha({},w),{},{ticks:I?b:w.ticks}):void 0,width:l,height:c,offset:u},I?!0:m);ac(Array.isArray(E),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(yh(E),"]")),Array.isArray(E)&&(O=E)}return ze.createElement("g",{className:"recharts-cartesian-grid"},ze.createElement(l0e,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),ze.createElement(c0e,Zp({},d,{offset:u,horizontalPoints:P,xAxis:w,yAxis:k})),ze.createElement(u0e,Zp({},d,{offset:u,verticalPoints:O,xAxis:w,yAxis:k})),ze.createElement(d0e,Zp({},d,{horizontalPoints:P})),ze.createElement(f0e,Zp({},d,{verticalPoints:O})))}xA.displayName="CartesianGrid";var g0e=["type","layout","connectNulls","ref"],m0e=["key"];function zm(e){"@babel/helpers - typeof";return zm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zm(e)}function Jz(e,t){if(e==null)return{};var r=v0e(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function v0e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Vy(){return Vy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vy.apply(this,arguments)}function e7(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Ds(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?e7(Object(r),!0).forEach(function(n){ec(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):e7(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ag(e){return w0e(e)||b0e(e)||x0e(e)||y0e()}function y0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x0e(e,t){if(e){if(typeof e=="string")return bA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bA(e,t)}}function b0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function w0e(e){if(Array.isArray(e))return bA(e)}function bA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function S0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t7(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,iY(n.key),n)}}function j0e(e,t,r){return t&&t7(e.prototype,t),r&&t7(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function k0e(e,t,r){return t=B2(t),_0e(e,nY()?Reflect.construct(t,r||[],B2(e).constructor):t.apply(e,r))}function _0e(e,t){if(t&&(zm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C0e(e)}function C0e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nY=function(){return!!e})()}function B2(e){return B2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},B2(e)}function E0e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wA(e,t)}function wA(e,t){return wA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},wA(e,t)}function ec(e,t,r){return t=iY(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iY(e){var t=A0e(e,"string");return zm(t)=="symbol"?t:t+""}function A0e(e,t){if(zm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(zm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Bm=(function(e){function t(){var r;S0e(this,t);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return r=k0e(this,t,[].concat(o)),ec(r,"state",{isAnimationFinished:!0,totalLength:0}),ec(r,"generateSimpleStrokeDasharray",function(s,l){return"".concat(l,"px ").concat(s-l,"px")}),ec(r,"getStrokeDasharray",function(s,l,c){var u=c.reduce(function(b,w){return b+w});if(!u)return r.generateSimpleStrokeDasharray(l,s);for(var d=Math.floor(s/u),f=s%u,h=l-s,p=[],y=0,m=0;y<c.length;m+=c[y],++y)if(m+c[y]>f){p=[].concat(Ag(c.slice(0,y)),[f-m]);break}var x=p.length%2===0?[0,h]:[h];return[].concat(Ag(t.repeat(c,d)),Ag(p),x).map(function(b){return"".concat(b,"px")}).join(", ")}),ec(r,"id",vv("recharts-line-")),ec(r,"pathRef",function(s){r.mainCurve=s}),ec(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),ec(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return E0e(t,e),j0e(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,o){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.points,l=a.xAxis,c=a.yAxis,u=a.layout,d=a.children,f=Ks(d,xb);if(!f)return null;var h=function(m,x){return{x:m.x,y:m.y,value:m.value,errorVal:uo(m.payload,x)}},p={clipPath:n?"url(#clipPath-".concat(o,")"):null};return ze.createElement(ln,p,f.map(function(y){return ze.cloneElement(y,{key:"bar-".concat(y.props.dataKey),data:s,xAxis:l,yAxis:c,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,o,a){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,d=l.dataKey,f=vr(this.props,!1),h=vr(c,!0),p=u.map(function(m,x){var b=Ds(Ds(Ds({key:"dot-".concat(x),r:3},f),h),{},{index:x,cx:m.x,cy:m.y,value:m.value,dataKey:d,payload:m.payload,points:u});return t.renderDotItem(c,b)}),y={clipPath:n?"url(#clipPath-".concat(o?"":"dots-").concat(a,")"):null};return ze.createElement(ln,Vy({className:"recharts-line-dots",key:"dots"},y),p)}},{key:"renderCurveStatically",value:function(n,o,a,s){var l=this.props,c=l.type,u=l.layout,d=l.connectNulls;l.ref;var f=Jz(l,g0e),h=Ds(Ds(Ds({},vr(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:o?"url(#clipPath-".concat(a,")"):null,points:n},s),{},{type:c,layout:u,connectNulls:d});return ze.createElement(x2,Vy({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,o){var a=this,s=this.props,l=s.points,c=s.strokeDasharray,u=s.isAnimationActive,d=s.animationBegin,f=s.animationDuration,h=s.animationEasing,p=s.animationId,y=s.animateNewValues,m=s.width,x=s.height,b=this.state,w=b.prevPoints,k=b.totalLength;return ze.createElement(eu,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var _=S.t;if(w){var P=w.length/l.length,O=l.map(function(A,F){var L=Math.floor(F*P);if(w[L]){var z=w[L],V=Ws(z.x,A.x),Q=Ws(z.y,A.y);return Ds(Ds({},A),{},{x:V(_),y:Q(_)})}if(y){var U=Ws(m*2,A.x),ee=Ws(x/2,A.y);return Ds(Ds({},A),{},{x:U(_),y:ee(_)})}return Ds(Ds({},A),{},{x:A.x,y:A.y})});return a.renderCurveStatically(O,n,o)}var T=Ws(0,k),R=T(_),I;if(c){var E="".concat(c).split(/[,\s]+/gim).map(function(A){return parseFloat(A)});I=a.getStrokeDasharray(R,k,E)}else I=a.generateSimpleStrokeDasharray(k,R);return a.renderCurveStatically(l,n,o,{strokeDasharray:I})})}},{key:"renderCurve",value:function(n,o){var a=this.props,s=a.points,l=a.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return l&&s&&s.length&&(!u&&d>0||!yb(u,s))?this.renderCurveWithAnimation(n,o):this.renderCurveStatically(s,n,o)}},{key:"render",value:function(){var n,o=this.props,a=o.hide,s=o.dot,l=o.points,c=o.className,u=o.xAxis,d=o.yAxis,f=o.top,h=o.left,p=o.width,y=o.height,m=o.isAnimationActive,x=o.id;if(a||!l||!l.length)return null;var b=this.state.isAnimationFinished,w=l.length===1,k=Lr("recharts-line",c),S=u&&u.allowDataOverflow,_=d&&d.allowDataOverflow,P=S||_,O=Rr(x)?this.id:x,T=(n=vr(s,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},R=T.r,I=R===void 0?3:R,E=T.strokeWidth,A=E===void 0?2:E,F=ise(s)?s:{},L=F.clipDot,z=L===void 0?!0:L,V=I*2+A;return ze.createElement(ln,{className:k},S||_?ze.createElement("defs",null,ze.createElement("clipPath",{id:"clipPath-".concat(O)},ze.createElement("rect",{x:S?h:h-p/2,y:_?f:f-y/2,width:S?p:p*2,height:_?y:y*2})),!z&&ze.createElement("clipPath",{id:"clipPath-dots-".concat(O)},ze.createElement("rect",{x:h-V/2,y:f-V/2,width:p+V,height:y+V}))):null,!w&&this.renderCurve(P,O),this.renderErrorBar(P,O),(w||s)&&this.renderDots(P,z,O),(!m||b)&&ld.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,o){return n.animationId!==o.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:o.curPoints}:n.points!==o.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,o){for(var a=n.length%2!==0?[].concat(Ag(n),[0]):n,s=[],l=0;l<o;++l)s=[].concat(Ag(s),Ag(a));return s}},{key:"renderDotItem",value:function(n,o){var a;if(ze.isValidElement(n))a=ze.cloneElement(n,o);else if(Ar(n))a=n(o);else{var s=o.key,l=Jz(o,m0e),c=Lr("recharts-line-dot",typeof n!="boolean"?n.className:"");a=ze.createElement(lS,Vy({key:s},l,{className:c}))}return a}}])})(j.PureComponent);ec(Bm,"displayName","Line");ec(Bm,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Ih.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});ec(Bm,"getComposedData",function(e){var t=e.props,r=e.xAxis,n=e.yAxis,o=e.xAxisTicks,a=e.yAxisTicks,s=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout,f=c.map(function(h,p){var y=uo(h,s);return d==="horizontal"?{x:aD({axis:r,ticks:o,bandSize:l,entry:h,index:p}),y:Rr(y)?null:n.scale(y),value:y,payload:h}:{x:Rr(y)?null:r.scale(y),y:aD({axis:n,ticks:a,bandSize:l,entry:h,index:p}),value:y,payload:h}});return Ds({points:f,layout:d},u)});function Wm(e){"@babel/helpers - typeof";return Wm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wm(e)}function T0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P0e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,sY(n.key),n)}}function O0e(e,t,r){return t&&P0e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function I0e(e,t,r){return t=W2(t),N0e(e,oY()?Reflect.construct(t,r||[],W2(e).constructor):t.apply(e,r))}function N0e(e,t){if(t&&(Wm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return R0e(e)}function R0e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oY=function(){return!!e})()}function W2(e){return W2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},W2(e)}function L0e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&SA(e,t)}function SA(e,t){return SA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},SA(e,t)}function aY(e,t,r){return t=sY(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sY(e){var t=F0e(e,"string");return Wm(t)=="symbol"?t:t+""}function F0e(e,t){if(Wm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Wm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function jA(){return jA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jA.apply(this,arguments)}function M0e(e){var t=e.xAxisId,r=iP(),n=oP(),o=HV(t);return o==null?null:ze.createElement(Sv,jA({},o,{className:Lr("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(s){return td(s,!0)}}))}var qm=(function(e){function t(){return T0e(this,t),I0e(this,t,arguments)}return L0e(t,e),O0e(t,[{key:"render",value:function(){return ze.createElement(M0e,this.props)}}])})(ze.Component);aY(qm,"displayName","XAxis");aY(qm,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function $m(e){"@babel/helpers - typeof";return $m=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$m(e)}function D0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z0e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,uY(n.key),n)}}function B0e(e,t,r){return t&&z0e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function W0e(e,t,r){return t=q2(t),q0e(e,lY()?Reflect.construct(t,r||[],q2(e).constructor):t.apply(e,r))}function q0e(e,t){if(t&&($m(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $0e(e)}function $0e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lY=function(){return!!e})()}function q2(e){return q2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},q2(e)}function U0e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kA(e,t)}function kA(e,t){return kA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},kA(e,t)}function cY(e,t,r){return t=uY(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uY(e){var t=H0e(e,"string");return $m(t)=="symbol"?t:t+""}function H0e(e,t){if($m(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if($m(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function _A(){return _A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_A.apply(this,arguments)}var V0e=function(t){var r=t.yAxisId,n=iP(),o=oP(),a=VV(r);return a==null?null:ze.createElement(Sv,_A({},a,{className:Lr("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:o},ticksGenerator:function(l){return td(l,!0)}}))},Um=(function(e){function t(){return D0e(this,t),W0e(this,t,arguments)}return U0e(t,e),B0e(t,[{key:"render",value:function(){return ze.createElement(V0e,this.props)}}])})(ze.Component);cY(Um,"displayName","YAxis");cY(Um,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function r7(e){return Q0e(e)||K0e(e)||G0e(e)||Y0e()}function Y0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G0e(e,t){if(e){if(typeof e=="string")return CA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return CA(e,t)}}function K0e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Q0e(e){if(Array.isArray(e))return CA(e)}function CA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var EA=function(t,r,n,o,a){var s=Ks(t,sP),l=Ks(t,vS),c=[].concat(r7(s),r7(l)),u=Ks(t,xS),d="".concat(o,"Id"),f=o[0],h=r;if(c.length&&(h=c.reduce(function(m,x){if(x.props[d]===n&&Xc(x.props,"extendDomain")&&Bt(x.props[f])){var b=x.props[f];return[Math.min(m[0],b),Math.max(m[1],b)]}return m},h)),u.length){var p="".concat(f,"1"),y="".concat(f,"2");h=u.reduce(function(m,x){if(x.props[d]===n&&Xc(x.props,"extendDomain")&&Bt(x.props[p])&&Bt(x.props[y])){var b=x.props[p],w=x.props[y];return[Math.min(m[0],b,w),Math.max(m[1],b,w)]}return m},h)}return a&&a.length&&(h=a.reduce(function(m,x){return Bt(x)?[Math.min(m[0],x),Math.max(m[1],x)]:m},h)),h},b4={exports:{}},n7;function X0e(){return n7||(n7=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function o(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new o(d,f||c,h),y=r?r+u:u;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],p]:c._events[y].push(p):(c._events[y]=p,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=r?r+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,y=new Array(p);h<p;h++)y[h]=f[h].fn;return y},l.prototype.listenerCount=function(u){var d=r?r+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,h,p,y){var m=r?r+u:u;if(!this._events[m])return!1;var x=this._events[m],b=arguments.length,w,k;if(x.fn){switch(x.once&&this.removeListener(u,x.fn,void 0,!0),b){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,d),!0;case 3:return x.fn.call(x.context,d,f),!0;case 4:return x.fn.call(x.context,d,f,h),!0;case 5:return x.fn.call(x.context,d,f,h,p),!0;case 6:return x.fn.call(x.context,d,f,h,p,y),!0}for(k=1,w=new Array(b-1);k<b;k++)w[k-1]=arguments[k];x.fn.apply(x.context,w)}else{var S=x.length,_;for(k=0;k<S;k++)switch(x[k].once&&this.removeListener(u,x[k].fn,void 0,!0),b){case 1:x[k].fn.call(x[k].context);break;case 2:x[k].fn.call(x[k].context,d);break;case 3:x[k].fn.call(x[k].context,d,f);break;case 4:x[k].fn.call(x[k].context,d,f,h);break;default:if(!w)for(_=1,w=new Array(b-1);_<b;_++)w[_-1]=arguments[_];x[k].fn.apply(x[k].context,w)}}return!0},l.prototype.on=function(u,d,f){return a(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return a(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,h){var p=r?r+u:u;if(!this._events[p])return this;if(!d)return s(this,p),this;var y=this._events[p];if(y.fn)y.fn===d&&(!h||y.once)&&(!f||y.context===f)&&s(this,p);else{for(var m=0,x=[],b=y.length;m<b;m++)(y[m].fn!==d||h&&!y[m].once||f&&y[m].context!==f)&&x.push(y[m]);x.length?this._events[p]=x.length===1?x[0]:x:s(this,p)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=r?r+u:u,this._events[d]&&s(this,d)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(b4)),b4.exports}var Z0e=X0e();const J0e=un(Z0e);var w4=new J0e,S4="recharts.syncMouseEvents";function Bx(e){"@babel/helpers - typeof";return Bx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bx(e)}function e2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t2e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,dY(n.key),n)}}function r2e(e,t,r){return t&&t2e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function j4(e,t,r){return t=dY(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dY(e){var t=n2e(e,"string");return Bx(t)=="symbol"?t:t+""}function n2e(e,t){if(Bx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Bx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var i2e=(function(){function e(){e2e(this,e),j4(this,"activeIndex",0),j4(this,"coordinateList",[]),j4(this,"layout","horizontal")}return r2e(e,[{key:"setDetails",value:function(r){var n,o=r.coordinateList,a=o===void 0?null:o,s=r.container,l=s===void 0?null:s,c=r.layout,u=c===void 0?null:c,d=r.offset,f=d===void 0?null:d,h=r.mouseHandlerCallback,p=h===void 0?null:h;this.coordinateList=(n=a??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=p??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var o=this.container.getBoundingClientRect(),a=o.x,s=o.y,l=o.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,d=((n=window)===null||n===void 0?void 0:n.scrollY)||0,f=a+c+u,h=s+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])})();function o2e(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],o=e==null?void 0:e[1];if(n&&o&&Bt(n)&&Bt(o))return!0}return!1}function a2e(e,t,r,n){var o=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-o:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-o,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function fY(e){var t=e.cx,r=e.cy,n=e.radius,o=e.startAngle,a=e.endAngle,s=Kn(t,r,n,o),l=Kn(t,r,n,a);return{points:[s,l],cx:t,cy:r,radius:n,startAngle:o,endAngle:a}}function s2e(e,t,r){var n,o,a,s;if(e==="horizontal")n=t.x,a=n,o=r.top,s=r.top+r.height;else if(e==="vertical")o=t.y,s=o,n=r.left,a=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,f=t.angle,h=Kn(l,c,u,f),p=Kn(l,c,d,f);n=h.x,o=h.y,a=p.x,s=p.y}else return fY(t);return[{x:n,y:o},{x:a,y:s}]}function Wx(e){"@babel/helpers - typeof";return Wx=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wx(e)}function i7(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function U1(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?i7(Object(r),!0).forEach(function(n){l2e(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i7(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function l2e(e,t,r){return t=c2e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c2e(e){var t=u2e(e,"string");return Wx(t)=="symbol"?t:t+""}function u2e(e,t){if(Wx(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Wx(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function d2e(e){var t,r,n=e.element,o=e.tooltipEventType,a=e.isActive,s=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,p=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!p||!a||!s||h!=="ScatterChart"&&o!=="axis")return null;var y,m=x2;if(h==="ScatterChart")y=s,m=Nye;else if(h==="BarChart")y=a2e(f,s,c,d),m=eP;else if(f==="radial"){var x=fY(s),b=x.cx,w=x.cy,k=x.radius,S=x.startAngle,_=x.endAngle;y={cx:b,cy:w,startAngle:S,endAngle:_,innerRadius:k,outerRadius:k},m=pV}else y={points:s2e(f,s,c)},m=x2;var P=U1(U1(U1(U1({stroke:"#ccc",pointerEvents:"none"},c),y),vr(p,!1)),{},{payload:l,payloadIndex:u,className:Lr("recharts-tooltip-cursor",p.className)});return j.isValidElement(p)?j.cloneElement(p,P):j.createElement(m,P)}var f2e=["item"],p2e=["children","className","width","height","style","compact","title","desc"];function Hm(e){"@babel/helpers - typeof";return Hm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hm(e)}function Yg(){return Yg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yg.apply(this,arguments)}function o7(e,t){return m2e(e)||g2e(e,t)||hY(e,t)||h2e()}function h2e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g2e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function m2e(e){if(Array.isArray(e))return e}function a7(e,t){if(e==null)return{};var r=v2e(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function v2e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function y2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x2e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,gY(n.key),n)}}function b2e(e,t,r){return t&&x2e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function w2e(e,t,r){return t=$2(t),S2e(e,pY()?Reflect.construct(t,r||[],$2(e).constructor):t.apply(e,r))}function S2e(e,t){if(t&&(Hm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return j2e(e)}function j2e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pY=function(){return!!e})()}function $2(e){return $2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$2(e)}function k2e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&AA(e,t)}function AA(e,t){return AA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},AA(e,t)}function Vm(e){return E2e(e)||C2e(e)||hY(e)||_2e()}function _2e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hY(e,t){if(e){if(typeof e=="string")return TA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return TA(e,t)}}function C2e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function E2e(e){if(Array.isArray(e))return TA(e)}function TA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function s7(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function St(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?s7(Object(r),!0).forEach(function(n){xr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s7(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xr(e,t,r){return t=gY(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gY(e){var t=A2e(e,"string");return Hm(t)=="symbol"?t:t+""}function A2e(e,t){if(Hm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Hm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var T2e={xAxis:["bottom","top"],yAxis:["left","right"]},P2e={width:"100%",height:"100%"},mY={x:0,y:0};function H1(e){return e}var O2e=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},I2e=function(t,r,n,o){var a=r.find(function(d){return d&&d.index===n});if(a){if(t==="horizontal")return{x:a.coordinate,y:o.y};if(t==="vertical")return{x:o.x,y:a.coordinate};if(t==="centric"){var s=a.coordinate,l=o.radius;return St(St(St({},o),Kn(o.cx,o.cy,l,s)),{},{angle:s,radius:l})}var c=a.coordinate,u=o.angle;return St(St(St({},o),Kn(o.cx,o.cy,c,u)),{},{angle:u,radius:c})}return mY},bS=function(t,r){var n=r.graphicalItems,o=r.dataStartIndex,a=r.dataEndIndex,s=(n??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(Vm(l),Vm(u)):l},[]);return s.length>0?s:t&&t.length&&Bt(o)&&Bt(a)?t.slice(o,a+1):[]};function vY(e){return e==="number"?[0,"auto"]:void 0}var PA=function(t,r,n,o){var a=t.graphicalItems,s=t.tooltipAxis,l=bS(r,t);return n<0||!a||!a.length||n>=l.length?null:a.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:r;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(s.dataKey&&!s.allowDuplicatedCategory){var p=f===void 0?l:f;h=U0(p,s.dataKey,o)}else h=f&&f[n]||l[n];return h?[].concat(Vm(c),[sV(u,h)]):c},[])},l7=function(t,r,n,o){var a=o||{x:t.chartX,y:t.chartY},s=O2e(a,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=ege(s,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=PA(t,r,d,f),p=I2e(n,l,d,a);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},N2e=function(t,r){var n=r.axes,o=r.graphicalItems,a=r.axisType,s=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,p=tV(d,a);return n.reduce(function(y,m){var x,b=m.type.defaultProps!==void 0?St(St({},m.type.defaultProps),m.props):m.props,w=b.type,k=b.dataKey,S=b.allowDataOverflow,_=b.allowDuplicatedCategory,P=b.scale,O=b.ticks,T=b.includeHidden,R=b[s];if(y[R])return y;var I=bS(t.data,{graphicalItems:o.filter(function(M){var $,q=s in M.props?M.props[s]:($=M.type.defaultProps)===null||$===void 0?void 0:$[s];return q===R}),dataStartIndex:c,dataEndIndex:u}),E=I.length,A,F,L;o2e(b.domain,S,w)&&(A=$E(b.domain,null,S),p&&(w==="number"||P!=="auto")&&(L=qy(I,k,"category")));var z=vY(w);if(!A||A.length===0){var V,Q=(V=b.domain)!==null&&V!==void 0?V:z;if(k){if(A=qy(I,k,w),w==="category"&&p){var U=Kae(A);_&&U?(F=A,A=P2(0,E)):_||(A=uD(Q,A,m).reduce(function(M,$){return M.indexOf($)>=0?M:[].concat(Vm(M),[$])},[]))}else if(w==="category")_?A=A.filter(function(M){return M!==""&&!Rr(M)}):A=uD(Q,A,m).reduce(function(M,$){return M.indexOf($)>=0||$===""||Rr($)?M:[].concat(Vm(M),[$])},[]);else if(w==="number"){var ee=oge(I,o.filter(function(M){var $,q,Y=s in M.props?M.props[s]:($=M.type.defaultProps)===null||$===void 0?void 0:$[s],K="hide"in M.props?M.props.hide:(q=M.type.defaultProps)===null||q===void 0?void 0:q.hide;return Y===R&&(T||!K)}),k,a,d);ee&&(A=ee)}p&&(w==="number"||P!=="auto")&&(L=qy(I,k,"category"))}else p?A=P2(0,E):l&&l[R]&&l[R].hasStack&&w==="number"?A=h==="expand"?[0,1]:aV(l[R].stackGroups,c,u):A=eV(I,o.filter(function(M){var $=s in M.props?M.props[s]:M.type.defaultProps[s],q="hide"in M.props?M.props.hide:M.type.defaultProps.hide;return $===R&&(T||!q)}),w,d,!0);if(w==="number")A=EA(f,A,R,a,O),Q&&(A=$E(Q,A,S));else if(w==="category"&&Q){var H=Q,B=A.every(function(M){return H.indexOf(M)>=0});B&&(A=H)}}return St(St({},y),{},xr({},R,St(St({},b),{},{axisType:a,domain:A,categoricalDomain:L,duplicateDomain:F,originalDomain:(x=b.domain)!==null&&x!==void 0?x:z,isCategorical:p,layout:d})))},{})},R2e=function(t,r){var n=r.graphicalItems,o=r.Axis,a=r.axisType,s=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,h=bS(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),p=h.length,y=tV(d,a),m=-1;return n.reduce(function(x,b){var w=b.type.defaultProps!==void 0?St(St({},b.type.defaultProps),b.props):b.props,k=w[s],S=vY("number");if(!x[k]){m++;var _;return y?_=P2(0,p):l&&l[k]&&l[k].hasStack?(_=aV(l[k].stackGroups,c,u),_=EA(f,_,k,a)):(_=$E(S,eV(h,n.filter(function(P){var O,T,R=s in P.props?P.props[s]:(O=P.type.defaultProps)===null||O===void 0?void 0:O[s],I="hide"in P.props?P.props.hide:(T=P.type.defaultProps)===null||T===void 0?void 0:T.hide;return R===k&&!I}),"number",d),o.defaultProps.allowDataOverflow),_=EA(f,_,k,a)),St(St({},x),{},xr({},k,St(St({axisType:a},o.defaultProps),{},{hide:!0,orientation:Gs(T2e,"".concat(a,".").concat(m%2),null),domain:_,originalDomain:S,isCategorical:y,layout:d})))}return x},{})},L2e=function(t,r){var n=r.axisType,o=n===void 0?"xAxis":n,a=r.AxisComp,s=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.children,f="".concat(o,"Id"),h=Ks(d,a),p={};return h&&h.length?p=N2e(t,{axes:h,graphicalItems:s,axisType:o,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):s&&s.length&&(p=R2e(t,{Axis:a,graphicalItems:s,axisType:o,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},F2e=function(t){var r=xf(t),n=td(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:ET(n,function(o){return o.coordinate}),tooltipAxis:r,tooltipAxisBandSize:m2(r,n)}},c7=function(t){var r=t.children,n=t.defaultShowTooltip,o=Bs(r,Nm),a=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),o&&o.props&&(o.props.startIndex>=0&&(a=o.props.startIndex),o.props.endIndex>=0&&(s=o.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!n}},M2e=function(t){return!t||!t.length?!1:t.some(function(r){var n=ad(r&&r.type);return n&&n.indexOf("Bar")>=0})},u7=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},D2e=function(t,r){var n=t.props,o=t.graphicalItems,a=t.xAxisMap,s=a===void 0?{}:a,l=t.yAxisMap,c=l===void 0?{}:l,u=n.width,d=n.height,f=n.children,h=n.margin||{},p=Bs(f,Nm),y=Bs(f,Af),m=Object.keys(c).reduce(function(_,P){var O=c[P],T=O.orientation;return!O.mirror&&!O.hide?St(St({},_),{},xr({},T,_[T]+O.width)):_},{left:h.left||0,right:h.right||0}),x=Object.keys(s).reduce(function(_,P){var O=s[P],T=O.orientation;return!O.mirror&&!O.hide?St(St({},_),{},xr({},T,Gs(_,"".concat(T))+O.height)):_},{top:h.top||0,bottom:h.bottom||0}),b=St(St({},x),m),w=b.bottom;p&&(b.bottom+=p.props.height||Nm.defaultProps.height),y&&r&&(b=nge(b,o,n,r));var k=u-b.left-b.right,S=d-b.top-b.bottom;return St(St({brushBottom:w},b),{},{width:Math.max(k,0),height:Math.max(S,0)})},z2e=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},uP=function(t){var r=t.chartName,n=t.GraphicalChild,o=t.defaultTooltipEventType,a=o===void 0?"axis":o,s=t.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(b,w){var k=w.graphicalItems,S=w.stackGroups,_=w.offset,P=w.updateId,O=w.dataStartIndex,T=w.dataEndIndex,R=b.barSize,I=b.layout,E=b.barGap,A=b.barCategoryGap,F=b.maxBarSize,L=u7(I),z=L.numericAxisName,V=L.cateAxisName,Q=M2e(k),U=[];return k.forEach(function(ee,H){var B=bS(b.data,{graphicalItems:[ee],dataStartIndex:O,dataEndIndex:T}),M=ee.type.defaultProps!==void 0?St(St({},ee.type.defaultProps),ee.props):ee.props,$=M.dataKey,q=M.maxBarSize,Y=M["".concat(z,"Id")],K=M["".concat(V,"Id")],G={},re=c.reduce(function(ce,je){var qe=w["".concat(je.axisType,"Map")],Ne=M["".concat(je.axisType,"Id")];qe&&qe[Ne]||je.axisType==="zAxis"||vh();var Je=qe[Ne];return St(St({},ce),{},xr(xr({},je.axisType,Je),"".concat(je.axisType,"Ticks"),td(Je)))},G),J=re[V],ae=re["".concat(V,"Ticks")],le=S&&S[Y]&&S[Y].hasStack&&hge(ee,S[Y].stackGroups),me=ad(ee.type).indexOf("Bar")>=0,Oe=m2(J,ae),we=[],ie=Q&&tge({barSize:R,stackGroups:S,totalSize:z2e(re,V)});if(me){var Me,ke,se=Rr(q)?F:q,fe=(Me=(ke=m2(J,ae,!0))!==null&&ke!==void 0?ke:se)!==null&&Me!==void 0?Me:0;we=rge({barGap:E,barCategoryGap:A,bandSize:fe!==Oe?fe:Oe,sizeList:ie[K],maxBarSize:se}),fe!==Oe&&(we=we.map(function(ce){return St(St({},ce),{},{position:St(St({},ce.position),{},{offset:ce.position.offset-fe/2})})}))}var Ie=ee&&ee.type&&ee.type.getComposedData;Ie&&U.push({props:St(St({},Ie(St(St({},re),{},{displayedData:B,props:b,dataKey:$,item:ee,bandSize:Oe,barPosition:we,offset:_,stackedData:le,layout:I,dataStartIndex:O,dataEndIndex:T}))),{},xr(xr(xr({key:ee.key||"item-".concat(H)},z,re[z]),V,re[V]),"animationId",P)),childIndex:sse(ee,b.children),item:ee})}),U},p=function(b,w){var k=b.props,S=b.dataStartIndex,_=b.dataEndIndex,P=b.updateId;if(!kR({props:k}))return null;var O=k.children,T=k.layout,R=k.stackOffset,I=k.data,E=k.reverseStackOrder,A=u7(T),F=A.numericAxisName,L=A.cateAxisName,z=Ks(O,n),V=fge(I,z,"".concat(F,"Id"),"".concat(L,"Id"),R,E),Q=c.reduce(function(M,$){var q="".concat($.axisType,"Map");return St(St({},M),{},xr({},q,L2e(k,St(St({},$),{},{graphicalItems:z,stackGroups:$.axisType===F&&V,dataStartIndex:S,dataEndIndex:_}))))},{}),U=D2e(St(St({},Q),{},{props:k,graphicalItems:z}),w==null?void 0:w.legendBBox);Object.keys(Q).forEach(function(M){Q[M]=d(k,Q[M],U,M.replace("Map",""),r)});var ee=Q["".concat(L,"Map")],H=F2e(ee),B=h(k,St(St({},Q),{},{dataStartIndex:S,dataEndIndex:_,updateId:P,graphicalItems:z,stackGroups:V,offset:U}));return St(St({formattedGraphicalItems:B,graphicalItems:z,offset:U,stackGroups:V},H),Q)},y=(function(x){function b(w){var k,S,_;return y2e(this,b),_=w2e(this,b,[w]),xr(_,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),xr(_,"accessibilityManager",new i2e),xr(_,"handleLegendBBoxUpdate",function(P){if(P){var O=_.state,T=O.dataStartIndex,R=O.dataEndIndex,I=O.updateId;_.setState(St({legendBBox:P},p({props:_.props,dataStartIndex:T,dataEndIndex:R,updateId:I},St(St({},_.state),{},{legendBBox:P}))))}}),xr(_,"handleReceiveSyncEvent",function(P,O,T){if(_.props.syncId===P){if(T===_.eventEmitterSymbol&&typeof _.props.syncMethod!="function")return;_.applySyncEvent(O)}}),xr(_,"handleBrushChange",function(P){var O=P.startIndex,T=P.endIndex;if(O!==_.state.dataStartIndex||T!==_.state.dataEndIndex){var R=_.state.updateId;_.setState(function(){return St({dataStartIndex:O,dataEndIndex:T},p({props:_.props,dataStartIndex:O,dataEndIndex:T,updateId:R},_.state))}),_.triggerSyncEvent({dataStartIndex:O,dataEndIndex:T})}}),xr(_,"handleMouseEnter",function(P){var O=_.getMouseInfo(P);if(O){var T=St(St({},O),{},{isTooltipActive:!0});_.setState(T),_.triggerSyncEvent(T);var R=_.props.onMouseEnter;Ar(R)&&R(T,P)}}),xr(_,"triggeredAfterMouseMove",function(P){var O=_.getMouseInfo(P),T=O?St(St({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};_.setState(T),_.triggerSyncEvent(T);var R=_.props.onMouseMove;Ar(R)&&R(T,P)}),xr(_,"handleItemMouseEnter",function(P){_.setState(function(){return{isTooltipActive:!0,activeItem:P,activePayload:P.tooltipPayload,activeCoordinate:P.tooltipPosition||{x:P.cx,y:P.cy}}})}),xr(_,"handleItemMouseLeave",function(){_.setState(function(){return{isTooltipActive:!1}})}),xr(_,"handleMouseMove",function(P){P.persist(),_.throttleTriggeredAfterMouseMove(P)}),xr(_,"handleMouseLeave",function(P){_.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};_.setState(O),_.triggerSyncEvent(O);var T=_.props.onMouseLeave;Ar(T)&&T(O,P)}),xr(_,"handleOuterEvent",function(P){var O=ase(P),T=Gs(_.props,"".concat(O));if(O&&Ar(T)){var R,I;/.*touch.*/i.test(O)?I=_.getMouseInfo(P.changedTouches[0]):I=_.getMouseInfo(P),T((R=I)!==null&&R!==void 0?R:{},P)}}),xr(_,"handleClick",function(P){var O=_.getMouseInfo(P);if(O){var T=St(St({},O),{},{isTooltipActive:!0});_.setState(T),_.triggerSyncEvent(T);var R=_.props.onClick;Ar(R)&&R(T,P)}}),xr(_,"handleMouseDown",function(P){var O=_.props.onMouseDown;if(Ar(O)){var T=_.getMouseInfo(P);O(T,P)}}),xr(_,"handleMouseUp",function(P){var O=_.props.onMouseUp;if(Ar(O)){var T=_.getMouseInfo(P);O(T,P)}}),xr(_,"handleTouchMove",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&_.throttleTriggeredAfterMouseMove(P.changedTouches[0])}),xr(_,"handleTouchStart",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&_.handleMouseDown(P.changedTouches[0])}),xr(_,"handleTouchEnd",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&_.handleMouseUp(P.changedTouches[0])}),xr(_,"handleDoubleClick",function(P){var O=_.props.onDoubleClick;if(Ar(O)){var T=_.getMouseInfo(P);O(T,P)}}),xr(_,"handleContextMenu",function(P){var O=_.props.onContextMenu;if(Ar(O)){var T=_.getMouseInfo(P);O(T,P)}}),xr(_,"triggerSyncEvent",function(P){_.props.syncId!==void 0&&w4.emit(S4,_.props.syncId,P,_.eventEmitterSymbol)}),xr(_,"applySyncEvent",function(P){var O=_.props,T=O.layout,R=O.syncMethod,I=_.state.updateId,E=P.dataStartIndex,A=P.dataEndIndex;if(P.dataStartIndex!==void 0||P.dataEndIndex!==void 0)_.setState(St({dataStartIndex:E,dataEndIndex:A},p({props:_.props,dataStartIndex:E,dataEndIndex:A,updateId:I},_.state)));else if(P.activeTooltipIndex!==void 0){var F=P.chartX,L=P.chartY,z=P.activeTooltipIndex,V=_.state,Q=V.offset,U=V.tooltipTicks;if(!Q)return;if(typeof R=="function")z=R(U,P);else if(R==="value"){z=-1;for(var ee=0;ee<U.length;ee++)if(U[ee].value===P.activeLabel){z=ee;break}}var H=St(St({},Q),{},{x:Q.left,y:Q.top}),B=Math.min(F,H.x+H.width),M=Math.min(L,H.y+H.height),$=U[z]&&U[z].value,q=PA(_.state,_.props.data,z),Y=U[z]?{x:T==="horizontal"?U[z].coordinate:B,y:T==="horizontal"?M:U[z].coordinate}:mY;_.setState(St(St({},P),{},{activeLabel:$,activeCoordinate:Y,activePayload:q,activeTooltipIndex:z}))}else _.setState(P)}),xr(_,"renderCursor",function(P){var O,T=_.state,R=T.isTooltipActive,I=T.activeCoordinate,E=T.activePayload,A=T.offset,F=T.activeTooltipIndex,L=T.tooltipAxisBandSize,z=_.getTooltipEventType(),V=(O=P.props.active)!==null&&O!==void 0?O:R,Q=_.props.layout,U=P.key||"_recharts-cursor";return ze.createElement(d2e,{key:U,activeCoordinate:I,activePayload:E,activeTooltipIndex:F,chartName:r,element:P,isActive:V,layout:Q,offset:A,tooltipAxisBandSize:L,tooltipEventType:z})}),xr(_,"renderPolarAxis",function(P,O,T){var R=Gs(P,"type.axisType"),I=Gs(_.state,"".concat(R,"Map")),E=P.type.defaultProps,A=E!==void 0?St(St({},E),P.props):P.props,F=I&&I[A["".concat(R,"Id")]];return j.cloneElement(P,St(St({},F),{},{className:Lr(R,F.className),key:P.key||"".concat(O,"-").concat(T),ticks:td(F,!0)}))}),xr(_,"renderPolarGrid",function(P){var O=P.props,T=O.radialLines,R=O.polarAngles,I=O.polarRadius,E=_.state,A=E.radiusAxisMap,F=E.angleAxisMap,L=xf(A),z=xf(F),V=z.cx,Q=z.cy,U=z.innerRadius,ee=z.outerRadius;return j.cloneElement(P,{polarAngles:Array.isArray(R)?R:td(z,!0).map(function(H){return H.coordinate}),polarRadius:Array.isArray(I)?I:td(L,!0).map(function(H){return H.coordinate}),cx:V,cy:Q,innerRadius:U,outerRadius:ee,key:P.key||"polar-grid",radialLines:T})}),xr(_,"renderLegend",function(){var P=_.state.formattedGraphicalItems,O=_.props,T=O.children,R=O.width,I=O.height,E=_.props.margin||{},A=R-(E.left||0)-(E.right||0),F=ZH({children:T,formattedGraphicalItems:P,legendWidth:A,legendContent:u});if(!F)return null;var L=F.item,z=a7(F,f2e);return j.cloneElement(L,St(St({},z),{},{chartWidth:R,chartHeight:I,margin:E,onBBoxUpdate:_.handleLegendBBoxUpdate}))}),xr(_,"renderTooltip",function(){var P,O=_.props,T=O.children,R=O.accessibilityLayer,I=Bs(T,kl);if(!I)return null;var E=_.state,A=E.isTooltipActive,F=E.activeCoordinate,L=E.activePayload,z=E.activeLabel,V=E.offset,Q=(P=I.props.active)!==null&&P!==void 0?P:A;return j.cloneElement(I,{viewBox:St(St({},V),{},{x:V.left,y:V.top}),active:Q,label:z,payload:Q?L:[],coordinate:F,accessibilityLayer:R})}),xr(_,"renderBrush",function(P){var O=_.props,T=O.margin,R=O.data,I=_.state,E=I.offset,A=I.dataStartIndex,F=I.dataEndIndex,L=I.updateId;return j.cloneElement(P,{key:P.key||"_recharts-brush",onChange:B1(_.handleBrushChange,P.props.onChange),data:R,x:Bt(P.props.x)?P.props.x:E.left,y:Bt(P.props.y)?P.props.y:E.top+E.height+E.brushBottom-(T.bottom||0),width:Bt(P.props.width)?P.props.width:E.width,startIndex:A,endIndex:F,updateId:"brush-".concat(L)})}),xr(_,"renderReferenceElement",function(P,O,T){if(!P)return null;var R=_,I=R.clipPathId,E=_.state,A=E.xAxisMap,F=E.yAxisMap,L=E.offset,z=P.type.defaultProps||{},V=P.props,Q=V.xAxisId,U=Q===void 0?z.xAxisId:Q,ee=V.yAxisId,H=ee===void 0?z.yAxisId:ee;return j.cloneElement(P,{key:P.key||"".concat(O,"-").concat(T),xAxis:A[U],yAxis:F[H],viewBox:{x:L.left,y:L.top,width:L.width,height:L.height},clipPathId:I})}),xr(_,"renderActivePoints",function(P){var O=P.item,T=P.activePoint,R=P.basePoint,I=P.childIndex,E=P.isRange,A=[],F=O.props.key,L=O.item.type.defaultProps!==void 0?St(St({},O.item.type.defaultProps),O.item.props):O.item.props,z=L.activeDot,V=L.dataKey,Q=St(St({index:I,dataKey:V,cx:T.x,cy:T.y,r:4,fill:JT(O.item),strokeWidth:2,stroke:"#fff",payload:T.payload,value:T.value},vr(z,!1)),H0(z));return A.push(b.renderActiveDot(z,Q,"".concat(F,"-activePoint-").concat(I))),R?A.push(b.renderActiveDot(z,St(St({},Q),{},{cx:R.x,cy:R.y}),"".concat(F,"-basePoint-").concat(I))):E&&A.push(null),A}),xr(_,"renderGraphicChild",function(P,O,T){var R=_.filterFormatItem(P,O,T);if(!R)return null;var I=_.getTooltipEventType(),E=_.state,A=E.isTooltipActive,F=E.tooltipAxis,L=E.activeTooltipIndex,z=E.activeLabel,V=_.props.children,Q=Bs(V,kl),U=R.props,ee=U.points,H=U.isRange,B=U.baseLine,M=R.item.type.defaultProps!==void 0?St(St({},R.item.type.defaultProps),R.item.props):R.item.props,$=M.activeDot,q=M.hide,Y=M.activeBar,K=M.activeShape,G=!!(!q&&A&&Q&&($||Y||K)),re={};I!=="axis"&&Q&&Q.props.trigger==="click"?re={onClick:B1(_.handleItemMouseEnter,P.props.onClick)}:I!=="axis"&&(re={onMouseLeave:B1(_.handleItemMouseLeave,P.props.onMouseLeave),onMouseEnter:B1(_.handleItemMouseEnter,P.props.onMouseEnter)});var J=j.cloneElement(P,St(St({},R.props),re));function ae(je){return typeof F.dataKey=="function"?F.dataKey(je.payload):null}if(G)if(L>=0){var le,me;if(F.dataKey&&!F.allowDuplicatedCategory){var Oe=typeof F.dataKey=="function"?ae:"payload.".concat(F.dataKey.toString());le=U0(ee,Oe,z),me=H&&B&&U0(B,Oe,z)}else le=ee==null?void 0:ee[L],me=H&&B&&B[L];if(K||Y){var we=P.props.activeIndex!==void 0?P.props.activeIndex:L;return[j.cloneElement(P,St(St(St({},R.props),re),{},{activeIndex:we})),null,null]}if(!Rr(le))return[J].concat(Vm(_.renderActivePoints({item:R,activePoint:le,basePoint:me,childIndex:L,isRange:H})))}else{var ie,Me=(ie=_.getItemByXY(_.state.activeCoordinate))!==null&&ie!==void 0?ie:{graphicalItem:J},ke=Me.graphicalItem,se=ke.item,fe=se===void 0?P:se,Ie=ke.childIndex,ce=St(St(St({},R.props),re),{},{activeIndex:Ie});return[j.cloneElement(fe,ce),null,null]}return H?[J,null,null]:[J,null]}),xr(_,"renderCustomized",function(P,O,T){return j.cloneElement(P,St(St({key:"recharts-customized-".concat(T)},_.props),_.state))}),xr(_,"renderMap",{CartesianGrid:{handler:H1,once:!0},ReferenceArea:{handler:_.renderReferenceElement},ReferenceLine:{handler:H1},ReferenceDot:{handler:_.renderReferenceElement},XAxis:{handler:H1},YAxis:{handler:H1},Brush:{handler:_.renderBrush,once:!0},Bar:{handler:_.renderGraphicChild},Line:{handler:_.renderGraphicChild},Area:{handler:_.renderGraphicChild},Radar:{handler:_.renderGraphicChild},RadialBar:{handler:_.renderGraphicChild},Scatter:{handler:_.renderGraphicChild},Pie:{handler:_.renderGraphicChild},Funnel:{handler:_.renderGraphicChild},Tooltip:{handler:_.renderCursor,once:!0},PolarGrid:{handler:_.renderPolarGrid,once:!0},PolarAngleAxis:{handler:_.renderPolarAxis},PolarRadiusAxis:{handler:_.renderPolarAxis},Customized:{handler:_.renderCustomized}}),_.clipPathId="".concat((k=w.id)!==null&&k!==void 0?k:vv("recharts"),"-clip"),_.throttleTriggeredAfterMouseMove=XU(_.triggeredAfterMouseMove,(S=w.throttleDelay)!==null&&S!==void 0?S:1e3/60),_.state={},_}return k2e(b,x),b2e(b,[{key:"componentDidMount",value:function(){var k,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(k=this.props.margin.left)!==null&&k!==void 0?k:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var k=this.props,S=k.children,_=k.data,P=k.height,O=k.layout,T=Bs(S,kl);if(T){var R=T.props.defaultIndex;if(!(typeof R!="number"||R<0||R>this.state.tooltipTicks.length-1)){var I=this.state.tooltipTicks[R]&&this.state.tooltipTicks[R].value,E=PA(this.state,_,R,I),A=this.state.tooltipTicks[R].coordinate,F=(this.state.offset.top+P)/2,L=O==="horizontal",z=L?{x:A,y:F}:{y:A,x:F},V=this.state.formattedGraphicalItems.find(function(U){var ee=U.item;return ee.type.name==="Scatter"});V&&(z=St(St({},z),V.props.points[R].tooltipPosition),E=V.props.points[R].tooltipPayload);var Q={activeTooltipIndex:R,isTooltipActive:!0,activeLabel:I,activePayload:E,activeCoordinate:z};this.setState(Q),this.renderCursor(T),this.accessibilityManager.setIndex(R)}}}},{key:"getSnapshotBeforeUpdate",value:function(k,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==k.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==k.margin){var _,P;this.accessibilityManager.setDetails({offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0}})}return null}},{key:"componentDidUpdate",value:function(k){dE([Bs(k.children,kl)],[Bs(this.props.children,kl)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var k=Bs(this.props.children,kl);if(k&&typeof k.props.shared=="boolean"){var S=k.props.shared?"axis":"item";return l.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(k){if(!this.container)return null;var S=this.container,_=S.getBoundingClientRect(),P=Yue(_),O={chartX:Math.round(k.pageX-P.left),chartY:Math.round(k.pageY-P.top)},T=_.width/S.offsetWidth||1,R=this.inRange(O.chartX,O.chartY,T);if(!R)return null;var I=this.state,E=I.xAxisMap,A=I.yAxisMap,F=this.getTooltipEventType(),L=l7(this.state,this.props.data,this.props.layout,R);if(F!=="axis"&&E&&A){var z=xf(E).scale,V=xf(A).scale,Q=z&&z.invert?z.invert(O.chartX):null,U=V&&V.invert?V.invert(O.chartY):null;return St(St({},O),{},{xValue:Q,yValue:U},L)}return L?St(St({},O),L):null}},{key:"inRange",value:function(k,S){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,P=this.props.layout,O=k/_,T=S/_;if(P==="horizontal"||P==="vertical"){var R=this.state.offset,I=O>=R.left&&O<=R.left+R.width&&T>=R.top&&T<=R.top+R.height;return I?{x:O,y:T}:null}var E=this.state,A=E.angleAxisMap,F=E.radiusAxisMap;if(A&&F){var L=xf(A);return pD({x:O,y:T},L)}return null}},{key:"parseEventsOfWrapper",value:function(){var k=this.props.children,S=this.getTooltipEventType(),_=Bs(k,kl),P={};_&&S==="axis"&&(_.props.trigger==="click"?P={onClick:this.handleClick}:P={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=H0(this.props,this.handleOuterEvent);return St(St({},O),P)}},{key:"addListener",value:function(){w4.on(S4,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){w4.removeListener(S4,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(k,S,_){for(var P=this.state.formattedGraphicalItems,O=0,T=P.length;O<T;O++){var R=P[O];if(R.item===k||R.props.key===k.key||S===ad(R.item.type)&&_===R.childIndex)return R}return null}},{key:"renderClipPath",value:function(){var k=this.clipPathId,S=this.state.offset,_=S.left,P=S.top,O=S.height,T=S.width;return ze.createElement("defs",null,ze.createElement("clipPath",{id:k},ze.createElement("rect",{x:_,y:P,height:O,width:T})))}},{key:"getXScales",value:function(){var k=this.state.xAxisMap;return k?Object.entries(k).reduce(function(S,_){var P=o7(_,2),O=P[0],T=P[1];return St(St({},S),{},xr({},O,T.scale))},{}):null}},{key:"getYScales",value:function(){var k=this.state.yAxisMap;return k?Object.entries(k).reduce(function(S,_){var P=o7(_,2),O=P[0],T=P[1];return St(St({},S),{},xr({},O,T.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(k){var S;return(S=this.state.xAxisMap)===null||S===void 0||(S=S[k])===null||S===void 0?void 0:S.scale}},{key:"getYScaleByAxisId",value:function(k){var S;return(S=this.state.yAxisMap)===null||S===void 0||(S=S[k])===null||S===void 0?void 0:S.scale}},{key:"getItemByXY",value:function(k){var S=this.state,_=S.formattedGraphicalItems,P=S.activeItem;if(_&&_.length)for(var O=0,T=_.length;O<T;O++){var R=_[O],I=R.props,E=R.item,A=E.type.defaultProps!==void 0?St(St({},E.type.defaultProps),E.props):E.props,F=ad(E.type);if(F==="Bar"){var L=(I.data||[]).find(function(U){return pye(k,U)});if(L)return{graphicalItem:R,payload:L}}else if(F==="RadialBar"){var z=(I.data||[]).find(function(U){return pD(k,U)});if(z)return{graphicalItem:R,payload:z}}else if(pS(R,P)||hS(R,P)||Lx(R,P)){var V=Fxe({graphicalItem:R,activeTooltipItem:P,itemData:A.data}),Q=A.activeIndex===void 0?V:A.activeIndex;return{graphicalItem:St(St({},R),{},{childIndex:Q}),payload:Lx(R,P)?A.data[V]:R.props.data[V]}}}return null}},{key:"render",value:function(){var k=this;if(!kR(this))return null;var S=this.props,_=S.children,P=S.className,O=S.width,T=S.height,R=S.style,I=S.compact,E=S.title,A=S.desc,F=a7(S,p2e),L=vr(F,!1);if(I)return ze.createElement(Bz,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},ze.createElement(pE,Yg({},L,{width:O,height:T,title:E,desc:A}),this.renderClipPath(),CR(_,this.renderMap)));if(this.props.accessibilityLayer){var z,V;L.tabIndex=(z=this.props.tabIndex)!==null&&z!==void 0?z:0,L.role=(V=this.props.role)!==null&&V!==void 0?V:"application",L.onKeyDown=function(U){k.accessibilityManager.keyboardEvent(U)},L.onFocus=function(){k.accessibilityManager.focus()}}var Q=this.parseEventsOfWrapper();return ze.createElement(Bz,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},ze.createElement("div",Yg({className:Lr("recharts-wrapper",P),style:St({position:"relative",cursor:"default",width:O,height:T},R)},Q,{ref:function(ee){k.container=ee}}),ze.createElement(pE,Yg({},L,{width:O,height:T,title:E,desc:A,style:P2e}),this.renderClipPath(),CR(_,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(j.Component);xr(y,"displayName",r),xr(y,"defaultProps",St({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),xr(y,"getDerivedStateFromProps",function(x,b){var w=x.dataKey,k=x.data,S=x.children,_=x.width,P=x.height,O=x.layout,T=x.stackOffset,R=x.margin,I=b.dataStartIndex,E=b.dataEndIndex;if(b.updateId===void 0){var A=c7(x);return St(St(St({},A),{},{updateId:0},p(St(St({props:x},A),{},{updateId:0}),b)),{},{prevDataKey:w,prevData:k,prevWidth:_,prevHeight:P,prevLayout:O,prevStackOffset:T,prevMargin:R,prevChildren:S})}if(w!==b.prevDataKey||k!==b.prevData||_!==b.prevWidth||P!==b.prevHeight||O!==b.prevLayout||T!==b.prevStackOffset||!tm(R,b.prevMargin)){var F=c7(x),L={chartX:b.chartX,chartY:b.chartY,isTooltipActive:b.isTooltipActive},z=St(St({},l7(b,k,O)),{},{updateId:b.updateId+1}),V=St(St(St({},F),L),z);return St(St(St({},V),p(St({props:x},V),b)),{},{prevDataKey:w,prevData:k,prevWidth:_,prevHeight:P,prevLayout:O,prevStackOffset:T,prevMargin:R,prevChildren:S})}if(!dE(S,b.prevChildren)){var Q,U,ee,H,B=Bs(S,Nm),M=B&&(Q=(U=B.props)===null||U===void 0?void 0:U.startIndex)!==null&&Q!==void 0?Q:I,$=B&&(ee=(H=B.props)===null||H===void 0?void 0:H.endIndex)!==null&&ee!==void 0?ee:E,q=M!==I||$!==E,Y=!Rr(k),K=Y&&!q?b.updateId:b.updateId+1;return St(St({updateId:K},p(St(St({props:x},b),{},{updateId:K,dataStartIndex:M,dataEndIndex:$}),b)),{},{prevChildren:S,dataStartIndex:M,dataEndIndex:$})}return null}),xr(y,"renderActiveDot",function(x,b,w){var k;return j.isValidElement(x)?k=j.cloneElement(x,b):Ar(x)?k=x(b):k=ze.createElement(lS,b),ze.createElement(ln,{className:"recharts-active-dot",key:w},k)});var m=j.forwardRef(function(b,w){return ze.createElement(y,Yg({},b,{ref:w}))});return m.displayName=y.displayName,m},B2e=uP({chartName:"LineChart",GraphicalChild:Bm,axisComponents:[{axisType:"xAxis",AxisComp:qm},{axisType:"yAxis",AxisComp:Um}],formatAxisMap:MV}),W2e=uP({chartName:"BarChart",GraphicalChild:Ff,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:qm},{axisType:"yAxis",AxisComp:Um}],formatAxisMap:MV}),q2e=uP({chartName:"PieChart",GraphicalChild:kd,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:fS},{axisType:"radiusAxis",AxisComp:uS}],formatAxisMap:kge,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const $2e=[{week:"Wk 1",Registrations:11,"Check-ins":0},{week:"Wk 2",Registrations:18,"Check-ins":0},{week:"Wk 3",Registrations:25,"Check-ins":8},{week:"Wk 4",Registrations:26,"Check-ins":18}],U2e=[{name:"Pulmonary",Responses:22,"Avg Score":82},{name:"ICS Guide",Responses:17,"Avg Score":65},{name:"COPD",Responses:24,"Avg Score":90},{name:"Resp.Phy",Responses:12,"Avg Score":45}],k4=[{name:"Delegates",value:18},{name:"Speakers",value:3},{name:"Moderators",value:2},{name:"Panelists",value:2},{name:"Admins",value:1}],V1=["var(--chart-1)","var(--chart-2)","var(--chart-3)","var(--chart-4)","var(--chart-5)"],_4={background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",fontSize:"12px",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",boxShadow:"var(--elevation-sm)"},Y1={fontSize:11,fontFamily:"var(--font-noto-sans)",fill:"var(--muted)"};function C4({title:e,subtitle:t,children:r}){return i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"20px"},children:[i.jsxs("div",{style:{marginBottom:"16px"},children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.3"},children:e}),t&&i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-xs)",color:"var(--muted)",marginTop:"2px"},children:t})]}),r]})}function H2e(){const e=qi(),t=e==="mobile",r=e==="tablet",n=t?1:r?2:3,o=t?160:180;return i.jsxs("div",{style:{display:"grid",gridTemplateColumns:`repeat(${n}, 1fr)`,gap:t?"12px":"16px"},children:[i.jsx(C4,{title:"Registration Trend",subtitle:"Weekly registrations vs check-ins",children:i.jsx(EC,{width:"100%",height:o,children:i.jsxs(B2e,{data:$2e,margin:{top:4,right:8,left:-24,bottom:0},children:[i.jsx(xA,{strokeDasharray:"3 3",stroke:"var(--border)",vertical:!1}),i.jsx(qm,{dataKey:"week",tick:Y1,axisLine:!1,tickLine:!1}),i.jsx(Um,{tick:Y1,axisLine:!1,tickLine:!1}),i.jsx(kl,{contentStyle:_4}),i.jsx(Af,{iconType:"circle",iconSize:7,wrapperStyle:{fontSize:"11px",fontFamily:"var(--font-noto-sans)"}}),i.jsx(Bm,{type:"monotone",dataKey:"Registrations",stroke:"var(--chart-2)",strokeWidth:2,dot:{r:3,fill:"var(--chart-2)",strokeWidth:0},activeDot:{r:5}}),i.jsx(Bm,{type:"monotone",dataKey:"Check-ins",stroke:"var(--chart-1)",strokeWidth:2,dot:{r:3,fill:"var(--chart-1)",strokeWidth:0},activeDot:{r:5},strokeDasharray:"4 3"})]})})}),i.jsx(C4,{title:"Quiz Participation",subtitle:"Responses and average scores",children:i.jsx(EC,{width:"100%",height:o,children:i.jsxs(W2e,{data:U2e,margin:{top:4,right:8,left:-24,bottom:0},children:[i.jsx(xA,{strokeDasharray:"3 3",stroke:"var(--border)",vertical:!1}),i.jsx(qm,{dataKey:"name",tick:Y1,axisLine:!1,tickLine:!1}),i.jsx(Um,{tick:Y1,axisLine:!1,tickLine:!1}),i.jsx(kl,{contentStyle:_4}),i.jsx(Af,{iconType:"square",iconSize:7,wrapperStyle:{fontSize:"11px",fontFamily:"var(--font-noto-sans)"}}),i.jsx(Ff,{dataKey:"Responses",fill:"var(--chart-3)",radius:[3,3,0,0]}),i.jsx(Ff,{dataKey:"Avg Score",fill:"var(--chart-4)",radius:[3,3,0,0]})]})})}),i.jsx("div",{style:r?{gridColumn:"1 / -1"}:{},children:i.jsx(C4,{title:"Participant Roles",subtitle:"Breakdown by role type",children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px"},children:[i.jsx(EC,{width:t?"45%":"50%",height:t?140:160,children:i.jsxs(q2e,{children:[i.jsx(kd,{data:k4,cx:"50%",cy:"50%",innerRadius:t?36:44,outerRadius:t?60:72,paddingAngle:2,dataKey:"value",children:k4.map((a,s)=>i.jsx(Qw,{fill:V1[s%V1.length]},`cell-${a.name}`))}),i.jsx(kl,{contentStyle:_4})]})}),i.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"7px"},children:k4.map((a,s)=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"7px"},children:[i.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",background:V1[s%V1.length],flexShrink:0}}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",flex:1},children:a.name}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",fontWeight:"var(--font-weight-medium)"},children:a.value})]},`legend-${a.name}`))})]})})})]})}const V2e={conference:"Conference",workshop:"Workshop",summit:"Summit",cme:"CME",webinar:"Webinar"},d7={draft:{label:"Draft",bg:"#64748b"},upcoming:{label:"Upcoming",bg:"#2563eb"},live:{label:"Live",bg:"#16a34a"},completed:{label:"Completed",bg:"#475569"}},Y2e={physical:"Physical",virtual:"Virtual",hybrid:"Hybrid"};function G2e(e,t){const r=new Date(e),n=new Date(t);if(Number.isNaN(r.getTime())||Number.isNaN(n.getTime()))return"—";const o=r.toDateString()===n.toDateString(),a=r.getFullYear(),s=n.getFullYear(),l=u=>u.toLocaleDateString(void 0,{month:"short"}),c=u=>u.getDate();return o?r.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}):r.getMonth()===n.getMonth()&&a===s?`${l(r)} ${c(r)}–${c(n)}, ${a}`:a===s?`${l(r)} ${c(r)} – ${l(n)} ${c(n)}, ${a}`:`${l(r)} ${c(r)}, ${a} – ${l(n)} ${c(n)}, ${s}`}function K2e(e){var n,o,a,s;const t=(n=e.bannerImage)==null?void 0:n.trim();if(t)return t;const r=(s=(a=(o=e.website)==null?void 0:o.banners)==null?void 0:a[0])==null?void 0:s.trim();return r||null}function Q2e(e){return null}function X2e({event:e,loading:t=!1,onEditEvent:r,canEdit:n=!0}){var b,w,k,S,_,P,O,T,R,I;const a=qi()==="mobile",[s,l]=j.useState(!1);j.useEffect(()=>{l(!1)},[e==null?void 0:e._id,e==null?void 0:e.bannerImage,(w=(b=e==null?void 0:e.website)==null?void 0:b.banners)==null?void 0:w[0]]);const c=e?K2e(e):null,u=e!=null&&e.status&&d7[e.status]?e.status:"draft",d=d7[u],f=e!=null&&e.type?V2e[e.type]??e.type:"Event",h=e!=null&&e.locationType?Y2e[e.locationType]??e.locationType:"",p=e!=null&&e.startDate&&(e!=null&&e.endDate)?G2e(e.startDate,e.endDate):"—",y=(e==null?void 0:e.locationType)==="virtual"?((k=e.virtualLink)==null?void 0:k.trim())||"Virtual event":(e==null?void 0:e.locationType)==="hybrid"?[(S=e.location)==null?void 0:S.trim(),(_=e.virtualLink)==null?void 0:_.trim()].filter(Boolean).join(" · ")||"Hybrid":((P=e==null?void 0:e.location)==null?void 0:P.trim())||"—",m=(O=e==null?void 0:e.website)!=null&&O.folder?Q2e(e.website.folder):null,x=(e==null?void 0:e.status)==="live"?{dot:"#16a34a",text:a?"Live":"Live now"}:(e==null?void 0:e.status)==="upcoming"?{dot:"#2563eb",text:"Upcoming"}:(e==null?void 0:e.status)==="completed"?{dot:"#64748b",text:a?"Ended":"Completed"}:{dot:"#94a3b8",text:"Draft"};return i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden",display:"flex",flexDirection:"column"},children:[i.jsxs("div",{style:{position:"relative",height:a?"110px":"140px",overflow:"hidden",background:c&&!s?void 0:"linear-gradient(135deg, #1e293b 0%, #334155 50%, #0f172a 100%)"},children:[c&&!s?i.jsx("img",{src:c,alt:"",onError:()=>l(!0),style:{width:"100%",height:"100%",objectFit:"cover"}}):null,i.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to right, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.15) 100%)",display:"flex",alignItems:"flex-end",padding:a?"12px 14px":"16px 20px"},children:i.jsxs("div",{style:{display:"flex",alignItems:"flex-end",justifyContent:"space-between",width:"100%",gap:"10px"},children:[i.jsxs("div",{style:{overflow:"hidden"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"5px",flexWrap:"wrap"},children:[t?i.jsx("span",{style:{display:"inline-block",width:"72px",height:"18px",borderRadius:"999px",background:"rgba(255,255,255,0.2)"}}):i.jsx("span",{style:{background:d.bg,color:"#fff",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",padding:"2px 8px",borderRadius:"999px"},children:d.label}),!a&&i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"rgba(255,255,255,0.65)"},children:[h,f].filter(Boolean).join(" · ")})]}),i.jsx("h2",{style:{fontFamily:"var(--font-inter)",fontSize:a?"var(--text-base)":"var(--text-xl)",fontWeight:"var(--font-weight-medium)",color:"#fff",lineHeight:"1.2",marginBottom:"2px"},children:t?"…":(e==null?void 0:e.name)??"Select an event"}),!a&&i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-xs)",color:"rgba(255,255,255,0.7)"},children:t?" ":((T=e==null?void 0:e.subtitle)==null?void 0:T.trim())||((I=(R=e==null?void 0:e.description)==null?void 0:R.trim())==null?void 0:I.slice(0,120))||" "})]}),i.jsxs("div",{style:{display:"flex",gap:"6px",flexShrink:0,flexWrap:a?"wrap":"nowrap"},children:[!a&&m?i.jsxs("a",{href:m,target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"5px",padding:"6px 12px",borderRadius:"var(--radius-button)",background:"rgba(255,255,255,0.15)",backdropFilter:"blur(4px)",color:"#fff",border:"1px solid rgba(255,255,255,0.25)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",cursor:"pointer",textDecoration:"none"},children:[i.jsx(av,{size:12})," View Website"]}):null,i.jsxs("button",{type:"button",disabled:!n||!e,onClick:()=>n&&e&&(r==null?void 0:r()),style:{display:"flex",alignItems:"center",gap:"5px",padding:"6px 12px",borderRadius:"var(--radius-button)",background:n&&e?"var(--primary)":"var(--secondary)",color:n&&e?"var(--primary-foreground)":"var(--muted)",border:"none",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",cursor:n&&e?"pointer":"not-allowed",opacity:n&&e?1:.7},children:[i.jsx(Ii,{size:12})," Edit"]})]})]})})]}),i.jsxs("div",{style:{padding:a?"8px 14px":"10px 20px",display:"flex",alignItems:"center",gap:a?"12px":"20px",flexWrap:"wrap"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(Wi,{size:12,style:{color:"var(--muted)"}}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:t?"…":p})]}),!a&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(lb,{size:12,style:{color:"var(--muted)"}}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:t?"…":y})]}),i.jsxs("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:x.dot,display:"block"}}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:x.dot,fontWeight:"var(--font-weight-medium)"},children:t?"…":x.text})]})]})]})}const G1={width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",outline:"none",boxSizing:"border-box"};function K1({msg:e}){return e?i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",margin:"4px 0 0",fontFamily:"var(--font-noto-sans)"},children:e}):null}function Z2e({n:e,state:t}){const r=t==="todo"?"var(--muted)":"var(--primary)";return i.jsx("div",{style:{width:28,height:28,borderRadius:"50%",background:r,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t==="done"?i.jsx(Oi,{size:13,style:{color:"#fff"}}):i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-inter)",color:"#fff",fontWeight:"var(--font-weight-medium)"},children:e})})}function J2e({eventId:e,existingTrack:t,onClose:r,onSuccess:n}){const o=!!(t!=null&&t._id),[a,s]=j.useState(1),[l,c]=j.useState(()=>o?new Set([1,2,3]):new Set),[u,d]=j.useState(!1),[f,h]=j.useState(null),[p,y]=j.useState((t==null?void 0:t.name)||""),[m,x]=j.useState((t==null?void 0:t.trackType)||"general"),[b,w]=j.useState((t==null?void 0:t.hall)||""),[k,S]=j.useState((t==null?void 0:t.status)||"active"),[_,P]=j.useState({}),[O,T]=j.useState({}),[R,I]=j.useState({}),E=j.useCallback(()=>{const ee={};return p.trim()?p.trim().length<2&&(ee.name="Use at least 2 characters."):ee.name="Track name is required.",P(ee),Object.keys(ee).length===0},[p]),A=j.useCallback(()=>(T({}),!0),[]),F=j.useCallback(()=>(I({}),!0),[]),L=j.useCallback(()=>{const ee=E(),H=A(),B=F();return ee&&H&&B},[E,A,F]),z=ee=>{ee===1&&!E()||ee===2&&!A()||(c(H=>new Set([...H,ee])),ee<3&&s(ee+1))},V=async()=>{if(h(null),!L()){E()?A()?s(3):s(2):s(1);return}d(!0);const ee={name:p.trim(),hall:b.trim()||void 0,trackType:m,status:k},H=o?await rh.update(t._id,ee):await rh.create(e,ee);if(d(!1),H.error){h(H.error);return}n(),r()},Q=[{n:1,title:"Track name",subtitle:"How this track appears on the agenda."},{n:2,title:"Type & venue",subtitle:"Track category and hall or room."},{n:3,title:"Status",subtitle:"Active tracks show on the public agenda."}],U=({className:ee})=>i.jsx("button",{type:"button",disabled:u,onClick:V,style:{padding:"6px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:u?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",opacity:u?.85:1,...ee?{}:{}},children:u?"Saving…":o?"Save changes":"Save track"});return i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:r,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:200}}),i.jsxs("div",{style:{position:"fixed",top:0,right:0,height:"100%",width:"min(520px, 100vw)",background:"var(--card)",zIndex:201,display:"flex",flexDirection:"column",boxShadow:"-4px 0 32px rgba(0,0,0,0.18)"},children:[i.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)",flexShrink:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:o?"Edit track":"Add track"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"6px 0 0",fontFamily:"var(--font-noto-sans)"},children:"Complete each section before continuing. Save submits the track."})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:[i.jsx("button",{type:"button",onClick:r,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",color:"var(--muted)"},children:i.jsx(er,{size:14})}),i.jsx(U,{})]})]}),f&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-xs)",marginTop:"10px",fontFamily:"var(--font-noto-sans)"},children:f})]}),i.jsx("div",{style:{flex:1,overflowY:"auto"},children:Q.map(ee=>{const H=a===ee.n,B=l.has(ee.n),M=H?"active":B?"done":"todo";return i.jsxs("div",{style:{borderBottom:"1px solid var(--border)"},children:[i.jsxs("button",{type:"button",onClick:()=>s(H?0:ee.n),style:{width:"100%",display:"flex",alignItems:"center",gap:"12px",padding:"14px 20px",background:"none",border:"none",cursor:"pointer",textAlign:"left"},children:[i.jsx(Z2e,{n:ee.n,state:M}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:H?"var(--primary)":"var(--card-foreground)",margin:0},children:ee.title}),!H&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:0,fontFamily:"var(--font-noto-sans)"},children:ee.subtitle})]}),H?i.jsx($f,{size:18,style:{color:"var(--muted)"}}):i.jsx(po,{size:18,style:{color:"var(--muted)"}})]}),H&&i.jsxs("div",{style:{padding:"0 20px 16px 52px"},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 14px",fontFamily:"var(--font-noto-sans)"},children:ee.subtitle}),ee.n===1&&i.jsxs("div",{children:[i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",marginBottom:"6px",fontFamily:"var(--font-noto-sans)"},children:["Track name ",i.jsx("span",{style:{color:"var(--destructive)"},children:"*"})]}),i.jsx("input",{value:p,onChange:$=>{y($.target.value),_.name&&P({})},placeholder:"e.g. Main hall track",style:G1}),i.jsx(K1,{msg:_.name})]}),ee.n===2&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",marginBottom:"6px",fontFamily:"var(--font-noto-sans)"},children:"Track type"}),i.jsxs("select",{value:m,onChange:$=>x($.target.value),style:{...G1,cursor:"pointer"},children:[i.jsx("option",{value:"general",children:"General"}),i.jsx("option",{value:"workshop",children:"Workshop"}),i.jsx("option",{value:"plenary",children:"Plenary"}),i.jsx("option",{value:"symposium",children:"Symposium"})]}),i.jsx(K1,{msg:O.trackType})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",marginBottom:"6px",fontFamily:"var(--font-noto-sans)"},children:"Hall / venue"}),i.jsx("input",{value:b,onChange:$=>w($.target.value),placeholder:"Optional",style:G1}),i.jsx(K1,{msg:O.hall})]})]}),ee.n===3&&i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",marginBottom:"6px",fontFamily:"var(--font-noto-sans)"},children:"Status"}),i.jsxs("select",{value:k,onChange:$=>S($.target.value),style:{...G1,cursor:"pointer"},children:[i.jsx("option",{value:"active",children:"Active"}),i.jsx("option",{value:"inactive",children:"Inactive"})]}),i.jsx(K1,{msg:R.status})]}),i.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"16px",paddingTop:"12px",borderTop:"1px solid var(--border)"},children:ee.n<3?i.jsx("button",{type:"button",onClick:()=>z(ee.n),style:{padding:"6px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:"Next section"}):i.jsx(U,{})})]})]},ee.n)})}),i.jsxs("div",{style:{padding:"14px 20px",borderTop:"1px solid var(--border)",display:"flex",justifyContent:"flex-end",gap:"10px",flexShrink:0},children:[i.jsx("button",{type:"button",onClick:r,style:{padding:"7px 16px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"Cancel"}),i.jsx(U,{})]})]})]})}const ewe={keynote:"Keynote",workshop:"Workshop",panel:"Panel",breakout:"Other",networking:"Qna"},twe={scheduled:"Scheduled",ongoing:"Live",completed:"Completed",cancelled:"Cancelled"};function rwe(e){return{general:"General",workshop:"Workshop",plenary:"Plenary",symposium:"Symposium"}[e]||"General"}function nwe(e){if(e&&typeof e=="object"&&"firstName"in e){const t=e;return`${t.firstName||""} ${t.lastName||""}`.trim()}return""}function iwe(e){var r,n;if((r=e.speakers)!=null&&r.length){const o=e.speakers.map(nwe).filter(Boolean);if(o.length===1)return o[0];if(o.length===2)return`${o[0]} & ${o[1]}`;if(o.length>2)return`${o[0]}, ${o[1]} +${o.length-2}`}const t=(e.description||"").match(/Speaker:\s*(.+?)(?:\n|$)/i);return(n=t==null?void 0:t[1])==null?void 0:n.trim()}function owe(e){const t=new Date(e.startTime),r=new Date(e.endTime),n=s=>Number.isNaN(s.getTime())?{date:"—",time:"—"}:{date:s.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),time:s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})},o=n(t),a=n(r);return{id:e._id,joinCode:e.joinCode,title:e.title,type:ewe[e.type]||"Other",startDate:o.date,startTime:o.time,endDate:a.date,endTime:a.time,status:twe[e.status]||"Scheduled",speaker:iwe(e),description:e.description}}const OA={Presentation:{bg:"#dbeafe",color:"#1d4ed8"},Panel:{bg:"#dcfce7",color:"#15803d"},Keynote:{bg:"#ede9fe",color:"#5b21b6"},Workshop:{bg:"#ffedd5",color:"#c2410c"},Qna:{bg:"#ccfbf1",color:"#0d9488"},Demo:{bg:"#f1f5f9",color:"#475569"},Other:{bg:"#f3f4f6",color:"#6b7280"},Debate:{bg:"#fce7f3",color:"#be185d"},Symposium:{bg:"#dbeafe",color:"#1d4ed8"}},awe={Scheduled:{bg:"#e0e7ff",color:"#3730a3"},Live:{bg:"#dcfce7",color:"#15803d"},Completed:{bg:"#f1f5f9",color:"#475569"},Cancelled:{bg:"#fee2e2",color:"#b91c1c"}};function yY({type:e}){const t=OA[e]||OA.Other;return i.jsx("span",{style:{display:"inline-flex",padding:"2px 7px",borderRadius:"3px",background:t.bg,color:t.color,fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",whiteSpace:"nowrap"},children:e})}function xY({status:e}){const t=awe[e];return i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"999px",background:t.bg,color:t.color,fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",whiteSpace:"nowrap"},children:[e==="Live"&&i.jsx("span",{style:{width:"5px",height:"5px",borderRadius:"50%",background:"#16a34a",display:"block"}}),e]})}const Us={width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",cursor:"pointer",color:"var(--card-foreground)",flexShrink:0};function swe({session:e,onEdit:t,onDelete:r,onDuplicate:n,onOpenQr:o,duplicateLoading:a}){var c,u,d,f;const[s,l]=j.useState(!1);return i.jsxs("tr",{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{background:s?"var(--secondary)":"transparent",transition:"background 0.12s",borderBottom:"1px solid var(--border)"},children:[i.jsx("td",{style:{width:"32px",paddingLeft:"12px"},children:i.jsx("div",{style:{opacity:s?1:0,transition:"opacity 0.15s",color:"var(--muted)",cursor:"grab",display:"flex"},children:i.jsx(sv,{size:14})})}),i.jsxs("td",{style:{padding:"10px 12px 10px 4px"},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)",fontWeight:"var(--font-weight-medium)",lineHeight:"1.4"},children:e.title}),e.speaker&&i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"2px",display:"flex",alignItems:"center",gap:"3px"},children:[i.jsx(ym,{size:10})," ",e.speaker]})]}),i.jsx("td",{style:{padding:"10px 12px",whiteSpace:"nowrap"},children:i.jsx(yY,{type:e.type})}),i.jsx("td",{style:{padding:"10px 12px",whiteSpace:"nowrap"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(ob,{size:11,style:{color:"var(--muted)",flexShrink:0}}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:[e.startDate,", ",e.startTime," – ",e.endTime]})]})}),i.jsx("td",{style:{padding:"10px 12px",whiteSpace:"nowrap"},children:i.jsx(xY,{status:e.status})}),i.jsx("td",{style:{padding:"10px 12px"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"4px",flexWrap:"wrap"},children:[i.jsxs("button",{type:"button",onClick:h=>{h.stopPropagation(),t()},title:"Edit",style:{display:"flex",alignItems:"center",gap:"4px",padding:"3px 10px",borderRadius:"var(--radius-button)",background:"var(--card)",border:"1px solid var(--border)",color:"var(--card-foreground)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},onMouseEnter:h=>{h.currentTarget.style.borderColor="var(--primary)",h.currentTarget.style.color="var(--primary)"},onMouseLeave:h=>{h.currentTarget.style.borderColor="var(--border)",h.currentTarget.style.color="var(--card-foreground)"},children:[i.jsx(Ii,{size:11})," Edit"]}),i.jsx("button",{type:"button",title:(c=e.joinCode)!=null&&c.trim()?"QR code":"Join code not available yet",disabled:!((u=e.joinCode)!=null&&u.trim()),onClick:h=>{h.stopPropagation(),o()},style:{...Us,opacity:(d=e.joinCode)!=null&&d.trim()?1:.35,cursor:(f=e.joinCode)!=null&&f.trim()?"pointer":"not-allowed"},onMouseEnter:h=>{var p;(p=e.joinCode)!=null&&p.trim()&&(h.currentTarget.style.borderColor="var(--primary)",h.currentTarget.style.color="var(--primary)")},onMouseLeave:h=>{h.currentTarget.style.borderColor="var(--border)",h.currentTarget.style.color="var(--card-foreground)"},children:i.jsx(lv,{size:13})}),i.jsx("button",{type:"button",title:"Duplicate",disabled:a,onClick:h=>{h.stopPropagation(),n()},style:{...Us,opacity:a?.7:1,cursor:a?"wait":"pointer"},onMouseEnter:h=>{a||(h.currentTarget.style.borderColor="var(--primary)",h.currentTarget.style.color="var(--primary)")},onMouseLeave:h=>{h.currentTarget.style.borderColor="var(--border)",h.currentTarget.style.color="var(--card-foreground)"},children:a?i.jsx(ix,{size:13,className:"animate-spin"}):i.jsx(iu,{size:13})}),i.jsx("button",{type:"button",title:"View Feedback",onClick:h=>{h.stopPropagation()},style:Us,onMouseEnter:h=>{h.currentTarget.style.borderColor="var(--primary)",h.currentTarget.style.color="var(--primary)"},onMouseLeave:h=>{h.currentTarget.style.borderColor="var(--border)",h.currentTarget.style.color="var(--card-foreground)"},children:i.jsx(Zs,{size:13})}),i.jsx("button",{type:"button",title:"View Ratings",onClick:h=>{h.stopPropagation()},style:Us,onMouseEnter:h=>{h.currentTarget.style.borderColor="var(--primary)",h.currentTarget.style.color="var(--primary)"},onMouseLeave:h=>{h.currentTarget.style.borderColor="var(--border)",h.currentTarget.style.color="var(--card-foreground)"},children:i.jsx(Rf,{size:13})}),i.jsx("button",{type:"button",title:"Delete",onClick:h=>{h.stopPropagation(),r()},style:{...Us,color:"var(--destructive)",borderColor:"var(--border)"},onMouseEnter:h=>{h.currentTarget.style.background="#fef2f2",h.currentTarget.style.borderColor="var(--destructive)"},onMouseLeave:h=>{h.currentTarget.style.background="var(--card)",h.currentTarget.style.borderColor="var(--border)"},children:i.jsx(gn,{size:13})})]})})]})}function lwe({session:e,onEdit:t,onDelete:r,onDuplicate:n,onOpenQr:o,duplicateLoading:a}){var c,u,d,f,h;const[s,l]=j.useState(!1);return i.jsxs("div",{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"14px 16px",display:"flex",flexDirection:"column",gap:"8px",borderTop:`3px solid ${((c=OA[e.type])==null?void 0:c.color)||"#94a3b8"}`,transition:"box-shadow 0.15s",boxShadow:s?"var(--elevation-sm)":"none"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"8px"},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.4",flex:1},children:e.title}),i.jsx("div",{style:{display:"flex",alignItems:"center",gap:"4px",flexShrink:0},children:i.jsx(yY,{type:e.type})})]}),e.speaker&&i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",display:"flex",alignItems:"center",gap:"4px"},children:[i.jsx(ym,{size:10})," ",e.speaker]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"8px",borderTop:"1px solid var(--border)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(ob,{size:11,style:{color:"var(--muted)"}}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:[e.startDate,", ",e.startTime," – ",e.endTime]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap",justifyContent:"flex-end"},children:[i.jsx(xY,{status:e.status}),i.jsxs("div",{style:{display:"flex",gap:"4px",alignItems:"center",flexShrink:0},children:[i.jsx("button",{type:"button",onClick:t,title:"Edit",style:{...Us,width:"28px",height:"28px"},onMouseEnter:p=>{p.currentTarget.style.borderColor="var(--primary)",p.currentTarget.style.color="var(--primary)"},onMouseLeave:p=>{p.currentTarget.style.borderColor="var(--border)",p.currentTarget.style.color="var(--card-foreground)"},children:i.jsx(Ii,{size:11})}),i.jsx("button",{type:"button",title:(u=e.joinCode)!=null&&u.trim()?"QR code":"Join code not available yet",disabled:!((d=e.joinCode)!=null&&d.trim()),onClick:o,style:{...Us,width:"28px",height:"28px",opacity:(f=e.joinCode)!=null&&f.trim()?1:.35,cursor:(h=e.joinCode)!=null&&h.trim()?"pointer":"not-allowed"},onMouseEnter:p=>{var y;(y=e.joinCode)!=null&&y.trim()&&(p.currentTarget.style.borderColor="var(--primary)",p.currentTarget.style.color="var(--primary)")},onMouseLeave:p=>{p.currentTarget.style.borderColor="var(--border)",p.currentTarget.style.color="var(--card-foreground)"},children:i.jsx(lv,{size:11})}),i.jsx("button",{type:"button",title:"Duplicate",disabled:a,onClick:n,style:{...Us,width:"28px",height:"28px",opacity:a?.7:1,cursor:a?"wait":"pointer"},onMouseEnter:p=>{a||(p.currentTarget.style.borderColor="var(--primary)",p.currentTarget.style.color="var(--primary)")},onMouseLeave:p=>{p.currentTarget.style.borderColor="var(--border)",p.currentTarget.style.color="var(--card-foreground)"},children:a?i.jsx(ix,{size:13,className:"animate-spin"}):i.jsx(iu,{size:13})}),i.jsx("button",{type:"button",title:"Delete",onClick:r,style:{...Us,width:"28px",height:"28px",color:"var(--destructive)"},onMouseEnter:p=>{p.currentTarget.style.background="#fef2f2",p.currentTarget.style.borderColor="var(--destructive)"},onMouseLeave:p=>{p.currentTarget.style.background="var(--card)",p.currentTarget.style.borderColor="var(--border)",p.currentTarget.style.color="var(--destructive)"},children:i.jsx(gn,{size:13})})]})]})]})]})}function cwe({title:e,message:t,confirmLabel:r,variant:n,onConfirm:o,onCancel:a}){const s=n==="danger";return i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",zIndex:110,display:"flex",alignItems:"center",justifyContent:"center"},onClick:a,children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"min(400px, calc(100vw - 32px))",padding:"20px",boxShadow:"var(--shadow-xl)"},onClick:l=>l.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"flex-start",marginBottom:"20px"},children:[i.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"50%",background:s?"#fee2e2":"var(--secondary)",border:s?"none":"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:s?i.jsx(nv,{size:16,style:{color:"var(--destructive)"}}):i.jsx(iu,{size:16,style:{color:"var(--primary)"}})}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"5px"},children:e}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:t})]})]}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"},children:[i.jsx("button",{type:"button",onClick:a,style:{padding:"6px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:"Cancel"}),i.jsx("button",{type:"button",onClick:()=>void Promise.resolve(o()),style:{padding:"6px 14px",borderRadius:"var(--radius-button)",border:"none",background:s?"var(--destructive)":"var(--primary)",color:s?"#fff":"var(--primary-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",cursor:"pointer"},children:r})]})]})})}function uwe({track:e,isOpen:t,virtual:r,onToggle:n,onEdit:o,onDelete:a,onDuplicate:s,onOpenTrackQr:l,duplicateTrackLoading:c,onAddSession:u,onEditSession:d,onDeleteSession:f,onDuplicateSession:h,onOpenSessionQr:p,duplicatingSessionId:y}){var k,S,_,P;const x=qi()==="mobile",[b,w]=j.useState(x?"card":"list");return i.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:"var(--radius-card)",background:"var(--card)",overflow:"hidden"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:x?"0 12px":"0 16px",background:"var(--card)",borderBottom:t?"1px solid var(--border)":"none",minHeight:x?"56px":"52px"},children:[i.jsx("button",{onClick:n,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"22px",height:"22px",borderRadius:"4px",background:"var(--secondary)",border:"none",cursor:"pointer",color:"var(--muted)",flexShrink:0},children:t?i.jsx(po,{size:13}):i.jsx(va,{size:13})}),i.jsxs("button",{onClick:n,style:{display:"flex",alignItems:"center",gap:"8px",flex:1,background:"none",border:"none",cursor:"pointer",textAlign:"left",padding:"0",minWidth:0},children:[i.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",background:"var(--primary)",flexShrink:0}}),i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),!x&&i.jsx("span",{style:{display:"inline-flex",padding:"1px 7px",borderRadius:"3px",background:"var(--accent)",color:"var(--accent-foreground)",fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",flexShrink:0},children:e.type}),!x&&i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"3px",flexShrink:0},children:[i.jsx(lb,{size:11,style:{color:"var(--muted)"}}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:e.hall})]}),i.jsx("span",{style:{marginLeft:"auto",fontSize:"11px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",background:"var(--secondary)",border:"1px solid var(--border)",padding:"1px 8px",borderRadius:"99px",flexShrink:0},children:e.sessions.length}),!x&&e.status==="Active"&&i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:"4px",fontSize:"11px",fontFamily:"var(--font-noto-sans)",color:"#15803d",flexShrink:0},children:[i.jsx("span",{style:{width:"5px",height:"5px",borderRadius:"50%",background:"#16a34a",display:"block"}}),"Active"]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexShrink:0,flexWrap:"wrap",justifyContent:"flex-end"},children:[i.jsxs("button",{type:"button",onClick:O=>{O.stopPropagation(),u()},style:{display:"flex",alignItems:"center",gap:"5px",padding:x?"8px":"5px 12px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:12}),!x&&" Add Session"]}),!r&&i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",title:"Edit track",onClick:O=>{O.stopPropagation(),o()},style:{...Us},onMouseEnter:O=>{O.currentTarget.style.borderColor="var(--primary)",O.currentTarget.style.color="var(--primary)"},onMouseLeave:O=>{O.currentTarget.style.borderColor="var(--border)",O.currentTarget.style.color="var(--card-foreground)"},children:i.jsx(Ii,{size:13})}),i.jsx("button",{type:"button",title:(k=e.joinCode)!=null&&k.trim()?"QR code":"Join code not available yet",disabled:!((S=e.joinCode)!=null&&S.trim()),onClick:O=>{O.stopPropagation(),l()},style:{...Us,opacity:(_=e.joinCode)!=null&&_.trim()?1:.35,cursor:(P=e.joinCode)!=null&&P.trim()?"pointer":"not-allowed"},onMouseEnter:O=>{var T;(T=e.joinCode)!=null&&T.trim()&&(O.currentTarget.style.borderColor="var(--primary)",O.currentTarget.style.color="var(--primary)")},onMouseLeave:O=>{O.currentTarget.style.borderColor="var(--border)",O.currentTarget.style.color="var(--card-foreground)"},children:i.jsx(lv,{size:13})}),i.jsx("button",{type:"button",title:"Duplicate track",disabled:c,onClick:O=>{O.stopPropagation(),s()},style:{...Us,opacity:c?.7:1,cursor:c?"wait":"pointer"},onMouseEnter:O=>{c||(O.currentTarget.style.borderColor="var(--primary)",O.currentTarget.style.color="var(--primary)")},onMouseLeave:O=>{O.currentTarget.style.borderColor="var(--border)",O.currentTarget.style.color="var(--card-foreground)"},children:c?i.jsx(ix,{size:13,className:"animate-spin"}):i.jsx(iu,{size:13})}),i.jsx("button",{type:"button",title:"Delete track",onClick:O=>{O.stopPropagation(),a()},style:{...Us,color:"var(--destructive)"},onMouseEnter:O=>{O.currentTarget.style.background="#fef2f2",O.currentTarget.style.borderColor="var(--destructive)"},onMouseLeave:O=>{O.currentTarget.style.background="var(--card)",O.currentTarget.style.borderColor="var(--border)",O.currentTarget.style.color="var(--destructive)"},children:i.jsx(gn,{size:13})})]})]})]}),t&&i.jsxs("div",{children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px",borderBottom:"1px solid var(--border)",background:"var(--secondary)"},children:[i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[e.sessions.length," session",e.sessions.length!==1?"s":""," in this track"]}),i.jsx("div",{style:{display:"flex",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",overflow:"hidden",background:"var(--card)"},children:["list","card"].map(O=>i.jsxs("button",{onClick:()=>w(O),style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 10px",background:b===O?"var(--primary)":"transparent",color:b===O?"#fff":"var(--muted)",border:"none",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",borderLeft:O==="card"?"1px solid var(--border)":"none"},children:[O==="list"?i.jsx(sb,{size:13}):i.jsx(ab,{size:13}),O==="list"?"List":"Cards"]},O))})]}),e.sessions.length===0?i.jsxs("div",{style:{padding:"36px 16px",textAlign:"center"},children:[i.jsx(Wi,{size:28,style:{color:"var(--border)",margin:"0 auto 10px"}}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"14px"},children:"No sessions yet"}),i.jsxs("button",{onClick:u,style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:13})," Add First Session"]})]}):b==="list"?i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{background:"var(--secondary)"},children:[i.jsx("th",{style:{width:"32px",padding:"8px 0 8px 12px"}}),["Session","Type","Time","Status",""].map(O=>i.jsx("th",{style:{padding:"8px 12px",textAlign:"left",fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",letterSpacing:"0.04em",textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid var(--border)"},children:O},O))]})}),i.jsx("tbody",{children:e.sessions.map(O=>i.jsx(swe,{session:O,onEdit:()=>d(O),onDelete:()=>f(O.id),onDuplicate:()=>h(O),onOpenQr:()=>p(O),duplicateLoading:y===O.id},O.id))})]})}):i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"12px",padding:"14px 16px"},children:e.sessions.map(O=>i.jsx(lwe,{session:O,onEdit:()=>d(O),onDelete:()=>f(O.id),onDuplicate:()=>h(O),onOpenQr:()=>p(O),duplicateLoading:y===O.id},O.id))})]})]})}function f7({embedInDashboard:e=!1}={}){const{selectedEventId:t,openAgendaSessionPanelOnce:r,setOpenAgendaSessionPanelOnce:n}=eo(),o=qi(),a=o==="mobile",s=o==="mobile"||o==="tablet",[l,c]=j.useState(""),[u,d]=j.useState(new Date().toISOString()),[f,h]=j.useState(""),[p,y]=j.useState([]),[m,x]=j.useState({}),[b,w]=j.useState([]),[k,S]=j.useState(new Set),[_,P]=j.useState(!1),[O,T]=j.useState(null),[R,I]=j.useState(null),[E,A]=j.useState(null),[F,L]=j.useState(null),[z,V]=j.useState(null),[Q,U]=j.useState(null),[ee,H]=j.useState(null),[B,M]=j.useState(!1),$=j.useRef(null);j.useEffect(()=>{!t||!r||(I({initialTrackId:da}),n(!1))},[t,r,n]);const q=j.useCallback(async()=>{var Ge,Ot;if(!t)return;P(!0),T(null);const[ie,Me,ke]=await Promise.all([zr.get(t),rh.list(t),Da.list(t)]);if(P(!1),ie.error||!ie.data){T(ie.error||"Could not load event");return}const se=ie.data;c(se.name||"Event"),d(se.startDate||new Date().toISOString());const fe=typeof se.organization=="object"&&se.organization&&"_id"in se.organization?String(se.organization._id):se.organization?String(se.organization):"";h(fe);const Ie=((Ge=Me.data)==null?void 0:Ge.tracks)||[];y(Ie);const ce=((Ot=ke.data)==null?void 0:Ot.sessions)||[],je={};ce.forEach(nt=>{je[nt._id]=nt}),x(je);const qe=[...Ie].sort((nt,Ae)=>(nt.sortOrder??0)-(Ae.sortOrder??0)||nt.name.localeCompare(Ae.name)),Ne=new Map;qe.forEach(nt=>{Ne.set(nt._id,{id:nt._id,joinCode:nt.joinCode,name:nt.name,type:rwe(nt.trackType),hall:nt.hall||"—",status:nt.status==="active"?"Active":"Inactive",sessions:[]})});const Je={id:da,name:"Unassigned",type:"General",hall:"—",status:"Active",sessions:[]};ce.forEach(nt=>{const Ae=owe(nt),Te=typeof nt.track=="object"&&nt.track&&"_id"in nt.track?String(nt.track._id):nt.track?String(nt.track):"";Te&&Ne.has(Te)?Ne.get(Te).sessions.push(Ae):Je.sessions.push(Ae)});const vt=[...Ne.values()];Je.sessions.sort((nt,Ae)=>nt.startDate.localeCompare(Ae.startDate)||nt.startTime.localeCompare(Ae.startTime)),vt.forEach(nt=>{nt.sessions.sort((Ae,Te)=>Ae.startDate.localeCompare(Te.startDate)||Ae.startTime.localeCompare(Te.startTime))}),Je.sessions.length&&vt.push(Je),w(vt),S(nt=>nt.size===0&&vt.length?new Set([vt[0].id]):nt)},[t]);j.useEffect(()=>{q()},[q]),j.useEffect(()=>{const ie=Me=>{$.current&&!$.current.contains(Me.target)&&M(!1)};return document.addEventListener("mousedown",ie),()=>document.removeEventListener("mousedown",ie)},[]);const Y=ie=>S(Me=>{const ke=new Set(Me);return ke.has(ie)?ke.delete(ie):ke.add(ie),ke}),K=()=>A({editTrack:null}),G=ie=>{if(ie.id===da)return;const Me=p.find(ke=>ke._id===ie.id);Me&&A({editTrack:Me})},re=ie=>{if(ie===da)return;const Me=b.find(ke=>ke.id===ie);L({title:"Confirm Delete",msg:`Delete "${Me==null?void 0:Me.name}"? Sessions in this track become unassigned.`,confirmLabel:"Delete",variant:"danger",onConfirm:async()=>{const ke=await rh.remove(ie);L(null),ke.error||await q()}})},J=async ie=>{if(ie.id===da||!t)return;const Me=p.find(fe=>fe._id===ie.id);if(!Me)return;const ke=await rh.create(t,{name:`${Me.name} (Copy)`,hall:Me.hall,trackType:Me.trackType,status:"active",sortOrder:(Me.sortOrder??0)+1});if(ke.error||!ke.data)return;const se=ke.data;for(const fe of ie.sessions){const Ie=m[fe.id];if(!Ie)continue;typeof Ie.track=="object"&&Ie.track&&"_id"in Ie.track?String(Ie.track._id):Ie.track&&String(Ie.track);const ce=(Ie.speakers||[]).map(je=>typeof je=="object"&&je&&"_id"in je?String(je._id):String(je));await Da.create(t,{title:`${Ie.title} (Copy)`,description:Ie.description,type:Ie.type,startTime:Ie.startTime,endTime:Ie.endTime,location:Ie.location,status:Ie.status,track:se._id,speakers:ce.filter(Boolean)})}await q()},ae=ie=>{ie.id===da||!t||L({title:"Duplicate track",msg:`Create a copy of "${ie.name}" including all ${ie.sessions.length} session(s)? This may take a moment.`,confirmLabel:"Duplicate",variant:"primary",onConfirm:async()=>{L(null),U(ie.id);try{await J(ie)}finally{U(null)}}})},le=(ie,Me)=>{const ke=m[Me];L({title:"Confirm Delete",msg:`Delete "${(ke==null?void 0:ke.title)||"session"}"?`,confirmLabel:"Delete",variant:"danger",onConfirm:async()=>{const se=await Da.remove(Me);L(null),se.error||await q()}})},me=async(ie,Me)=>{if(!t)return;const ke=m[Me.id];if(!ke)return;const se=typeof ke.track=="object"&&ke.track&&"_id"in ke.track?ke.track._id:ke.track||null,fe=(ke.speakers||[]).map(Ie=>typeof Ie=="object"&&Ie&&"_id"in Ie?String(Ie._id):String(Ie));await Da.create(t,{title:`${ke.title} (Copy)`,description:ke.description,type:ke.type,startTime:ke.startTime,endTime:ke.endTime,location:ke.location,status:ke.status,track:se?String(se):null,speakers:fe.filter(Boolean),audienceFeedbackEnabled:ke.audienceFeedbackEnabled,audienceRatingsEnabled:ke.audienceRatingsEnabled,audienceFeedbackForm:ke.audienceFeedbackForm??null,audienceRatingsForm:ke.audienceRatingsForm??null}),await q()},Oe=(ie,Me)=>{L({title:"Duplicate session",msg:`Create a copy of "${Me.title}"?`,confirmLabel:"Duplicate",variant:"primary",onConfirm:async()=>{L(null),H(Me.id);try{await me(ie,Me)}finally{H(null)}}})},we=b.reduce((ie,Me)=>ie+Me.sessions.length,0);return t?i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:_?"…":l}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:a?"var(--text-xl)":"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.2",marginBottom:"4px"},children:e?"Agenda":"Dashboard"}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:O?i.jsx("span",{style:{color:"var(--destructive)"},children:O}):`${b.filter(ie=>ie.id!==da).length} tracks · ${we} sessions`})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[!s&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},onMouseEnter:ie=>{ie.currentTarget.style.borderColor="var(--primary)",ie.currentTarget.style.color="var(--primary)"},onMouseLeave:ie=>{ie.currentTarget.style.borderColor="var(--border)",ie.currentTarget.style.color="var(--card-foreground)"},children:[i.jsx(Zs,{size:14})," Feedback"]}),i.jsxs("button",{style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},onMouseEnter:ie=>{ie.currentTarget.style.borderColor="var(--primary)",ie.currentTarget.style.color="var(--primary)"},onMouseLeave:ie=>{ie.currentTarget.style.borderColor="var(--border)",ie.currentTarget.style.color="var(--card-foreground)"},children:[i.jsx(Rf,{size:14})," Ratings"]}),i.jsx("div",{style:{width:"1px",height:"20px",background:"var(--border)",flexShrink:0}}),i.jsxs("button",{onClick:K,style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},onMouseEnter:ie=>{ie.currentTarget.style.borderColor="var(--primary)",ie.currentTarget.style.color="var(--primary)"},onMouseLeave:ie=>{ie.currentTarget.style.borderColor="var(--border)",ie.currentTarget.style.color="var(--card-foreground)"},children:[i.jsx(wr,{size:14})," Add Track"]})]}),s&&i.jsxs("div",{ref:$,style:{position:"relative"},children:[i.jsx("button",{onClick:()=>M(ie=>!ie),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",cursor:"pointer"},children:"···"}),B&&i.jsx("div",{style:{position:"absolute",right:0,top:"calc(100% + 6px)",background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",boxShadow:"var(--elevation-sm)",zIndex:50,minWidth:"160px",overflow:"hidden"},children:[{label:"Feedback",icon:i.jsx(Zs,{size:13}),action:()=>M(!1)},{label:"Ratings",icon:i.jsx(Rf,{size:13}),action:()=>M(!1)},{label:"Add Track",icon:i.jsx(wr,{size:13}),action:()=>{K(),M(!1)}}].map((ie,Me,ke)=>i.jsxs("button",{onClick:ie.action,style:{width:"100%",display:"flex",alignItems:"center",gap:"8px",padding:"10px 14px",background:"none",border:"none",cursor:"pointer",textAlign:"left",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",borderBottom:Me<ke.length-1?"1px solid var(--border)":"none"},onMouseEnter:se=>{se.currentTarget.style.background="var(--secondary)"},onMouseLeave:se=>{se.currentTarget.style.background="none"},children:[ie.icon," ",ie.label]},ie.label))})]}),i.jsxs("button",{onClick:()=>I({}),style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:14})," ",s?"New Session":"Create New Session"]})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("button",{onClick:()=>S(new Set(b.map(ie=>ie.id))),style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",background:"none",border:"none",cursor:"pointer",padding:"0 4px"},onMouseEnter:ie=>{ie.currentTarget.style.color="var(--foreground)"},onMouseLeave:ie=>{ie.currentTarget.style.color="var(--muted)"},children:"Expand all"}),i.jsx("span",{style:{color:"var(--border)"},children:"·"}),i.jsx("button",{onClick:()=>S(new Set),style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",background:"none",border:"none",cursor:"pointer",padding:"0 4px"},onMouseEnter:ie=>{ie.currentTarget.style.color="var(--foreground)"},onMouseLeave:ie=>{ie.currentTarget.style.color="var(--muted)"},children:"Collapse all"})]}),b.length===0?i.jsxs("div",{style:{textAlign:"center",padding:"60px 20px",border:"2px dashed var(--border)",borderRadius:"var(--radius-card)"},children:[i.jsx(Wi,{size:32,style:{color:"var(--border)",margin:"0 auto 12px"}}),i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"6px"},children:"No tracks yet"}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--muted)",marginBottom:"16px"},children:"Create your first track to start organizing sessions."}),i.jsxs("button",{onClick:K,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 18px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:14})," Add First Track"]})]}):i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:b.map(ie=>i.jsx(uwe,{track:ie,virtual:ie.id===da,isOpen:k.has(ie.id),onToggle:()=>Y(ie.id),onEdit:()=>G(ie),onDelete:()=>re(ie.id),onDuplicate:()=>ae(ie),onOpenTrackQr:()=>V({kind:"track",label:ie.name,joinCode:ie.joinCode||""}),duplicateTrackLoading:Q===ie.id,onAddSession:()=>I({initialTrackId:ie.id===da?da:ie.id}),onEditSession:Me=>I({initialTrackId:ie.id,sessionId:Me.id}),onDeleteSession:Me=>le(ie.id,Me),onDuplicateSession:Me=>Oe(ie.id,Me),onOpenSessionQr:Me=>V({kind:"session",label:Me.title,joinCode:Me.joinCode||""}),duplicatingSessionId:ee},ie.id))}),!e&&i.jsx("div",{style:{paddingTop:"16px",borderTop:"1px solid var(--border)",textAlign:"center"},children:i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"© 2026 Stratawiz Technologies Pvt Ltd · EventBuzz"})}),R&&t&&i.jsx(V$,{eventId:t,eventName:l,eventStartIso:u,organizationId:f,tracks:p,initialTrackId:R.initialTrackId??void 0,session:R.sessionId?m[R.sessionId]??null:null,onClose:()=>I(null),onSuccess:()=>q(),onTrackCreated:ie=>y(Me=>[...Me,ie])}),E&&t&&i.jsx(J2e,{eventId:t,existingTrack:E.editTrack,onClose:()=>A(null),onSuccess:()=>q()}),F&&i.jsx(cwe,{title:F.title,message:F.msg,confirmLabel:F.confirmLabel,variant:F.variant,onConfirm:F.onConfirm,onCancel:()=>L(null)}),z&&i.jsx(aT,{open:!0,onClose:()=>V(null),kind:z.kind,joinCode:z.joinCode,label:z.label})]}):i.jsxs("div",{style:{textAlign:"center",padding:"80px 24px",border:"2px dashed var(--border)",borderRadius:"var(--radius-card)"},children:[i.jsx(Wi,{size:40,style:{color:"var(--border)",margin:"0 auto 16px"}}),i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:"Select an event"}),i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",marginTop:"8px",fontFamily:"var(--font-noto-sans)"},children:"Choose an event in the sidebar to manage its agenda."})]})}const Ep={width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",outline:"none",boxSizing:"border-box"};function Ap({text:e,required:t}){return i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)",marginBottom:"5px"},children:[t&&i.jsx("span",{style:{color:"var(--destructive)",marginRight:"3px"},children:"*"}),e]})}function Q1({msg:e}){return e?i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",margin:"4px 0 0",fontFamily:"var(--font-noto-sans)"},children:e}):null}function Tp({children:e}){return i.jsx("div",{style:{display:"flex",flexDirection:"column"},children:e})}function p7({children:e,cols:t=2}){return i.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t}, 1fr)`,gap:"12px"},children:e})}function dwe({n:e,state:t}){return i.jsx("div",{style:{width:28,height:28,borderRadius:"50%",background:t==="todo"?"var(--muted)":"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t==="done"?i.jsx(Oi,{size:13,style:{color:"#fff"}}):i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-inter)",color:"#fff",fontWeight:"var(--font-weight-medium)"},children:e})})}function E4({n:e,title:t,subtitle:r,open:n,completed:o,onToggle:a,children:s,onNext:l,nextLabel:c,nextDisabled:u}){const d=n?"active":o?"done":"todo";return i.jsxs("div",{style:{borderBottom:"1px solid var(--border)"},children:[i.jsxs("button",{type:"button",onClick:a,style:{width:"100%",display:"flex",alignItems:"center",gap:"12px",padding:"14px 20px",background:"none",border:"none",cursor:"pointer",textAlign:"left"},children:[i.jsx(dwe,{n:e,state:d}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)",margin:0},children:t}),!n&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:r})]}),n?i.jsx($f,{size:18,style:{color:"var(--muted)",flexShrink:0}}):i.jsx(po,{size:18,style:{color:"var(--muted)",flexShrink:0}})]}),n&&i.jsxs("div",{style:{padding:"0 20px 16px"},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"0 0 16px 40px"},children:r}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:s}),i.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"20px",paddingTop:"14px",borderTop:"1px solid var(--border)"},children:i.jsx("button",{type:"button",disabled:u,onClick:l,style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 18px",borderRadius:"var(--radius-button)",background:u?"var(--secondary)":"var(--primary)",color:u?"var(--muted)":"var(--primary-foreground)",border:"none",cursor:u?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:c})})]})]})}const fwe={firstName:"",lastName:"",email:"",phone:"",organization:"",designation:"",notes:""},pwe=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function h7(e){const t={};e.firstName.trim()||(t.firstName="First name is required."),e.lastName.trim()||(t.lastName="Last name is required."),e.email.trim()?pwe.test(e.email.trim())||(t.email="Enter a valid email address."):t.email="Email is required.";const r=e.phone.trim();return r&&!/^[\d\s+().-]{6,}$/.test(r)&&(t.phone="Enter a valid phone number."),t}function g7(e){return{}}function hwe({eventId:e,onClose:t,participantId:r,onSuccess:n}){const o=!!r,a=3,[s,l]=j.useState(1),[c,u]=j.useState(()=>o?new Set([1,2,3]):new Set),[d,f]=j.useState(fwe),[h,p]=j.useState(!1),[y,m]=j.useState({}),[x,b]=j.useState(null);j.useEffect(()=>{r&&Ei.get(r).then(R=>{const I=R.data;I&&(f({firstName:I.firstName??"",lastName:I.lastName??"",email:I.email??"",phone:I.phone??"",organization:I.organization??"",designation:I.designation??"",notes:I.notes??""}),u(new Set([1,2,3])))})},[r]);const w=j.useCallback((R,I)=>{f(E=>({...E,[R]:I})),m(E=>{if(!E[R])return E;const A={...E};return delete A[R],A}),b(null)},[]),k=j.useCallback(()=>{const R=h7(d),I=g7(),E={...R,...I};return m(E),Object.keys(R).length?{ok:!1,section:1}:Object.keys(I).length?{ok:!1,section:2}:{ok:!0,section:0}},[d]),S=R=>{if(R===1){const I=h7(d);if(m(E=>({...E,...I})),Object.keys(I).length)return;u(E=>new Set([...E,1])),l(2);return}if(R===2){const I=g7();if(m(E=>({...E,...I})),Object.keys(I).length)return;u(E=>new Set([...E,2])),l(3);return}R===3&&_()},_=async()=>{const R=k();if(!R.ok){l(R.section);return}p(!0),b(null);const I={firstName:d.firstName.trim(),lastName:d.lastName.trim(),email:d.email.trim(),phone:d.phone.trim()||void 0,organization:d.organization.trim()||void 0,designation:d.designation.trim()||void 0,notes:d.notes.trim()||void 0},E=o&&r?await Ei.update(r,I):await Ei.create(e,I);if(p(!1),E.error){b(E.error),/email|duplicate|exists/i.test(E.error)&&m(A=>({...A,email:E.error||"This email may already be registered for this event."}));return}n==null||n(),t()},P=R=>l(I=>I===R?0:R),O=!h,T=({compact:R})=>i.jsx("button",{type:"button",disabled:!O,onClick:_,style:{padding:R?"6px 16px":"7px 18px",borderRadius:"var(--radius-button)",background:O?"var(--primary)":"var(--secondary)",color:O?"var(--primary-foreground)":"var(--muted)",border:"none",cursor:O?"pointer":"not-allowed",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:h?"Saving…":o?"Save changes":"Save participant"});return i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:t,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.50)",zIndex:200}}),i.jsxs("div",{style:{position:"fixed",top:0,right:0,height:"100%",width:"min(520px, 100vw)",background:"var(--card)",zIndex:201,display:"flex",flexDirection:"column",boxShadow:"-4px 0 40px rgba(0,0,0,0.20)"},children:[i.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)",flexShrink:0,background:"var(--card)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",marginBottom:"14px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"0 0 3px"},children:"Participants"}),i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:o?"Edit participant":"Add participant"}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"5px 0 0"},children:["Complete each section to continue. Use ",i.jsx("strong",{children:"Next"})," or ",i.jsx("strong",{children:"Save"})," (top or bottom) to submit."]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:[i.jsx("button",{type:"button",onClick:t,title:"Close",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",color:"var(--muted)"},children:i.jsx(er,{size:14})}),i.jsx(T,{compact:!0})]})]}),x&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",marginBottom:"8px",fontFamily:"var(--font-noto-sans)"},children:x}),i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"6px"},children:[i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[c.size," of ",a," sections passed"]}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--primary)",fontWeight:"var(--font-weight-medium)"},children:[Math.round(c.size/a*100),"%"]})]}),i.jsx("div",{style:{height:"6px",borderRadius:"99px",background:"var(--border)",overflow:"hidden"},children:i.jsx("div",{style:{height:"100%",width:`${Math.round(c.size/a*100)}%`,background:"var(--primary)",borderRadius:"99px",transition:"width 0.35s ease"}})})]}),i.jsxs("div",{style:{flex:1,overflowY:"auto"},children:[i.jsx(E4,{n:1,title:"Personal information",subtitle:"Name and contact details",open:s===1,completed:c.has(1),onToggle:()=>P(1),onNext:()=>S(1),nextLabel:"Next: Professional details",children:i.jsxs(p7,{cols:2,children:[i.jsxs(Tp,{children:[i.jsx(Ap,{text:"First name",required:!0}),i.jsx("input",{style:Ep,placeholder:"John",value:d.firstName,onChange:R=>w("firstName",R.target.value)}),i.jsx(Q1,{msg:y.firstName})]}),i.jsxs(Tp,{children:[i.jsx(Ap,{text:"Last name",required:!0}),i.jsx("input",{style:Ep,placeholder:"Smith",value:d.lastName,onChange:R=>w("lastName",R.target.value)}),i.jsx(Q1,{msg:y.lastName})]}),i.jsxs(Tp,{children:[i.jsx(Ap,{text:"Email",required:!0}),i.jsx("input",{type:"email",style:Ep,placeholder:"john@example.com",value:d.email,onChange:R=>w("email",R.target.value)}),i.jsx(Q1,{msg:y.email})]}),i.jsxs(Tp,{children:[i.jsx(Ap,{text:"Phone"}),i.jsx("input",{type:"tel",style:Ep,placeholder:"+91 9800000000",value:d.phone,onChange:R=>w("phone",R.target.value)}),i.jsx(Q1,{msg:y.phone})]})]})}),i.jsx(E4,{n:2,title:"Professional details",subtitle:"Organization and designation",open:s===2,completed:c.has(2),onToggle:()=>P(2),onNext:()=>S(2),nextLabel:"Next: Additional info",children:i.jsxs(p7,{cols:2,children:[i.jsxs(Tp,{children:[i.jsx(Ap,{text:"Organization"}),i.jsx("input",{style:Ep,placeholder:"Company or institution",value:d.organization,onChange:R=>w("organization",R.target.value)})]}),i.jsxs(Tp,{children:[i.jsx(Ap,{text:"Designation"}),i.jsx("input",{style:Ep,placeholder:"e.g. Delegate, Speaker",value:d.designation,onChange:R=>w("designation",R.target.value)})]})]})}),i.jsx(E4,{n:3,title:"Additional info",subtitle:"Internal notes (optional)",open:s===3,completed:c.has(3),onToggle:()=>P(3),onNext:()=>S(3),nextLabel:"Save participant",nextDisabled:h,children:i.jsxs(Tp,{children:[i.jsx(Ap,{text:"Notes"}),i.jsx("textarea",{style:{...Ep,resize:"vertical",minHeight:"80px"},placeholder:"Internal notes (optional)",value:d.notes,onChange:R=>w("notes",R.target.value)})]})})]}),i.jsxs("div",{style:{padding:"14px 20px",borderTop:"1px solid var(--border)",display:"flex",justifyContent:"flex-end",gap:"10px",flexShrink:0,background:"var(--card)"},children:[i.jsx("button",{type:"button",onClick:t,style:{padding:"7px 16px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"Cancel"}),i.jsx(T,{})]})]})]})}function gwe(e){var o;const t=[e.firstName,e.lastName].filter(Boolean).join(" ").trim()||"—",r=e.registrationDate?new Date(e.registrationDate).toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}):null,n={pending:"Pending",confirmed:"Confirmed",checked_in:"Checked In",cancelled:"Cancelled"}[e.status]??e.status;return{id:e._id,name:t,email:e.email??"",phone:e.phone??"",role:((o=e.designation)==null?void 0:o.trim())||"—",status:n,checkedIn:e.status==="checked_in"||!!e.checkedIn,registrationDate:r}}const m7=[20,50,100];function v7(e,t){if(t<=5)return Array.from({length:t},(a,s)=>s+1);const r=Math.max(1,e-2),n=Math.min(t,e+2),o=[];r>1&&(o.push(1),r>2&&o.push("ellipsis"));for(let a=r;a<=n;a++)o.push(a);return n<t&&(n<t-1&&o.push("ellipsis"),o.push(t)),o}const y7=[{bg:"#dbeafe",color:"#1d4ed8"},{bg:"#ede9fe",color:"#5b21b6"},{bg:"#dcfce7",color:"#15803d"},{bg:"#ffedd5",color:"#c2410c"},{bg:"#fce7f3",color:"#be185d"},{bg:"#ccfbf1",color:"#0d9488"},{bg:"#fef9c3",color:"#a16207"}];function bY(e){const t=(e.charCodeAt(0)||0)+(e.charCodeAt(1)||0);return y7[t%y7.length]}function wY(e){var r;const t=e.trim().replace(/^Dr\.\s*/i,"").split(/\s+/);return t.length===1?((r=t[0][0])==null?void 0:r.toUpperCase())??"?":(t[0][0]+t[t.length-1][0]).toUpperCase()}const mwe={bg:"#e5e7eb",color:"#374151"},vwe={Delegate:{bg:"#e0e7ff",color:"#3730a3"},Speaker:{bg:"#ede9fe",color:"#5b21b6"},Moderator:{bg:"#dcfce7",color:"#15803d"},Panelist:{bg:"#ffedd5",color:"#c2410c"}};function SY({name:e,size:t=36}){const r=bY(e);return i.jsx("div",{style:{width:t,height:t,borderRadius:"50%",background:r.bg,color:r.color,display:"flex",alignItems:"center",justifyContent:"center",fontSize:t>32?"var(--text-sm)":"11px",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",flexShrink:0},children:wY(e)})}function dP({role:e}){const t=vwe[e]??mwe;return i.jsx("span",{style:{display:"inline-flex",padding:"2px 8px",borderRadius:"3px",background:t.bg,color:t.color,fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",whiteSpace:"nowrap"},children:e})}function jY({checked:e}){return i.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"999px",background:e?"#dcfce7":"#f1f5f9",color:e?"#15803d":"#6b7280",fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",whiteSpace:"nowrap"},children:e?i.jsxs(i.Fragment,{children:[i.jsx(iv,{size:10})," Yes"]}):i.jsxs(i.Fragment,{children:[i.jsx(ob,{size:10})," No"]})})}function fP({status:e}){const t=e==="Cancelled"?"var(--muted)":e==="Checked In"?"#15803d":e==="Confirmed"?"#2563eb":"var(--card-foreground)",r=e==="Cancelled"?"#9ca3af":e==="Checked In"?"#16a34a":e==="Confirmed"?"#2563eb":"#94a3b8";return i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"11px",fontFamily:"var(--font-noto-sans)",color:t},children:[i.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:r,display:"block"}}),e]})}function x7({label:e,value:t,options:r,onChange:n}){return i.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[i.jsxs("select",{value:t,onChange:o=>n(o.target.value),style:{appearance:"none",padding:"6px 28px 6px 10px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--card)",color:t!=="All"?"var(--foreground)":"var(--muted)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer",outline:"none",height:"34px",borderColor:t!=="All"?"var(--primary)":"var(--border)"},children:[i.jsx("option",{value:"All",children:e}),r.map(o=>i.jsx("option",{value:o,children:o},o))]}),i.jsx(po,{size:12,style:{position:"absolute",right:"8px",pointerEvents:"none",color:"var(--muted)"}})]})}function ywe({p:e,onView:t,onEdit:r,onDelete:n,onToggleCheckIn:o,canEdit:a}){const[s,l]=j.useState(!1);return i.jsxs("tr",{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{background:s?"var(--secondary)":"transparent",transition:"background 0.12s",cursor:"default",borderBottom:"1px solid var(--border)"},children:[i.jsx("td",{style:{padding:"12px 16px"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[i.jsx(SY,{name:e.name,size:32}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.3"},children:e.name}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"1px"},children:e.email})]})]})}),i.jsx("td",{style:{padding:"12px 12px",whiteSpace:"nowrap"},children:i.jsx(dP,{role:e.role})}),i.jsx("td",{style:{padding:"12px 12px"},children:i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:e.phone})}),i.jsx("td",{style:{padding:"12px 12px"},children:i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:e.registrationDate?"var(--card-foreground)":"var(--muted)"},children:e.registrationDate??"—"})}),i.jsx("td",{style:{padding:"12px 12px",whiteSpace:"nowrap"},children:i.jsx(fP,{status:e.status})}),i.jsx("td",{style:{padding:"12px 12px",whiteSpace:"nowrap"},children:i.jsx(jY,{checked:e.checkedIn})}),i.jsx("td",{style:{padding:"12px 16px 12px 8px",whiteSpace:"nowrap"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[i.jsxs("button",{onClick:o,title:e.checkedIn?"Undo check-in":"Mark checked in",style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"var(--radius-button)",background:e.checkedIn?"var(--secondary)":"#dcfce7",border:`1px solid ${e.checkedIn?"var(--border)":"#86efac"}`,color:e.checkedIn?"var(--muted)":"#15803d",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"pointer",fontWeight:"var(--font-weight-medium)"},children:[e.checkedIn?i.jsx(er,{size:11}):i.jsx(Oi,{size:11}),e.checkedIn?"Undo":"Check In"]}),i.jsxs("button",{onClick:t,title:"View profile",style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"var(--radius-button)",background:"var(--card)",border:"1px solid var(--border)",color:"var(--card-foreground)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},onMouseEnter:c=>{c.currentTarget.style.borderColor="var(--primary)",c.currentTarget.style.color="var(--primary)"},onMouseLeave:c=>{c.currentTarget.style.borderColor="var(--border)",c.currentTarget.style.color="var(--card-foreground)"},children:[i.jsx(Ah,{size:11})," View"]}),a&&i.jsxs("button",{onClick:r,title:"Edit participant",style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"var(--radius-button)",background:"var(--card)",border:"1px solid var(--border)",color:"var(--card-foreground)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},onMouseEnter:c=>{c.currentTarget.style.borderColor="var(--primary)",c.currentTarget.style.color="var(--primary)"},onMouseLeave:c=>{c.currentTarget.style.borderColor="var(--border)",c.currentTarget.style.color="var(--card-foreground)"},children:[i.jsx(Ii,{size:11})," Edit"]}),i.jsxs("button",{onClick:n,title:"Delete participant",style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"var(--radius-button)",background:"var(--card)",border:"1px solid var(--border)",color:"var(--destructive)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},onMouseEnter:c=>{c.currentTarget.style.background="#fef2f2",c.currentTarget.style.borderColor="var(--destructive)"},onMouseLeave:c=>{c.currentTarget.style.background="var(--card)",c.currentTarget.style.borderColor="var(--border)"},children:[i.jsx(gn,{size:11})," Delete"]})]})})]})}function xwe({p:e,onView:t,onEdit:r,onDelete:n,onToggleCheckIn:o,canEdit:a}){const[s,l]=j.useState(!1);return i.jsxs("div",{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"20px",display:"flex",flexDirection:"column",gap:"12px",transition:"box-shadow 0.15s, border-color 0.15s",boxShadow:s?"var(--elevation-sm)":"none",borderColor:s?"var(--primary)":"var(--border)",cursor:"default"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px"},children:[i.jsx(SY,{name:e.name,size:42}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"4px"},children:[i.jsx(dP,{role:e.role}),i.jsx(fP,{status:e.status})]})]}),i.jsx("button",{onClick:o,title:e.checkedIn?"Undo check-in":"Mark as checked in",style:{width:"28px",height:"28px",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",background:e.checkedIn?"#dcfce7":"var(--secondary)",border:`1px solid ${e.checkedIn?"#86efac":"var(--border)"}`,color:e.checkedIn?"#15803d":"var(--muted)",cursor:"pointer"},children:i.jsx(Oi,{size:13})})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"5px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[i.jsx(Uf,{size:11,style:{color:"var(--muted)",flexShrink:0}}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.email})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[i.jsx(Iw,{size:11,style:{color:"var(--muted)",flexShrink:0}}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:e.phone})]}),e.registrationDate&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[i.jsx(Wi,{size:11,style:{color:"var(--muted)",flexShrink:0}}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:e.registrationDate})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"10px",borderTop:"1px solid var(--border)"},children:[i.jsx(jY,{checked:e.checkedIn}),i.jsxs("div",{style:{display:"flex",gap:"4px"},children:[i.jsx("button",{onClick:t,title:"View",style:{width:"26px",height:"26px",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--secondary)",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",cursor:"pointer",color:"var(--muted)"},onMouseEnter:c=>{c.currentTarget.style.color="var(--primary)"},onMouseLeave:c=>{c.currentTarget.style.color="var(--muted)"},children:i.jsx(Ah,{size:12})}),a&&i.jsx("button",{onClick:r,title:"Edit",style:{width:"26px",height:"26px",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--secondary)",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",cursor:"pointer",color:"var(--muted)"},onMouseEnter:c=>{c.currentTarget.style.color="var(--primary)"},onMouseLeave:c=>{c.currentTarget.style.color="var(--muted)"},children:i.jsx(Ii,{size:12})}),i.jsx("button",{onClick:n,title:"Delete",style:{width:"26px",height:"26px",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--secondary)",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",cursor:"pointer",color:"var(--muted)"},onMouseEnter:c=>{c.currentTarget.style.color="var(--destructive)"},onMouseLeave:c=>{c.currentTarget.style.color="var(--muted)"},children:i.jsx(gn,{size:12})})]})]})]})}function bwe({p:e,onClose:t,onEdit:r,canEdit:n}){const o=bY(e.name);return i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center"},onClick:t,children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"420px",maxWidth:"94vw",boxShadow:"var(--shadow-xl)",overflow:"hidden"},onClick:a=>a.stopPropagation(),children:[i.jsxs("div",{style:{background:o.bg,padding:"24px 24px 16px",display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"14px"},children:[i.jsx("div",{style:{width:"52px",height:"52px",borderRadius:"50%",background:o.color+"20",border:`2px solid ${o.color}40`,display:"flex",alignItems:"center",justifyContent:"center",color:o.color,fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",fontSize:"var(--text-xl)"},children:wY(e.name)}),i.jsxs("div",{children:[i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:o.color,lineHeight:"1.3"},children:e.name}),i.jsxs("div",{style:{display:"flex",gap:"6px",marginTop:"5px"},children:[i.jsx(dP,{role:e.role}),i.jsx(fP,{status:e.status})]})]})]}),i.jsx("button",{onClick:t,style:{background:"none",border:"none",cursor:"pointer",color:o.color,padding:"2px",opacity:.6},children:i.jsx(er,{size:16})})]}),i.jsx("div",{style:{padding:"20px 24px",display:"flex",flexDirection:"column",gap:"0"},children:[{icon:i.jsx(Uf,{size:14}),label:"Email",value:e.email},{icon:i.jsx(Iw,{size:14}),label:"Phone",value:e.phone},{icon:i.jsx(Wi,{size:14}),label:"Registered",value:e.registrationDate||"—"},{icon:i.jsx(Iq,{size:14}),label:"Checked In",value:e.checkedIn?"Yes":"Not yet"}].map((a,s,l)=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"11px 0",borderBottom:s<l.length-1?"1px solid var(--border)":"none"},children:[i.jsx("span",{style:{color:"var(--muted)",display:"flex",flexShrink:0},children:a.icon}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",width:"80px",flexShrink:0},children:a.label}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)",fontWeight:"var(--font-weight-medium)"},children:a.value})]},a.label))}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",padding:"14px 24px",borderTop:"1px solid var(--border)"},children:[i.jsx("button",{type:"button",onClick:t,style:{padding:"7px 16px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:"Close"}),n&&i.jsxs("button",{type:"button",onClick:r,style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 16px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",cursor:"pointer"},children:[i.jsx(Ii,{size:13})," Edit"]})]})]})})}const wwe=["Pending","Confirmed","Checked In","Cancelled"],Swe={Pending:"pending",Confirmed:"confirmed","Checked In":"checked_in",Cancelled:"cancelled"},jwe=["Delegate","Speaker","Moderator","Panelist"];function kwe({message:e,onConfirm:t,onCancel:r}){return i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",zIndex:110,display:"flex",alignItems:"center",justifyContent:"center"},onClick:r,children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"360px",padding:"20px",boxShadow:"var(--shadow-xl)"},onClick:n=>n.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"flex-start",marginBottom:"20px"},children:[i.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"50%",background:"#fee2e2",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:i.jsx(nv,{size:16,style:{color:"var(--destructive)"}})}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"5px"},children:"Confirm Delete"}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:e})]})]}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"},children:[i.jsx("button",{onClick:r,style:{padding:"6px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:"Cancel"}),i.jsx("button",{onClick:t,style:{padding:"6px 14px",borderRadius:"var(--radius-button)",border:"none",background:"var(--destructive)",color:"#fff",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",cursor:"pointer"},children:"Delete"})]})]})})}function kY({compactChrome:e=!1}={}){const{selectedEventId:t}=eo(),{user:r}=Ur(),o=qi()==="mobile",a=(r==null?void 0:r.role)==="super_admin",[s,l]=j.useState([]),[c,u]=j.useState(0),[d,f]=j.useState(1),[h,p]=j.useState(20),[y,m]=j.useState(""),[x,b]=j.useState(""),[w,k]=j.useState("All"),[S,_]=j.useState("All"),[P,O]=j.useState(!1),[T,R]=j.useState(o?"card":"list"),[I,E]=j.useState(!1),[A,F]=j.useState(!1),[L,z]=j.useState(null),[V,Q]=j.useState(!1),[U,ee]=j.useState(null),[H,B]=j.useState(null),[M,$]=j.useState(!1),[q,Y]=j.useState(!1),K=j.useRef(null),[G,re]=j.useState(null),[J,ae]=j.useState(null),le=j.useCallback(()=>{t&&(O(!0),Ei.list(t,{page:d,limit:h,q:x||void 0,status:w!=="All"?Swe[w]??w:void 0,designation:S!=="All"?S:void 0}).then(ce=>{var je;O(!1),(je=ce.data)!=null&&je.participants&&(l(ce.data.participants.map(gwe)),u(ce.data.total??0))}).catch(()=>O(!1)))},[t,d,h,x,w,S]);j.useEffect(()=>{le()},[le]);const me=j.useRef();j.useEffect(()=>(me.current=setTimeout(()=>b(y.trim()),300),()=>{me.current&&clearTimeout(me.current)}),[y]),j.useEffect(()=>{f(1)},[x,w,S,h]);const Oe=Math.max(1,Math.ceil(c/h)),we=s.filter(ce=>ce.checkedIn).length,ie=s.filter(ce=>["Speaker","Moderator","Panelist"].includes(ce.role)).length,Me=ce=>{const je=s.find(qe=>qe.id===ce);B({msg:`Remove "${je==null?void 0:je.name}" from this event?`,onConfirm:()=>{t&&Ei.remove(ce,t).then(()=>{le(),B(null)})}})},ke=ce=>{t&&Ei.checkIn(ce,t).then(()=>le())},se=async()=>{if(!t||M)return;$(!0);const ce=await Ei.downloadExport(t);$(!1),!ce.ok&&"error"in ce?ae(ce.error||"Export failed"):ae(null)},fe=async ce=>{var qe;const je=(qe=ce.target.files)==null?void 0:qe[0];if(!(!je||!t)){Y(!0);try{const Ne=await je.text(),Je=await Ei.importCsv(t,Ne);Je.data?(re(Je.data),le()):ae(Je.error||"Import failed")}catch{ae("Could not read file.")}Y(!1),ce.target.value=""}},Ie=w!=="All"||S!=="All";return t?i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[J&&i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:"10px 14px",borderRadius:"var(--radius-button)",background:"#fef2f2",border:"1px solid #fecaca",color:"#b91c1c",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx("span",{children:J}),i.jsx("button",{type:"button",onClick:()=>ae(null),style:{background:"none",border:"none",cursor:"pointer",color:"inherit",padding:"4px"},children:i.jsx(er,{size:16})})]}),i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"},children:[e?i.jsxs("div",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[c," registered · ",we," checked in on this page"]}):i.jsxs("div",{children:[i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.2",marginBottom:"4px"},children:"Participants"}),i.jsxs("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[c," registered · ",we," checked in on this page"]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[i.jsx("input",{ref:K,type:"file",accept:".csv,text/csv",style:{display:"none"},onChange:fe}),i.jsxs("button",{type:"button",disabled:M,onClick:se,style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:M?"wait":"pointer",opacity:M?.8:1},onMouseEnter:ce=>{M||(ce.currentTarget.style.borderColor="var(--primary)",ce.currentTarget.style.color="var(--primary)")},onMouseLeave:ce=>{ce.currentTarget.style.borderColor="var(--border)",ce.currentTarget.style.color="var(--card-foreground)"},children:[i.jsx(Al,{size:14})," ",M?"Exporting…":o?"Export":"Export CSV"]}),a&&i.jsxs("button",{type:"button",disabled:q,onClick:()=>{var ce;return(ce=K.current)==null?void 0:ce.click()},style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:q?"wait":"pointer"},onMouseEnter:ce=>{q||(ce.currentTarget.style.borderColor="var(--primary)",ce.currentTarget.style.color="var(--primary)")},onMouseLeave:ce=>{ce.currentTarget.style.borderColor="var(--border)",ce.currentTarget.style.color="var(--card-foreground)"},children:[i.jsx(ou,{size:14})," ",q?"Importing…":o?"Import":"Import CSV"]}),a&&i.jsxs("button",{type:"button",onClick:()=>{ee(null),Q(!0)},style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:14})," ",o?"Add":"Add Participant"]})]})]}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:o?"repeat(2, 1fr)":"repeat(4, 1fr)",gap:o?"10px":"12px"},children:[{icon:i.jsx(vi,{size:14}),label:"Total Registered",value:c,accent:"var(--chart-1)"},{icon:i.jsx(Iq,{size:14}),label:"Checked In (this page)",value:we,accent:"var(--chart-2)",sub:s.length?`${Math.round(we/s.length*100)}%`:""},{icon:i.jsx(ore,{size:14}),label:"Not Checked In (this page)",value:s.length-we,accent:"var(--chart-3)"},{icon:i.jsx(ym,{size:14}),label:"Speakers & Staff (this page)",value:ie,accent:"var(--chart-4)"}].map(ce=>i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"14px 16px",display:"flex",alignItems:"center",gap:"12px",borderLeft:`3px solid ${ce.accent}`},children:[i.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"var(--radius-button)",background:ce.accent+"15",display:"flex",alignItems:"center",justifyContent:"center",color:ce.accent,flexShrink:0},children:ce.icon}),i.jsxs("div",{children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.1"},children:ce.value}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"2px"},children:ce.label}),ce.sub&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"#16a34a",marginTop:"3px"},children:ce.sub})]})]},ce.label))}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"7px",padding:"0 10px",height:"36px",flex:1,background:"var(--card)",border:`1px solid ${I?"var(--ring)":"var(--border)"}`,borderRadius:"var(--radius-button)",transition:"border-color 0.15s"},children:[i.jsx(Pi,{size:13,style:{color:"var(--muted)",flexShrink:0}}),i.jsx("input",{value:y,onChange:ce=>m(ce.target.value),placeholder:o?"Search…":"Search by name, email or phone…",onFocus:()=>E(!0),onBlur:()=>E(!1),style:{background:"transparent",border:"none",outline:"none",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",width:"100%"}}),y&&i.jsx("button",{onClick:()=>m(""),type:"button",style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",padding:0,display:"flex"},children:i.jsx(er,{size:12})})]}),o&&i.jsxs("button",{onClick:()=>F(ce=>!ce),style:{display:"flex",alignItems:"center",gap:"5px",padding:"0 12px",height:"36px",borderRadius:"var(--radius-button)",border:`1px solid ${Ie?"var(--primary)":"var(--border)"}`,background:Ie?"var(--accent)":"var(--card)",color:Ie?"var(--primary)":"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer",flexShrink:0},children:[i.jsx(Wee,{size:13})," ",Ie?"Filtered":"Filter"]}),i.jsx("div",{style:{display:"flex",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",overflow:"hidden",background:"var(--card)",flexShrink:0},children:["list","card"].map(ce=>i.jsxs("button",{onClick:()=>R(ce),style:{display:"flex",alignItems:"center",gap:"4px",padding:"0 10px",height:"36px",background:T===ce?"var(--primary)":"transparent",color:T===ce?"#fff":"var(--muted)",border:"none",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",borderLeft:ce==="card"?"1px solid var(--border)":"none"},children:[ce==="list"?i.jsx(sb,{size:13}):i.jsx(ab,{size:13}),!o&&(ce==="list"?"List":"Cards")]},ce))})]}),(!o||A)&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[i.jsx(x7,{label:"All Statuses",value:w,options:wwe,onChange:k}),i.jsx(x7,{label:"All Designations",value:S,options:jwe,onChange:_}),Ie&&i.jsxs("button",{type:"button",onClick:()=>{k("All"),_("All")},style:{display:"flex",alignItems:"center",gap:"4px",padding:"6px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:[i.jsx(er,{size:11})," Clear"]})]})]}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:["Showing ",i.jsx("strong",{style:{color:"var(--foreground)"},children:(d-1)*h+1}),"–",i.jsx("strong",{children:Math.min(d*h,c)})," of ",c," participants"]}),P?i.jsx("div",{style:{textAlign:"center",padding:"48px 20px",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"Loading…"}):s.length===0?i.jsxs("div",{style:{textAlign:"center",padding:"60px 20px",border:"2px dashed var(--border)",borderRadius:"var(--radius-card)"},children:[i.jsx(vi,{size:32,style:{color:"var(--border)",margin:"0 auto 12px"}}),i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"6px"},children:"No participants found"}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--muted)",marginBottom:"16px"},children:"Try adjusting your search or filters."}),i.jsxs("button",{type:"button",onClick:()=>{m(""),b(""),k("All"),_("All"),f(1)},style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",background:"var(--secondary)",color:"var(--card-foreground)",border:"1px solid var(--border)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(er,{size:13})," Clear all filters"]})]}):T==="list"?i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:[i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsx("tr",{style:{background:"var(--secondary)",borderBottom:"1px solid var(--border)"},children:["Participant","Role","Phone","Registered","Status","Checked In",""].map(ce=>i.jsx("th",{style:{padding:"9px 12px",textAlign:"left",fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",letterSpacing:"0.04em",textTransform:"uppercase",whiteSpace:"nowrap"},children:ce},ce))})}),i.jsx("tbody",{children:s.map(ce=>i.jsx(ywe,{p:ce,onView:()=>z(ce),onEdit:()=>{ee(ce.id),Q(!0)},onDelete:()=>Me(ce.id),onToggleCheckIn:()=>ke(ce.id),canEdit:a},ce.id))})]})}),i.jsxs("div",{style:{padding:"12px 16px",borderTop:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"10px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Per page"}),i.jsx("select",{value:h,onChange:ce=>{p(Number(ce.target.value)),f(1)},style:{padding:"4px 8px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--card)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:m7.map(ce=>i.jsx("option",{value:ce,children:ce},ce))})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[i.jsx("button",{type:"button",disabled:d<=1,onClick:()=>f(ce=>Math.max(1,ce-1)),style:{display:"flex",alignItems:"center",padding:"6px 10px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--card)",cursor:d<=1?"not-allowed":"pointer",color:d<=1?"var(--muted)":"var(--foreground)"},children:i.jsx(Nf,{size:16})}),v7(d,Oe).map((ce,je)=>ce==="ellipsis"?i.jsx("span",{style:{padding:"0 4px",fontSize:"var(--text-sm)",color:"var(--muted)"},children:"…"},`e-${je}`):i.jsx("button",{type:"button",onClick:()=>f(ce),style:{minWidth:"32px",padding:"6px 8px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:d===ce?"var(--primary)":"var(--card)",color:d===ce?"var(--primary-foreground)":"var(--foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:ce},ce)),i.jsx("button",{type:"button",disabled:d>=Oe,onClick:()=>f(ce=>Math.min(Oe,ce+1)),style:{display:"flex",alignItems:"center",padding:"6px 10px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--card)",cursor:d>=Oe?"not-allowed":"pointer",color:d>=Oe?"var(--muted)":"var(--foreground)"},children:i.jsx(va,{size:16})})]})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(240px, 1fr))",gap:"14px"},children:s.map(ce=>i.jsx(xwe,{p:ce,onView:()=>z(ce),onEdit:()=>{ee(ce.id),Q(!0)},onDelete:()=>Me(ce.id),onToggleCheckIn:()=>ke(ce.id),canEdit:a},ce.id))}),i.jsxs("div",{style:{padding:"12px 16px",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",background:"var(--card)",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"10px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Per page"}),i.jsx("select",{value:h,onChange:ce=>{p(Number(ce.target.value)),f(1)},style:{padding:"4px 8px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--card)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:m7.map(ce=>i.jsx("option",{value:ce,children:ce},ce))})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[i.jsx("button",{type:"button",disabled:d<=1,onClick:()=>f(ce=>Math.max(1,ce-1)),style:{display:"flex",alignItems:"center",padding:"6px 10px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--card)",cursor:d<=1?"not-allowed":"pointer",color:d<=1?"var(--muted)":"var(--foreground)"},children:i.jsx(Nf,{size:16})}),v7(d,Oe).map((ce,je)=>ce==="ellipsis"?i.jsx("span",{style:{padding:"0 4px",fontSize:"var(--text-sm)",color:"var(--muted)"},children:"…"},`e2-${je}`):i.jsx("button",{type:"button",onClick:()=>f(ce),style:{minWidth:"32px",padding:"6px 8px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:d===ce?"var(--primary)":"var(--card)",color:d===ce?"var(--primary-foreground)":"var(--foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:ce},ce)),i.jsx("button",{type:"button",disabled:d>=Oe,onClick:()=>f(ce=>Math.min(Oe,ce+1)),style:{display:"flex",alignItems:"center",padding:"6px 10px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--card)",cursor:d>=Oe?"not-allowed":"pointer",color:d>=Oe?"var(--muted)":"var(--foreground)"},children:i.jsx(va,{size:16})})]})]})]}),e?null:i.jsx("div",{style:{paddingTop:"16px",borderTop:"1px solid var(--border)",textAlign:"center"},children:i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"© 2026 Stratawiz Technologies Pvt Ltd · EventBuzz"})}),L&&i.jsx(bwe,{p:L,onClose:()=>z(null),onEdit:()=>{ee(L.id),z(null),Q(!0)},canEdit:a}),V&&t&&i.jsx(hwe,{eventId:t,participantId:U??void 0,onClose:()=>{Q(!1),ee(null)},onSuccess:()=>{le(),Q(!1),ee(null)}}),H&&i.jsx(kwe,{message:H.msg,onConfirm:H.onConfirm,onCancel:()=>B(null)}),G&&i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",zIndex:120,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},onClick:()=>re(null),children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",maxWidth:"440px",width:"100%",padding:"22px",boxShadow:"var(--shadow-xl)",border:"1px solid var(--border)"},onClick:ce=>ce.stopPropagation(),children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"0 0 12px"},children:"Import finished"}),i.jsxs("ul",{style:{margin:"0 0 14px",paddingLeft:"18px",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",lineHeight:1.6},children:[i.jsxs("li",{children:[i.jsx("strong",{children:G.created})," added"]}),i.jsxs("li",{children:[i.jsx("strong",{children:G.skippedDuplicate})," skipped (email already registered for this event)"]}),G.failed>0&&i.jsxs("li",{children:[i.jsx("strong",{children:G.failed})," rows failed validation"]})]}),G.errors.length>0&&i.jsxs("div",{style:{maxHeight:"160px",overflowY:"auto",marginBottom:"14px",padding:"10px",background:"var(--secondary)",borderRadius:"var(--radius-button)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:[G.errors.map((ce,je)=>i.jsxs("div",{style:{marginBottom:"6px"},children:["Line ",ce.line,": ",ce.message]},je)),G.failed>G.errors.length&&i.jsx("div",{children:"…and more"})]}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 14px",fontFamily:"var(--font-noto-sans)"},children:["Required columns: ",i.jsx("code",{style:{fontSize:"11px"},children:"email"}),", ",i.jsx("code",{children:"firstName"})," (or First name), ",i.jsx("code",{children:"lastName"})," (or Last name). Optional: phone, organization, designation, tags, notes."]}),i.jsx("button",{type:"button",onClick:()=>re(null),style:{padding:"8px 18px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:"OK"})]})})]}):i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px",alignItems:"center",justifyContent:"center",minHeight:"280px",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(vi,{size:40,style:{opacity:.5}}),i.jsx("p",{style:{fontSize:"var(--text-base)"},children:"Select an event to view participants."})]})}const _we={id:"venue",prompt:"What is the venue or address for the in-person part of this event?"},Cwe={id:"virtualLink",prompt:"What is the meeting or stream URL (e.g. https://…)?"};function _Y(e){const t=e.trim();if(!t)return!1;try{return new URL(t.startsWith("http")?t:`https://${t}`),!0}catch{return!1}}function Ewe(e,t){const r=[],n=(t.location||"").trim(),o=(t.virtualLink||"").trim();return(e==="Physical"||e==="Hybrid")&&(n||r.push(_we)),(e==="Virtual"||e==="Hybrid")&&(_Y(o)||r.push(Cwe)),r}function Awe(e,t,r){const n=new Set(e.slice(t+1).map(a=>a.id)),o=r.filter(a=>!n.has(a.id));return[...e.slice(0,t+1),...o,...e.slice(t+1)]}function Twe({gaps:e,mergedPreview:t,organizationId:r,onClose:n,onCreated:o}){const a=j.useMemo(()=>z$(t),[t]),[s,l]=j.useState(()=>[...e]),[c,u]=j.useState(0),[d,f]=j.useState({}),[h,p]=j.useState({}),[y,m]=j.useState(!1),[x,b]=j.useState(null),[w,k]=j.useState(""),[S,_]=j.useState(""),[P,O]=j.useState(""),[T,R]=j.useState(""),[I,E]=j.useState(""),[A,F]=j.useState(""),L=s[c],z=c>=s.length;j.useEffect(()=>{!L||z||(p({}),L.id==="eventName"&&k(d.eventName??a.name??""),L.id==="startEnd"&&(_(d.startLocal??""),O(d.endLocal??"")),L.id==="locationType"&&R(d.locationType||""),L.id==="venue"&&E(d.venue??a.location??""),L.id==="virtualLink"&&F(d.virtualLink??a.virtualLink??""))},[L,z,d,a]);const V=j.useCallback($=>h[$],[h]),Q=j.useCallback(()=>{const $={};if(!L)return $;if(L.id==="eventName"&&w.trim().length<3&&($.eventName="Name must be at least 3 characters."),L.id==="startEnd"&&(S.trim()||($.startLocal="Start is required."),P.trim()||($.endLocal="End is required."),S&&P)){const q=new Date(S).getTime(),Y=new Date(P).getTime();!Number.isNaN(q)&&!Number.isNaN(Y)&&Y<=q&&($.endLocal="End must be after start.")}return L.id==="locationType"&&(T||($.locationType="Select a type.")),L.id==="venue"&&(I.trim()||($.venue="Venue or address is required.")),L.id==="virtualLink"&&(A.trim()?_Y(A)||($.virtualLink="Enter a valid URL (e.g. https://…)."):$.virtualLink="URL is required."),$},[L,w,S,P,T,I,A]),U=j.useCallback(()=>{if(!L)return d;const $={...d};return L.id==="eventName"&&($.eventName=w.trim()),L.id==="startEnd"&&($.startLocal=S,$.endLocal=P),L.id==="locationType"&&($.locationType=T),L.id==="venue"&&($.venue=I.trim()),L.id==="virtualLink"&&($.virtualLink=A.trim()),$},[d,L,w,S,P,T,I,A]),ee=()=>{const $=Q();if(Object.keys($).length>0){p($);return}const q=U();if(f(q),(L==null?void 0:L.id)==="locationType"&&T){const Y=Ewe(T,a);Y.length>0&&l(K=>Awe(K,c,Y))}u(Y=>Y+1)},H=()=>{b(null),p({}),u($=>Math.max(0,$-1))},B=j.useMemo(()=>{const $=(a.locationType||"physical").toLowerCase(),q={physical:"Physical",virtual:"Virtual",hybrid:"Hybrid"},Y=d.locationType||q[$]||"Physical",K=(d.eventName??a.name).trim(),G=(a.description||"").trim()||"—";let re=d.startLocal,J=d.endLocal;if(!re||!J)try{re=new Date(a.startDate).toLocaleString(),J=new Date(a.endDate).toLocaleString()}catch{re=a.startDate,J=a.endDate}const ae=(d.venue??a.location??"").trim()||"—",le=(d.virtualLink??a.virtualLink??"").trim()||"—";return[{k:"Name",v:K},{k:"Description",v:G},{k:"Type",v:Y},{k:"Venue",v:ae},{k:"Virtual link",v:le},{k:"Start",v:re},{k:"End",v:J},{k:"Event type (program)",v:a.type||"conference"},{k:"Status",v:a.status||"draft"}]},[d,a]),M=async()=>{b(null);let $;try{$=D$(a,d,r)}catch(Y){b(Y instanceof Error?Y.message:"Invalid event data.");return}m(!0);const q=await zr.create($);if(m(!1),q.data!=null&&!q.error){const Y=q.data._id;Y?(o(Y),n()):b("Could not create the event.")}else b(q.error||"Could not create the event.")};return i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:n,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:200}}),i.jsxs("div",{style:{position:"fixed",top:0,right:0,height:"100%",width:"min(520px, 100vw)",background:"var(--card)",zIndex:201,display:"flex",flexDirection:"column",boxShadow:"-4px 0 32px rgba(0,0,0,0.18)"},children:[i.jsx("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)",flexShrink:0},children:i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:"A few details needed"}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"4px 0 0",fontFamily:"var(--font-noto-sans)"},children:["Step ",z?s.length+1:c+1," of ",s.length+1]})]}),i.jsx("button",{type:"button",onClick:n,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",color:"var(--muted)"},children:i.jsx(er,{size:14})})]})}),i.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"16px 20px 24px",display:"flex",flexDirection:"column",gap:"14px"},children:[!z&&L&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{alignSelf:"flex-start",maxWidth:"100%",padding:"12px 14px",borderRadius:"12px",background:"var(--secondary)",border:"1px solid var(--border)"},children:[i.jsx("p",{style:{margin:0,fontSize:"var(--text-xs)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)",marginBottom:"6px"},children:"Assistant"}),i.jsx("p",{style:{margin:0,fontSize:"var(--text-sm)",color:"var(--foreground)",fontFamily:"var(--font-noto-sans)",lineHeight:1.5},children:L.prompt})]}),L.id==="eventName"&&i.jsxs(lr,{error:V("eventName"),children:[i.jsx(ur,{text:"Event name",required:!0}),i.jsx("input",{style:{...Xr,...V("eventName")?{borderColor:"var(--destructive)"}:{}},value:w,onChange:$=>k($.target.value)})]}),L.id==="startEnd"&&i.jsxs(No,{children:[i.jsxs(lr,{error:V("startLocal"),children:[i.jsx(ur,{text:"Start date & time",required:!0}),i.jsx("input",{type:"datetime-local",style:{...Xr,...V("startLocal")?{borderColor:"var(--destructive)"}:{}},value:S,onChange:$=>_($.target.value)})]}),i.jsxs(lr,{error:V("endLocal"),children:[i.jsx(ur,{text:"End date & time",required:!0}),i.jsx("input",{type:"datetime-local",style:{...Xr,...V("endLocal")?{borderColor:"var(--destructive)"}:{}},value:P,onChange:$=>O($.target.value)})]})]}),L.id==="locationType"&&i.jsxs(lr,{error:V("locationType"),children:[i.jsx(ur,{text:"Type",required:!0}),i.jsx(La,{children:i.jsxs("select",{style:{...Ra,...V("locationType")?{borderColor:"var(--destructive)"}:{}},value:T,onChange:$=>R($.target.value),children:[i.jsx("option",{value:"",children:"Select"}),i.jsx("option",{value:"Physical",children:"Physical"}),i.jsx("option",{value:"Virtual",children:"Virtual"}),i.jsx("option",{value:"Hybrid",children:"Hybrid"})]})})]}),L.id==="venue"&&i.jsxs(lr,{error:V("venue"),children:[i.jsx(ur,{text:"Location / venue",required:!0}),i.jsx("input",{style:{...Xr,...V("venue")?{borderColor:"var(--destructive)"}:{}},value:I,onChange:$=>E($.target.value)})]}),L.id==="virtualLink"&&i.jsxs(lr,{error:V("virtualLink"),children:[i.jsx(ur,{text:"Virtual link",required:!0}),i.jsx("input",{style:{...Xr,...V("virtualLink")?{borderColor:"var(--destructive)"}:{}},placeholder:"https://…",value:A,onChange:$=>F($.target.value)})]})]}),z&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{alignSelf:"flex-start",maxWidth:"100%",padding:"12px 14px",borderRadius:"12px",background:"var(--secondary)",border:"1px solid var(--border)"},children:[i.jsx("p",{style:{margin:0,fontSize:"var(--text-xs)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)",marginBottom:"6px"},children:"Assistant"}),i.jsx("p",{style:{margin:0,fontSize:"var(--text-sm)",color:"var(--foreground)",fontFamily:"var(--font-noto-sans)",lineHeight:1.5},children:"Here is a summary of your event. When you are ready, create the draft and open your dashboard."})]}),i.jsx("div",{style:{border:"1px solid var(--border)",borderRadius:"var(--radius-button)",padding:"12px 14px",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)"},children:B.map($=>i.jsxs("div",{style:{display:"flex",gap:"10px",padding:"6px 0",borderBottom:"1px solid var(--border)"},children:[i.jsx("span",{style:{color:"var(--muted)",minWidth:"120px",flexShrink:0},children:$.k}),i.jsx("span",{style:{color:"var(--foreground)",wordBreak:"break-word"},children:$.v})]},$.k))})]}),x&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",margin:0,fontFamily:"var(--font-noto-sans)"},children:x})]}),i.jsxs("div",{style:{padding:"12px 20px",borderTop:"1px solid var(--border)",display:"flex",gap:"10px",justifyContent:"flex-end",flexShrink:0},children:[!z&&c>0&&i.jsx("button",{type:"button",onClick:H,style:{padding:"8px 16px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"Back"}),!z&&i.jsx("button",{type:"button",onClick:ee,style:{padding:"8px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:c>=s.length-1?"Review":"Next"}),z&&i.jsx("button",{type:"button",disabled:y,onClick:()=>void M(),style:{padding:"8px 16px",borderRadius:"var(--radius-button)",background:y?"var(--muted)":"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:y?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:y?"Creating…":"Create event"})]})]})]})}function Pwe({organizationId:e,onCreated:t}){const[r,n]=j.useState(""),[o,a]=j.useState(!1),[s,l]=j.useState(null),[c,u]=j.useState(!1),[d,f]=j.useState([]),[h,p]=j.useState(null),y=()=>{(async()=>{var x;l(null);const m=r.trim();if(m.length<10){l("Add a bit more detail (at least 10 characters).");return}a(!0);try{const b=await zr.aiExtractPreview({description:m,organization:e});if(b.error!=null||b.data==null){l(b.error||"Could not analyze the description.");return}const{gaps:w,mergedPreview:k}=b.data,S=Array.isArray(w)?w:[],_=k!=null&&typeof k=="object"?k:{};if(S.length===0)try{const P=z$(_),O=D$(P,{},e),T=await zr.create(O);if(T.error!=null||!((x=T.data)!=null&&x._id)){l(T.error||"Could not create the event.");return}t(String(T.data._id)),n("")}catch(P){l(P instanceof Error?P.message:"Could not create the event.")}else f(S),p(_),u(!0)}finally{a(!1)}})()};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"16px 20px",marginBottom:"14px"},children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"6px"},children:"Describe your Event, Session and other details"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"12px",lineHeight:1.45},children:"Include the event name, what it is about, dates, venue or online link, and anything else relevant. We infer fields from your description. If something important is missing, we will ask a few short questions before creating your draft event with a default track and opening session."}),i.jsx("textarea",{value:r,onChange:m=>n(m.target.value),rows:5,disabled:o,placeholder:"Example: Annual cardiometabolic summit on 15–16 June 2026 at Hyderabad International Convention Centre, keynote on GLP-1 therapies…",style:{width:"100%",boxSizing:"border-box",resize:"vertical",minHeight:"120px",padding:"12px 14px",borderRadius:"var(--radius-button)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",background:"var(--background)",color:"var(--foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",lineHeight:1.45,marginBottom:"12px"}}),s&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--destructive)",marginBottom:"10px"},children:s}),i.jsxs("button",{type:"button",onClick:y,disabled:o,style:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"8px 18px",borderRadius:"var(--radius-button)",background:o?"var(--muted)":"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:o?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",opacity:o?.85:1},children:[i.jsx(Wte,{size:16}),o?"Analyzing…":"Generate your Event using AI"]})]}),c&&h!=null&&i.jsx(Twe,{gaps:d,mergedPreview:h,organizationId:e,onClose:()=>{u(!1),p(null)},onCreated:m=>{u(!1),p(null),n(""),t(m)}})]})}function CY({onClose:e,onSuccess:t,onCreated:r,organizationId:n}){const{user:o}=Ur(),a=zn(o),s=n??a??void 0,[l,c]=j.useState(""),[u,d]=j.useState(""),[f,h]=j.useState(""),[p,y]=j.useState(""),[m,x]=j.useState(""),[b,w]=j.useState(""),[k,S]=j.useState(""),[_,P]=j.useState({}),[O,T]=j.useState(!1),[R,I]=j.useState(null),E=j.useCallback(L=>_[L],[_]),A=j.useCallback(()=>{const L={};if(l.trim().length<3&&(L.eventName="Name must be at least 3 characters."),f||(L.locationType="Select a type."),(f==="Physical"||f==="Hybrid")&&(p.trim()||(L.venue="Venue or address is required.")),(f==="Virtual"||f==="Hybrid")&&(m.trim()||(L.virtualLink="Virtual link is required.")),b.trim()||(L.startLocal="Start date and time are required."),k.trim()||(L.endLocal="End date and time are required."),b&&k){const V=new Date(b).getTime(),Q=new Date(k).getTime();!Number.isNaN(V)&&!Number.isNaN(Q)&&Q<=V&&(L.endLocal="End must be after start.")}return L},[l,f,p,m,b,k]),F=async()=>{I(null);const L=A();if(Object.keys(L).length>0){P(L);return}P({});let z;try{z=Vie({eventName:l,description:u,locationTypeLabel:f,venue:p,virtualLink:m,startLocal:b,endLocal:k,organizationId:s})}catch(Q){I(Q instanceof Error?Q.message:"Invalid dates.");return}T(!0);const V=await zr.create(z);if(T(!1),V.data!=null&&!V.error){const Q=V.data._id;Q&&(r==null||r(Q)),t==null||t(),e()}else I(V.error||"Could not create event. Please try again.")};return i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:e,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:200}}),i.jsxs("div",{style:{position:"fixed",top:0,right:0,height:"100%",width:"min(520px, 100vw)",background:"var(--card)",zIndex:201,display:"flex",flexDirection:"column",boxShadow:"-4px 0 32px rgba(0,0,0,0.18)",animation:"slideInRightQuick 0.25s ease"},children:[i.jsx("style",{children:"@keyframes slideInRightQuick { from { transform: translateX(100%); } to { transform: translateX(0); } }"}),i.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)",flexShrink:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:"Create event"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"4px 0 0",lineHeight:1.45},children:"A default track and opening session are added automatically."})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:[i.jsx("button",{type:"button",onClick:e,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",color:"var(--muted)"},children:i.jsx(er,{size:14})}),i.jsx("button",{type:"button",disabled:O,onClick:()=>void F(),style:{padding:"6px 14px",borderRadius:"var(--radius-button)",background:O?"var(--secondary)":"var(--primary)",color:O?"var(--muted)":"var(--primary-foreground)",border:"none",cursor:O?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:O?"Creating…":"Create event"})]})]}),R?i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",margin:"10px 0 0"},children:R}):null]}),i.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"16px 20px 24px",display:"flex",flexDirection:"column",gap:"14px"},children:[i.jsxs(lr,{error:E("eventName"),children:[i.jsx(ur,{text:"Event name",required:!0}),i.jsx("input",{style:{...Xr,...E("eventName")?{borderColor:"var(--destructive)"}:{}},value:l,onChange:L=>c(L.target.value),autoComplete:"off"})]}),i.jsxs(lr,{error:E("description"),children:[i.jsx(ur,{text:"Description"}),i.jsx("textarea",{style:{...Xr,resize:"vertical",minHeight:"72px",...E("description")?{borderColor:"var(--destructive)"}:{}},value:u,onChange:L=>d(L.target.value)})]}),i.jsxs(lr,{error:E("locationType"),children:[i.jsx(ur,{text:"Type",required:!0}),i.jsx(La,{children:i.jsxs("select",{style:{...Ra,...E("locationType")?{borderColor:"var(--destructive)"}:{}},value:f,onChange:L=>h(L.target.value),children:[i.jsx("option",{value:"",children:"Physical / Virtual / Hybrid"}),i.jsx("option",{value:"Physical",children:"Physical"}),i.jsx("option",{value:"Virtual",children:"Virtual"}),i.jsx("option",{value:"Hybrid",children:"Hybrid"})]})})]}),(f==="Physical"||f==="Hybrid")&&i.jsxs(lr,{error:E("venue"),children:[i.jsx(ur,{text:"Location / venue",required:!0}),i.jsx("input",{style:{...Xr,...E("venue")?{borderColor:"var(--destructive)"}:{}},value:p,onChange:L=>y(L.target.value)})]}),(f==="Virtual"||f==="Hybrid")&&i.jsxs(lr,{error:E("virtualLink"),children:[i.jsx(ur,{text:"Virtual link",required:!0}),i.jsx("input",{style:{...Xr,...E("virtualLink")?{borderColor:"var(--destructive)"}:{}},placeholder:"https://…",value:m,onChange:L=>x(L.target.value)})]}),i.jsxs(No,{children:[i.jsxs(lr,{error:E("startLocal"),children:[i.jsx(ur,{text:"Start date & time",required:!0}),i.jsx("input",{type:"datetime-local",style:{...Xr,...E("startLocal")?{borderColor:"var(--destructive)"}:{}},value:b,onChange:L=>w(L.target.value)})]}),i.jsxs(lr,{error:E("endLocal"),children:[i.jsx(ur,{text:"End date & time",required:!0}),i.jsx("input",{type:"datetime-local",style:{...Xr,...E("endLocal")?{borderColor:"var(--destructive)"}:{}},value:k,onChange:L=>S(L.target.value)})]})]})]})]})]})}function Owe(e){var t;return e?e.firstName||e.lastName?[e.firstName,e.lastName].filter(Boolean).join(" ").trim():((t=e.email)==null?void 0:t.split("@")[0])??"there":"there"}function Iwe({msg:e,onDone:t}){return j.useEffect(()=>{const r=setTimeout(t,3e3);return()=>clearTimeout(r)},[]),i.jsxs("div",{style:{position:"fixed",bottom:"24px",left:"50%",transform:"translateX(-50%)",background:"var(--foreground)",color:"var(--background)",padding:"10px 20px",borderRadius:"var(--radius-button)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",boxShadow:"var(--shadow-xl)",zIndex:200,display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx(av,{size:13})," ",e]})}function Nwe(){const{setActiveNav:e,setSelectedEventId:t}=eo(),{user:r}=Ur(),n=zn(r),o=Owe(r??null),[a,s]=j.useState(null),[l,c]=j.useState(!1),[u,d]=j.useState(!1),h=qi()==="mobile",p=y=>{y==="event"?c(!0):(y==="qna"||y==="quiz-poll")&&d(!0)};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:h?"32px":"40px",maxWidth:"1200px",margin:"0 auto"},children:[i.jsx("div",{children:i.jsxs("h1",{style:{fontFamily:"var(--font-inter)",fontSize:h?"var(--text-2xl)":"var(--text-3xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"0 0 8px"},children:["Hi, ",o]})}),i.jsxs("div",{children:[i.jsx("h2",{style:{fontFamily:"var(--font-noto-sans)",fontSize:h?"var(--text-lg)":"var(--text-xl)",fontWeight:"var(--font-weight-normal)",color:"var(--foreground)",margin:"0 0 20px",lineHeight:1.4},children:"Tell us about your event or activity, we will create it for you."}),n?i.jsx(Pwe,{organizationId:n,onCreated:y=>{t(y),e("dashboard"),s("Event, track, and opening session created from your description.")}}):i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0,lineHeight:1.5},children:"Set up an organization in your portfolio to generate events with AI from here."})]}),i.jsx("div",{children:i.jsxs("div",{style:{display:"grid",gridTemplateColumns:h?"1fr":"repeat(3, 1fr)",gap:h?"12px":"20px"},children:[i.jsx(A4,{icon:i.jsx(Wi,{size:32}),title:"Create new event",onClick:()=>p("event")}),i.jsx(A4,{icon:i.jsx(Zs,{size:32}),title:"Create Q&A Session",onClick:()=>p("qna")}),i.jsx(A4,{icon:i.jsx(N6,{size:32}),title:"Create quiz or poll",onClick:()=>p("quiz-poll")})]})}),u&&i.jsx(Rwe,{onClose:()=>d(!1)}),l&&i.jsx(CY,{organizationId:n,onClose:()=>c(!1),onCreated:y=>{t(y),e("dashboard")}}),a&&i.jsx(Iwe,{msg:a,onDone:()=>s(null)})]})}function A4({icon:e,title:t,onClick:r}){return i.jsxs("button",{type:"button",onClick:r,style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"20px",padding:"48px 24px",borderRadius:"var(--radius-card)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",background:"var(--card)",cursor:"pointer",transition:"border-color 0.15s, background 0.15s, box-shadow 0.15s",minHeight:"200px"},onMouseEnter:n=>{n.currentTarget.style.borderColor="var(--primary)",n.currentTarget.style.background="var(--accent)",n.currentTarget.style.boxShadow="0 4px 12px rgba(11,77,209,0.15)"},onMouseLeave:n=>{n.currentTarget.style.borderColor="var(--border)",n.currentTarget.style.background="var(--card)",n.currentTarget.style.boxShadow="none"},children:[i.jsx("div",{style:{color:"var(--primary)"},children:e}),i.jsx("p",{style:{fontSize:"var(--text-lg)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0,textAlign:"center"},children:t})]})}function Rwe({onClose:e}){return i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:e,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.50)",zIndex:200},role:"presentation"}),i.jsxs("div",{style:{position:"fixed",top:0,right:0,height:"100%",width:"min(480px, 100vw)",background:"var(--card)",zIndex:201,display:"flex",flexDirection:"column",boxShadow:"-4px 0 40px rgba(0,0,0,0.20)",animation:"homePanelIn 0.25s cubic-bezier(0.4, 0, 0.2, 1)"},children:[i.jsx("style",{children:"@keyframes homePanelIn { from { transform:translateX(100%); opacity:.6 } to { transform:translateX(0); opacity:1 } }"}),i.jsxs("div",{style:{padding:"20px 24px",borderBottom:"1px solid var(--border)"},children:[i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:"Quick activity creation"}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"6px 0 0"},children:"Create a Q&A session, quiz, or poll in seconds"})]}),i.jsx("div",{style:{flex:1,overflowY:"auto",padding:"24px"},children:i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",textAlign:"center",marginTop:"60px"},children:"Quick activity creation interface coming soon!"})}),i.jsxs("div",{style:{padding:"16px 24px",borderTop:"1px solid var(--border)",display:"flex",gap:"12px"},children:[i.jsx("button",{type:"button",onClick:e,style:{flex:1,padding:"10px 20px",borderRadius:"var(--radius-button)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",background:"var(--card)",color:"var(--card-foreground)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",transition:"background 0.15s"},onMouseEnter:t=>{t.currentTarget.style.background="var(--secondary)"},onMouseLeave:t=>{t.currentTarget.style.background="var(--card)"},children:"Cancel"}),i.jsx("button",{type:"button",style:{flex:1,padding:"10px 20px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",transition:"opacity 0.15s ease",opacity:1},onMouseEnter:t=>{t.currentTarget.style.opacity="0.88"},onMouseLeave:t=>{t.currentTarget.style.opacity="1"},children:"Create Activity"})]})]})]})}function nn(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Js(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Na(e,t){const r=nn(e);return isNaN(t)?Js(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function cc(e,t){const r=nn(e);if(isNaN(t))return Js(e,NaN);if(!t)return r;const n=r.getDate(),o=Js(e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const a=o.getDate();return n>=a?o:(r.setFullYear(o.getFullYear(),o.getMonth(),n),r)}const pP=6048e5,Lwe=864e5;let Fwe={};function bb(){return Fwe}function tu(e,t){var l,c,u,d;const r=bb(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,o=nn(e),a=o.getDay(),s=(a<n?7:0)+a-n;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function xh(e){return tu(e,{weekStartsOn:1})}function EY(e){const t=nn(e),r=t.getFullYear(),n=Js(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const o=xh(n),a=Js(e,0);a.setFullYear(r,0,4),a.setHours(0,0,0,0);const s=xh(a);return t.getTime()>=o.getTime()?r+1:t.getTime()>=s.getTime()?r:r-1}function Ym(e){const t=nn(e);return t.setHours(0,0,0,0),t}function U2(e){const t=nn(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function Yc(e,t){const r=Ym(e),n=Ym(t),o=+r-U2(r),a=+n-U2(n);return Math.round((o-a)/Lwe)}function Mwe(e){const t=EY(e),r=Js(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),xh(r)}function IA(e,t){const r=t*7;return Na(e,r)}function Dwe(e,t){return cc(e,t*12)}function zwe(e){let t;return e.forEach(function(r){const n=nn(r);(t===void 0||t<n||isNaN(Number(n)))&&(t=n)}),t||new Date(NaN)}function Bwe(e){let t;return e.forEach(r=>{const n=nn(r);(!t||t>n||isNaN(+n))&&(t=n)}),t||new Date(NaN)}function us(e,t){const r=Ym(e),n=Ym(t);return+r==+n}function hP(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Wwe(e){if(!hP(e)&&typeof e!="number")return!1;const t=nn(e);return!isNaN(Number(t))}function qx(e,t){const r=nn(e),n=nn(t),o=r.getFullYear()-n.getFullYear(),a=r.getMonth()-n.getMonth();return o*12+a}function qwe(e,t,r){const n=tu(e,r),o=tu(t,r),a=+n-U2(n),s=+o-U2(o);return Math.round((a-s)/pP)}function gP(e){const t=nn(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function hs(e){const t=nn(e);return t.setDate(1),t.setHours(0,0,0,0),t}function AY(e){const t=nn(e),r=Js(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}function mP(e,t){var l,c,u,d;const r=bb(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,o=nn(e),a=o.getDay(),s=(a<n?-7:0)+6-(a-n);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}function TY(e){return mP(e,{weekStartsOn:1})}const $we={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"}},Uwe=(e,t,r)=>{let n;const o=$we[e];return typeof o=="string"?n=o:t===1?n=o.one:n=o.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function T4(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const Hwe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Vwe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ywe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Gwe={date:T4({formats:Hwe,defaultWidth:"full"}),time:T4({formats:Vwe,defaultWidth:"full"}),dateTime:T4({formats:Ywe,defaultWidth:"full"})},Kwe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Qwe=(e,t,r,n)=>Kwe[e];function vy(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let o;if(n==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):s;o=e.formattingValues[l]||e.formattingValues[s]}else{const s=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;o=e.values[l]||e.values[s]}const a=e.argumentCallback?e.argumentCallback(t):t;return o[a]}}const Xwe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Zwe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Jwe={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"]},eSe={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"]},tSe={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"}},rSe={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"}},nSe=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},iSe={ordinalNumber:nSe,era:vy({values:Xwe,defaultWidth:"wide"}),quarter:vy({values:Zwe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:vy({values:Jwe,defaultWidth:"wide"}),day:vy({values:eSe,defaultWidth:"wide"}),dayPeriod:vy({values:tSe,defaultWidth:"wide",formattingValues:rSe,defaultFormattingWidth:"wide"})};function yy(e){return(t,r={})=>{const n=r.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(o);if(!a)return null;const s=a[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?aSe(l,f=>f.test(s)):oSe(l,f=>f.test(s));let u;u=e.valueCallback?e.valueCallback(c):c,u=r.valueCallback?r.valueCallback(u):u;const d=t.slice(s.length);return{value:u,rest:d}}}function oSe(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function aSe(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function sSe(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const o=n[0],a=t.match(e.parsePattern);if(!a)return null;let s=e.valueCallback?e.valueCallback(a[0]):a[0];s=r.valueCallback?r.valueCallback(s):s;const l=t.slice(o.length);return{value:s,rest:l}}}const lSe=/^(\d+)(th|st|nd|rd)?/i,cSe=/\d+/i,uSe={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},dSe={any:[/^b/i,/^(a|c)/i]},fSe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},pSe={any:[/1/i,/2/i,/3/i,/4/i]},hSe={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},gSe={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]},mSe={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},vSe={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]},ySe={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},xSe={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}},bSe={ordinalNumber:sSe({matchPattern:lSe,parsePattern:cSe,valueCallback:e=>parseInt(e,10)}),era:yy({matchPatterns:uSe,defaultMatchWidth:"wide",parsePatterns:dSe,defaultParseWidth:"any"}),quarter:yy({matchPatterns:fSe,defaultMatchWidth:"wide",parsePatterns:pSe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:yy({matchPatterns:hSe,defaultMatchWidth:"wide",parsePatterns:gSe,defaultParseWidth:"any"}),day:yy({matchPatterns:mSe,defaultMatchWidth:"wide",parsePatterns:vSe,defaultParseWidth:"any"}),dayPeriod:yy({matchPatterns:ySe,defaultMatchWidth:"any",parsePatterns:xSe,defaultParseWidth:"any"})},PY={code:"en-US",formatDistance:Uwe,formatLong:Gwe,formatRelative:Qwe,localize:iSe,match:bSe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function wSe(e){const t=nn(e);return Yc(t,AY(t))+1}function OY(e){const t=nn(e),r=+xh(t)-+Mwe(t);return Math.round(r/pP)+1}function IY(e,t){var d,f,h,p;const r=nn(e),n=r.getFullYear(),o=bb(),a=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(h=o.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=Js(e,0);s.setFullYear(n+1,0,a),s.setHours(0,0,0,0);const l=tu(s,t),c=Js(e,0);c.setFullYear(n,0,a),c.setHours(0,0,0,0);const u=tu(c,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=u.getTime()?n:n-1}function SSe(e,t){var l,c,u,d;const r=bb(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,o=IY(e,t),a=Js(e,0);return a.setFullYear(o,0,n),a.setHours(0,0,0,0),tu(a,t)}function NY(e,t){const r=nn(e),n=+tu(r,t)-+SSe(r,t);return Math.round(n/pP)+1}function Pn(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const pf={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return Pn(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Pn(r+1,2)},d(e,t){return Pn(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return Pn(e.getHours()%12||12,t.length)},H(e,t){return Pn(e.getHours(),t.length)},m(e,t){return Pn(e.getMinutes(),t.length)},s(e,t){return Pn(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),o=Math.trunc(n*Math.pow(10,r-3));return Pn(o,t.length)}},Tg={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},b7={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),o=n>0?n:1-n;return r.ordinalNumber(o,{unit:"year"})}return pf.y(e,t)},Y:function(e,t,r,n){const o=IY(e,n),a=o>0?o:1-o;if(t==="YY"){const s=a%100;return Pn(s,2)}return t==="Yo"?r.ordinalNumber(a,{unit:"year"}):Pn(a,t.length)},R:function(e,t){const r=EY(e);return Pn(r,t.length)},u:function(e,t){const r=e.getFullYear();return Pn(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return Pn(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return Pn(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return pf.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return Pn(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const o=NY(e,n);return t==="wo"?r.ordinalNumber(o,{unit:"week"}):Pn(o,t.length)},I:function(e,t,r){const n=OY(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):Pn(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):pf.d(e,t)},D:function(e,t,r){const n=wSe(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Pn(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const o=e.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Pn(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const o=e.getDay(),a=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Pn(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),o=n===0?7:n;switch(t){case"i":return String(o);case"ii":return Pn(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let o;switch(n===12?o=Tg.noon:n===0?o=Tg.midnight:o=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let o;switch(n>=17?o=Tg.evening:n>=12?o=Tg.afternoon:n>=4?o=Tg.morning:o=Tg.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return pf.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):pf.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Pn(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):Pn(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):pf.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):pf.s(e,t)},S:function(e,t){return pf.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return S7(n);case"XXXX":case"XX":return Bp(n);case"XXXXX":case"XXX":default:return Bp(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return S7(n);case"xxxx":case"xx":return Bp(n);case"xxxxx":case"xxx":default:return Bp(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+w7(n,":");case"OOOO":default:return"GMT"+Bp(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+w7(n,":");case"zzzz":default:return"GMT"+Bp(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return Pn(n,t.length)},T:function(e,t,r){const n=e.getTime();return Pn(n,t.length)}};function w7(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),o=Math.trunc(n/60),a=n%60;return a===0?r+String(o):r+String(o)+t+Pn(a,2)}function S7(e,t){return e%60===0?(e>0?"-":"+")+Pn(Math.abs(e)/60,2):Bp(e,t)}function Bp(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),o=Pn(Math.trunc(n/60),2),a=Pn(n%60,2);return r+o+t+a}const j7=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},RY=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},jSe=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return j7(e,t);let a;switch(n){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",j7(n,t)).replace("{{time}}",RY(o,t))},kSe={p:RY,P:jSe},_Se=/^D+$/,CSe=/^Y+$/,ESe=["D","DD","YY","YYYY"];function ASe(e){return _Se.test(e)}function TSe(e){return CSe.test(e)}function PSe(e,t,r){const n=OSe(e,t,r);if(console.warn(n),ESe.includes(e))throw new RangeError(n)}function OSe(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ISe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,NSe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,RSe=/^'([^]*?)'?$/,LSe=/''/g,FSe=/[a-zA-Z]/;function Fh(e,t,r){var d,f,h,p,y,m,x,b;const n=bb(),o=(r==null?void 0:r.locale)??n.locale??PY,a=(r==null?void 0:r.firstWeekContainsDate)??((f=(d=r==null?void 0:r.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,s=(r==null?void 0:r.weekStartsOn)??((m=(y=r==null?void 0:r.locale)==null?void 0:y.options)==null?void 0:m.weekStartsOn)??n.weekStartsOn??((b=(x=n.locale)==null?void 0:x.options)==null?void 0:b.weekStartsOn)??0,l=nn(e);if(!Wwe(l))throw new RangeError("Invalid time value");let c=t.match(NSe).map(w=>{const k=w[0];if(k==="p"||k==="P"){const S=kSe[k];return S(w,o.formatLong)}return w}).join("").match(ISe).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const k=w[0];if(k==="'")return{isToken:!1,value:MSe(w)};if(b7[k])return{isToken:!0,value:w};if(k.match(FSe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:w}});o.localize.preprocessor&&(c=o.localize.preprocessor(l,c));const u={firstWeekContainsDate:a,weekStartsOn:s,locale:o};return c.map(w=>{if(!w.isToken)return w.value;const k=w.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&TSe(k)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&ASe(k))&&PSe(k,t,String(e));const S=b7[k[0]];return S(l,k,o.localize,u)}).join("")}function MSe(e){const t=e.match(RSe);return t?t[1].replace(LSe,"'"):e}function DSe(e){const t=nn(e),r=t.getFullYear(),n=t.getMonth(),o=Js(e,0);return o.setFullYear(r,n+1,0),o.setHours(0,0,0,0),o.getDate()}function zSe(e){return Math.trunc(+nn(e)/1e3)}function BSe(e){const t=nn(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(0,0,0,0),t}function WSe(e,t){return qwe(BSe(e),hs(e),t)+1}function NA(e,t){const r=nn(e),n=nn(t);return r.getTime()>n.getTime()}function LY(e,t){const r=nn(e),n=nn(t);return+r<+n}function vP(e,t){const r=nn(e),n=nn(t);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function qSe(e,t){const r=nn(e),n=nn(t);return r.getFullYear()===n.getFullYear()}function P4(e,t){return Na(e,-t)}function O4(e,t){const r=nn(e),n=r.getFullYear(),o=r.getDate(),a=Js(e,0);a.setFullYear(n,t,15),a.setHours(0,0,0,0);const s=DSe(a);return r.setMonth(t,Math.min(o,s)),r}function k7(e,t){const r=nn(e);return isNaN(+r)?Js(e,NaN):(r.setFullYear(t),r)}var Sr=function(){return Sr=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Sr.apply(this,arguments)};function $Se(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function FY(e,t,r){for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function wb(e){return e.mode==="multiple"}function Sb(e){return e.mode==="range"}function wS(e){return e.mode==="single"}var USe={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function HSe(e,t){return Fh(e,"LLLL y",t)}function VSe(e,t){return Fh(e,"d",t)}function YSe(e,t){return Fh(e,"LLLL",t)}function GSe(e){return"".concat(e)}function KSe(e,t){return Fh(e,"cccccc",t)}function QSe(e,t){return Fh(e,"yyyy",t)}var XSe=Object.freeze({__proto__:null,formatCaption:HSe,formatDay:VSe,formatMonthCaption:YSe,formatWeekNumber:GSe,formatWeekdayName:KSe,formatYearCaption:QSe}),ZSe=function(e,t,r){return Fh(e,"do MMMM (EEEE)",r)},JSe=function(){return"Month: "},eje=function(){return"Go to next month"},tje=function(){return"Go to previous month"},rje=function(e,t){return Fh(e,"cccc",t)},nje=function(e){return"Week n. ".concat(e)},ije=function(){return"Year: "},oje=Object.freeze({__proto__:null,labelDay:ZSe,labelMonthDropdown:JSe,labelNext:eje,labelPrevious:tje,labelWeekNumber:nje,labelWeekday:rje,labelYearDropdown:ije});function aje(){var e="buttons",t=USe,r=PY,n={},o={},a=1,s={},l=new Date;return{captionLayout:e,classNames:t,formatters:XSe,labels:oje,locale:r,modifiersClassNames:n,modifiers:o,numberOfMonths:a,styles:s,today:l,mode:"default"}}function sje(e){var t=e.fromYear,r=e.toYear,n=e.fromMonth,o=e.toMonth,a=e.fromDate,s=e.toDate;return n?a=hs(n):t&&(a=new Date(t,0,1)),o?s=gP(o):r&&(s=new Date(r,11,31)),{fromDate:a?Ym(a):void 0,toDate:s?Ym(s):void 0}}var MY=j.createContext(void 0);function lje(e){var t,r=e.initialProps,n=aje(),o=sje(r),a=o.fromDate,s=o.toDate,l=(t=r.captionLayout)!==null&&t!==void 0?t:n.captionLayout;l!=="buttons"&&(!a||!s)&&(l="buttons");var c;(wS(r)||wb(r)||Sb(r))&&(c=r.onSelect);var u=Sr(Sr(Sr({},n),r),{captionLayout:l,classNames:Sr(Sr({},n.classNames),r.classNames),components:Sr({},r.components),formatters:Sr(Sr({},n.formatters),r.formatters),fromDate:a,labels:Sr(Sr({},n.labels),r.labels),mode:r.mode||n.mode,modifiers:Sr(Sr({},n.modifiers),r.modifiers),modifiersClassNames:Sr(Sr({},n.modifiersClassNames),r.modifiersClassNames),onSelect:c,styles:Sr(Sr({},n.styles),r.styles),toDate:s});return i.jsx(MY.Provider,{value:u,children:e.children})}function Qn(){var e=j.useContext(MY);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function DY(e){var t=Qn(),r=t.locale,n=t.classNames,o=t.styles,a=t.formatters.formatCaption;return i.jsx("div",{className:n.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:a(e.displayMonth,{locale:r})})}function cje(e){return i.jsx("svg",Sr({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:i.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function zY(e){var t,r,n=e.onChange,o=e.value,a=e.children,s=e.caption,l=e.className,c=e.style,u=Qn(),d=(r=(t=u.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&r!==void 0?r:cje;return i.jsxs("div",{className:l,style:c,children:[i.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),i.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:o,onChange:n,children:a}),i.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[s,i.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function uje(e){var t,r=Qn(),n=r.fromDate,o=r.toDate,a=r.styles,s=r.locale,l=r.formatters.formatMonthCaption,c=r.classNames,u=r.components,d=r.labels.labelMonthDropdown;if(!n)return i.jsx(i.Fragment,{});if(!o)return i.jsx(i.Fragment,{});var f=[];if(qSe(n,o))for(var h=hs(n),p=n.getMonth();p<=o.getMonth();p++)f.push(O4(h,p));else for(var h=hs(new Date),p=0;p<=11;p++)f.push(O4(h,p));var y=function(x){var b=Number(x.target.value),w=O4(hs(e.displayMonth),b);e.onChange(w)},m=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:zY;return i.jsx(m,{name:"months","aria-label":d(),className:c.dropdown_month,style:a.dropdown_month,onChange:y,value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:s}),children:f.map(function(x){return i.jsx("option",{value:x.getMonth(),children:l(x,{locale:s})},x.getMonth())})})}function dje(e){var t,r=e.displayMonth,n=Qn(),o=n.fromDate,a=n.toDate,s=n.locale,l=n.styles,c=n.classNames,u=n.components,d=n.formatters.formatYearCaption,f=n.labels.labelYearDropdown,h=[];if(!o)return i.jsx(i.Fragment,{});if(!a)return i.jsx(i.Fragment,{});for(var p=o.getFullYear(),y=a.getFullYear(),m=p;m<=y;m++)h.push(k7(AY(new Date),m));var x=function(w){var k=k7(hs(r),Number(w.target.value));e.onChange(k)},b=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:zY;return i.jsx(b,{name:"years","aria-label":f(),className:c.dropdown_year,style:l.dropdown_year,onChange:x,value:r.getFullYear(),caption:d(r,{locale:s}),children:h.map(function(w){return i.jsx("option",{value:w.getFullYear(),children:d(w,{locale:s})},w.getFullYear())})})}function fje(e,t){var r=j.useState(e),n=r[0],o=r[1],a=t===void 0?n:t;return[a,o]}function pje(e){var t=e.month,r=e.defaultMonth,n=e.today,o=t||r||n||new Date,a=e.toDate,s=e.fromDate,l=e.numberOfMonths,c=l===void 0?1:l;if(a&&qx(a,o)<0){var u=-1*(c-1);o=cc(a,u)}return s&&qx(o,s)<0&&(o=s),hs(o)}function hje(){var e=Qn(),t=pje(e),r=fje(t,e.month),n=r[0],o=r[1],a=function(s){var l;if(!e.disableNavigation){var c=hs(s);o(c),(l=e.onMonthChange)===null||l===void 0||l.call(e,c)}};return[n,a]}function gje(e,t){for(var r=t.reverseMonths,n=t.numberOfMonths,o=hs(e),a=hs(cc(o,n)),s=qx(a,o),l=[],c=0;c<s;c++){var u=cc(o,c);l.push(u)}return r&&(l=l.reverse()),l}function mje(e,t){if(!t.disableNavigation){var r=t.toDate,n=t.pagedNavigation,o=t.numberOfMonths,a=o===void 0?1:o,s=n?a:1,l=hs(e);if(!r)return cc(l,s);var c=qx(r,e);if(!(c<a))return cc(l,s)}}function vje(e,t){if(!t.disableNavigation){var r=t.fromDate,n=t.pagedNavigation,o=t.numberOfMonths,a=o===void 0?1:o,s=n?a:1,l=hs(e);if(!r)return cc(l,-s);var c=qx(l,r);if(!(c<=0))return cc(l,-s)}}var BY=j.createContext(void 0);function yje(e){var t=Qn(),r=hje(),n=r[0],o=r[1],a=gje(n,t),s=mje(n,t),l=vje(n,t),c=function(f){return a.some(function(h){return vP(f,h)})},u=function(f,h){c(f)||(h&&LY(f,h)?o(cc(f,1+t.numberOfMonths*-1)):o(f))},d={currentMonth:n,displayMonths:a,goToMonth:o,goToDate:u,previousMonth:l,nextMonth:s,isDateDisplayed:c};return i.jsx(BY.Provider,{value:d,children:e.children})}function jb(){var e=j.useContext(BY);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function _7(e){var t,r=Qn(),n=r.classNames,o=r.styles,a=r.components,s=jb().goToMonth,l=function(d){s(cc(d,e.displayIndex?-e.displayIndex:0))},c=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:DY,u=i.jsx(c,{id:e.id,displayMonth:e.displayMonth});return i.jsxs("div",{className:n.caption_dropdowns,style:o.caption_dropdowns,children:[i.jsx("div",{className:n.vhidden,children:u}),i.jsx(uje,{onChange:l,displayMonth:e.displayMonth}),i.jsx(dje,{onChange:l,displayMonth:e.displayMonth})]})}function xje(e){return i.jsx("svg",Sr({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:i.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function bje(e){return i.jsx("svg",Sr({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:i.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var H2=j.forwardRef(function(e,t){var r=Qn(),n=r.classNames,o=r.styles,a=[n.button_reset,n.button];e.className&&a.push(e.className);var s=a.join(" "),l=Sr(Sr({},o.button_reset),o.button);return e.style&&Object.assign(l,e.style),i.jsx("button",Sr({},e,{ref:t,type:"button",className:s,style:l}))});function wje(e){var t,r,n=Qn(),o=n.dir,a=n.locale,s=n.classNames,l=n.styles,c=n.labels,u=c.labelPrevious,d=c.labelNext,f=n.components;if(!e.nextMonth&&!e.previousMonth)return i.jsx(i.Fragment,{});var h=u(e.previousMonth,{locale:a}),p=[s.nav_button,s.nav_button_previous].join(" "),y=d(e.nextMonth,{locale:a}),m=[s.nav_button,s.nav_button_next].join(" "),x=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:bje,b=(r=f==null?void 0:f.IconLeft)!==null&&r!==void 0?r:xje;return i.jsxs("div",{className:s.nav,style:l.nav,children:[!e.hidePrevious&&i.jsx(H2,{name:"previous-month","aria-label":h,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?i.jsx(x,{className:s.nav_icon,style:l.nav_icon}):i.jsx(b,{className:s.nav_icon,style:l.nav_icon})}),!e.hideNext&&i.jsx(H2,{name:"next-month","aria-label":y,className:m,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?i.jsx(b,{className:s.nav_icon,style:l.nav_icon}):i.jsx(x,{className:s.nav_icon,style:l.nav_icon})})]})}function C7(e){var t=Qn().numberOfMonths,r=jb(),n=r.previousMonth,o=r.nextMonth,a=r.goToMonth,s=r.displayMonths,l=s.findIndex(function(y){return vP(e.displayMonth,y)}),c=l===0,u=l===s.length-1,d=t>1&&(c||!u),f=t>1&&(u||!c),h=function(){n&&a(n)},p=function(){o&&a(o)};return i.jsx(wje,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:f,nextMonth:o,previousMonth:n,onPreviousClick:h,onNextClick:p})}function Sje(e){var t,r=Qn(),n=r.classNames,o=r.disableNavigation,a=r.styles,s=r.captionLayout,l=r.components,c=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:DY,u;return o?u=i.jsx(c,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?u=i.jsx(_7,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?u=i.jsxs(i.Fragment,{children:[i.jsx(_7,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),i.jsx(C7,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):u=i.jsxs(i.Fragment,{children:[i.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),i.jsx(C7,{displayMonth:e.displayMonth,id:e.id})]}),i.jsx("div",{className:n.caption,style:a.caption,children:u})}function jje(e){var t=Qn(),r=t.footer,n=t.styles,o=t.classNames.tfoot;return r?i.jsx("tfoot",{className:o,style:n.tfoot,children:i.jsx("tr",{children:i.jsx("td",{colSpan:8,children:r})})}):i.jsx(i.Fragment,{})}function kje(e,t,r){for(var n=r?xh(new Date):tu(new Date,{locale:e,weekStartsOn:t}),o=[],a=0;a<7;a++){var s=Na(n,a);o.push(s)}return o}function _je(){var e=Qn(),t=e.classNames,r=e.styles,n=e.showWeekNumber,o=e.locale,a=e.weekStartsOn,s=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=kje(o,a,s);return i.jsxs("tr",{style:r.head_row,className:t.head_row,children:[n&&i.jsx("td",{style:r.head_cell,className:t.head_cell}),u.map(function(d,f){return i.jsx("th",{scope:"col",className:t.head_cell,style:r.head_cell,"aria-label":c(d,{locale:o}),children:l(d,{locale:o})},f)})]})}function Cje(){var e,t=Qn(),r=t.classNames,n=t.styles,o=t.components,a=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:_je;return i.jsx("thead",{style:n.head,className:r.head,children:i.jsx(a,{})})}function Eje(e){var t=Qn(),r=t.locale,n=t.formatters.formatDay;return i.jsx(i.Fragment,{children:n(e.date,{locale:r})})}var yP=j.createContext(void 0);function Aje(e){if(!wb(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return i.jsx(yP.Provider,{value:t,children:e.children})}return i.jsx(Tje,{initialProps:e.initialProps,children:e.children})}function Tje(e){var t=e.initialProps,r=e.children,n=t.selected,o=t.min,a=t.max,s=function(u,d,f){var h,p;(h=t.onDayClick)===null||h===void 0||h.call(t,u,d,f);var y=!!(d.selected&&o&&(n==null?void 0:n.length)===o);if(!y){var m=!!(!d.selected&&a&&(n==null?void 0:n.length)===a);if(!m){var x=n?FY([],n):[];if(d.selected){var b=x.findIndex(function(w){return us(u,w)});x.splice(b,1)}else x.push(u);(p=t.onSelect)===null||p===void 0||p.call(t,x,u,d,f)}}},l={disabled:[]};n&&l.disabled.push(function(u){var d=a&&n.length>a-1,f=n.some(function(h){return us(h,u)});return!!(d&&!f)});var c={selected:n,onDayClick:s,modifiers:l};return i.jsx(yP.Provider,{value:c,children:r})}function xP(){var e=j.useContext(yP);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function Pje(e,t){var r=t||{},n=r.from,o=r.to;return n&&o?us(o,e)&&us(n,e)?void 0:us(o,e)?{from:o,to:void 0}:us(n,e)?void 0:NA(n,e)?{from:e,to:o}:{from:n,to:e}:o?NA(e,o)?{from:o,to:e}:{from:e,to:o}:n?LY(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}var bP=j.createContext(void 0);function Oje(e){if(!Sb(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return i.jsx(bP.Provider,{value:t,children:e.children})}return i.jsx(Ije,{initialProps:e.initialProps,children:e.children})}function Ije(e){var t=e.initialProps,r=e.children,n=t.selected,o=n||{},a=o.from,s=o.to,l=t.min,c=t.max,u=function(p,y,m){var x,b;(x=t.onDayClick)===null||x===void 0||x.call(t,p,y,m);var w=Pje(p,n);(b=t.onSelect)===null||b===void 0||b.call(t,w,p,y,m)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(d.range_start=[a],s?(d.range_end=[s],us(a,s)||(d.range_middle=[{after:a,before:s}])):d.range_end=[a]):s&&(d.range_start=[s],d.range_end=[s]),l&&(a&&!s&&d.disabled.push({after:P4(a,l-1),before:Na(a,l-1)}),a&&s&&d.disabled.push({after:a,before:Na(a,l-1)}),!a&&s&&d.disabled.push({after:P4(s,l-1),before:Na(s,l-1)})),c){if(a&&!s&&(d.disabled.push({before:Na(a,-c+1)}),d.disabled.push({after:Na(a,c-1)})),a&&s){var f=Yc(s,a)+1,h=c-f;d.disabled.push({before:P4(a,h)}),d.disabled.push({after:Na(s,h)})}!a&&s&&(d.disabled.push({before:Na(s,-c+1)}),d.disabled.push({after:Na(s,c-1)}))}return i.jsx(bP.Provider,{value:{selected:n,onDayClick:u,modifiers:d},children:r})}function wP(){var e=j.useContext(bP);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function y0(e){return Array.isArray(e)?FY([],e):e!==void 0?[e]:[]}function Nje(e){var t={};return Object.entries(e).forEach(function(r){var n=r[0],o=r[1];t[n]=y0(o)}),t}var uc;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(uc||(uc={}));var Rje=uc.Selected,$u=uc.Disabled,Lje=uc.Hidden,Fje=uc.Today,I4=uc.RangeEnd,N4=uc.RangeMiddle,R4=uc.RangeStart,Mje=uc.Outside;function Dje(e,t,r){var n,o=(n={},n[Rje]=y0(e.selected),n[$u]=y0(e.disabled),n[Lje]=y0(e.hidden),n[Fje]=[e.today],n[I4]=[],n[N4]=[],n[R4]=[],n[Mje]=[],n);return e.fromDate&&o[$u].push({before:e.fromDate}),e.toDate&&o[$u].push({after:e.toDate}),wb(e)?o[$u]=o[$u].concat(t.modifiers[$u]):Sb(e)&&(o[$u]=o[$u].concat(r.modifiers[$u]),o[R4]=r.modifiers[R4],o[N4]=r.modifiers[N4],o[I4]=r.modifiers[I4]),o}var WY=j.createContext(void 0);function zje(e){var t=Qn(),r=xP(),n=wP(),o=Dje(t,r,n),a=Nje(t.modifiers),s=Sr(Sr({},o),a);return i.jsx(WY.Provider,{value:s,children:e.children})}function qY(){var e=j.useContext(WY);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Bje(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Wje(e){return!!(e&&typeof e=="object"&&"from"in e)}function qje(e){return!!(e&&typeof e=="object"&&"after"in e)}function $je(e){return!!(e&&typeof e=="object"&&"before"in e)}function Uje(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Hje(e,t){var r,n=t.from,o=t.to;if(n&&o){var a=Yc(o,n)<0;a&&(r=[o,n],n=r[0],o=r[1]);var s=Yc(e,n)>=0&&Yc(o,e)>=0;return s}return o?us(o,e):n?us(n,e):!1}function Vje(e){return hP(e)}function Yje(e){return Array.isArray(e)&&e.every(hP)}function Gje(e,t){return t.some(function(r){if(typeof r=="boolean")return r;if(Vje(r))return us(e,r);if(Yje(r))return r.includes(e);if(Wje(r))return Hje(e,r);if(Uje(r))return r.dayOfWeek.includes(e.getDay());if(Bje(r)){var n=Yc(r.before,e),o=Yc(r.after,e),a=n>0,s=o<0,l=NA(r.before,r.after);return l?s&&a:a||s}return qje(r)?Yc(e,r.after)>0:$je(r)?Yc(r.before,e)>0:typeof r=="function"?r(e):!1})}function SP(e,t,r){var n=Object.keys(t).reduce(function(a,s){var l=t[s];return Gje(e,l)&&a.push(s),a},[]),o={};return n.forEach(function(a){return o[a]=!0}),r&&!vP(e,r)&&(o.outside=!0),o}function Kje(e,t){for(var r=hs(e[0]),n=gP(e[e.length-1]),o,a,s=r;s<=n;){var l=SP(s,t),c=!l.disabled&&!l.hidden;if(!c){s=Na(s,1);continue}if(l.selected)return s;l.today&&!a&&(a=s),o||(o=s),s=Na(s,1)}return a||o}var Qje=365;function $Y(e,t){var r=t.moveBy,n=t.direction,o=t.context,a=t.modifiers,s=t.retry,l=s===void 0?{count:0,lastFocused:e}:s,c=o.weekStartsOn,u=o.fromDate,d=o.toDate,f=o.locale,h={day:Na,week:IA,month:cc,year:Dwe,startOfWeek:function(x){return o.ISOWeek?xh(x):tu(x,{locale:f,weekStartsOn:c})},endOfWeek:function(x){return o.ISOWeek?TY(x):mP(x,{locale:f,weekStartsOn:c})}},p=h[r](e,n==="after"?1:-1);n==="before"&&u?p=zwe([u,p]):n==="after"&&d&&(p=Bwe([d,p]));var y=!0;if(a){var m=SP(p,a);y=!m.disabled&&!m.hidden}return y?p:l.count>Qje?l.lastFocused:$Y(p,{moveBy:r,direction:n,context:o,modifiers:a,retry:Sr(Sr({},l),{count:l.count+1})})}var UY=j.createContext(void 0);function Xje(e){var t=jb(),r=qY(),n=j.useState(),o=n[0],a=n[1],s=j.useState(),l=s[0],c=s[1],u=Kje(t.displayMonths,r),d=o??(l&&t.isDateDisplayed(l))?l:u,f=function(){c(o),a(void 0)},h=function(x){a(x)},p=Qn(),y=function(x,b){if(o){var w=$Y(o,{moveBy:x,direction:b,context:p,modifiers:r});us(o,w)||(t.goToDate(w,o),h(w))}},m={focusedDay:o,focusTarget:d,blur:f,focus:h,focusDayAfter:function(){return y("day","after")},focusDayBefore:function(){return y("day","before")},focusWeekAfter:function(){return y("week","after")},focusWeekBefore:function(){return y("week","before")},focusMonthBefore:function(){return y("month","before")},focusMonthAfter:function(){return y("month","after")},focusYearBefore:function(){return y("year","before")},focusYearAfter:function(){return y("year","after")},focusStartOfWeek:function(){return y("startOfWeek","before")},focusEndOfWeek:function(){return y("endOfWeek","after")}};return i.jsx(UY.Provider,{value:m,children:e.children})}function jP(){var e=j.useContext(UY);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Zje(e,t){var r=qY(),n=SP(e,r,t);return n}var kP=j.createContext(void 0);function Jje(e){if(!wS(e.initialProps)){var t={selected:void 0};return i.jsx(kP.Provider,{value:t,children:e.children})}return i.jsx(e5e,{initialProps:e.initialProps,children:e.children})}function e5e(e){var t=e.initialProps,r=e.children,n=function(a,s,l){var c,u,d;if((c=t.onDayClick)===null||c===void 0||c.call(t,a,s,l),s.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,a,s,l);return}(d=t.onSelect)===null||d===void 0||d.call(t,a,a,s,l)},o={selected:t.selected,onDayClick:n};return i.jsx(kP.Provider,{value:o,children:r})}function HY(){var e=j.useContext(kP);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function t5e(e,t){var r=Qn(),n=HY(),o=xP(),a=wP(),s=jP(),l=s.focusDayAfter,c=s.focusDayBefore,u=s.focusWeekAfter,d=s.focusWeekBefore,f=s.blur,h=s.focus,p=s.focusMonthBefore,y=s.focusMonthAfter,m=s.focusYearBefore,x=s.focusYearAfter,b=s.focusStartOfWeek,w=s.focusEndOfWeek,k=function(Q){var U,ee,H,B;wS(r)?(U=n.onDayClick)===null||U===void 0||U.call(n,e,t,Q):wb(r)?(ee=o.onDayClick)===null||ee===void 0||ee.call(o,e,t,Q):Sb(r)?(H=a.onDayClick)===null||H===void 0||H.call(a,e,t,Q):(B=r.onDayClick)===null||B===void 0||B.call(r,e,t,Q)},S=function(Q){var U;h(e),(U=r.onDayFocus)===null||U===void 0||U.call(r,e,t,Q)},_=function(Q){var U;f(),(U=r.onDayBlur)===null||U===void 0||U.call(r,e,t,Q)},P=function(Q){var U;(U=r.onDayMouseEnter)===null||U===void 0||U.call(r,e,t,Q)},O=function(Q){var U;(U=r.onDayMouseLeave)===null||U===void 0||U.call(r,e,t,Q)},T=function(Q){var U;(U=r.onDayPointerEnter)===null||U===void 0||U.call(r,e,t,Q)},R=function(Q){var U;(U=r.onDayPointerLeave)===null||U===void 0||U.call(r,e,t,Q)},I=function(Q){var U;(U=r.onDayTouchCancel)===null||U===void 0||U.call(r,e,t,Q)},E=function(Q){var U;(U=r.onDayTouchEnd)===null||U===void 0||U.call(r,e,t,Q)},A=function(Q){var U;(U=r.onDayTouchMove)===null||U===void 0||U.call(r,e,t,Q)},F=function(Q){var U;(U=r.onDayTouchStart)===null||U===void 0||U.call(r,e,t,Q)},L=function(Q){var U;(U=r.onDayKeyUp)===null||U===void 0||U.call(r,e,t,Q)},z=function(Q){var U;switch(Q.key){case"ArrowLeft":Q.preventDefault(),Q.stopPropagation(),r.dir==="rtl"?l():c();break;case"ArrowRight":Q.preventDefault(),Q.stopPropagation(),r.dir==="rtl"?c():l();break;case"ArrowDown":Q.preventDefault(),Q.stopPropagation(),u();break;case"ArrowUp":Q.preventDefault(),Q.stopPropagation(),d();break;case"PageUp":Q.preventDefault(),Q.stopPropagation(),Q.shiftKey?m():p();break;case"PageDown":Q.preventDefault(),Q.stopPropagation(),Q.shiftKey?x():y();break;case"Home":Q.preventDefault(),Q.stopPropagation(),b();break;case"End":Q.preventDefault(),Q.stopPropagation(),w();break}(U=r.onDayKeyDown)===null||U===void 0||U.call(r,e,t,Q)},V={onClick:k,onFocus:S,onBlur:_,onKeyDown:z,onKeyUp:L,onMouseEnter:P,onMouseLeave:O,onPointerEnter:T,onPointerLeave:R,onTouchCancel:I,onTouchEnd:E,onTouchMove:A,onTouchStart:F};return V}function r5e(){var e=Qn(),t=HY(),r=xP(),n=wP(),o=wS(e)?t.selected:wb(e)?r.selected:Sb(e)?n.selected:void 0;return o}function n5e(e){return Object.values(uc).includes(e)}function i5e(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(n){var o=e.modifiersClassNames[n];if(o)r.push(o);else if(n5e(n)){var a=e.classNames["day_".concat(n)];a&&r.push(a)}}),r}function o5e(e,t){var r=Sr({},e.styles.day);return Object.keys(t).forEach(function(n){var o;r=Sr(Sr({},r),(o=e.modifiersStyles)===null||o===void 0?void 0:o[n])}),r}function a5e(e,t,r){var n,o,a,s=Qn(),l=jP(),c=Zje(e,t),u=t5e(e,c),d=r5e(),f=!!(s.onDayClick||s.mode!=="default");j.useEffect(function(){var P;c.outside||l.focusedDay&&f&&us(l.focusedDay,e)&&((P=r.current)===null||P===void 0||P.focus())},[l.focusedDay,e,r,f,c.outside]);var h=i5e(s,c).join(" "),p=o5e(s,c),y=!!(c.outside&&!s.showOutsideDays||c.hidden),m=(a=(o=s.components)===null||o===void 0?void 0:o.DayContent)!==null&&a!==void 0?a:Eje,x=i.jsx(m,{date:e,displayMonth:t,activeModifiers:c}),b={style:p,className:h,children:x,role:"gridcell"},w=l.focusTarget&&us(l.focusTarget,e)&&!c.outside,k=l.focusedDay&&us(l.focusedDay,e),S=Sr(Sr(Sr({},b),(n={disabled:c.disabled,role:"gridcell"},n["aria-selected"]=c.selected,n.tabIndex=k||w?0:-1,n)),u),_={isButton:f,isHidden:y,activeModifiers:c,selectedDays:d,buttonProps:S,divProps:b};return _}function s5e(e){var t=j.useRef(null),r=a5e(e.date,e.displayMonth,t);return r.isHidden?i.jsx("div",{role:"gridcell"}):r.isButton?i.jsx(H2,Sr({name:"day",ref:t},r.buttonProps)):i.jsx("div",Sr({},r.divProps))}function l5e(e){var t=e.number,r=e.dates,n=Qn(),o=n.onWeekNumberClick,a=n.styles,s=n.classNames,l=n.locale,c=n.labels.labelWeekNumber,u=n.formatters.formatWeekNumber,d=u(Number(t),{locale:l});if(!o)return i.jsx("span",{className:s.weeknumber,style:a.weeknumber,children:d});var f=c(Number(t),{locale:l}),h=function(p){o(t,r,p)};return i.jsx(H2,{name:"week-number","aria-label":f,className:s.weeknumber,style:a.weeknumber,onClick:h,children:d})}function c5e(e){var t,r,n=Qn(),o=n.styles,a=n.classNames,s=n.showWeekNumber,l=n.components,c=(t=l==null?void 0:l.Day)!==null&&t!==void 0?t:s5e,u=(r=l==null?void 0:l.WeekNumber)!==null&&r!==void 0?r:l5e,d;return s&&(d=i.jsx("td",{className:a.cell,style:o.cell,children:i.jsx(u,{number:e.weekNumber,dates:e.dates})})),i.jsxs("tr",{className:a.row,style:o.row,children:[d,e.dates.map(function(f){return i.jsx("td",{className:a.cell,style:o.cell,role:"presentation",children:i.jsx(c,{displayMonth:e.displayMonth,date:f})},zSe(f))})]})}function E7(e,t,r){for(var n=r!=null&&r.ISOWeek?TY(t):mP(t,r),o=r!=null&&r.ISOWeek?xh(e):tu(e,r),a=Yc(n,o),s=[],l=0;l<=a;l++)s.push(Na(o,l));var c=s.reduce(function(u,d){var f=r!=null&&r.ISOWeek?OY(d):NY(d,r),h=u.find(function(p){return p.weekNumber===f});return h?(h.dates.push(d),u):(u.push({weekNumber:f,dates:[d]}),u)},[]);return c}function u5e(e,t){var r=E7(hs(e),gP(e),t);if(t!=null&&t.useFixedWeeks){var n=WSe(e,t);if(n<6){var o=r[r.length-1],a=o.dates[o.dates.length-1],s=IA(a,6-n),l=E7(IA(a,1),s,t);r.push.apply(r,l)}}return r}function d5e(e){var t,r,n,o=Qn(),a=o.locale,s=o.classNames,l=o.styles,c=o.hideHead,u=o.fixedWeeks,d=o.components,f=o.weekStartsOn,h=o.firstWeekContainsDate,p=o.ISOWeek,y=u5e(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:p,locale:a,weekStartsOn:f,firstWeekContainsDate:h}),m=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:Cje,x=(r=d==null?void 0:d.Row)!==null&&r!==void 0?r:c5e,b=(n=d==null?void 0:d.Footer)!==null&&n!==void 0?n:jje;return i.jsxs("table",{id:e.id,className:s.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&i.jsx(m,{}),i.jsx("tbody",{className:s.tbody,style:l.tbody,children:y.map(function(w){return i.jsx(x,{displayMonth:e.displayMonth,dates:w.dates,weekNumber:w.weekNumber},w.weekNumber)})}),i.jsx(b,{displayMonth:e.displayMonth})]})}function f5e(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var p5e=f5e()?j.useLayoutEffect:j.useEffect,L4=!1,h5e=0;function A7(){return"react-day-picker-".concat(++h5e)}function g5e(e){var t,r=e??(L4?A7():null),n=j.useState(r),o=n[0],a=n[1];return p5e(function(){o===null&&a(A7())},[]),j.useEffect(function(){L4===!1&&(L4=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function m5e(e){var t,r,n=Qn(),o=n.dir,a=n.classNames,s=n.styles,l=n.components,c=jb().displayMonths,u=g5e(n.id?"".concat(n.id,"-").concat(e.displayIndex):void 0),d=n.id?"".concat(n.id,"-grid-").concat(e.displayIndex):void 0,f=[a.month],h=s.month,p=e.displayIndex===0,y=e.displayIndex===c.length-1,m=!p&&!y;o==="rtl"&&(t=[p,y],y=t[0],p=t[1]),p&&(f.push(a.caption_start),h=Sr(Sr({},h),s.caption_start)),y&&(f.push(a.caption_end),h=Sr(Sr({},h),s.caption_end)),m&&(f.push(a.caption_between),h=Sr(Sr({},h),s.caption_between));var x=(r=l==null?void 0:l.Caption)!==null&&r!==void 0?r:Sje;return i.jsxs("div",{className:f.join(" "),style:h,children:[i.jsx(x,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),i.jsx(d5e,{id:d,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function v5e(e){var t=Qn(),r=t.classNames,n=t.styles;return i.jsx("div",{className:r.months,style:n.months,children:e.children})}function y5e(e){var t,r,n=e.initialProps,o=Qn(),a=jP(),s=jb(),l=j.useState(!1),c=l[0],u=l[1];j.useEffect(function(){o.initialFocus&&a.focusTarget&&(c||(a.focus(a.focusTarget),u(!0)))},[o.initialFocus,c,a.focus,a.focusTarget,a]);var d=[o.classNames.root,o.className];o.numberOfMonths>1&&d.push(o.classNames.multiple_months),o.showWeekNumber&&d.push(o.classNames.with_weeknumber);var f=Sr(Sr({},o.styles.root),o.style),h=Object.keys(n).filter(function(y){return y.startsWith("data-")}).reduce(function(y,m){var x;return Sr(Sr({},y),(x={},x[m]=n[m],x))},{}),p=(r=(t=n.components)===null||t===void 0?void 0:t.Months)!==null&&r!==void 0?r:v5e;return i.jsx("div",Sr({className:d.join(" "),style:f,dir:o.dir,id:o.id,nonce:n.nonce,title:n.title,lang:n.lang},h,{children:i.jsx(p,{children:s.displayMonths.map(function(y,m){return i.jsx(m5e,{displayIndex:m,displayMonth:y},m)})})}))}function x5e(e){var t=e.children,r=$Se(e,["children"]);return i.jsx(lje,{initialProps:r,children:i.jsx(yje,{children:i.jsx(Jje,{initialProps:r,children:i.jsx(Aje,{initialProps:r,children:i.jsx(Oje,{initialProps:r,children:i.jsx(zje,{children:i.jsx(Xje,{children:t})})})})})})})}function b5e(e){return i.jsx(x5e,Sr({},e,{children:i.jsx(y5e,{initialProps:e})}))}const T7=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,P7=Lr,w5e=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return P7(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:a}=t,s=Object.keys(o).map(u=>{const d=r==null?void 0:r[u],f=a==null?void 0:a[u];if(d===null)return null;const h=T7(d)||T7(f);return o[u][h]}),l=r&&Object.entries(r).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(y=>{let[m,x]=y;return Array.isArray(x)?x.includes({...a,...l}[m]):{...a,...l}[m]===x})?[...u,f,h]:u},[]);return P7(e,s,c,r==null?void 0:r.class,r==null?void 0:r.className)},O7=w5e("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}});function S5e({className:e,classNames:t,showOutsideDays:r=!0,...n}){return i.jsx(b5e,{showOutsideDays:r,className:Xo("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:Xo(O7({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:Xo("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:Xo(O7({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({className:o,...a})=>i.jsx(Nf,{className:Xo("size-4",o),...a}),IconRight:({className:o,...a})=>i.jsx(va,{className:Xo("size-4",o),...a})},...n})}const j5e=["top","right","bottom","left"],Mf=Math.min,qs=Math.max,V2=Math.round,X1=Math.floor,Zc=e=>({x:e,y:e}),k5e={left:"right",right:"left",bottom:"top",top:"bottom"};function RA(e,t,r){return qs(e,Mf(t,r))}function hd(e,t){return typeof e=="function"?e(t):e}function gd(e){return e.split("-")[0]}function jv(e){return e.split("-")[1]}function _P(e){return e==="x"?"y":"x"}function CP(e){return e==="y"?"height":"width"}function Gc(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function EP(e){return _P(Gc(e))}function _5e(e,t,r){r===void 0&&(r=!1);const n=jv(e),o=EP(e),a=CP(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=Y2(s)),[s,Y2(s)]}function C5e(e){const t=Y2(e);return[LA(e),t,LA(t)]}function LA(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const I7=["left","right"],N7=["right","left"],E5e=["top","bottom"],A5e=["bottom","top"];function T5e(e,t,r){switch(e){case"top":case"bottom":return r?t?N7:I7:t?I7:N7;case"left":case"right":return t?E5e:A5e;default:return[]}}function P5e(e,t,r,n){const o=jv(e);let a=T5e(gd(e),r==="start",n);return o&&(a=a.map(s=>s+"-"+o),t&&(a=a.concat(a.map(LA)))),a}function Y2(e){const t=gd(e);return k5e[t]+e.slice(t.length)}function O5e(e){return{top:0,right:0,bottom:0,left:0,...e}}function VY(e){return typeof e!="number"?O5e(e):{top:e,right:e,bottom:e,left:e}}function G2(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function R7(e,t,r){let{reference:n,floating:o}=e;const a=Gc(t),s=EP(t),l=CP(s),c=gd(t),u=a==="y",d=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,h=n[l]/2-o[l]/2;let p;switch(c){case"top":p={x:d,y:n.y-o.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-o.width,y:f};break;default:p={x:n.x,y:n.y}}switch(jv(t)){case"start":p[s]-=h*(r&&u?-1:1);break;case"end":p[s]+=h*(r&&u?-1:1);break}return p}async function I5e(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:s,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=hd(t,e),y=VY(p),x=l[h?f==="floating"?"reference":"floating":f],b=G2(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(x)))==null||r?x:x.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),S=await(a.isElement==null?void 0:a.isElement(k))?await(a.getScale==null?void 0:a.getScale(k))||{x:1,y:1}:{x:1,y:1},_=G2(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:k,strategy:c}):w);return{top:(b.top-_.top+y.top)/S.y,bottom:(_.bottom-b.bottom+y.bottom)/S.y,left:(b.left-_.left+y.left)/S.x,right:(_.right-b.right+y.right)/S.x}}const N5e=50,R5e=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:s}=r,l=s.detectOverflow?s:{...s,detectOverflow:I5e},c=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=R7(u,n,c),h=n,p=0;const y={};for(let m=0;m<a.length;m++){const x=a[m];if(!x)continue;const{name:b,fn:w}=x,{x:k,y:S,data:_,reset:P}=await w({x:d,y:f,initialPlacement:n,placement:h,strategy:o,middlewareData:y,rects:u,platform:l,elements:{reference:e,floating:t}});d=k??d,f=S??f,y[b]={...y[b],..._},P&&p<N5e&&(p++,typeof P=="object"&&(P.placement&&(h=P.placement),P.rects&&(u=P.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:d,y:f}=R7(u,h,c)),m=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:y}},L5e=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:s,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=hd(e,t)||{};if(u==null)return{};const f=VY(d),h={x:r,y:n},p=EP(o),y=CP(p),m=await s.getDimensions(u),x=p==="y",b=x?"top":"left",w=x?"bottom":"right",k=x?"clientHeight":"clientWidth",S=a.reference[y]+a.reference[p]-h[p]-a.floating[y],_=h[p]-a.reference[p],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let O=P?P[k]:0;(!O||!await(s.isElement==null?void 0:s.isElement(P)))&&(O=l.floating[k]||a.floating[y]);const T=S/2-_/2,R=O/2-m[y]/2-1,I=Mf(f[b],R),E=Mf(f[w],R),A=I,F=O-m[y]-E,L=O/2-m[y]/2+T,z=RA(A,L,F),V=!c.arrow&&jv(o)!=null&&L!==z&&a.reference[y]/2-(L<A?I:E)-m[y]/2<0,Q=V?L<A?L-A:L-F:0;return{[p]:h[p]+Q,data:{[p]:z,centerOffset:L-z-Q,...V&&{alignmentOffset:Q}},reset:V}}}),F5e=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:s,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:m=!0,...x}=hd(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const b=gd(o),w=Gc(l),k=gd(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),_=h||(k||!m?[Y2(l)]:C5e(l)),P=y!=="none";!h&&P&&_.push(...P5e(l,m,y,S));const O=[l,..._],T=await c.detectOverflow(t,x),R=[];let I=((n=a.flip)==null?void 0:n.overflows)||[];if(d&&R.push(T[b]),f){const L=_5e(o,s,S);R.push(T[L[0]],T[L[1]])}if(I=[...I,{placement:o,overflows:R}],!R.every(L=>L<=0)){var E,A;const L=(((E=a.flip)==null?void 0:E.index)||0)+1,z=O[L];if(z&&(!(f==="alignment"?w!==Gc(z):!1)||I.every(U=>Gc(U.placement)===w?U.overflows[0]>0:!0)))return{data:{index:L,overflows:I},reset:{placement:z}};let V=(A=I.filter(Q=>Q.overflows[0]<=0).sort((Q,U)=>Q.overflows[1]-U.overflows[1])[0])==null?void 0:A.placement;if(!V)switch(p){case"bestFit":{var F;const Q=(F=I.filter(U=>{if(P){const ee=Gc(U.placement);return ee===w||ee==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(ee=>ee>0).reduce((ee,H)=>ee+H,0)]).sort((U,ee)=>U[1]-ee[1])[0])==null?void 0:F[0];Q&&(V=Q);break}case"initialPlacement":V=l;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function L7(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function F7(e){return j5e.some(t=>e[t]>=0)}const M5e=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...a}=hd(e,t);switch(o){case"referenceHidden":{const s=await n.detectOverflow(t,{...a,elementContext:"reference"}),l=L7(s,r.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:F7(l)}}}case"escaped":{const s=await n.detectOverflow(t,{...a,altBoundary:!0}),l=L7(s,r.floating);return{data:{escapedOffsets:l,escaped:F7(l)}}}default:return{}}}}},YY=new Set(["left","top"]);async function D5e(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=gd(r),l=jv(r),c=Gc(r)==="y",u=YY.has(s)?-1:1,d=a&&c?-1:1,f=hd(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof y=="number"&&(p=l==="end"?y*-1:y),c?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const z5e=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:s,middlewareData:l}=t,c=await D5e(t,e);return s===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:o+c.x,y:a+c.y,data:{...c,placement:s}}}}},B5e=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:a}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:c={fn:b=>{let{x:w,y:k}=b;return{x:w,y:k}}},...u}=hd(e,t),d={x:r,y:n},f=await a.detectOverflow(t,u),h=Gc(gd(o)),p=_P(h);let y=d[p],m=d[h];if(s){const b=p==="y"?"top":"left",w=p==="y"?"bottom":"right",k=y+f[b],S=y-f[w];y=RA(k,y,S)}if(l){const b=h==="y"?"top":"left",w=h==="y"?"bottom":"right",k=m+f[b],S=m-f[w];m=RA(k,m,S)}const x=c.fn({...t,[p]:y,[h]:m});return{...x,data:{x:x.x-r,y:x.y-n,enabled:{[p]:s,[h]:l}}}}}},W5e=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=hd(e,t),d={x:r,y:n},f=Gc(o),h=_P(f);let p=d[h],y=d[f];const m=hd(l,t),x=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const k=h==="y"?"height":"width",S=a.reference[h]-a.floating[k]+x.mainAxis,_=a.reference[h]+a.reference[k]-x.mainAxis;p<S?p=S:p>_&&(p=_)}if(u){var b,w;const k=h==="y"?"width":"height",S=YY.has(gd(o)),_=a.reference[f]-a.floating[k]+(S&&((b=s.offset)==null?void 0:b[f])||0)+(S?0:x.crossAxis),P=a.reference[f]+a.reference[k]+(S?0:((w=s.offset)==null?void 0:w[f])||0)-(S?x.crossAxis:0);y<_?y=_:y>P&&(y=P)}return{[h]:p,[f]:y}}}},q5e=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:s,elements:l}=t,{apply:c=()=>{},...u}=hd(e,t),d=await s.detectOverflow(t,u),f=gd(o),h=jv(o),p=Gc(o)==="y",{width:y,height:m}=a.floating;let x,b;f==="top"||f==="bottom"?(x=f,b=h===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(b=f,x=h==="end"?"top":"bottom");const w=m-d.top-d.bottom,k=y-d.left-d.right,S=Mf(m-d[x],w),_=Mf(y-d[b],k),P=!t.middlewareData.shift;let O=S,T=_;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(T=k),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(O=w),P&&!h){const I=qs(d.left,0),E=qs(d.right,0),A=qs(d.top,0),F=qs(d.bottom,0);p?T=y-2*(I!==0||E!==0?I+E:qs(d.left,d.right)):O=m-2*(A!==0||F!==0?A+F:qs(d.top,d.bottom))}await c({...t,availableWidth:T,availableHeight:O});const R=await s.getDimensions(l.floating);return y!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function SS(){return typeof window<"u"}function kv(e){return GY(e)?(e.nodeName||"").toLowerCase():"#document"}function Qs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function lu(e){var t;return(t=(GY(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function GY(e){return SS()?e instanceof Node||e instanceof Qs(e).Node:!1}function dc(e){return SS()?e instanceof Element||e instanceof Qs(e).Element:!1}function _d(e){return SS()?e instanceof HTMLElement||e instanceof Qs(e).HTMLElement:!1}function M7(e){return!SS()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qs(e).ShadowRoot}function kb(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=fc(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&o!=="inline"&&o!=="contents"}function $5e(e){return/^(table|td|th)$/.test(kv(e))}function jS(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const U5e=/transform|translate|scale|rotate|perspective|filter/,H5e=/paint|layout|strict|content/,Pp=e=>!!e&&e!=="none";let F4;function AP(e){const t=dc(e)?fc(e):e;return Pp(t.transform)||Pp(t.translate)||Pp(t.scale)||Pp(t.rotate)||Pp(t.perspective)||!TP()&&(Pp(t.backdropFilter)||Pp(t.filter))||U5e.test(t.willChange||"")||H5e.test(t.contain||"")}function V5e(e){let t=Df(e);for(;_d(t)&&!Gm(t);){if(AP(t))return t;if(jS(t))return null;t=Df(t)}return null}function TP(){return F4==null&&(F4=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),F4}function Gm(e){return/^(html|body|#document)$/.test(kv(e))}function fc(e){return Qs(e).getComputedStyle(e)}function kS(e){return dc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Df(e){if(kv(e)==="html")return e;const t=e.assignedSlot||e.parentNode||M7(e)&&e.host||lu(e);return M7(t)?t.host:t}function KY(e){const t=Df(e);return Gm(t)?e.ownerDocument?e.ownerDocument.body:e.body:_d(t)&&kb(t)?t:KY(t)}function $x(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=KY(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),s=Qs(o);if(a){const l=FA(s);return t.concat(s,s.visualViewport||[],kb(o)?o:[],l&&r?$x(l):[])}else return t.concat(o,$x(o,[],r))}function FA(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function QY(e){const t=fc(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=_d(e),a=o?e.offsetWidth:r,s=o?e.offsetHeight:n,l=V2(r)!==a||V2(n)!==s;return l&&(r=a,n=s),{width:r,height:n,$:l}}function PP(e){return dc(e)?e:e.contextElement}function im(e){const t=PP(e);if(!_d(t))return Zc(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=QY(t);let s=(a?V2(r.width):r.width)/n,l=(a?V2(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Y5e=Zc(0);function XY(e){const t=Qs(e);return!TP()||!t.visualViewport?Y5e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function G5e(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Qs(e)?!1:t}function bh(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=PP(e);let s=Zc(1);t&&(n?dc(n)&&(s=im(n)):s=im(e));const l=G5e(a,r,n)?XY(a):Zc(0);let c=(o.left+l.x)/s.x,u=(o.top+l.y)/s.y,d=o.width/s.x,f=o.height/s.y;if(a){const h=Qs(a),p=n&&dc(n)?Qs(n):n;let y=h,m=FA(y);for(;m&&n&&p!==y;){const x=im(m),b=m.getBoundingClientRect(),w=fc(m),k=b.left+(m.clientLeft+parseFloat(w.paddingLeft))*x.x,S=b.top+(m.clientTop+parseFloat(w.paddingTop))*x.y;c*=x.x,u*=x.y,d*=x.x,f*=x.y,c+=k,u+=S,y=Qs(m),m=FA(y)}}return G2({width:d,height:f,x:c,y:u})}function _S(e,t){const r=kS(e).scrollLeft;return t?t.left+r:bh(lu(e)).left+r}function ZY(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-_S(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function K5e(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",s=lu(n),l=t?jS(t.floating):!1;if(n===s||l&&a)return r;let c={scrollLeft:0,scrollTop:0},u=Zc(1);const d=Zc(0),f=_d(n);if((f||!f&&!a)&&((kv(n)!=="body"||kb(s))&&(c=kS(n)),f)){const p=bh(n);u=im(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}const h=s&&!f&&!a?ZY(s,c):Zc(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:r.y*u.y-c.scrollTop*u.y+d.y+h.y}}function Q5e(e){return Array.from(e.getClientRects())}function X5e(e){const t=lu(e),r=kS(e),n=e.ownerDocument.body,o=qs(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=qs(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+_S(e);const l=-r.scrollTop;return fc(n).direction==="rtl"&&(s+=qs(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:s,y:l}}const D7=25;function Z5e(e,t){const r=Qs(e),n=lu(e),o=r.visualViewport;let a=n.clientWidth,s=n.clientHeight,l=0,c=0;if(o){a=o.width,s=o.height;const d=TP();(!d||d&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const u=_S(n);if(u<=0){const d=n.ownerDocument,f=d.body,h=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,y=Math.abs(n.clientWidth-f.clientWidth-p);y<=D7&&(a-=y)}else u<=D7&&(a+=u);return{width:a,height:s,x:l,y:c}}function J5e(e,t){const r=bh(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=_d(e)?im(e):Zc(1),s=e.clientWidth*a.x,l=e.clientHeight*a.y,c=o*a.x,u=n*a.y;return{width:s,height:l,x:c,y:u}}function z7(e,t,r){let n;if(t==="viewport")n=Z5e(e,r);else if(t==="document")n=X5e(lu(e));else if(dc(t))n=J5e(t,r);else{const o=XY(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return G2(n)}function JY(e,t){const r=Df(e);return r===t||!dc(r)||Gm(r)?!1:fc(r).position==="fixed"||JY(r,t)}function eke(e,t){const r=t.get(e);if(r)return r;let n=$x(e,[],!1).filter(l=>dc(l)&&kv(l)!=="body"),o=null;const a=fc(e).position==="fixed";let s=a?Df(e):e;for(;dc(s)&&!Gm(s);){const l=fc(s),c=AP(s);!c&&l.position==="fixed"&&(o=null),(a?!c&&!o:!c&&l.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||kb(s)&&!c&&JY(e,s))?n=n.filter(d=>d!==s):o=l,s=Df(s)}return t.set(e,n),n}function tke(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?jS(t)?[]:eke(t,this._c):[].concat(r),n],l=z7(t,s[0],o);let c=l.top,u=l.right,d=l.bottom,f=l.left;for(let h=1;h<s.length;h++){const p=z7(t,s[h],o);c=qs(p.top,c),u=Mf(p.right,u),d=Mf(p.bottom,d),f=qs(p.left,f)}return{width:u-f,height:d-c,x:f,y:c}}function rke(e){const{width:t,height:r}=QY(e);return{width:t,height:r}}function nke(e,t,r){const n=_d(t),o=lu(t),a=r==="fixed",s=bh(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=Zc(0);function u(){c.x=_S(o)}if(n||!n&&!a)if((kv(t)!=="body"||kb(o))&&(l=kS(t)),n){const p=bh(t,!0,a,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else o&&u();a&&!n&&o&&u();const d=o&&!n&&!a?ZY(o,l):Zc(0),f=s.left+l.scrollLeft-c.x-d.x,h=s.top+l.scrollTop-c.y-d.y;return{x:f,y:h,width:s.width,height:s.height}}function M4(e){return fc(e).position==="static"}function B7(e,t){if(!_d(e)||fc(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return lu(e)===r&&(r=r.ownerDocument.body),r}function eG(e,t){const r=Qs(e);if(jS(e))return r;if(!_d(e)){let o=Df(e);for(;o&&!Gm(o);){if(dc(o)&&!M4(o))return o;o=Df(o)}return r}let n=B7(e,t);for(;n&&$5e(n)&&M4(n);)n=B7(n,t);return n&&Gm(n)&&M4(n)&&!AP(n)?r:n||V5e(e)||r}const ike=async function(e){const t=this.getOffsetParent||eG,r=this.getDimensions,n=await r(e.floating);return{reference:nke(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function oke(e){return fc(e).direction==="rtl"}const ake={convertOffsetParentRelativeRectToViewportRelativeRect:K5e,getDocumentElement:lu,getClippingRect:tke,getOffsetParent:eG,getElementRects:ike,getClientRects:Q5e,getDimensions:rke,getScale:im,isElement:dc,isRTL:oke};function tG(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ske(e,t){let r=null,n;const o=lu(e);function a(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const u=e.getBoundingClientRect(),{left:d,top:f,width:h,height:p}=u;if(l||t(),!h||!p)return;const y=X1(f),m=X1(o.clientWidth-(d+h)),x=X1(o.clientHeight-(f+p)),b=X1(d),k={rootMargin:-y+"px "+-m+"px "+-x+"px "+-b+"px",threshold:qs(0,Mf(1,c))||1};let S=!0;function _(P){const O=P[0].intersectionRatio;if(O!==c){if(!S)return s();O?s(!1,O):n=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!tG(u,e.getBoundingClientRect())&&s(),S=!1}try{r=new IntersectionObserver(_,{...k,root:o.ownerDocument})}catch{r=new IntersectionObserver(_,k)}r.observe(e)}return s(!0),a}function lke(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=PP(e),d=o||a?[...u?$x(u):[],...t?$x(t):[]]:[];d.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:!0}),a&&b.addEventListener("resize",r)});const f=u&&l?ske(u,r):null;let h=-1,p=null;s&&(p=new ResizeObserver(b=>{let[w]=b;w&&w.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var k;(k=p)==null||k.observe(t)})),r()}),u&&!c&&p.observe(u),t&&p.observe(t));let y,m=c?bh(e):null;c&&x();function x(){const b=bh(e);m&&!tG(m,b)&&r(),m=b,y=requestAnimationFrame(x)}return r(),()=>{var b;d.forEach(w=>{o&&w.removeEventListener("scroll",r),a&&w.removeEventListener("resize",r)}),f==null||f(),(b=p)==null||b.disconnect(),p=null,c&&cancelAnimationFrame(y)}}const cke=z5e,uke=B5e,dke=F5e,fke=q5e,pke=M5e,W7=L5e,hke=W5e,gke=(e,t,r)=>{const n=new Map,o={platform:ake,...r},a={...o.platform,_c:n};return R5e(e,t,{...o,platform:a})};var mke=typeof document<"u",vke=function(){},x0=mke?j.useLayoutEffect:vke;function K2(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!K2(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!K2(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function rG(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function q7(e,t){const r=rG(e);return Math.round(t*r)/r}function D4(e){const t=j.useRef(e);return x0(()=>{t.current=e}),t}function yke(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=j.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=j.useState(n);K2(h,n)||p(n);const[y,m]=j.useState(null),[x,b]=j.useState(null),w=j.useCallback(U=>{U!==P.current&&(P.current=U,m(U))},[]),k=j.useCallback(U=>{U!==O.current&&(O.current=U,b(U))},[]),S=a||y,_=s||x,P=j.useRef(null),O=j.useRef(null),T=j.useRef(d),R=c!=null,I=D4(c),E=D4(o),A=D4(u),F=j.useCallback(()=>{if(!P.current||!O.current)return;const U={placement:t,strategy:r,middleware:h};E.current&&(U.platform=E.current),gke(P.current,O.current,U).then(ee=>{const H={...ee,isPositioned:A.current!==!1};L.current&&!K2(T.current,H)&&(T.current=H,k6.flushSync(()=>{f(H)}))})},[h,t,r,E,A]);x0(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(U=>({...U,isPositioned:!1})))},[u]);const L=j.useRef(!1);x0(()=>(L.current=!0,()=>{L.current=!1}),[]),x0(()=>{if(S&&(P.current=S),_&&(O.current=_),S&&_){if(I.current)return I.current(S,_,F);F()}},[S,_,F,I,R]);const z=j.useMemo(()=>({reference:P,floating:O,setReference:w,setFloating:k}),[w,k]),V=j.useMemo(()=>({reference:S,floating:_}),[S,_]),Q=j.useMemo(()=>{const U={position:r,left:0,top:0};if(!V.floating)return U;const ee=q7(V.floating,d.x),H=q7(V.floating,d.y);return l?{...U,transform:"translate("+ee+"px, "+H+"px)",...rG(V.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:ee,top:H}},[r,l,V.floating,d.x,d.y]);return j.useMemo(()=>({...d,update:F,refs:z,elements:V,floatingStyles:Q}),[d,F,z,V,Q])}const xke=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?W7({element:n.current,padding:o}).fn(r):{}:n?W7({element:n,padding:o}).fn(r):{}}}},bke=(e,t)=>{const r=cke(e);return{name:r.name,fn:r.fn,options:[e,t]}},wke=(e,t)=>{const r=uke(e);return{name:r.name,fn:r.fn,options:[e,t]}},Ske=(e,t)=>({fn:hke(e).fn,options:[e,t]}),jke=(e,t)=>{const r=dke(e);return{name:r.name,fn:r.fn,options:[e,t]}},kke=(e,t)=>{const r=fke(e);return{name:r.name,fn:r.fn,options:[e,t]}},_ke=(e,t)=>{const r=pke(e);return{name:r.name,fn:r.fn,options:[e,t]}},Cke=(e,t)=>{const r=xke(e);return{name:r.name,fn:r.fn,options:[e,t]}};var Eke="Arrow",nG=j.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return i.jsx(ya.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:i.jsx("polygon",{points:"0,0 30,0 15,10"})})});nG.displayName=Eke;var Ake=nG;function iG(e){const[t,r]=j.useState(void 0);return uh(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let s,l;if("borderBoxSize"in a){const c=a.borderBoxSize,u=Array.isArray(c)?c[0]:c;s=u.inlineSize,l=u.blockSize}else s=e.offsetWidth,l=e.offsetHeight;r({width:s,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var OP="Popper",[oG,aG]=Rw(OP),[Tke,sG]=oG(OP),lG=e=>{const{__scopePopper:t,children:r}=e,[n,o]=j.useState(null);return i.jsx(Tke,{scope:t,anchor:n,onAnchorChange:o,children:r})};lG.displayName=OP;var cG="PopperAnchor",uG=j.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=sG(cG,r),s=j.useRef(null),l=Nl(t,s);return j.useEffect(()=>{a.onAnchorChange((n==null?void 0:n.current)||s.current)}),n?null:i.jsx(ya.div,{...o,ref:l})});uG.displayName=cG;var IP="PopperContent",[Pke,Oke]=oG(IP),dG=j.forwardRef((e,t)=>{var G,re,J,ae,le,me;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:y,...m}=e,x=sG(IP,r),[b,w]=j.useState(null),k=Nl(t,Oe=>w(Oe)),[S,_]=j.useState(null),P=iG(S),O=(P==null?void 0:P.width)??0,T=(P==null?void 0:P.height)??0,R=n+(a!=="center"?"-"+a:""),I=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},E=Array.isArray(u)?u:[u],A=E.length>0,F={padding:I,boundary:E.filter(Nke),altBoundary:A},{refs:L,floatingStyles:z,placement:V,isPositioned:Q,middlewareData:U}=yke({strategy:"fixed",placement:R,whileElementsMounted:(...Oe)=>lke(...Oe,{animationFrame:p==="always"}),elements:{reference:x.anchor},middleware:[bke({mainAxis:o+T,alignmentAxis:s}),c&&wke({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Ske():void 0,...F}),c&&jke({...F}),kke({...F,apply:({elements:Oe,rects:we,availableWidth:ie,availableHeight:Me})=>{const{width:ke,height:se}=we.reference,fe=Oe.floating.style;fe.setProperty("--radix-popper-available-width",`${ie}px`),fe.setProperty("--radix-popper-available-height",`${Me}px`),fe.setProperty("--radix-popper-anchor-width",`${ke}px`),fe.setProperty("--radix-popper-anchor-height",`${se}px`)}}),S&&Cke({element:S,padding:l}),Rke({arrowWidth:O,arrowHeight:T}),h&&_ke({strategy:"referenceHidden",...F})]}),[ee,H]=hG(V),B=Lf(y);uh(()=>{Q&&(B==null||B())},[Q,B]);const M=(G=U.arrow)==null?void 0:G.x,$=(re=U.arrow)==null?void 0:re.y,q=((J=U.arrow)==null?void 0:J.centerOffset)!==0,[Y,K]=j.useState();return uh(()=>{b&&K(window.getComputedStyle(b).zIndex)},[b]),i.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:Q?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(ae=U.transformOrigin)==null?void 0:ae.x,(le=U.transformOrigin)==null?void 0:le.y].join(" "),...((me=U.hide)==null?void 0:me.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i.jsx(Pke,{scope:r,placedSide:ee,onArrowChange:_,arrowX:M,arrowY:$,shouldHideArrow:q,children:i.jsx(ya.div,{"data-side":ee,"data-align":H,...m,ref:k,style:{...m.style,animation:Q?void 0:"none"}})})})});dG.displayName=IP;var fG="PopperArrow",Ike={top:"bottom",right:"left",bottom:"top",left:"right"},pG=j.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,a=Oke(fG,n),s=Ike[a.placedSide];return i.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:i.jsx(Ake,{...o,ref:r,style:{...o.style,display:"block"}})})});pG.displayName=fG;function Nke(e){return e!==null}var Rke=e=>({name:"transformOrigin",options:e,fn(t){var x,b,w;const{placement:r,rects:n,middlewareData:o}=t,s=((x=o.arrow)==null?void 0:x.centerOffset)!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[u,d]=hG(r),f={start:"0%",center:"50%",end:"100%"}[d],h=(((b=o.arrow)==null?void 0:b.x)??0)+l/2,p=(((w=o.arrow)==null?void 0:w.y)??0)+c/2;let y="",m="";return u==="bottom"?(y=s?f:`${h}px`,m=`${-c}px`):u==="top"?(y=s?f:`${h}px`,m=`${n.floating.height+c}px`):u==="right"?(y=`${-c}px`,m=s?f:`${p}px`):u==="left"&&(y=`${n.floating.width+c}px`,m=s?f:`${p}px`),{data:{x:y,y:m}}}});function hG(e){const[t,r="center"]=e.split("-");return[t,r]}var Lke=lG,gG=uG,Fke=dG,Mke=pG,NP="Popover",[mG]=Rw(NP,[aG]),_b=aG(),[Dke,Kf]=mG(NP),vG=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:a,modal:s=!1}=e,l=_b(t),c=j.useRef(null),[u,d]=j.useState(!1),[f=!1,h]=W6({prop:n,defaultProp:o,onChange:a});return i.jsx(Lke,{...l,children:i.jsx(Dke,{scope:t,contentId:h0(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:j.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:u,onCustomAnchorAdd:j.useCallback(()=>d(!0),[]),onCustomAnchorRemove:j.useCallback(()=>d(!1),[]),modal:s,children:r})})};vG.displayName=NP;var yG="PopoverAnchor",zke=j.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Kf(yG,r),a=_b(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return j.useEffect(()=>(s(),()=>l()),[s,l]),i.jsx(gG,{...a,...n,ref:t})});zke.displayName=yG;var xG="PopoverTrigger",bG=j.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Kf(xG,r),a=_b(r),s=Nl(t,o.triggerRef),l=i.jsx(ya.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":_G(o.open),...n,ref:s,onClick:ps(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:i.jsx(gG,{asChild:!0,...a,children:l})});bG.displayName=xG;var RP="PopoverPortal",[Bke,Wke]=mG(RP,{forceMount:void 0}),wG=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,a=Kf(RP,t);return i.jsx(Bke,{scope:t,forceMount:r,children:i.jsx(cv,{present:r||a.open,children:i.jsx(U6,{asChild:!0,container:o,children:n})})})};wG.displayName=RP;var Km="PopoverContent",SG=j.forwardRef((e,t)=>{const r=Wke(Km,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,a=Kf(Km,e.__scopePopover);return i.jsx(cv,{present:n||a.open,children:a.modal?i.jsx(qke,{...o,ref:t}):i.jsx($ke,{...o,ref:t})})});SG.displayName=Km;var qke=j.forwardRef((e,t)=>{const r=Kf(Km,e.__scopePopover),n=j.useRef(null),o=Nl(t,n),a=j.useRef(!1);return j.useEffect(()=>{const s=n.current;if(s)return Vq(s)},[]),i.jsx(H6,{as:Lw,allowPinchZoom:!0,children:i.jsx(jG,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ps(e.onCloseAutoFocus,s=>{var l;s.preventDefault(),a.current||(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ps(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;a.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:ps(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),$ke=j.forwardRef((e,t)=>{const r=Kf(Km,e.__scopePopover),n=j.useRef(!1),o=j.useRef(!1);return i.jsx(jG,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var s,l;(s=e.onCloseAutoFocus)==null||s.call(e,a),a.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),a.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:a=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=a.target;((u=r.triggerRef.current)==null?void 0:u.contains(s))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),jG=j.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,h=Kf(Km,r),p=_b(r);return Mq(),i.jsx($6,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:a,children:i.jsx(q6,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:i.jsx(Fke,{"data-state":_G(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),kG="PopoverClose",Uke=j.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Kf(kG,r);return i.jsx(ya.button,{type:"button",...n,ref:t,onClick:ps(e.onClick,()=>o.onOpenChange(!1))})});Uke.displayName=kG;var Hke="PopoverArrow",Vke=j.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=_b(r);return i.jsx(Mke,{...o,...n,ref:t})});Vke.displayName=Hke;function _G(e){return e?"open":"closed"}var Yke=vG,Gke=bG,Kke=wG,Qke=SG;function Xke({...e}){return i.jsx(Yke,{"data-slot":"popover",...e})}function Zke({...e}){return i.jsx(Gke,{"data-slot":"popover-trigger",...e})}function Jke({className:e,align:t="center",sideOffset:r=4,...n}){return i.jsx(Kke,{children:i.jsx(Qke,{"data-slot":"popover-content",align:t,sideOffset:r,className:Xo("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}const $7="eventbuzz_setup_checklist_dismissed",e_e=["organisation","event","session","team","notifications"];function t_e(e){return e?[e.description,e.email,e.phone,e.website,e.address,e.logo,e.timezone,e.dateFormat,e.language].some(r=>r!=null&&String(r).trim()!==""):!1}function r_e(e,t){return e.some(r=>String(r._id)!==String(t))}function n_e(e){return e_e.every(t=>e[t]===!0)}function i_e(e){const t=String(e||"conference").toLowerCase().replace(/[\s_-]+/g,"");return{conference:"Conference",workshop:"Workshop",summit:"Summit",cme:"CME",webinar:"Webinar"}[t]||"Conference"}function o_e(e){const t=String(e||"draft").toLowerCase();return{live:"Live",upcoming:"Upcoming",completed:"Completed",draft:"Draft"}[t]||"Draft"}function Q2(e){return(typeof e=="string"?new Date(e):e).toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"})}function a_e(e,t){var c,u,d;const r=o_e(e.status),n=i_e(e.type),o=(e.locationType||"physical").toLowerCase(),a=o==="virtual"?"Virtual":o==="hybrid"?"Hybrid":"Physical",s=typeof e.startDate=="string"?e.startDate:new Date(e.startDate).toISOString(),l=typeof e.endDate=="string"?e.endDate:new Date(e.endDate).toISOString();return{id:e._id,name:e.name,subtitle:e.subtitle,categoryId:t,type:n,status:r,startDate:s,endDate:l,location:e.location||"",locationType:a,participants:0,sessions:0,totalRevenue:(c=e.metadata)==null?void 0:c.totalRevenue,rating:(u=e.metadata)==null?void 0:u.rating,ratingCount:(d=e.metadata)==null?void 0:d.ratingCount}}function s_e(e){return[{id:"all",name:"All Events",description:"",accent:"var(--chart-1)",events:e.map(n=>a_e(n,"all"))}]}const LP={Live:{bg:"#dcfce7",color:"#15803d",label:"Live"},Upcoming:{bg:"#dbeafe",color:"#1d4ed8",label:"Upcoming"},Completed:{bg:"#f1f5f9",color:"#475569",label:"Completed"},Draft:{bg:"#ffedd5",color:"#c2410c",label:"Draft"}},l_e={Conference:{bg:"#ede9fe",color:"#5b21b6"},Workshop:{bg:"#ffedd5",color:"#c2410c"},Summit:{bg:"#fce7f3",color:"#be185d"},CME:{bg:"#ccfbf1",color:"#0d9488"},Webinar:{bg:"#e0e7ff",color:"#3730a3"}},c_e={bg:"#f1f5f9",color:"#475569"},FP={bg:"#f1f5f9",color:"#475569",label:"Unknown"},MP={Physical:i.jsx(nb,{size:11}),Virtual:i.jsx(ud,{size:11}),Hybrid:i.jsx(B6,{size:11})};function DP({status:e}){const t=LP[e]??FP;return i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"999px",background:t.bg,color:t.color,fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",whiteSpace:"nowrap"},children:[e==="Live"&&i.jsx("span",{style:{width:"5px",height:"5px",borderRadius:"50%",background:"#16a34a",display:"block",animation:"pulse 1.5s infinite"}}),t.label]})}function zP({type:e}){const t=l_e[e]??c_e;return i.jsx("span",{style:{display:"inline-flex",padding:"2px 7px",borderRadius:"3px",background:t.bg,color:t.color,fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",whiteSpace:"nowrap"},children:e})}function CG({name:e,accent:t}){return i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 0px",fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:t,whiteSpace:"nowrap"},children:[i.jsx("span",{style:{width:"5px",height:"5px",borderRadius:"50%",background:t,display:"block",flexShrink:0}}),e]})}function U7({icon:e,value:t,label:r}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[i.jsx("span",{style:{color:"var(--muted)",display:"flex"},children:e}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",fontWeight:"var(--font-weight-medium)"},children:t}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:r})]})}function u_e({items:e}){const[t,r]=j.useState(!1),n=j.useRef(null);return j.useEffect(()=>{const o=a=>{n.current&&!n.current.contains(a.target)&&r(!1)};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[]),i.jsxs("div",{ref:n,style:{position:"relative"},children:[i.jsx("button",{onClick:o=>{o.stopPropagation(),r(a=>!a)},style:{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",background:"transparent",border:"1px solid transparent",borderRadius:"var(--radius-button)",cursor:"pointer",color:"var(--muted)"},onMouseEnter:o=>{o.currentTarget.style.background="var(--secondary)",o.currentTarget.style.borderColor="var(--border)"},onMouseLeave:o=>{t||(o.currentTarget.style.background="transparent",o.currentTarget.style.borderColor="transparent")},children:i.jsx(Tee,{size:14})}),t&&i.jsx("div",{style:{position:"absolute",right:0,top:"calc(100% + 4px)",background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",boxShadow:"var(--shadow-md)",zIndex:50,minWidth:"160px",overflow:"hidden"},children:e.map((o,a)=>i.jsxs("button",{onClick:()=>{o.onClick(),r(!1)},style:{width:"100%",display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:"none",border:"none",cursor:"pointer",textAlign:"left",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:o.danger?"var(--destructive)":"var(--card-foreground)",borderBottom:a<e.length-1?"1px solid var(--border)":"none"},onMouseEnter:s=>{s.currentTarget.style.background=o.danger?"#fef2f2":"var(--secondary)"},onMouseLeave:s=>{s.currentTarget.style.background="none"},children:[o.icon," ",o.label]},a))})]})}function EG(e){return e>=1e5?`₹${(e/1e5).toFixed(2)}L`:e>=1e3?`₹${(e/1e3).toFixed(1)}K`:`₹${e}`}function d_e({rating:e,count:t}){const r=Math.floor(e),n=e%1>=.4;return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[i.jsxs("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:["Rating (",t,")"]}),i.jsx("div",{style:{display:"flex",gap:"1px"},children:[1,2,3,4,5].map(o=>i.jsx(Rf,{size:11,style:{color:o<=r||o===r+1&&n?"#f59e0b":"var(--border)",fill:o<=r||o===r+1&&n?"#f59e0b":"none"}},o))}),i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)",fontWeight:"var(--font-weight-medium)"},children:e.toFixed(1)})]})}function f_e({event:e,accent:t,categoryName:r,onOpen:n}){const[o,a]=j.useState(!1),[s,l]=j.useState("attendance");LP[e.status];const c=(e.status==="Live"||e.status==="Completed")&&e.registeredAttendees!==void 0;return i.jsxs("div",{onClick:n,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{background:"var(--card)",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"1px",borderTopColor:o?t:"var(--border)",borderRightColor:o?t:"var(--border)",borderBottomColor:o?t:"var(--border)",borderLeftColor:o?t:"var(--border)",borderRadius:"var(--radius-card)",display:"flex",flexDirection:"column",overflow:"hidden",transition:"box-shadow 0.15s, border-color 0.15s, transform 0.15s",boxShadow:o?"var(--elevation-sm)":"none",transform:o?"translateY(-2px)":"translateY(0)",position:"relative",cursor:"pointer"},children:[i.jsxs("div",{style:{padding:"16px 16px 12px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"8px",marginBottom:"10px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexWrap:"wrap"},children:[i.jsx(DP,{status:e.status}),i.jsx(zP,{type:e.type}),i.jsx(CG,{name:r,accent:t})]}),c&&i.jsx("div",{style:{display:"flex",alignItems:"center",flexShrink:0,background:"var(--secondary)",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"1px",borderTopColor:"var(--border)",borderRightColor:"var(--border)",borderBottomColor:"var(--border)",borderLeftColor:"var(--border)",borderRadius:"999px",padding:"2px"},children:["attendance","sales"].map(u=>i.jsx("button",{onClick:d=>{d.stopPropagation(),l(u)},style:{padding:"2px 8px",borderRadius:"999px",border:"none",cursor:"pointer",background:s===u?"var(--primary)":"transparent",color:s===u?"var(--primary-foreground)":"var(--muted)",fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:s===u?"var(--font-weight-medium)":"var(--font-weight-normal)",transition:"background 0.15s, color 0.15s"},children:u==="attendance"?"Attendance":"Sales"},u))})]}),i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.35",marginBottom:"4px"},children:e.name}),e.subtitle&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",lineHeight:"1.4",marginBottom:"8px"},children:e.subtitle}),i.jsxs("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap",marginBottom:c?"12px":"0"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[i.jsx(Wi,{size:11,style:{color:"var(--muted)",flexShrink:0}}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:[Q2(e.startDate),e.endDate!==e.startDate?` – ${Q2(e.endDate)}`:""]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[i.jsx("span",{style:{color:"var(--muted)",display:"flex",flexShrink:0},children:MP[e.locationType]}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:e.location})]})]}),c&&i.jsxs("div",{style:{borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"1px",borderTopColor:"var(--border)",borderRightColor:"var(--border)",borderBottomColor:"var(--border)",borderLeftColor:"var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:[s==="attendance"?i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 10px",background:"var(--secondary)",borderBottomStyle:"solid",borderBottomWidth:"1px",borderBottomColor:"var(--border)"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Registered Attendees"}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:e.registeredAttendees})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr"},children:[i.jsxs("div",{style:{padding:"8px 6px",textAlign:"center",borderRightStyle:"solid",borderRightWidth:"1px",borderRightColor:"var(--border)",background:"var(--success-bg)"},children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--success-fg)",lineHeight:"1.2",fontSize:"var(--text-base)"},children:e.attended}),i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--success-fg-label)",marginTop:"2px"},children:"Attended"})]}),i.jsxs("div",{style:{padding:"8px 6px",textAlign:"center",borderRightStyle:"solid",borderRightWidth:"1px",borderRightColor:"var(--border)"},children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)",lineHeight:"1.2",fontSize:"var(--text-base)"},children:e.notAttended}),i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"2px"},children:"Absent"})]}),i.jsxs("div",{style:{padding:"8px 6px",textAlign:"center"},children:[i.jsxs("p",{style:{fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",lineHeight:"1.2",fontSize:"var(--text-base)",color:e.attendancePct!==void 0?e.attendancePct>=75?"#15803d":e.attendancePct>=50?"#d97706":"var(--destructive)":"var(--card-foreground)"},children:[e.attendancePct,"%"]}),i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"2px"},children:"% Rate"})]})]})]}):i.jsx(i.Fragment,{children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 10px",background:e.totalRevenue&&e.totalRevenue>0?"rgba(11, 77, 209, 0.04)":"var(--secondary)"},children:[i.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"var(--radius-button)",background:e.totalRevenue&&e.totalRevenue>0?"rgba(11, 77, 209, 0.1)":"var(--border)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:i.jsx(D6,{size:13,style:{color:e.totalRevenue&&e.totalRevenue>0?"var(--primary)":"var(--muted)"}})}),i.jsxs("div",{children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:e.totalRevenue&&e.totalRevenue>0?"var(--primary)":"var(--muted)",lineHeight:"1.1",fontSize:"var(--text-base)"},children:e.totalRevenue&&e.totalRevenue>0?EG(e.totalRevenue):"Free event"}),i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"2px"},children:e.totalRevenue&&e.totalRevenue>0?"Total Revenue Earned":"No paid tickets"})]})]})}),e.rating!==void 0&&e.ratingCount!==void 0&&i.jsx("div",{style:{padding:"6px 10px",borderTopStyle:"solid",borderTopWidth:"1px",borderTopColor:"var(--border)",background:"var(--secondary)",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx(d_e,{rating:e.rating,count:e.ratingCount})})]})]}),i.jsxs("div",{style:{padding:"10px 16px",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"var(--border)",background:"var(--secondary)",display:"flex",alignItems:"center",gap:"12px",marginTop:"auto"},children:[i.jsx(U7,{icon:i.jsx(vi,{size:11}),value:e.participants>0?e.participants:"—",label:e.participants===1?"participant":"participants"}),i.jsx(U7,{icon:i.jsx(Wi,{size:11}),value:e.sessions>0?e.sessions:"—",label:"sessions"})]})]})}function p_e({event:e,categoryName:t,accent:r,onOpen:n}){const[o,a]=j.useState(!1),[s,l]=j.useState(!1),c=(e.status==="Live"||e.status==="Completed")&&e.registeredAttendees!==void 0;LP[e.status];const u=o?"var(--secondary)":e.isCurrent?"var(--accent)":"transparent";return i.jsxs(i.Fragment,{children:[i.jsxs("tr",{onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),style:{background:u,transition:"background 0.12s",borderBottomStyle:"solid",borderBottomWidth:"1px",borderBottomColor:s?"transparent":"var(--border)"},children:[i.jsx("td",{style:{padding:"11px 8px 11px 12px",width:"32px"},children:c?i.jsx("button",{onClick:()=>l(d=>!d),title:s?"Collapse attendance & sales details":"Expand attendance & sales details","aria-expanded":s,"aria-label":s?"Collapse details":"Expand details",style:{width:"22px",height:"22px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",cursor:"pointer",background:s?"var(--primary)":"var(--secondary)",borderStyle:"solid",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"1px",borderTopColor:s?"var(--primary)":"var(--border)",borderRightColor:s?"var(--primary)":"var(--border)",borderBottomColor:s?"var(--primary)":"var(--border)",borderLeftColor:s?"var(--primary)":"var(--border)",color:s?"var(--primary-foreground)":"var(--muted)",transition:"background 0.15s, color 0.15s, border-top-color 0.15s, border-right-color 0.15s, border-bottom-color 0.15s, border-left-color 0.15s",flexShrink:0},children:s?i.jsx($f,{size:12}):i.jsx(po,{size:12})}):i.jsx("span",{style:{width:"22px",height:"22px",display:"block"}})}),i.jsx("td",{style:{padding:"11px 16px 11px 4px"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[e.isCurrent&&i.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:"var(--primary)",display:"block",flexShrink:0}}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.3"},children:e.name}),e.subtitle&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"1px"},children:e.subtitle})]})]})}),i.jsx("td",{style:{padding:"11px 12px",whiteSpace:"nowrap"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"},children:[i.jsx(zP,{type:e.type}),i.jsx(CG,{name:t,accent:r})]})}),i.jsx("td",{style:{padding:"11px 12px",whiteSpace:"nowrap"},children:i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:[Q2(e.startDate),e.endDate!==e.startDate?` – ${Q2(e.endDate)}`:""]})}),i.jsx("td",{style:{padding:"11px 12px"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx("span",{style:{color:"var(--muted)",display:"flex"},children:MP[e.locationType]}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:e.location})]})}),i.jsx("td",{style:{padding:"11px 12px",whiteSpace:"nowrap"},children:i.jsx(DP,{status:e.status})}),i.jsx("td",{style:{padding:"11px 12px",textAlign:"right"},children:i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:e.participants>0?e.participants.toLocaleString():"—"})}),i.jsx("td",{style:{padding:"11px 12px",textAlign:"right"},children:i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:e.sessions>0?e.sessions:"—"})}),i.jsx("td",{style:{padding:"11px 16px 11px 8px",whiteSpace:"nowrap"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",opacity:o?1:0,transition:"opacity 0.15s"},children:[i.jsxs("button",{onClick:n,style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"var(--radius-button)",background:"var(--card)",border:"1px solid var(--border)",color:"var(--card-foreground)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},onMouseEnter:d=>{d.currentTarget.style.borderColor="var(--primary)",d.currentTarget.style.color="var(--primary)"},onMouseLeave:d=>{d.currentTarget.style.borderColor="var(--border)",d.currentTarget.style.color="var(--card-foreground)"},children:[i.jsx(av,{size:11})," Open"]}),i.jsx(u_e,{items:[{label:"Duplicate",icon:i.jsx(iu,{size:13}),onClick:()=>{}},{label:"Edit",icon:i.jsx(Ii,{size:13}),onClick:()=>{}},{label:"Delete",icon:i.jsx(gn,{size:13}),danger:!0,onClick:()=>{window.confirm("Delete this event? This cannot be undone.")}}]})]})})]}),c&&s&&i.jsx("tr",{style:{borderBottomStyle:"solid",borderBottomWidth:"1px",borderBottomColor:"var(--border)",background:"var(--card)"},children:i.jsx("td",{colSpan:9,style:{padding:"0 16px 14px 48px",background:"var(--accent)"},children:(()=>{const d=e.attendancePct??0,f=d>=75?"#15803d":d>=50?"#d97706":"var(--destructive)",h=e.totalRevenue!==void 0&&e.totalRevenue>0,p=e.rating!==void 0&&e.ratingCount!==void 0;return i.jsxs("div",{style:{display:"flex",alignItems:"center",background:"var(--secondary)",borderTopWidth:"1px",borderTopStyle:"solid",borderTopColor:"var(--border)",borderRadius:"var(--radius-button)",overflow:"hidden"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 12px",flexShrink:0},children:[i.jsx(vi,{size:11,style:{color:"var(--muted)",flexShrink:0}}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",whiteSpace:"nowrap"},children:[i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:e.registeredAttendees})," ","reg."]})]}),i.jsx("div",{style:{width:"1px",height:"28px",background:"var(--border)",flexShrink:0}}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"7px 12px",flex:"1 1 0",minWidth:0},children:[i.jsx("div",{style:{flex:"1 1 60px",minWidth:"40px",maxWidth:"100px",height:"5px",borderRadius:"999px",background:"var(--border)",overflow:"hidden",flexShrink:0},children:i.jsx("div",{style:{height:"100%",borderRadius:"999px",width:`${d}%`,background:f,transition:"width 0.4s ease"}})}),i.jsxs("span",{style:{fontSize:"10px",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:f,whiteSpace:"nowrap",flexShrink:0},children:[d,"%"]}),i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"#15803d",whiteSpace:"nowrap",flexShrink:0},children:[i.jsx("span",{style:{width:"5px",height:"5px",borderRadius:"50%",background:"#16a34a",display:"inline-block",flexShrink:0}}),i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)"},children:e.attended})," ","attended"]}),i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",whiteSpace:"nowrap",flexShrink:0},children:[i.jsx("span",{style:{width:"5px",height:"5px",borderRadius:"50%",background:"var(--muted-foreground)",display:"inline-block",flexShrink:0}}),i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)"},children:e.notAttended})," ","absent"]})]}),h&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{width:"1px",height:"28px",background:"var(--border)",flexShrink:0}}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 12px",flexShrink:0},children:[i.jsx(D6,{size:11,style:{color:"var(--primary)",flexShrink:0}}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",whiteSpace:"nowrap"},children:[i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--primary)"},children:EG(e.totalRevenue)})," ","revenue"]})]})]}),p&&i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{width:"1px",height:"28px",background:"var(--border)",flexShrink:0}}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",padding:"7px 12px",flexShrink:0},children:[i.jsx(Rf,{size:11,style:{color:"#f59e0b",fill:"#f59e0b",flexShrink:0}}),i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",whiteSpace:"nowrap"},children:e.rating.toFixed(1)}),i.jsxs("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",whiteSpace:"nowrap"},children:["(",e.ratingCount,")"]})]})]})]})})()})})]})}function h_e({categories:e}){const t=qi(),r=t==="mobile",n=t==="tablet",o=e.flatMap(x=>x.events),a=o.length,s=o.filter(x=>x.status==="Live").length,l=o.filter(x=>x.status==="Upcoming").length,c=o.filter(x=>x.status==="Completed").length,u=o.reduce((x,b)=>x+b.participants,0),d=[{label:"Total Events",value:a,icon:i.jsx(lh,{size:14}),accent:"var(--chart-1)",sub:`${e.length} categor${e.length===1?"y":"ies"}`},{label:"Live Now",value:s,icon:i.jsx(Eq,{size:14}),accent:"#16a34a",sub:"Active right now",pulse:!0},{label:"Upcoming",value:l,icon:i.jsx(ob,{size:14}),accent:"var(--chart-3)",sub:"Scheduled events"},{label:"Completed",value:c,icon:i.jsx(iv,{size:14}),accent:"var(--muted)",sub:"Past events"},{label:"Total Participants",value:u.toLocaleString(),icon:i.jsx(vi,{size:14}),accent:"var(--chart-2)",sub:"Across all events"},{label:"Total Revenue",value:"₹14.2L",icon:i.jsx(D6,{size:14}),accent:"var(--chart-5)",sub:"Till date"}],f=r?"repeat(2, 1fr)":n?"repeat(3, 1fr)":"repeat(6, 1fr)",h=r?"10px 12px":"14px 16px",p=r?28:32,y=r?13:14,m=r?"8px":"12px";return i.jsx("div",{style:{display:"grid",gridTemplateColumns:f,gap:r?"8px":"12px"},children:d.map(x=>i.jsxs("div",{style:{background:"var(--card)",borderStyle:"solid",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"3px",borderTopColor:"var(--border)",borderRightColor:"var(--border)",borderBottomColor:"var(--border)",borderLeftColor:x.accent,borderRadius:"var(--radius-card)",padding:h,display:"flex",flexDirection:r?"column":"row",alignItems:r?"flex-start":"center",gap:m},children:[i.jsxs("div",{style:{width:`${p}px`,height:`${p}px`,borderRadius:"var(--radius-button)",background:x.accent+"15",display:"flex",alignItems:"center",justifyContent:"center",color:x.accent,flexShrink:0,position:"relative"},children:[ze.cloneElement(x.icon,{size:y}),x.pulse&&i.jsx("span",{style:{position:"absolute",top:"3px",right:"3px",width:"6px",height:"6px",borderRadius:"50%",background:"#16a34a",border:"2px solid var(--card)"}})]}),i.jsxs("div",{style:{minWidth:0},children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:r?"var(--text-xl)":"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.value}),i.jsx("p",{style:{fontSize:r?"10px":"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:x.label}),!r&&i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:x.pulse?"#16a34a":"var(--muted)",marginTop:"3px"},children:x.sub})]})]},x.label))})}function g_e({categories:e,onOpenEvent:t}){const r=new Date,[n,o]=j.useState(new Date(r.getFullYear(),r.getMonth(),1)),[a,s]=j.useState(null);function l(w){return`${w.getFullYear()}-${String(w.getMonth()+1).padStart(2,"0")}-${String(w.getDate()).padStart(2,"0")}`}const c=l(r),u=j.useMemo(()=>{const w=new Map;return e.forEach(k=>{k.events.forEach(S=>{const _=new Date(S.startDate),P=new Date(S.endDate),O=new Date(_);let T=0;for(;O<=P&&T<60;){const R=l(O);w.has(R)||w.set(R,[]),w.get(R).push({event:S,category:k}),O.setDate(O.getDate()+1),T++}})}),w},[e]),d=n.getFullYear(),f=n.getMonth(),h=new Date(d,f,1).getDay(),p=new Date(d,f+1,0).getDate(),y=[...Array(h).fill(null),...Array.from({length:p},(w,k)=>k+1)];for(;y.length%7!==0;)y.push(null);const m=["January","February","March","April","May","June","July","August","September","October","November","December"],x=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],b=a?e.find(w=>w.id===a.categoryId):null;return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid var(--border)",background:"var(--secondary)"},children:[i.jsx("button",{onClick:()=>o(new Date(d,f-1,1)),style:{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--card)",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"1px",borderTopColor:"var(--border)",borderRightColor:"var(--border)",borderBottomColor:"var(--border)",borderLeftColor:"var(--border)",borderStyle:"solid",borderRadius:"var(--radius-button)",cursor:"pointer",color:"var(--muted)"},children:i.jsx(Nf,{size:13})}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[i.jsxs("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:[m[f]," ",d]}),i.jsx("button",{onClick:()=>o(new Date(r.getFullYear(),r.getMonth(),1)),style:{padding:"3px 10px",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"1px",borderTopColor:"var(--border)",borderRightColor:"var(--border)",borderBottomColor:"var(--border)",borderLeftColor:"var(--border)",borderStyle:"solid",borderRadius:"var(--radius-button)",background:"var(--card)",color:"var(--muted)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:"Today"})]}),i.jsx("button",{onClick:()=>o(new Date(d,f+1,1)),style:{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--card)",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"1px",borderTopColor:"var(--border)",borderRightColor:"var(--border)",borderBottomColor:"var(--border)",borderLeftColor:"var(--border)",borderStyle:"solid",borderRadius:"var(--radius-button)",cursor:"pointer",color:"var(--muted)"},children:i.jsx(va,{size:13})})]}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",borderBottom:"1px solid var(--border)"},children:x.map(w=>i.jsx("div",{style:{padding:"7px 0",textAlign:"center",fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",letterSpacing:"0.04em",textTransform:"uppercase"},children:w},w))}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"},children:y.map((w,k)=>{const S=k%7,_=k>=y.length-7;if(w===null)return i.jsx("div",{style:{minHeight:"90px",background:"var(--secondary)",borderRightWidth:S<6?"1px":"0",borderRightStyle:"solid",borderRightColor:"var(--border)",borderBottomWidth:_?"0":"1px",borderBottomStyle:"solid",borderBottomColor:"var(--border)"}},`pad-${k}`);const P=l(new Date(d,f,w)),O=u.get(P)||[],T=P===c,R=S===0||S===6;return i.jsxs("div",{style:{minHeight:"90px",padding:"5px",background:R?"var(--secondary)":"var(--card)",borderRightWidth:S<6?"1px":"0",borderRightStyle:"solid",borderRightColor:"var(--border)",borderBottomWidth:_?"0":"1px",borderBottomStyle:"solid",borderBottomColor:"var(--border)"},children:[i.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:"3px"},children:i.jsx("span",{style:{width:"22px",height:"22px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",background:T?"var(--primary)":"transparent",color:T?"var(--primary-foreground)":R?"var(--muted)":"var(--foreground)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:T?"var(--font-weight-medium)":"var(--font-weight-normal)"},children:w})}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[O.slice(0,3).map(({event:I,category:E})=>i.jsx("button",{title:I.name,onClick:()=>s(A=>(A==null?void 0:A.id)===I.id?null:I),style:{display:"block",width:"100%",textAlign:"left",padding:"2px 5px",borderRadius:"3px",background:(a==null?void 0:a.id)===I.id?E.accent+"30":E.accent+"18",borderLeftWidth:"2px",borderLeftStyle:"solid",borderLeftColor:E.accent,borderTopWidth:"0",borderRightWidth:"0",borderBottomWidth:"0",outlineWidth:(a==null?void 0:a.id)===I.id?"1px":"0",outlineStyle:"solid",outlineColor:E.accent,cursor:"pointer",fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:I.name},I.id)),O.length>3&&i.jsxs("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",paddingLeft:"4px"},children:["+",O.length-3," more"]})]})]},P)})})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"16px",flexWrap:"wrap",padding:"0 2px"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",fontWeight:"var(--font-weight-medium)"},children:"Categories:"}),e.map(w=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx("span",{style:{width:"10px",height:"10px",borderRadius:"2px",background:w.accent,flexShrink:0}}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:w.name})]},w.id))]}),a&&b&&i.jsxs("div",{style:{background:"var(--card)",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"4px",borderStyle:"solid",borderTopColor:"var(--border)",borderRightColor:"var(--border)",borderBottomColor:"var(--border)",borderLeftColor:b.accent,borderRadius:"var(--radius-card)",padding:"16px 20px",display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"16px"},children:[i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px",flexWrap:"wrap"},children:[i.jsx(DP,{status:a.status}),i.jsx(zP,{type:a.type}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:b.name})]}),i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"4px"},children:a.name}),a.subtitle&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"10px"},children:a.subtitle}),i.jsxs("div",{style:{display:"flex",gap:"16px",flexWrap:"wrap"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(Wi,{size:11,style:{color:"var(--muted)"}}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:[a.startDate,a.endDate!==a.startDate?` – ${a.endDate}`:""]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx("span",{style:{color:"var(--muted)",display:"flex"},children:MP[a.locationType]}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:a.location})]}),a.participants>0&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[i.jsx(vi,{size:11,style:{color:"var(--muted)"}}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:[a.participants.toLocaleString()," participants"]})]})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:[i.jsxs("button",{onClick:()=>t(a),style:{display:"flex",alignItems:"center",gap:"4px",padding:"6px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:["Open ",i.jsx(O6,{size:11})]}),i.jsx("button",{onClick:()=>s(null),style:{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--secondary)",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"1px",borderTopColor:"var(--border)",borderRightColor:"var(--border)",borderBottomColor:"var(--border)",borderLeftColor:"var(--border)",borderStyle:"solid",borderRadius:"var(--radius-button)",cursor:"pointer",color:"var(--muted)"},children:i.jsx(er,{size:13})})]})]})]})}function m_e({msg:e,onDone:t}){return j.useEffect(()=>{const r=setTimeout(t,3e3);return()=>clearTimeout(r)},[]),i.jsxs("div",{style:{position:"fixed",bottom:"24px",left:"50%",transform:"translateX(-50%)",background:"var(--foreground)",color:"var(--background)",padding:"10px 20px",borderRadius:"var(--radius-button)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",boxShadow:"var(--shadow-xl)",zIndex:200,display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx(av,{size:13})," ",e]})}function v_e({onNavigateToEvent:e}){const{user:t}=Ur(),r=zn(t),{setActiveNav:n,setSelectedEventId:o,setSettingsInitialSection:a,setOpenAgendaSessionPanelOnce:s}=eo(),{theme:l}=lq(),[c,u]=j.useState("card"),[d,f]=j.useState(""),[h,p]=j.useState("All"),[y,m]=j.useState("All"),[x,b]=j.useState("All"),[w,k]=j.useState(!1),[S,_]=j.useState(null),[P,O]=j.useState(void 0),[T,R]=j.useState(!1),[I,E]=j.useState(!1),[A,F]=j.useState([]),[L,z]=j.useState(!0),[V,Q]=j.useState(null),[U,ee]=j.useState(()=>{try{return localStorage.getItem($7)==="1"}catch{return!1}}),[H,B]=j.useState(null),[M,$]=j.useState([]),[q,Y]=j.useState(!1),[K,G]=j.useState(0),re=j.useMemo(()=>s_e(A),[A]),J=(t==null?void 0:t.role)==="super_admin"||(t==null?void 0:t.role)==="admin",ae=j.useMemo(()=>({organisation:t_e(H),event:A.length>=1,session:K>=1,team:J?q?!1:r_e(M,(t==null?void 0:t._id)??""):!1,notifications:!!(t!=null&&t.notificationPreferencesSavedAt)}),[H,A.length,K,J,q,M,t==null?void 0:t._id,t==null?void 0:t.notificationPreferencesSavedAt]);j.useEffect(()=>{var Ie;if(!r||L||V)return;let se=!1;const fe=(Ie=A[0])==null?void 0:Ie._id;return(async()=>{var Ge,Ot,nt;const ce=ls.get().catch(()=>null),je=J?nx.list():Promise.resolve(null),qe=fe?Da.list(fe):Promise.resolve(null),[Ne,Je,vt]=await Promise.all([ce,je,qe]);se||(B(Ne),J&&Je?Je.error?($([]),Y(!0)):($(((Ge=Je.data)==null?void 0:Ge.users)??[]),Y(!1)):($([]),Y(!1)),G(fe&&vt?vt.error?0:((nt=(Ot=vt.data)==null?void 0:Ot.sessions)==null?void 0:nt.length)??0:0))})(),()=>{se=!0}},[r,L,V,J,A]);const le=j.useCallback(()=>{if(z(!0),Q(null),!r){F([]),Q((t==null?void 0:t.role)==="super_admin"?"Assign an organisation to your account to load events for that tenant.":"Your profile has no organisation."),z(!1);return}zr.list({organization:r}).then(se=>{var fe;((fe=se.data)==null?void 0:fe.events)!=null?F(se.data.events):Q(se.error||"Failed to load events")}).catch(()=>Q("Failed to load events")).finally(()=>z(!1))},[r,t==null?void 0:t.role]);j.useEffect(()=>{le()},[le]);const me=j.useMemo(()=>re.flatMap(se=>se.events.map(fe=>({ev:fe,cat:se}))),[re]),Oe=j.useMemo(()=>me.filter(({ev:se,cat:fe})=>{const Ie=d.toLowerCase(),ce=!Ie||se.name.toLowerCase().includes(Ie)||se.location.toLowerCase().includes(Ie)||(se.subtitle||"").toLowerCase().includes(Ie)||fe.name.toLowerCase().includes(Ie),je=h==="All"||se.status===h,qe=y==="All"||se.type===y,Ne=x==="All"||fe.id===x;return ce&&je&&qe&&Ne}),[me,d,h,y,x]),we=Oe.length,ie=h!=="All"||y!=="All"||x!=="All"||!!d,Me=!L&&A.length>0,ke=se=>{e?e(se.id):_(se.isCurrent?`You are already viewing ${se.name}`:`Switching to ${se.name}…`)};return j.useCallback(()=>{try{localStorage.setItem($7,"1")}catch{}ee(!0)},[]),j.useCallback(se=>{var fe;if(se==="organisation"){a("org"),n("settings");return}if(se==="event"){E(!0);return}if(se==="session"){const Ie=(fe=A[0])==null?void 0:fe._id;Ie?(o(Ie),s(!0),n("dashboard")):E(!0);return}if(se==="team"){n("user-management");return}se==="notifications"&&(a("notifications"),n("settings"))},[A,n,o,a,s]),r&&!L&&!V&&!U&&n_e(ae),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:"EventBuzz · Organisation"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.2",marginBottom:"4px"},children:"All Events"}),i.jsxs("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[L?"Loading…":V||`${re.length} categor${re.length===1?"y":"ies"} · ${re.flatMap(se=>se.events).length} events`,(P==null?void 0:P.from)&&i.jsx("span",{style:{marginLeft:"8px",color:"var(--primary)",fontWeight:"var(--font-weight-medium)"},children:"· filtered by date range"})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[i.jsxs(Xke,{open:T,onOpenChange:R,children:[i.jsx(Zke,{asChild:!0,children:i.jsxs("button",{style:{display:"flex",alignItems:"center",gap:"7px",padding:"7px 12px",borderRadius:"var(--radius-button)",background:P!=null&&P.from?"var(--accent)":"var(--secondary)",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"1px",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopColor:P!=null&&P.from?"var(--primary)":"var(--border)",borderRightColor:P!=null&&P.from?"var(--primary)":"var(--border)",borderBottomColor:P!=null&&P.from?"var(--primary)":"var(--border)",borderLeftColor:P!=null&&P.from?"var(--primary)":"var(--border)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-normal)",color:P!=null&&P.from?"var(--primary)":"var(--muted)",transition:"border-top-color 0.15s, border-right-color 0.15s, border-bottom-color 0.15s, border-left-color 0.15s, background 0.15s",whiteSpace:"nowrap"},onMouseEnter:se=>{P!=null&&P.from||(se.currentTarget.style.borderTopColor="var(--ring)",se.currentTarget.style.borderRightColor="var(--ring)",se.currentTarget.style.borderBottomColor="var(--ring)",se.currentTarget.style.borderLeftColor="var(--ring)",se.currentTarget.style.color="var(--foreground)")},onMouseLeave:se=>{P!=null&&P.from||(se.currentTarget.style.borderTopColor="var(--border)",se.currentTarget.style.borderRightColor="var(--border)",se.currentTarget.style.borderBottomColor="var(--border)",se.currentTarget.style.borderLeftColor="var(--border)",se.currentTarget.style.color="var(--muted)")},children:[i.jsx(Wi,{size:13,style:{flexShrink:0}}),P!=null&&P.from?i.jsxs("span",{children:[P.from.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}),P.to&&P.to.getTime()!==P.from.getTime()?` – ${P.to.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"})}`:""]}):i.jsx("span",{children:"Select date range"}),P!=null&&P.from?i.jsx("span",{onClick:se=>{se.stopPropagation(),O(void 0)},style:{display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"2px",cursor:"pointer",color:"var(--muted)"},onMouseEnter:se=>{se.currentTarget.style.color="var(--destructive)"},onMouseLeave:se=>{se.currentTarget.style.color="var(--muted)"},children:i.jsx(er,{size:11})}):i.jsx(po,{size:11,style:{flexShrink:0}})]})}),i.jsxs(Jke,{align:"end",sideOffset:6,style:{padding:0,background:"var(--card)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",borderRadius:"var(--radius-card)",boxShadow:"var(--elevation-sm)",overflow:"hidden",width:"auto"},children:[i.jsx("div",{style:{display:"flex",gap:"6px",flexWrap:"wrap",padding:"10px 12px 8px",borderBottom:"1px solid var(--border)"},children:[{label:"Last 30 days",days:30},{label:"Last 90 days",days:90},{label:"This year",days:365}].map(se=>{var je,qe;const fe=new Date,Ie=new Date;Ie.setDate(Ie.getDate()-se.days);const ce=((je=P==null?void 0:P.from)==null?void 0:je.toDateString())===Ie.toDateString()&&((qe=P==null?void 0:P.to)==null?void 0:qe.toDateString())===fe.toDateString();return i.jsx("button",{onClick:()=>{O({from:Ie,to:fe}),R(!1)},style:{padding:"3px 10px",borderRadius:"999px",background:ce?"var(--primary)":"var(--secondary)",borderWidth:"1px",borderStyle:"solid",borderColor:ce?"var(--primary)":"var(--border)",color:ce?"var(--primary-foreground)":"var(--card-foreground)",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-normal)",transition:"all 0.12s"},onMouseEnter:Ne=>{ce||(Ne.currentTarget.style.borderColor="var(--primary)",Ne.currentTarget.style.color="var(--primary)")},onMouseLeave:Ne=>{ce||(Ne.currentTarget.style.borderColor="var(--border)",Ne.currentTarget.style.color="var(--card-foreground)")},children:se.label},se.label)})}),i.jsx(S5e,{mode:"range",selected:P,onSelect:O,numberOfMonths:2,defaultMonth:(()=>{const se=new Date;return se.setMonth(se.getMonth()-1),se})(),style:{padding:"8px 12px 12px",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-xs)"}}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"8px",padding:"8px 12px 10px",borderTop:"1px solid var(--border)"},children:[i.jsx("button",{onClick:()=>{O(void 0),R(!1)},style:{padding:"5px 14px",borderRadius:"var(--radius-button)",background:"transparent",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",color:"var(--card-foreground)",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},onMouseEnter:se=>{se.currentTarget.style.borderColor="var(--ring)"},onMouseLeave:se=>{se.currentTarget.style.borderColor="var(--border)"},children:"Clear"}),i.jsx("button",{onClick:()=>R(!1),style:{padding:"5px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--primary)",color:"var(--primary-foreground)",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:"Apply"})]})]})]}),i.jsxs("button",{onClick:()=>E(!0),style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:14})," Create Event"]})]})]}),L&&i.jsx(fh,{message:"Loading events…"}),!L&&V&&i.jsxs("div",{style:{padding:"32px 24px",textAlign:"center",borderRadius:"var(--radius-card)",border:"1px solid var(--border)",background:"var(--card)"},children:[i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",color:"var(--destructive)",marginBottom:"12px"},children:V}),i.jsx("button",{type:"button",onClick:()=>le(),style:{padding:"8px 18px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:"Retry"})]}),!L&&!V&&!Me&&i.jsxs("div",{style:{textAlign:"center",padding:"48px 24px",border:"2px dashed var(--border)",borderRadius:"var(--radius-card)",background:"var(--secondary)"},children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"8px"},children:"No events yet"}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--muted)",marginBottom:"16px",maxWidth:"360px",marginLeft:"auto",marginRight:"auto"},children:"Create an event to see it listed here with stats, filters, and calendar view."}),i.jsxs("button",{type:"button",onClick:()=>E(!0),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 18px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:16})," Create your first event"]})]}),!L&&!V&&Me&&i.jsxs(ze.Fragment,{children:[i.jsx(h_e,{categories:re}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",fontWeight:"var(--font-weight-medium)",textTransform:"uppercase",letterSpacing:"0.06em",whiteSpace:"nowrap"},children:"Events"}),i.jsx("div",{style:{flex:1,height:"1px",background:"var(--border)"}})]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"7px",padding:"0 10px",height:"34px",flex:"1 1 180px",background:"var(--card)",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"1px",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopColor:w?"var(--ring)":"var(--border)",borderRightColor:w?"var(--ring)":"var(--border)",borderBottomColor:w?"var(--ring)":"var(--border)",borderLeftColor:w?"var(--ring)":"var(--border)",borderRadius:"var(--radius-button)",transition:"border-top-color 0.15s, border-right-color 0.15s, border-bottom-color 0.15s, border-left-color 0.15s"},children:[i.jsx(Pi,{size:13,style:{color:"var(--muted)",flexShrink:0}}),i.jsx("input",{value:d,onChange:se=>f(se.target.value),placeholder:"Search events…",onFocus:()=>k(!0),onBlur:()=>k(!1),style:{background:"transparent",border:"none",outline:"none",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",width:"100%"}}),d&&i.jsx("button",{onClick:()=>f(""),style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",padding:0,display:"flex"},children:i.jsx(er,{size:12})})]}),i.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",flexShrink:0},children:[i.jsxs("select",{value:h,onChange:se=>p(se.target.value),style:{height:"34px",paddingLeft:"10px",paddingRight:"28px",appearance:"none",WebkitAppearance:"none",background:h!=="All"?"var(--accent)":"var(--card)",borderWidth:"1px",borderStyle:"solid",borderColor:h!=="All"?"var(--primary)":"var(--border)",borderRadius:"var(--radius-button)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:h!=="All"?"var(--primary)":"var(--card-foreground)",cursor:"pointer",outline:"none",minWidth:"100px"},children:[i.jsx("option",{value:"All",children:"Status"}),["Live","Upcoming","Completed","Draft"].map(se=>i.jsx("option",{value:se,children:se},se))]}),i.jsx(po,{size:12,style:{position:"absolute",right:"8px",pointerEvents:"none",color:h!=="All"?"var(--primary)":"var(--muted)"}})]}),i.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",flexShrink:0},children:[i.jsxs("select",{value:y,onChange:se=>m(se.target.value),style:{height:"34px",paddingLeft:"10px",paddingRight:"28px",appearance:"none",WebkitAppearance:"none",background:y!=="All"?"var(--accent)":"var(--card)",borderWidth:"1px",borderStyle:"solid",borderColor:y!=="All"?"var(--primary)":"var(--border)",borderRadius:"var(--radius-button)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:y!=="All"?"var(--primary)":"var(--card-foreground)",cursor:"pointer",outline:"none",minWidth:"110px"},children:[i.jsx("option",{value:"All",children:"Type"}),["Conference","Workshop","Summit","CME","Webinar"].map(se=>i.jsx("option",{value:se,children:se},se))]}),i.jsx(po,{size:12,style:{position:"absolute",right:"8px",pointerEvents:"none",color:y!=="All"?"var(--primary)":"var(--muted)"}})]}),(()=>{const se=x!=="All"?re.find(fe=>fe.id===x):null;return i.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",flexShrink:0},children:[se&&i.jsx("span",{style:{position:"absolute",left:"10px",width:"7px",height:"7px",borderRadius:"50%",background:se.accent,flexShrink:0,zIndex:1,pointerEvents:"none"}}),i.jsxs("select",{value:x,onChange:fe=>b(fe.target.value),style:{height:"34px",paddingLeft:se?"24px":"10px",paddingRight:"28px",appearance:"none",WebkitAppearance:"none",background:se?se.accent+"18":"var(--card)",borderWidth:"1px",borderStyle:"solid",borderColor:se?se.accent:"var(--border)",borderRadius:"var(--radius-button)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:se?se.accent:"var(--card-foreground)",cursor:"pointer",outline:"none",minWidth:"120px"},children:[i.jsx("option",{value:"All",children:"Category"}),re.map(fe=>i.jsx("option",{value:fe.id,children:fe.name},fe.id))]}),i.jsx(po,{size:12,style:{position:"absolute",right:"8px",pointerEvents:"none",color:se?se.accent:"var(--muted)"}})]})})(),ie&&i.jsxs("button",{onClick:()=>{f(""),p("All"),m("All"),b("All")},style:{display:"flex",alignItems:"center",gap:"4px",padding:"0 10px",height:"34px",borderRadius:"var(--radius-button)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",background:"var(--card)",color:"var(--muted)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"pointer",flexShrink:0},children:[i.jsx(er,{size:11})," Clear"]}),i.jsx("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"6px"},children:i.jsx("div",{style:{display:"flex",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",borderRadius:"var(--radius-button)",overflow:"hidden",background:"var(--card)"},children:["card","list","calendar"].map(se=>i.jsxs("button",{onClick:()=>u(se),style:{display:"flex",alignItems:"center",gap:"4px",padding:"5px 10px",background:c===se?"var(--primary)":"transparent",color:c===se?"#fff":"var(--muted)",border:"none",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",borderLeft:se!=="card"?"1px solid var(--border)":"none"},children:[se==="card"?i.jsx(ab,{size:13}):se==="list"?i.jsx(sb,{size:13}):i.jsx(Wi,{size:13}),se==="card"?"Cards":se==="list"?"List":"Calendar"]},se))})})]})}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:["Showing ",i.jsx("strong",{style:{color:"var(--foreground)",fontFamily:"var(--font-inter)"},children:we})," event",we!==1?"s":"",ie&&i.jsx("span",{style:{color:"var(--primary)",marginLeft:"6px"},children:"· filtered"})]}),c==="calendar"?i.jsx(g_e,{categories:re,onOpenEvent:ke}):Oe.length===0?i.jsxs("div",{style:{textAlign:"center",padding:"60px 20px",border:"2px dashed var(--border)",borderRadius:"var(--radius-card)"},children:[i.jsx(Pi,{size:28,style:{color:"var(--border)",margin:"0 auto 12px"}}),i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"6px"},children:"No events match your filters"}),i.jsxs("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--muted)",marginBottom:"16px"},children:[d?`No results for "${d}". `:"","Try adjusting your status, type, or category filters."]}),i.jsxs("button",{onClick:()=>{f(""),p("All"),m("All"),b("All")},style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"6px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(er,{size:12})," Clear all filters"]})]}):c==="card"?i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(288px, 1fr))",gap:"14px"},children:Oe.map(({ev:se,cat:fe})=>i.jsx(f_e,{event:se,accent:fe.accent,categoryName:fe.name,onOpen:()=>ke(se)},se.id))}):i.jsx("div",{style:{background:"var(--card)",borderStyle:"solid",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"1px",borderTopColor:"var(--border)",borderRightColor:"var(--border)",borderBottomColor:"var(--border)",borderLeftColor:"var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[i.jsx("thead",{children:i.jsx("tr",{style:{background:"var(--secondary)",borderBottomStyle:"solid",borderBottomWidth:"1px",borderBottomColor:"var(--border)"},children:["","Event","Type / Category","Dates","Location","Status","Participants","Sessions",""].map((se,fe)=>i.jsx("th",{style:{padding:fe===0?"8px 8px 8px 12px":"8px 12px",textAlign:se==="Participants"||se==="Sessions"?"right":"left",fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",letterSpacing:"0.04em",textTransform:"uppercase",whiteSpace:"nowrap"},children:se},fe))})}),i.jsx("tbody",{children:Oe.map(({ev:se,cat:fe})=>i.jsx(p_e,{event:se,categoryName:fe.name,accent:fe.accent,onOpen:()=>ke(se)},se.id))})]})})}),i.jsx("div",{style:{paddingTop:"16px",borderTop:"1px solid var(--border)",textAlign:"center"},children:i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"© 2026 Stratawiz Technologies Pvt Ltd · EventBuzz"})})]}),S&&i.jsx(m_e,{msg:S,onDone:()=>_(null)}),I&&i.jsx(CY,{organizationId:r,onClose:()=>{E(!1),le()},onCreated:se=>{e==null||e(se)}})]})}function y_e(e){return e==="quiz"?"Quiz":e==="poll"?"Poll":"Q&A Session"}function x_e(e){const t=(e||"draft").toLowerCase();return t==="live"?"Active":t==="upcoming"?"Scheduled":t==="completed"?"Completed":"Draft"}function b_e(e){if(!e)return"—";try{return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}catch{return"—"}}const Op={width:"100%",boxSizing:"border-box",padding:"10px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",color:"var(--foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"};async function H7(e,t,r,n,o){var y,m,x;const a=$0(n),s=$0(o);if(!a||!s)return{ok:!1,error:"Invalid start or end date/time."};const l=new Date(a);let c=new Date(s);c<=l&&(c=new Date(l.getTime()+3600*1e3));const u=await zr.create({name:t.trim(),type:"webinar",recordKind:"activity",activitySubtype:r,status:"draft",startDate:l.toISOString(),endDate:c.toISOString(),locationType:"virtual",organization:e});if(u.error||!((y=u.data)!=null&&y._id))return{ok:!1,error:u.error||"Could not create activity."};const d=u.data._id,p=(x=(((m=(await Da.list(d)).data)==null?void 0:m.sessions)??[])[0])==null?void 0:x._id;return p?{ok:!0,eventId:d,sessionId:p}:{ok:!1,error:"Activity created but no session was found."}}function w_e(e){var r,n;const t=e.activityStats;return{id:e._id,name:e.name,type:y_e(e.activitySubtype),status:x_e(e.status),createdDate:b_e(e.createdAt),subtitle:(r=e.description)!=null&&r.trim()?e.description.trim().slice(0,120):((n=e.subtitle)==null?void 0:n.trim())||void 0,participants:(t==null?void 0:t.participantCount)??0,questions:(t==null?void 0:t.questionCount)??0,responses:(t==null?void 0:t.responseCount)??0,subtype:e.activitySubtype||"qna",raw:e}}const AG={"Q&A Session":{bg:"#E8EFFC",fg:"#0B4DD1",icon:i.jsx(Zs,{size:14})},Quiz:{bg:"#FEF3C7",fg:"#D97706",icon:i.jsx(ib,{size:14})},Poll:{bg:"#ECFDF5",fg:"#059669",icon:i.jsx(N6,{size:14})}},TG={Active:{bg:"#dcfce7",color:"#15803d"},Scheduled:{bg:"#dbeafe",color:"#1d4ed8"},Completed:{bg:"#f1f5f9",color:"#475569"},Draft:{bg:"#ffedd5",color:"#c2410c"}};function S_e(e,t){var r,n;return{question:e.text,imageUrl:(r=e.imageUrl)!=null&&r.trim()?e.imageUrl.trim():null,type:e.type==="Single Choice"||e.type==="True / False"?"single":e.type==="Multiple Choice"?"multiple":"text",options:(n=e.options)==null?void 0:n.map(o=>{var a;return{text:o.text,isCorrect:o.isCorrect,imageUrl:(a=o.imageUrl)!=null&&a.trim()?o.imageUrl.trim():null}}),required:!0,...t==="quiz"?{points:1}:{}}}function V7({title:e,subtitle:t,onClose:r,children:n,footer:o}){return i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:r,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:200},role:"presentation"}),i.jsxs("div",{style:{position:"fixed",top:0,right:0,height:"100%",width:"min(720px, 100vw)",background:"var(--card)",zIndex:201,display:"flex",flexDirection:"column",boxShadow:"-4px 0 32px rgba(0,0,0,0.18)",animation:"activityPanelIn 0.25s ease"},children:[i.jsx("style",{children:"@keyframes activityPanelIn { from { transform: translateX(100%); } to { transform: translateX(0); } }"}),i.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)",flexShrink:0,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("h2",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:e}),t?i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"6px 0 0",lineHeight:1.45},children:t}):null]}),i.jsx("button",{type:"button",onClick:r,style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",padding:4},children:i.jsx(er,{size:20})})]}),i.jsx("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:n}),o?i.jsx("div",{style:{padding:"14px 20px",borderTop:"1px solid var(--border)",flexShrink:0},children:o}):null]})]})}function j_e({onNavigateToActivity:e}){const{user:t}=Ur(),r=zn(t),[n,o]=j.useState("card"),[a,s]=j.useState(""),[l,c]=j.useState("all"),[u,d]=j.useState("all"),[f,h]=j.useState(!1),[p,y]=j.useState([]),[m,x]=j.useState(!0),[b,w]=j.useState(null),[k,S]=j.useState(!1),[_,P]=j.useState(!1),[O,T]=j.useState("shell"),[R,I]=j.useState("poll"),[E,A]=j.useState(""),[F,L]=j.useState(""),[z,V]=j.useState(""),[Q,U]=j.useState(!1),[ee,H]=j.useState(null),[B,M]=j.useState(null),[$,q]=j.useState(null),[Y,K]=j.useState(!1),[G,re]=j.useState(null),[J,ae]=j.useState(null),le=qi(),me=le==="mobile",Oe=le==="mobile"?"1fr":"repeat(4, minmax(0, 1fr))",we=j.useCallback(async()=>{var Je;if(!r){y([]),x(!1);return}x(!0),w(null);const Ne=await zr.list({organization:r,recordKind:"activity",enrich:!0,limit:200});if(x(!1),Ne.error||!((Je=Ne.data)!=null&&Je.events)){w(Ne.error||"Could not load activities."),y([]);return}y(Ne.data.events.map(w_e))},[r]);j.useEffect(()=>{we()},[we]);const ie=()=>{const{start:Ne,end:Je}=WI();A(""),L(Ne),V(Je),re(null),S(!0)},Me=()=>{const{start:Ne,end:Je}=WI();A(""),L(Ne),V(Je),I("poll"),H(null),T("shell"),M(null),q(null),P(!0)},ke=()=>{P(!1),T("shell"),M(null),q(null),H(null),ae(null)},se=j.useMemo(()=>{if(O!=="form")return;const Ne=nT();return Ne.title=E.trim(),Ne.status="Draft",Ne.displayMode="always_sched",Ne.scheduledStart=F,Ne.scheduledEnd=z,{form:Ne,questions:[]}},[O,E,F,z]),fe=()=>{(async()=>{if(!r)return;re(null);const Ne=E.trim();if(Ne.length<3){re("Name must be at least 3 characters.");return}K(!0);const Je=await H7(r,Ne,"qna",F,z);if(K(!1),!Je.ok){re(Je.error);return}S(!1),we(),e==null||e(Je.eventId)})()},Ie=()=>{(async()=>{if(!r)return;H(null);const Ne=E.trim();if(Ne.length<3){H("Name must be at least 3 characters.");return}U(!0);const Je=await H7(r,Ne,R,F,z);if(U(!1),!Je.ok){H(Je.error);return}M(Je.eventId),q(Je.sessionId),ae(null),T("form")})()},ce=Ne=>{(async()=>{if(!B||!$)return;const Je=R;ae(null);const vt={session:$,title:Ne.form.title,type:Je,description:Ne.form.description||void 0,questions:Ne.questions.map(Ot=>S_e(Ot,Je)),settings:iT(Ne.form,Je)},Ge=await Oa.create(B,vt);if(Ge.error){ae(Ge.error);return}ke(),we(),e==null||e(B)})()},je=j.useMemo(()=>p.filter(Ne=>{var Ot;const Je=a===""||Ne.name.toLowerCase().includes(a.toLowerCase())||(((Ot=Ne.subtitle)==null?void 0:Ot.toLowerCase().includes(a.toLowerCase()))??!1),vt=l==="all"||Ne.type===l,Ge=u==="all"||Ne.status===u;return Je&&vt&&Ge}),[p,a,l,u]),qe=j.useMemo(()=>{const Ne=p;return{count:Ne.length,active:Ne.filter(Je=>Je.status==="Active").length,participants:Ne.reduce((Je,vt)=>Je+vt.participants,0),responses:Ne.reduce((Je,vt)=>Je+vt.responses,0)}},[p]);return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"24px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"},children:[i.jsxs("div",{children:[i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:me?"var(--text-xl)":"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"0 0 6px"},children:"Activities"}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:"Manage Q&A sessions, quizzes, and polls (standalone activity events)"})]}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"},children:[i.jsxs("button",{type:"button",onClick:()=>r&&ie(),disabled:!r,style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 16px",borderRadius:"var(--radius-button)",background:r?"var(--primary)":"var(--muted)",color:"var(--primary-foreground)",border:"none",cursor:r?"pointer":"not-allowed",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",opacity:r?1:.7},children:[i.jsx(Zs,{size:14})," Create Q&A Session"]}),i.jsxs("button",{type:"button",onClick:()=>r&&Me(),disabled:!r,style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 16px",borderRadius:"var(--radius-button)",background:r?"var(--card)":"var(--muted)",color:r?"var(--foreground)":"var(--muted-foreground)",border:"1px solid var(--border)",cursor:r?"pointer":"not-allowed",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(N6,{size:14})," Create Quiz/Poll"]})]})]}),!r&&i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:"Set up an organization in your portfolio to view and create activities."}),b&&i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--destructive)",margin:0},children:b}),m&&r?i.jsx(fh,{message:"Loading activities…"}):null,!m&&r?i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"grid",gridTemplateColumns:me?"1fr 1fr":"repeat(4, 1fr)",gap:"12px"},children:[i.jsx(Z1,{label:"Total Activities",value:String(qe.count)}),i.jsx(Z1,{label:"Active",value:String(qe.active),color:"#15803d"}),i.jsx(Z1,{label:"Total Participants",value:String(qe.participants)}),i.jsx(Z1,{label:"Total Responses",value:String(qe.responses)})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"7px",padding:"0 10px",height:"34px",flex:me?"1 1 100%":"1 1 180px",background:"var(--card)",borderTopWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderLeftWidth:"1px",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopColor:f?"var(--ring)":"var(--border)",borderRightColor:f?"var(--ring)":"var(--border)",borderBottomColor:f?"var(--ring)":"var(--border)",borderLeftColor:f?"var(--ring)":"var(--border)",borderRadius:"var(--radius-button)",transition:"border-top-color 0.15s, border-right-color 0.15s, border-bottom-color 0.15s, border-left-color 0.15s"},children:[i.jsx(Pi,{size:13,style:{color:"var(--muted)",flexShrink:0}}),i.jsx("input",{value:a,onChange:Ne=>s(Ne.target.value),placeholder:"Search activities…",onFocus:()=>h(!0),onBlur:()=>h(!1),style:{background:"transparent",border:"none",outline:"none",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",width:"100%"}}),a?i.jsx("button",{type:"button",onClick:()=>s(""),style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",padding:0,display:"flex"},children:i.jsx(er,{size:12})}):null]}),i.jsxs("select",{value:l,onChange:Ne=>c(Ne.target.value),style:{padding:"0 32px 0 10px",height:"34px",borderRadius:"var(--radius-button)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",background:"var(--card)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",cursor:"pointer",outline:"none"},children:[i.jsx("option",{value:"all",children:"All Types"}),i.jsx("option",{value:"Q&A Session",children:"Q&A Session"}),i.jsx("option",{value:"Quiz",children:"Quiz"}),i.jsx("option",{value:"Poll",children:"Poll"})]}),i.jsxs("select",{value:u,onChange:Ne=>d(Ne.target.value),style:{padding:"0 32px 0 10px",height:"34px",borderRadius:"var(--radius-button)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",background:"var(--card)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",cursor:"pointer",outline:"none"},children:[i.jsx("option",{value:"all",children:"All Status"}),i.jsx("option",{value:"Active",children:"Active"}),i.jsx("option",{value:"Scheduled",children:"Scheduled"}),i.jsx("option",{value:"Completed",children:"Completed"}),i.jsx("option",{value:"Draft",children:"Draft"})]}),i.jsx("div",{style:{flex:1}}),i.jsx("div",{style:{display:"flex",gap:"4px",borderRadius:"var(--radius-button)",background:"var(--secondary)",padding:"3px"},children:[{mode:"card",icon:i.jsx(ab,{size:14}),label:"Cards"},{mode:"list",icon:i.jsx(sb,{size:14}),label:"List"},{mode:"calendar",icon:i.jsx(Wi,{size:14}),label:"Calendar"}].map(Ne=>i.jsx("button",{type:"button",onClick:()=>o(Ne.mode),title:Ne.label,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"28px",borderRadius:"var(--radius-button)",background:n===Ne.mode?"var(--card)":"transparent",color:n===Ne.mode?"var(--primary)":"var(--muted)",border:"none",cursor:"pointer",transition:"all 0.15s"},children:Ne.icon},Ne.mode))})]}),i.jsxs("div",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:["Showing ",je.length," ",je.length===1?"activity":"activities"]}),n==="card"&&i.jsx("div",{style:{display:"grid",gridTemplateColumns:Oe,gap:"16px"},children:je.map(Ne=>i.jsx(k_e,{activity:Ne,onClick:()=>e==null?void 0:e(Ne.id)},Ne.id))}),n==="list"&&i.jsx("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",overflow:"hidden"},children:je.map((Ne,Je)=>i.jsx(__e,{activity:Ne,isLast:Je===je.length-1,onClick:()=>e==null?void 0:e(Ne.id)},Ne.id))}),n==="calendar"&&i.jsxs("div",{style:{padding:"60px 20px",textAlign:"center",background:"var(--card)",borderRadius:"var(--radius-card)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)"},children:[i.jsx(Wi,{size:32,style:{color:"var(--muted)",margin:"0 auto 16px",display:"block"}}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Calendar view coming soon"})]}),je.length===0&&!m?i.jsxs("div",{style:{padding:"60px 20px",textAlign:"center",background:"var(--card)",borderRadius:"var(--radius-card)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)"},children:[i.jsx(Pi,{size:32,style:{color:"var(--muted)",margin:"0 auto 16px",display:"block"}}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:p.length===0?"No activities yet. Create one to get started.":"No activities match your filters."})]}):null]}):null,k&&r?i.jsx(V7,{title:"Create Q&A Session",subtitle:"Name is used for the event and the session. Track: Default.",onClose:()=>{S(!1),re(null)},footer:i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[i.jsx("button",{type:"button",onClick:()=>{S(!1),re(null)},disabled:Y,style:{padding:"8px 16px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:Y?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"Cancel"}),i.jsx("button",{type:"button",onClick:fe,disabled:Y,style:{padding:"8px 16px",borderRadius:"var(--radius-button)",border:"none",background:Y?"var(--muted)":"var(--primary)",color:"var(--primary-foreground)",cursor:Y?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:Y?"Creating…":"Create"})]}),children:i.jsxs("div",{style:{padding:"20px",overflowY:"auto"},children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"6px"},children:"Name of activity"}),i.jsx("input",{value:E,onChange:Ne=>A(Ne.target.value),disabled:Y,placeholder:"e.g. Keynote Q&A",style:{...Op,marginBottom:"16px"}}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:me?"1fr":"1fr 1fr",gap:"16px"},children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"6px"},children:"Start"}),i.jsx(jf,{value:F,onChange:L,style:Op,disabled:Y})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"6px"},children:"End"}),i.jsx(jf,{value:z,onChange:V,style:Op,disabled:Y})]})]}),G?i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--destructive)",marginTop:"14px",marginBottom:0},children:G}):null]})}):null,_&&r?i.jsx(V7,{title:O==="shell"?"Create Quiz / Poll":R==="quiz"?"New quiz":"New poll",subtitle:O==="shell"?"Step 1: name and schedule (event & session; track: Default). Step 2: same form as Quiz & Polls in the event dashboard.":void 0,onClose:ke,footer:O==="shell"?i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px"},children:[i.jsx("button",{type:"button",onClick:ke,disabled:Q,style:{padding:"8px 16px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:Q?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"Cancel"}),i.jsx("button",{type:"button",onClick:Ie,disabled:Q,style:{padding:"8px 16px",borderRadius:"var(--radius-button)",border:"none",background:Q?"var(--muted)":"var(--primary)",color:"var(--primary-foreground)",cursor:Q?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:Q?"Creating…":"Continue to form"})]}):void 0,children:O==="shell"?i.jsxs("div",{style:{padding:"20px",overflowY:"auto"},children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"6px"},children:"Name of activity"}),i.jsx("input",{value:E,onChange:Ne=>A(Ne.target.value),disabled:Q,placeholder:"e.g. Audience pulse check",style:{...Op,marginBottom:"16px"}}),i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"6px"},children:"Type"}),i.jsxs("select",{value:R,onChange:Ne=>I(Ne.target.value),disabled:Q,style:{...Op,marginBottom:"16px",cursor:Q?"not-allowed":"pointer"},children:[i.jsx("option",{value:"poll",children:"Poll"}),i.jsx("option",{value:"quiz",children:"Quiz"})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:me?"1fr":"1fr 1fr",gap:"16px"},children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"6px"},children:"Start"}),i.jsx(jf,{value:F,onChange:L,style:Op,disabled:Q})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"6px"},children:"End"}),i.jsx(jf,{value:z,onChange:V,style:Op,disabled:Q})]})]}),ee?i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--destructive)",marginTop:"14px",marginBottom:0},children:ee}):null]}):B&&se?i.jsxs("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:[J?i.jsx("div",{style:{padding:"10px 20px",borderBottom:"1px solid var(--border)",background:"var(--secondary)",color:"var(--destructive)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:J}):null,i.jsx(ax,{variant:"panel",kind:R,eventId:B,initial:se,onClose:ke,onSave:ce},`${B}-${R}`)]}):null}):null]})}function Z1({label:e,value:t,color:r}){return i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",padding:"16px 20px"},children:[i.jsx("div",{style:{fontSize:"var(--text-2xl)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:r||"var(--foreground)",marginBottom:"4px"},children:t}),i.jsx("div",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.5px"},children:e})]})}function k_e({activity:e,onClick:t}){const r=AG[e.type],n=TG[e.status];return i.jsxs("div",{role:"button",tabIndex:0,onClick:t,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t())},style:{background:"var(--card)",borderRadius:"var(--radius-card)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",padding:"20px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s"},onMouseEnter:o=>{o.currentTarget.style.borderColor="var(--primary)",o.currentTarget.style.boxShadow="0 4px 12px rgba(11,77,209,0.1)"},onMouseLeave:o=>{o.currentTarget.style.borderColor="var(--border)",o.currentTarget.style.boxShadow="none"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",marginBottom:"12px"},children:[i.jsx("h3",{style:{fontSize:"var(--text-base)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0,flex:1},children:e.name}),i.jsx("span",{style:{padding:"3px 10px",borderRadius:"999px",background:n.bg,color:n.color,fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",flexShrink:0,textTransform:"uppercase",letterSpacing:"0.3px"},children:e.status})]}),i.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 10px",borderRadius:"var(--radius-button)",background:r.bg,marginBottom:"16px"},children:[r.icon,i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:r.fg},children:e.type})]}),e.subtitle?i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"0 0 16px",lineHeight:1.4},children:e.subtitle}):null,i.jsxs("div",{style:{display:"flex",gap:"16px",paddingTop:"12px",borderTop:"1px solid var(--border)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[i.jsx(vi,{size:14,style:{color:"var(--muted)"}}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:e.participants})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[i.jsx(ib,{size:14,style:{color:"var(--muted)"}}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:e.questions})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[i.jsx(iv,{size:14,style:{color:"var(--muted)"}}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:e.responses})]})]})]})}function __e({activity:e,isLast:t,onClick:r}){const n=AG[e.type],o=TG[e.status];return i.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),r())},style:{display:"flex",alignItems:"center",gap:"16px",padding:"16px 20px",borderBottom:t?"none":"1px solid var(--border)",cursor:"pointer",transition:"background 0.15s"},onMouseEnter:a=>{a.currentTarget.style.background="var(--secondary)"},onMouseLeave:a=>{a.currentTarget.style.background="transparent"},children:[i.jsx("div",{style:{width:"36px",height:"36px",borderRadius:"var(--radius-button)",background:n.bg,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:n.fg},children:n.icon}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("h4",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"0 0 3px"},children:e.name}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:e.createdDate})]}),i.jsx("div",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",minWidth:"100px"},children:e.type}),i.jsx("div",{style:{display:"flex",gap:"12px",minWidth:"120px"},children:i.jsxs("div",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:[e.participants," participants"]})}),i.jsx("span",{style:{padding:"3px 10px",borderRadius:"999px",background:o.bg,color:o.color,fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",flexShrink:0,textTransform:"uppercase"},children:e.status})]})}const C_e=()=>{};var Y7={};/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const PG={NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"};/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const Wt=function(e,t){if(!e)throw _v(t)},_v=function(e){return new Error("Firebase Database ("+PG.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)};/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const OG=function(e){const t=[];let r=0;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);o<128?t[r++]=o:o<2048?(t[r++]=o>>6|192,t[r++]=o&63|128):(o&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(o=65536+((o&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=o&63|128):(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=o&63|128)}return t},E_e=function(e){const t=[];let r=0,n=0;for(;r<e.length;){const o=e[r++];if(o<128)t[n++]=String.fromCharCode(o);else if(o>191&&o<224){const a=e[r++];t[n++]=String.fromCharCode((o&31)<<6|a&63)}else if(o>239&&o<365){const a=e[r++],s=e[r++],l=e[r++],c=((o&7)<<18|(a&63)<<12|(s&63)<<6|l&63)-65536;t[n++]=String.fromCharCode(55296+(c>>10)),t[n++]=String.fromCharCode(56320+(c&1023))}else{const a=e[r++],s=e[r++];t[n++]=String.fromCharCode((o&15)<<12|(a&63)<<6|s&63)}}return t.join("")},BP={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const r=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[];for(let o=0;o<e.length;o+=3){const a=e[o],s=o+1<e.length,l=s?e[o+1]:0,c=o+2<e.length,u=c?e[o+2]:0,d=a>>2,f=(a&3)<<4|l>>4;let h=(l&15)<<2|u>>6,p=u&63;c||(p=64,s||(h=64)),n.push(r[d],r[f],r[h],r[p])}return n.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(OG(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):E_e(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const r=t?this.charToByteMapWebSafe_:this.charToByteMap_,n=[];for(let o=0;o<e.length;){const a=r[e.charAt(o++)],l=o<e.length?r[e.charAt(o)]:0;++o;const u=o<e.length?r[e.charAt(o)]:64;++o;const f=o<e.length?r[e.charAt(o)]:64;if(++o,a==null||l==null||u==null||f==null)throw new A_e;const h=a<<2|l>>4;if(n.push(h),u!==64){const p=l<<4&240|u>>2;if(n.push(p),f!==64){const y=u<<6&192|f;n.push(y)}}}return n},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class A_e extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const IG=function(e){const t=OG(e);return BP.encodeByteArray(t,!0)},X2=function(e){return IG(e).replace(/\./g,"")},MA=function(e){try{return BP.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function T_e(e){return NG(void 0,e)}function NG(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:const r=t;return new Date(r.getTime());case Object:e===void 0&&(e={});break;case Array:e=[];break;default:return t}for(const r in t)!t.hasOwnProperty(r)||!P_e(r)||(e[r]=NG(e[r],t[r]));return e}function P_e(e){return e!=="__proto__"}/**
|
||
* @license
|
||
* Copyright 2022 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function O_e(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
|
||
* @license
|
||
* Copyright 2022 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const I_e=()=>O_e().__FIREBASE_DEFAULTS__,N_e=()=>{if(typeof process>"u"||typeof Y7>"u")return;const e=Y7.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},R_e=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&MA(e[1]);return t&&JSON.parse(t)},RG=()=>{try{return C_e()||I_e()||N_e()||R_e()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},L_e=e=>{var t,r;return(r=(t=RG())===null||t===void 0?void 0:t.emulatorHosts)===null||r===void 0?void 0:r[e]},F_e=e=>{const t=L_e(e);if(!t)return;const r=t.lastIndexOf(":");if(r<=0||r+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const n=parseInt(t.substring(r+1),10);return t[0]==="["?[t.substring(1,r-1),n]:[t.substring(0,r),n]},LG=()=>{var e;return(e=RG())===null||e===void 0?void 0:e.config};/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class WP{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,r)=>{this.resolve=t,this.reject=r})}wrapCallback(t){return(r,n)=>{r?this.reject(r):this.resolve(n),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(r):t(r,n))}}}/**
|
||
* @license
|
||
* Copyright 2025 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function qP(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function M_e(e){return(await fetch(e,{credentials:"include"})).ok}/**
|
||
* @license
|
||
* Copyright 2021 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function D_e(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const r={alg:"none",type:"JWT"},n=t||"demo-project",o=e.iat||0,a=e.sub||e.user_id;if(!a)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const s=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:o,exp:o+3600,auth_time:o,sub:a,user_id:a,firebase:{sign_in_provider:"custom",identities:{}}},e);return[X2(JSON.stringify(r)),X2(JSON.stringify(s)),""].join(".")}const Yy={};function z_e(){const e={prod:[],emulator:[]};for(const t of Object.keys(Yy))Yy[t]?e.emulator.push(t):e.prod.push(t);return e}function B_e(e){let t=document.getElementById(e),r=!1;return t||(t=document.createElement("div"),t.setAttribute("id",e),r=!0),{created:r,element:t}}let G7=!1;function W_e(e,t){if(typeof window>"u"||typeof document>"u"||!qP(window.location.host)||Yy[e]===t||Yy[e]||G7)return;Yy[e]=t;function r(h){return`__firebase__banner__${h}`}const n="__firebase__banner",a=z_e().prod.length>0;function s(){const h=document.getElementById(n);h&&h.remove()}function l(h){h.style.display="flex",h.style.background="#7faaf0",h.style.position="fixed",h.style.bottom="5px",h.style.left="5px",h.style.padding=".5em",h.style.borderRadius="5px",h.style.alignItems="center"}function c(h,p){h.setAttribute("width","24"),h.setAttribute("id",p),h.setAttribute("height","24"),h.setAttribute("viewBox","0 0 24 24"),h.setAttribute("fill","none"),h.style.marginLeft="-6px"}function u(){const h=document.createElement("span");return h.style.cursor="pointer",h.style.marginLeft="16px",h.style.fontSize="24px",h.innerHTML=" ×",h.onclick=()=>{G7=!0,s()},h}function d(h,p){h.setAttribute("id",p),h.innerText="Learn more",h.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",h.setAttribute("target","__blank"),h.style.paddingLeft="5px",h.style.textDecoration="underline"}function f(){const h=B_e(n),p=r("text"),y=document.getElementById(p)||document.createElement("span"),m=r("learnmore"),x=document.getElementById(m)||document.createElement("a"),b=r("preprendIcon"),w=document.getElementById(b)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(h.created){const k=h.element;l(k),d(x,m);const S=u();c(w,b),k.append(w,y,x,S),document.body.appendChild(k)}a?(y.innerText="Preview backend disconnected.",w.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
|
||
<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
|
||
</g>
|
||
<defs>
|
||
<clipPath id="clip0_6013_33858">
|
||
<rect width="24" height="24" fill="white"/>
|
||
</clipPath>
|
||
</defs>`):(w.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
|
||
<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
|
||
</g>
|
||
<defs>
|
||
<clipPath id="clip0_6083_34804">
|
||
<rect width="24" height="24" fill="white"/>
|
||
</clipPath>
|
||
</defs>`,y.innerText="Preview backend running in this workspace."),y.setAttribute("id",p)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",f):f()}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function q_e(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function FG(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(q_e())}function $_e(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function U_e(){return PG.NODE_ADMIN===!0}function H_e(){try{return typeof indexedDB=="object"}catch{return!1}}function V_e(){return new Promise((e,t)=>{try{let r=!0;const n="validate-browser-context-for-indexeddb-analytics-module",o=self.indexedDB.open(n);o.onsuccess=()=>{o.result.close(),r||self.indexedDB.deleteDatabase(n),e(!0)},o.onupgradeneeded=()=>{r=!1},o.onerror=()=>{var a;t(((a=o.error)===null||a===void 0?void 0:a.message)||"")}}catch(r){t(r)}})}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const Y_e="FirebaseError";class Cb extends Error{constructor(t,r,n){super(r),this.code=t,this.customData=n,this.name=Y_e,Object.setPrototypeOf(this,Cb.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,MG.prototype.create)}}class MG{constructor(t,r,n){this.service=t,this.serviceName=r,this.errors=n}create(t,...r){const n=r[0]||{},o=`${this.service}/${t}`,a=this.errors[t],s=a?G_e(a,n):"Error",l=`${this.serviceName}: ${s} (${o}).`;return new Cb(o,l,n)}}function G_e(e,t){return e.replace(K_e,(r,n)=>{const o=t[n];return o!=null?String(o):`<${n}?>`})}const K_e=/\{\$([^}]+)}/g;/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function Ux(e){return JSON.parse(e)}function Mo(e){return JSON.stringify(e)}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const DG=function(e){let t={},r={},n={},o="";try{const a=e.split(".");t=Ux(MA(a[0])||""),r=Ux(MA(a[1])||""),o=a[2],n=r.d||{},delete r.d}catch{}return{header:t,claims:r,data:n,signature:o}},Q_e=function(e){const t=DG(e),r=t.claims;return!!r&&typeof r=="object"&&r.hasOwnProperty("iat")},X_e=function(e){const t=DG(e).claims;return typeof t=="object"&&t.admin===!0};/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function Cd(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Qm(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]}function K7(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function Z2(e,t,r){const n={};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=t.call(r,e[o],o,e));return n}function J2(e,t){if(e===t)return!0;const r=Object.keys(e),n=Object.keys(t);for(const o of r){if(!n.includes(o))return!1;const a=e[o],s=t[o];if(Q7(a)&&Q7(s)){if(!J2(a,s))return!1}else if(a!==s)return!1}for(const o of n)if(!r.includes(o))return!1;return!0}function Q7(e){return e!==null&&typeof e=="object"}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function Z_e(e){const t=[];for(const[r,n]of Object.entries(e))Array.isArray(n)?n.forEach(o=>{t.push(encodeURIComponent(r)+"="+encodeURIComponent(o))}):t.push(encodeURIComponent(r)+"="+encodeURIComponent(n));return t.length?"&"+t.join("&"):""}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class J_e{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=512/8,this.pad_[0]=128;for(let t=1;t<this.blockSize;++t)this.pad_[t]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(t,r){r||(r=0);const n=this.W_;if(typeof t=="string")for(let f=0;f<16;f++)n[f]=t.charCodeAt(r)<<24|t.charCodeAt(r+1)<<16|t.charCodeAt(r+2)<<8|t.charCodeAt(r+3),r+=4;else for(let f=0;f<16;f++)n[f]=t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3],r+=4;for(let f=16;f<80;f++){const h=n[f-3]^n[f-8]^n[f-14]^n[f-16];n[f]=(h<<1|h>>>31)&4294967295}let o=this.chain_[0],a=this.chain_[1],s=this.chain_[2],l=this.chain_[3],c=this.chain_[4],u,d;for(let f=0;f<80;f++){f<40?f<20?(u=l^a&(s^l),d=1518500249):(u=a^s^l,d=1859775393):f<60?(u=a&s|l&(a|s),d=2400959708):(u=a^s^l,d=3395469782);const h=(o<<5|o>>>27)+u+c+d+n[f]&4294967295;c=l,l=s,s=(a<<30|a>>>2)&4294967295,a=o,o=h}this.chain_[0]=this.chain_[0]+o&4294967295,this.chain_[1]=this.chain_[1]+a&4294967295,this.chain_[2]=this.chain_[2]+s&4294967295,this.chain_[3]=this.chain_[3]+l&4294967295,this.chain_[4]=this.chain_[4]+c&4294967295}update(t,r){if(t==null)return;r===void 0&&(r=t.length);const n=r-this.blockSize;let o=0;const a=this.buf_;let s=this.inbuf_;for(;o<r;){if(s===0)for(;o<=n;)this.compress_(t,o),o+=this.blockSize;if(typeof t=="string"){for(;o<r;)if(a[s]=t.charCodeAt(o),++s,++o,s===this.blockSize){this.compress_(a),s=0;break}}else for(;o<r;)if(a[s]=t[o],++s,++o,s===this.blockSize){this.compress_(a),s=0;break}}this.inbuf_=s,this.total_+=r}digest(){const t=[];let r=this.total_*8;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let o=this.blockSize-1;o>=56;o--)this.buf_[o]=r&255,r/=256;this.compress_(this.buf_);let n=0;for(let o=0;o<5;o++)for(let a=24;a>=0;a-=8)t[n]=this.chain_[o]>>a&255,++n;return t}}function zG(e,t){return`${e} failed: ${t} argument `}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const eCe=function(e){const t=[];let r=0;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);if(o>=55296&&o<=56319){const a=o-55296;n++,Wt(n<e.length,"Surrogate pair missing trail surrogate.");const s=e.charCodeAt(n)-56320;o=65536+(a<<10)+s}o<128?t[r++]=o:o<2048?(t[r++]=o>>6|192,t[r++]=o&63|128):o<65536?(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=o&63|128):(t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=o&63|128)}return t},CS=function(e){let t=0;for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);n<128?t++:n<2048?t+=2:n>=55296&&n<=56319?(t+=4,r++):t+=3}return t};/**
|
||
* @license
|
||
* Copyright 2021 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function ES(e){return e&&e._delegate?e._delegate:e}class Hx{constructor(t,r,n){this.name=t,this.instanceFactory=r,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/**
|
||
* @license
|
||
* Copyright 2019 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const Wp="[DEFAULT]";/**
|
||
* @license
|
||
* Copyright 2019 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class tCe{constructor(t,r){this.name=t,this.container=r,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const r=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(r)){const n=new WP;if(this.instancesDeferred.set(r,n),this.isInitialized(r)||this.shouldAutoInitialize())try{const o=this.getOrInitializeService({instanceIdentifier:r});o&&n.resolve(o)}catch{}}return this.instancesDeferred.get(r).promise}getImmediate(t){var r;const n=this.normalizeInstanceIdentifier(t==null?void 0:t.identifier),o=(r=t==null?void 0:t.optional)!==null&&r!==void 0?r:!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(a){if(o)return null;throw a}else{if(o)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(nCe(t))try{this.getOrInitializeService({instanceIdentifier:Wp})}catch{}for(const[r,n]of this.instancesDeferred.entries()){const o=this.normalizeInstanceIdentifier(r);try{const a=this.getOrInitializeService({instanceIdentifier:o});n.resolve(a)}catch{}}}}clearInstance(t=Wp){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter(r=>"INTERNAL"in r).map(r=>r.INTERNAL.delete()),...t.filter(r=>"_delete"in r).map(r=>r._delete())])}isComponentSet(){return this.component!=null}isInitialized(t=Wp){return this.instances.has(t)}getOptions(t=Wp){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:r={}}=t,n=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const o=this.getOrInitializeService({instanceIdentifier:n,options:r});for(const[a,s]of this.instancesDeferred.entries()){const l=this.normalizeInstanceIdentifier(a);n===l&&s.resolve(o)}return o}onInit(t,r){var n;const o=this.normalizeInstanceIdentifier(r),a=(n=this.onInitCallbacks.get(o))!==null&&n!==void 0?n:new Set;a.add(t),this.onInitCallbacks.set(o,a);const s=this.instances.get(o);return s&&t(s,o),()=>{a.delete(t)}}invokeOnInitCallbacks(t,r){const n=this.onInitCallbacks.get(r);if(n)for(const o of n)try{o(t,r)}catch{}}getOrInitializeService({instanceIdentifier:t,options:r={}}){let n=this.instances.get(t);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:rCe(t),options:r}),this.instances.set(t,n),this.instancesOptions.set(t,r),this.invokeOnInitCallbacks(n,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,n)}catch{}return n||null}normalizeInstanceIdentifier(t=Wp){return this.component?this.component.multipleInstances?t:Wp:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function rCe(e){return e===Wp?void 0:e}function nCe(e){return e.instantiationMode==="EAGER"}/**
|
||
* @license
|
||
* Copyright 2019 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class iCe{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const r=this.getProvider(t.name);if(r.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);r.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const r=new tCe(t,this);return this.providers.set(t,r),r}getProviders(){return Array.from(this.providers.values())}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/var Yn;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(Yn||(Yn={}));const oCe={debug:Yn.DEBUG,verbose:Yn.VERBOSE,info:Yn.INFO,warn:Yn.WARN,error:Yn.ERROR,silent:Yn.SILENT},aCe=Yn.INFO,sCe={[Yn.DEBUG]:"log",[Yn.VERBOSE]:"log",[Yn.INFO]:"info",[Yn.WARN]:"warn",[Yn.ERROR]:"error"},lCe=(e,t,...r)=>{if(t<e.logLevel)return;const n=new Date().toISOString(),o=sCe[t];if(o)console[o](`[${n}] ${e.name}:`,...r);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class BG{constructor(t){this.name=t,this._logLevel=aCe,this._logHandler=lCe,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in Yn))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?oCe[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,Yn.DEBUG,...t),this._logHandler(this,Yn.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,Yn.VERBOSE,...t),this._logHandler(this,Yn.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,Yn.INFO,...t),this._logHandler(this,Yn.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,Yn.WARN,...t),this._logHandler(this,Yn.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,Yn.ERROR,...t),this._logHandler(this,Yn.ERROR,...t)}}const cCe=(e,t)=>t.some(r=>e instanceof r);let X7,Z7;function uCe(){return X7||(X7=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function dCe(){return Z7||(Z7=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const WG=new WeakMap,DA=new WeakMap,qG=new WeakMap,z4=new WeakMap,$P=new WeakMap;function fCe(e){const t=new Promise((r,n)=>{const o=()=>{e.removeEventListener("success",a),e.removeEventListener("error",s)},a=()=>{r(Pf(e.result)),o()},s=()=>{n(e.error),o()};e.addEventListener("success",a),e.addEventListener("error",s)});return t.then(r=>{r instanceof IDBCursor&&WG.set(r,e)}).catch(()=>{}),$P.set(t,e),t}function pCe(e){if(DA.has(e))return;const t=new Promise((r,n)=>{const o=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",s),e.removeEventListener("abort",s)},a=()=>{r(),o()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),o()};e.addEventListener("complete",a),e.addEventListener("error",s),e.addEventListener("abort",s)});DA.set(e,t)}let zA={get(e,t,r){if(e instanceof IDBTransaction){if(t==="done")return DA.get(e);if(t==="objectStoreNames")return e.objectStoreNames||qG.get(e);if(t==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Pf(e[t])},set(e,t,r){return e[t]=r,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function hCe(e){zA=e(zA)}function gCe(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...r){const n=e.call(B4(this),t,...r);return qG.set(n,t.sort?t.sort():[t]),Pf(n)}:dCe().includes(e)?function(...t){return e.apply(B4(this),t),Pf(WG.get(this))}:function(...t){return Pf(e.apply(B4(this),t))}}function mCe(e){return typeof e=="function"?gCe(e):(e instanceof IDBTransaction&&pCe(e),cCe(e,uCe())?new Proxy(e,zA):e)}function Pf(e){if(e instanceof IDBRequest)return fCe(e);if(z4.has(e))return z4.get(e);const t=mCe(e);return t!==e&&(z4.set(e,t),$P.set(t,e)),t}const B4=e=>$P.get(e);function vCe(e,t,{blocked:r,upgrade:n,blocking:o,terminated:a}={}){const s=indexedDB.open(e,t),l=Pf(s);return n&&s.addEventListener("upgradeneeded",c=>{n(Pf(s.result),c.oldVersion,c.newVersion,Pf(s.transaction),c)}),r&&s.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),l.then(c=>{a&&c.addEventListener("close",()=>a()),o&&c.addEventListener("versionchange",u=>o(u.oldVersion,u.newVersion,u))}).catch(()=>{}),l}const yCe=["get","getKey","getAll","getAllKeys","count"],xCe=["put","add","delete","clear"],W4=new Map;function J7(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(W4.get(t))return W4.get(t);const r=t.replace(/FromIndex$/,""),n=t!==r,o=xCe.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(o||yCe.includes(r)))return;const a=async function(s,...l){const c=this.transaction(s,o?"readwrite":"readonly");let u=c.store;return n&&(u=u.index(l.shift())),(await Promise.all([u[r](...l),o&&c.done]))[0]};return W4.set(t,a),a}hCe(e=>({...e,get:(t,r,n)=>J7(t,r)||e.get(t,r,n),has:(t,r)=>!!J7(t,r)||e.has(t,r)}));/**
|
||
* @license
|
||
* Copyright 2019 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class bCe{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(r=>{if(wCe(r)){const n=r.getImmediate();return`${n.library}/${n.version}`}else return null}).filter(r=>r).join(" ")}}function wCe(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const BA="@firebase/app",eB="0.13.2";/**
|
||
* @license
|
||
* Copyright 2019 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const md=new BG("@firebase/app"),SCe="@firebase/app-compat",jCe="@firebase/analytics-compat",kCe="@firebase/analytics",_Ce="@firebase/app-check-compat",CCe="@firebase/app-check",ECe="@firebase/auth",ACe="@firebase/auth-compat",TCe="@firebase/database",PCe="@firebase/data-connect",OCe="@firebase/database-compat",ICe="@firebase/functions",NCe="@firebase/functions-compat",RCe="@firebase/installations",LCe="@firebase/installations-compat",FCe="@firebase/messaging",MCe="@firebase/messaging-compat",DCe="@firebase/performance",zCe="@firebase/performance-compat",BCe="@firebase/remote-config",WCe="@firebase/remote-config-compat",qCe="@firebase/storage",$Ce="@firebase/storage-compat",UCe="@firebase/firestore",HCe="@firebase/ai",VCe="@firebase/firestore-compat",YCe="firebase",GCe="11.10.0";/**
|
||
* @license
|
||
* Copyright 2019 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const WA="[DEFAULT]",KCe={[BA]:"fire-core",[SCe]:"fire-core-compat",[kCe]:"fire-analytics",[jCe]:"fire-analytics-compat",[CCe]:"fire-app-check",[_Ce]:"fire-app-check-compat",[ECe]:"fire-auth",[ACe]:"fire-auth-compat",[TCe]:"fire-rtdb",[PCe]:"fire-data-connect",[OCe]:"fire-rtdb-compat",[ICe]:"fire-fn",[NCe]:"fire-fn-compat",[RCe]:"fire-iid",[LCe]:"fire-iid-compat",[FCe]:"fire-fcm",[MCe]:"fire-fcm-compat",[DCe]:"fire-perf",[zCe]:"fire-perf-compat",[BCe]:"fire-rc",[WCe]:"fire-rc-compat",[qCe]:"fire-gcs",[$Ce]:"fire-gcs-compat",[UCe]:"fire-fst",[VCe]:"fire-fst-compat",[HCe]:"fire-vertex","fire-js":"fire-js",[YCe]:"fire-js-all"};/**
|
||
* @license
|
||
* Copyright 2019 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const Vx=new Map,QCe=new Map,qA=new Map;function tB(e,t){try{e.container.addComponent(t)}catch(r){md.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,r)}}function ew(e){const t=e.name;if(qA.has(t))return md.debug(`There were multiple attempts to register component ${t}.`),!1;qA.set(t,e);for(const r of Vx.values())tB(r,e);for(const r of QCe.values())tB(r,e);return!0}function XCe(e,t){const r=e.container.getProvider("heartbeat").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),e.container.getProvider(t)}function ZCe(e){return e==null?!1:e.settings!==void 0}/**
|
||
* @license
|
||
* Copyright 2019 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const JCe={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Of=new MG("app","Firebase",JCe);/**
|
||
* @license
|
||
* Copyright 2019 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class e4e{constructor(t,r,n){this._isDeleted=!1,this._options=Object.assign({},t),this._config=Object.assign({},r),this._name=r.name,this._automaticDataCollectionEnabled=r.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new Hx("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw Of.create("app-deleted",{appName:this._name})}}/**
|
||
* @license
|
||
* Copyright 2019 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const t4e=GCe;function $G(e,t={}){let r=e;typeof t!="object"&&(t={name:t});const n=Object.assign({name:WA,automaticDataCollectionEnabled:!0},t),o=n.name;if(typeof o!="string"||!o)throw Of.create("bad-app-name",{appName:String(o)});if(r||(r=LG()),!r)throw Of.create("no-options");const a=Vx.get(o);if(a){if(J2(r,a.options)&&J2(n,a.config))return a;throw Of.create("duplicate-app",{appName:o})}const s=new iCe(o);for(const c of qA.values())s.addComponent(c);const l=new e4e(r,n,s);return Vx.set(o,l),l}function r4e(e=WA){const t=Vx.get(e);if(!t&&e===WA&&LG())return $G();if(!t)throw Of.create("no-app",{appName:e});return t}function rB(){return Array.from(Vx.values())}function om(e,t,r){var n;let o=(n=KCe[e])!==null&&n!==void 0?n:e;r&&(o+=`-${r}`);const a=o.match(/\s|\//),s=t.match(/\s|\//);if(a||s){const l=[`Unable to register library "${o}" with version "${t}":`];a&&l.push(`library name "${o}" contains illegal characters (whitespace or "/")`),a&&s&&l.push("and"),s&&l.push(`version name "${t}" contains illegal characters (whitespace or "/")`),md.warn(l.join(" "));return}ew(new Hx(`${o}-version`,()=>({library:o,version:t}),"VERSION"))}/**
|
||
* @license
|
||
* Copyright 2021 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const n4e="firebase-heartbeat-database",i4e=1,Yx="firebase-heartbeat-store";let q4=null;function UG(){return q4||(q4=vCe(n4e,i4e,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(Yx)}catch(r){console.warn(r)}}}}).catch(e=>{throw Of.create("idb-open",{originalErrorMessage:e.message})})),q4}async function o4e(e){try{const r=(await UG()).transaction(Yx),n=await r.objectStore(Yx).get(HG(e));return await r.done,n}catch(t){if(t instanceof Cb)md.warn(t.message);else{const r=Of.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});md.warn(r.message)}}}async function nB(e,t){try{const n=(await UG()).transaction(Yx,"readwrite");await n.objectStore(Yx).put(t,HG(e)),await n.done}catch(r){if(r instanceof Cb)md.warn(r.message);else{const n=Of.create("idb-set",{originalErrorMessage:r==null?void 0:r.message});md.warn(n.message)}}}function HG(e){return`${e.name}!${e.options.appId}`}/**
|
||
* @license
|
||
* Copyright 2021 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const a4e=1024,s4e=30;class l4e{constructor(t){this.container=t,this._heartbeatsCache=null;const r=this.container.getProvider("app").getImmediate();this._storage=new u4e(r),this._heartbeatsCachePromise=this._storage.read().then(n=>(this._heartbeatsCache=n,n))}async triggerHeartbeat(){var t,r;try{const o=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),a=iB();if(((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((r=this._heartbeatsCache)===null||r===void 0?void 0:r.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===a||this._heartbeatsCache.heartbeats.some(s=>s.date===a))return;if(this._heartbeatsCache.heartbeats.push({date:a,agent:o}),this._heartbeatsCache.heartbeats.length>s4e){const s=d4e(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(s,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(n){md.warn(n)}}async getHeartbeatsHeader(){var t;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const r=iB(),{heartbeatsToSend:n,unsentEntries:o}=c4e(this._heartbeatsCache.heartbeats),a=X2(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=r,o.length>0?(this._heartbeatsCache.heartbeats=o,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),a}catch(r){return md.warn(r),""}}}function iB(){return new Date().toISOString().substring(0,10)}function c4e(e,t=a4e){const r=[];let n=e.slice();for(const o of e){const a=r.find(s=>s.agent===o.agent);if(a){if(a.dates.push(o.date),oB(r)>t){a.dates.pop();break}}else if(r.push({agent:o.agent,dates:[o.date]}),oB(r)>t){r.pop();break}n=n.slice(1)}return{heartbeatsToSend:r,unsentEntries:n}}class u4e{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return H_e()?V_e().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const r=await o4e(this.app);return r!=null&&r.heartbeats?r:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){var r;if(await this._canUseIndexedDBPromise){const o=await this.read();return nB(this.app,{lastSentHeartbeatDate:(r=t.lastSentHeartbeatDate)!==null&&r!==void 0?r:o.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){var r;if(await this._canUseIndexedDBPromise){const o=await this.read();return nB(this.app,{lastSentHeartbeatDate:(r=t.lastSentHeartbeatDate)!==null&&r!==void 0?r:o.lastSentHeartbeatDate,heartbeats:[...o.heartbeats,...t.heartbeats]})}else return}}function oB(e){return X2(JSON.stringify({version:2,heartbeats:e})).length}function d4e(e){if(e.length===0)return-1;let t=0,r=e[0].date;for(let n=1;n<e.length;n++)e[n].date<r&&(r=e[n].date,t=n);return t}/**
|
||
* @license
|
||
* Copyright 2019 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function f4e(e){ew(new Hx("platform-logger",t=>new bCe(t),"PRIVATE")),ew(new Hx("heartbeat",t=>new l4e(t),"PRIVATE")),om(BA,eB,e),om(BA,eB,"esm2017"),om("fire-js","")}f4e("");var aB={};const sB="@firebase/database",lB="1.0.20";/**
|
||
* @license
|
||
* Copyright 2019 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/let VG="";function p4e(e){VG=e}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class h4e{constructor(t){this.domStorage_=t,this.prefix_="firebase:"}set(t,r){r==null?this.domStorage_.removeItem(this.prefixedName_(t)):this.domStorage_.setItem(this.prefixedName_(t),Mo(r))}get(t){const r=this.domStorage_.getItem(this.prefixedName_(t));return r==null?null:Ux(r)}remove(t){this.domStorage_.removeItem(this.prefixedName_(t))}prefixedName_(t){return this.prefix_+t}toString(){return this.domStorage_.toString()}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class g4e{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(t,r){r==null?delete this.cache_[t]:this.cache_[t]=r}get(t){return Cd(this.cache_,t)?this.cache_[t]:null}remove(t){delete this.cache_[t]}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const YG=function(e){try{if(typeof window<"u"&&typeof window[e]<"u"){const t=window[e];return t.setItem("firebase:sentinel","cache"),t.removeItem("firebase:sentinel"),new h4e(t)}}catch{}return new g4e},Jp=YG("localStorage"),m4e=YG("sessionStorage");/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const am=new BG("@firebase/database"),v4e=(function(){let e=1;return function(){return e++}})(),GG=function(e){const t=eCe(e),r=new J_e;r.update(t);const n=r.digest();return BP.encodeByteArray(n)},Eb=function(...e){let t="";for(let r=0;r<e.length;r++){const n=e[r];Array.isArray(n)||n&&typeof n=="object"&&typeof n.length=="number"?t+=Eb.apply(null,n):typeof n=="object"?t+=Mo(n):t+=n,t+=" "}return t};let Gy=null,cB=!0;const y4e=function(e,t){Wt(!0,"Can't turn on custom loggers persistently."),am.logLevel=Yn.VERBOSE,Gy=am.log.bind(am)},ga=function(...e){if(cB===!0&&(cB=!1,Gy===null&&m4e.get("logging_enabled")===!0&&y4e()),Gy){const t=Eb.apply(null,e);Gy(t)}},Ab=function(e){return function(...t){ga(e,...t)}},$A=function(...e){const t="FIREBASE INTERNAL ERROR: "+Eb(...e);am.error(t)},vd=function(...e){const t=`FIREBASE FATAL ERROR: ${Eb(...e)}`;throw am.error(t),new Error(t)},Xs=function(...e){const t="FIREBASE WARNING: "+Eb(...e);am.warn(t)},x4e=function(){typeof window<"u"&&window.location&&window.location.protocol&&window.location.protocol.indexOf("https:")!==-1&&Xs("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().")},KG=function(e){return typeof e=="number"&&(e!==e||e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY)},b4e=function(e){if(document.readyState==="complete")e();else{let t=!1;const r=function(){if(!document.body){setTimeout(r,Math.floor(10));return}t||(t=!0,e())};document.addEventListener?(document.addEventListener("DOMContentLoaded",r,!1),window.addEventListener("load",r,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&r()}),window.attachEvent("onload",r))}},Xm="[MIN_NAME]",wh="[MAX_NAME]",Cv=function(e,t){if(e===t)return 0;if(e===Xm||t===wh)return-1;if(t===Xm||e===wh)return 1;{const r=uB(e),n=uB(t);return r!==null?n!==null?r-n===0?e.length-t.length:r-n:-1:n!==null?1:e<t?-1:1}},w4e=function(e,t){return e===t?0:e<t?-1:1},xy=function(e,t){if(t&&e in t)return t[e];throw new Error("Missing required key ("+e+") in object: "+Mo(t))},UP=function(e){if(typeof e!="object"||e===null)return Mo(e);const t=[];for(const n in e)t.push(n);t.sort();let r="{";for(let n=0;n<t.length;n++)n!==0&&(r+=","),r+=Mo(t[n]),r+=":",r+=UP(e[t[n]]);return r+="}",r},QG=function(e,t){const r=e.length;if(r<=t)return[e];const n=[];for(let o=0;o<r;o+=t)o+t>r?n.push(e.substring(o,r)):n.push(e.substring(o,o+t));return n};function gs(e,t){for(const r in e)e.hasOwnProperty(r)&&t(r,e[r])}const XG=function(e){Wt(!KG(e),"Invalid JSON number");const t=11,r=52,n=(1<<t-1)-1;let o,a,s,l,c;e===0?(a=0,s=0,o=1/e===-1/0?1:0):(o=e<0,e=Math.abs(e),e>=Math.pow(2,1-n)?(l=Math.min(Math.floor(Math.log(e)/Math.LN2),n),a=l+n,s=Math.round(e*Math.pow(2,r-l)-Math.pow(2,r))):(a=0,s=Math.round(e/Math.pow(2,1-n-r))));const u=[];for(c=r;c;c-=1)u.push(s%2?1:0),s=Math.floor(s/2);for(c=t;c;c-=1)u.push(a%2?1:0),a=Math.floor(a/2);u.push(o?1:0),u.reverse();const d=u.join("");let f="";for(c=0;c<64;c+=8){let h=parseInt(d.substr(c,8),2).toString(16);h.length===1&&(h="0"+h),f=f+h}return f.toLowerCase()},S4e=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},j4e=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"};function k4e(e,t){let r="Unknown Error";e==="too_big"?r="The data requested exceeds the maximum size that can be accessed with a single request.":e==="permission_denied"?r="Client doesn't have permission to access the desired data.":e==="unavailable"&&(r="The service is unavailable");const n=new Error(e+" at "+t._path.toString()+": "+r);return n.code=e.toUpperCase(),n}const _4e=new RegExp("^-?(0*)\\d{1,10}$"),C4e=-2147483648,E4e=2147483647,uB=function(e){if(_4e.test(e)){const t=Number(e);if(t>=C4e&&t<=E4e)return t}return null},Tb=function(e){try{e()}catch(t){setTimeout(()=>{const r=t.stack||"";throw Xs("Exception was thrown by user callback.",r),t},Math.floor(0))}},A4e=function(){return(typeof window=="object"&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},Ky=function(e,t){const r=setTimeout(e,t);return typeof r=="number"&&typeof Deno<"u"&&Deno.unrefTimer?Deno.unrefTimer(r):typeof r=="object"&&r.unref&&r.unref(),r};/**
|
||
* @license
|
||
* Copyright 2021 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class T4e{constructor(t,r){this.appCheckProvider=r,this.appName=t.name,ZCe(t)&&t.settings.appCheckToken&&(this.serverAppAppCheckToken=t.settings.appCheckToken),this.appCheck=r==null?void 0:r.getImmediate({optional:!0}),this.appCheck||r==null||r.get().then(n=>this.appCheck=n)}getToken(t){if(this.serverAppAppCheckToken){if(t)throw new Error("Attempted reuse of `FirebaseServerApp.appCheckToken` after previous usage failed.");return Promise.resolve({token:this.serverAppAppCheckToken})}return this.appCheck?this.appCheck.getToken(t):new Promise((r,n)=>{setTimeout(()=>{this.appCheck?this.getToken(t).then(r,n):r(null)},0)})}addTokenChangeListener(t){var r;(r=this.appCheckProvider)===null||r===void 0||r.get().then(n=>n.addTokenListener(t))}notifyForInvalidToken(){Xs(`Provided AppCheck credentials for the app named "${this.appName}" are invalid. This usually indicates your app was not initialized correctly.`)}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class P4e{constructor(t,r,n){this.appName_=t,this.firebaseOptions_=r,this.authProvider_=n,this.auth_=null,this.auth_=n.getImmediate({optional:!0}),this.auth_||n.onInit(o=>this.auth_=o)}getToken(t){return this.auth_?this.auth_.getToken(t).catch(r=>r&&r.code==="auth/token-not-initialized"?(ga("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(r)):new Promise((r,n)=>{setTimeout(()=>{this.auth_?this.getToken(t).then(r,n):r(null)},0)})}addTokenChangeListener(t){this.auth_?this.auth_.addAuthTokenListener(t):this.authProvider_.get().then(r=>r.addAuthTokenListener(t))}removeTokenChangeListener(t){this.authProvider_.get().then(r=>r.removeAuthTokenListener(t))}notifyForInvalidToken(){let t='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?t+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?t+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':t+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',Xs(t)}}class b0{constructor(t){this.accessToken=t}getToken(t){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(t){t(this.accessToken)}removeTokenChangeListener(t){}notifyForInvalidToken(){}}b0.OWNER="owner";/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const HP="5",ZG="v",JG="s",eK="r",tK="f",rK=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,nK="ls",iK="p",UA="ac",oK="websocket",aK="long_polling";/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class sK{constructor(t,r,n,o,a=!1,s="",l=!1,c=!1,u=null){this.secure=r,this.namespace=n,this.webSocketOnly=o,this.nodeAdmin=a,this.persistenceKey=s,this.includeNamespaceInQueryParams=l,this.isUsingEmulator=c,this.emulatorOptions=u,this._host=t.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=Jp.get("host:"+t)||this._host}isCacheableHost(){return this.internalHost.substr(0,2)==="s-"}isCustomHost(){return this._domain!=="firebaseio.com"&&this._domain!=="firebaseio-demo.com"}get host(){return this._host}set host(t){t!==this.internalHost&&(this.internalHost=t,this.isCacheableHost()&&Jp.set("host:"+this._host,this.internalHost))}toString(){let t=this.toURLString();return this.persistenceKey&&(t+="<"+this.persistenceKey+">"),t}toURLString(){const t=this.secure?"https://":"http://",r=this.includeNamespaceInQueryParams?`?ns=${this.namespace}`:"";return`${t}${this.host}/${r}`}}function O4e(e){return e.host!==e.internalHost||e.isCustomHost()||e.includeNamespaceInQueryParams}function lK(e,t,r){Wt(typeof t=="string","typeof type must == string"),Wt(typeof r=="object","typeof params must == object");let n;if(t===oK)n=(e.secure?"wss://":"ws://")+e.internalHost+"/.ws?";else if(t===aK)n=(e.secure?"https://":"http://")+e.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+t);O4e(e)&&(r.ns=e.namespace);const o=[];return gs(r,(a,s)=>{o.push(a+"="+s)}),n+o.join("&")}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class I4e{constructor(){this.counters_={}}incrementCounter(t,r=1){Cd(this.counters_,t)||(this.counters_[t]=0),this.counters_[t]+=r}get(){return T_e(this.counters_)}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const $4={},U4={};function VP(e){const t=e.toString();return $4[t]||($4[t]=new I4e),$4[t]}function N4e(e,t){const r=e.toString();return U4[r]||(U4[r]=t()),U4[r]}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class R4e{constructor(t){this.onMessage_=t,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(t,r){this.closeAfterResponse=t,this.onClose=r,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)}handleResponse(t,r){for(this.pendingResponses[t]=r;this.pendingResponses[this.currentResponseNum];){const n=this.pendingResponses[this.currentResponseNum];delete this.pendingResponses[this.currentResponseNum];for(let o=0;o<n.length;++o)n[o]&&Tb(()=>{this.onMessage_(n[o])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const dB="start",L4e="close",F4e="pLPCommand",M4e="pRTLPCB",cK="id",uK="pw",dK="ser",D4e="cb",z4e="seg",B4e="ts",W4e="d",q4e="dframe",fK=1870,pK=30,$4e=fK-pK,U4e=25e3,H4e=3e4;class Gg{constructor(t,r,n,o,a,s,l){this.connId=t,this.repoInfo=r,this.applicationId=n,this.appCheckToken=o,this.authToken=a,this.transportSessionId=s,this.lastSessionId=l,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=Ab(t),this.stats_=VP(r),this.urlFn=c=>(this.appCheckToken&&(c[UA]=this.appCheckToken),lK(r,aK,c))}open(t,r){this.curSegmentNum=0,this.onDisconnect_=r,this.myPacketOrderer=new R4e(t),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(H4e)),b4e(()=>{if(this.isClosed_)return;this.scriptTagHolder=new YP((...a)=>{const[s,l,c,u,d]=a;if(this.incrementIncomingBytes_(a),!!this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,s===dB)this.id=l,this.password=c;else if(s===L4e)l?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(l,()=>{this.onClosed_()})):this.onClosed_();else throw new Error("Unrecognized command received: "+s)},(...a)=>{const[s,l]=a;this.incrementIncomingBytes_(a),this.myPacketOrderer.handleResponse(s,l)},()=>{this.onClosed_()},this.urlFn);const n={};n[dB]="t",n[dK]=Math.floor(Math.random()*1e8),this.scriptTagHolder.uniqueCallbackIdentifier&&(n[D4e]=this.scriptTagHolder.uniqueCallbackIdentifier),n[ZG]=HP,this.transportSessionId&&(n[JG]=this.transportSessionId),this.lastSessionId&&(n[nK]=this.lastSessionId),this.applicationId&&(n[iK]=this.applicationId),this.appCheckToken&&(n[UA]=this.appCheckToken),typeof location<"u"&&location.hostname&&rK.test(location.hostname)&&(n[eK]=tK);const o=this.urlFn(n);this.log_("Connecting via long-poll to "+o),this.scriptTagHolder.addTag(o,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){Gg.forceAllow_=!0}static forceDisallow(){Gg.forceDisallow_=!0}static isAvailable(){return Gg.forceAllow_?!0:!Gg.forceDisallow_&&typeof document<"u"&&document.createElement!=null&&!S4e()&&!j4e()}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(t){const r=Mo(t);this.bytesSent+=r.length,this.stats_.incrementCounter("bytes_sent",r.length);const n=IG(r),o=QG(n,$4e);for(let a=0;a<o.length;a++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,o.length,o[a]),this.curSegmentNum++}addDisconnectPingFrame(t,r){this.myDisconnFrame=document.createElement("iframe");const n={};n[q4e]="t",n[cK]=t,n[uK]=r,this.myDisconnFrame.src=this.urlFn(n),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}incrementIncomingBytes_(t){const r=Mo(t).length;this.bytesReceived+=r,this.stats_.incrementCounter("bytes_received",r)}}class YP{constructor(t,r,n,o){this.onDisconnect=n,this.urlFn=o,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(Math.random()*1e8),this.sendNewPolls=!0;{this.uniqueCallbackIdentifier=v4e(),window[F4e+this.uniqueCallbackIdentifier]=t,window[M4e+this.uniqueCallbackIdentifier]=r,this.myIFrame=YP.createIFrame_();let a="";this.myIFrame.src&&this.myIFrame.src.substr(0,11)==="javascript:"&&(a='<script>document.domain="'+document.domain+'";<\/script>');const s="<html><body>"+a+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(s),this.myIFrame.doc.close()}catch(l){ga("frame writing exception"),l.stack&&ga(l.stack),ga(l)}}}static createIFrame_(){const t=document.createElement("iframe");if(t.style.display="none",document.body){document.body.appendChild(t);try{t.contentWindow.document||ga("No IE domain setting required")}catch{const n=document.domain;t.src="javascript:void((function(){document.open();document.domain='"+n+"';document.close();})())"}}else throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";return t.contentDocument?t.doc=t.contentDocument:t.contentWindow?t.doc=t.contentWindow.document:t.document&&(t.doc=t.document),t}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout(()=>{this.myIFrame!==null&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},Math.floor(0)));const t=this.onDisconnect;t&&(this.onDisconnect=null,t())}startLongPoll(t,r){for(this.myID=t,this.myPW=r,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;const t={};t[cK]=this.myID,t[uK]=this.myPW,t[dK]=this.currentSerial;let r=this.urlFn(t),n="",o=0;for(;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+pK+n.length<=fK;){const s=this.pendingSegs.shift();n=n+"&"+z4e+o+"="+s.seg+"&"+B4e+o+"="+s.ts+"&"+W4e+o+"="+s.d,o++}return r=r+n,this.addLongPollTag_(r,this.currentSerial),!0}else return!1}enqueueSegment(t,r,n){this.pendingSegs.push({seg:t,ts:r,d:n}),this.alive&&this.newRequest_()}addLongPollTag_(t,r){this.outstandingRequests.add(r);const n=()=>{this.outstandingRequests.delete(r),this.newRequest_()},o=setTimeout(n,Math.floor(U4e)),a=()=>{clearTimeout(o),n()};this.addTag(t,a)}addTag(t,r){setTimeout(()=>{try{if(!this.sendNewPolls)return;const n=this.myIFrame.doc.createElement("script");n.type="text/javascript",n.async=!0,n.src=t,n.onload=n.onreadystatechange=function(){const o=n.readyState;(!o||o==="loaded"||o==="complete")&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),r())},n.onerror=()=>{ga("Long-poll script failed to load: "+t),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(n)}catch{}},Math.floor(1))}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const V4e=16384,Y4e=45e3;let tw=null;typeof MozWebSocket<"u"?tw=MozWebSocket:typeof WebSocket<"u"&&(tw=WebSocket);class rc{constructor(t,r,n,o,a,s,l){this.connId=t,this.applicationId=n,this.appCheckToken=o,this.authToken=a,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=Ab(this.connId),this.stats_=VP(r),this.connURL=rc.connectionURL_(r,s,l,o,n),this.nodeAdmin=r.nodeAdmin}static connectionURL_(t,r,n,o,a){const s={};return s[ZG]=HP,typeof location<"u"&&location.hostname&&rK.test(location.hostname)&&(s[eK]=tK),r&&(s[JG]=r),n&&(s[nK]=n),o&&(s[UA]=o),a&&(s[iK]=a),lK(t,oK,s)}open(t,r){this.onDisconnect=r,this.onMessage=t,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,Jp.set("previous_websocket_failure",!0);try{let n;U_e(),this.mySock=new tw(this.connURL,[],n)}catch(n){this.log_("Error instantiating WebSocket.");const o=n.message||n.data;o&&this.log_(o),this.onClosed_();return}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=n=>{this.handleIncomingFrame(n)},this.mySock.onerror=n=>{this.log_("WebSocket error. Closing connection.");const o=n.message||n.data;o&&this.log_(o),this.onClosed_()}}start(){}static forceDisallow(){rc.forceDisallow_=!0}static isAvailable(){let t=!1;if(typeof navigator<"u"&&navigator.userAgent){const r=/Android ([0-9]{0,}\.[0-9]{0,})/,n=navigator.userAgent.match(r);n&&n.length>1&&parseFloat(n[1])<4.4&&(t=!0)}return!t&&tw!==null&&!rc.forceDisallow_}static previouslyFailed(){return Jp.isInMemoryStorage||Jp.get("previous_websocket_failure")===!0}markConnectionHealthy(){Jp.remove("previous_websocket_failure")}appendFrame_(t){if(this.frames.push(t),this.frames.length===this.totalFrames){const r=this.frames.join("");this.frames=null;const n=Ux(r);this.onMessage(n)}}handleNewFrameCount_(t){this.totalFrames=t,this.frames=[]}extractFrameCount_(t){if(Wt(this.frames===null,"We already have a frame buffer"),t.length<=6){const r=Number(t);if(!isNaN(r))return this.handleNewFrameCount_(r),null}return this.handleNewFrameCount_(1),t}handleIncomingFrame(t){if(this.mySock===null)return;const r=t.data;if(this.bytesReceived+=r.length,this.stats_.incrementCounter("bytes_received",r.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(r);else{const n=this.extractFrameCount_(r);n!==null&&this.appendFrame_(n)}}send(t){this.resetKeepAlive();const r=Mo(t);this.bytesSent+=r.length,this.stats_.incrementCounter("bytes_sent",r.length);const n=QG(r,V4e);n.length>1&&this.sendString_(String(n.length));for(let o=0;o<n.length;o++)this.sendString_(n[o])}shutdown_(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)}onClosed_(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))}close(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())}resetKeepAlive(){clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(()=>{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(Y4e))}sendString_(t){try{this.mySock.send(t)}catch(r){this.log_("Exception thrown from WebSocket.send():",r.message||r.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}rc.responsesRequiredToBeHealthy=2;rc.healthyTimeout=3e4;/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class Gx{static get ALL_TRANSPORTS(){return[Gg,rc]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(t){this.initTransports_(t)}initTransports_(t){const r=rc&&rc.isAvailable();let n=r&&!rc.previouslyFailed();if(t.webSocketOnly&&(r||Xs("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),n=!0),n)this.transports_=[rc];else{const o=this.transports_=[];for(const a of Gx.ALL_TRANSPORTS)a&&a.isAvailable()&&o.push(a);Gx.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}Gx.globalTransportInitialized_=!1;/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const G4e=6e4,K4e=5e3,Q4e=10*1024,X4e=100*1024,H4="t",fB="d",Z4e="s",pB="r",J4e="e",hB="o",gB="a",mB="n",vB="p",e3e="h";class t3e{constructor(t,r,n,o,a,s,l,c,u,d){this.id=t,this.repoInfo_=r,this.applicationId_=n,this.appCheckToken_=o,this.authToken_=a,this.onMessage_=s,this.onReady_=l,this.onDisconnect_=c,this.onKill_=u,this.lastSessionId=d,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=Ab("c:"+this.id+":"),this.transportManager_=new Gx(r),this.log_("Connection created"),this.start_()}start_(){const t=this.transportManager_.initialTransport();this.conn_=new t(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;const r=this.connReceiver_(this.conn_),n=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(r,n)},Math.floor(0));const o=t.healthyTimeout||0;o>0&&(this.healthyTimeout_=Ky(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>X4e?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes. Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>Q4e?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes. Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))},Math.floor(o)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(t){return r=>{t===this.conn_?this.onConnectionLost_(r):t===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(t){return r=>{this.state_!==2&&(t===this.rx_?this.onPrimaryMessageReceived_(r):t===this.secondaryConn_?this.onSecondaryMessageReceived_(r):this.log_("message on old connection"))}}sendRequest(t){const r={t:"d",d:t};this.sendData_(r)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(t){if(H4 in t){const r=t[H4];r===gB?this.upgradeIfSecondaryHealthy_():r===pB?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):r===hB&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(t){const r=xy("t",t),n=xy("d",t);if(r==="c")this.onSecondaryControl_(n);else if(r==="d")this.pendingDataMessages.push(n);else throw new Error("Unknown protocol layer: "+r)}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:vB,d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:gB,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:mB,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(t){const r=xy("t",t),n=xy("d",t);r==="c"?this.onControl_(n):r==="d"&&this.onDataMessage_(n)}onDataMessage_(t){this.onPrimaryResponse_(),this.onMessage_(t)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(t){const r=xy(H4,t);if(fB in t){const n=t[fB];if(r===e3e){const o=Object.assign({},n);this.repoInfo_.isUsingEmulator&&(o.h=this.repoInfo_.host),this.onHandshake_(o)}else if(r===mB){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let o=0;o<this.pendingDataMessages.length;++o)this.onDataMessage_(this.pendingDataMessages[o]);this.pendingDataMessages=[],this.tryCleanupConnection()}else r===Z4e?this.onConnectionShutdown_(n):r===pB?this.onReset_(n):r===J4e?$A("Server Error: "+n):r===hB?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):$A("Unknown control packet command: "+r)}}onHandshake_(t){const r=t.ts,n=t.v,o=t.h;this.sessionId=t.s,this.repoInfo_.host=o,this.state_===0&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,r),HP!==n&&Xs("Protocol version mismatch detected"),this.tryStartUpgrade_())}tryStartUpgrade_(){const t=this.transportManager_.upgradeTransport();t&&this.startUpgrade_(t)}startUpgrade_(t){this.secondaryConn_=new t(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=t.responsesRequiredToBeHealthy||0;const r=this.connReceiver_(this.secondaryConn_),n=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(r,n),Ky(()=>{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(G4e))}onReset_(t){this.log_("Reset packet received. New host: "+t),this.repoInfo_.host=t,this.state_===1?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(t,r){this.log_("Realtime connection established."),this.conn_=t,this.state_=1,this.onReady_&&(this.onReady_(r,this.sessionId),this.onReady_=null),this.primaryResponsesRequired_===0?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):Ky(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(K4e))}sendPingOnPrimaryIfNecessary_(){!this.isHealthy_&&this.state_===1&&(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:vB,d:{}}}))}onSecondaryConnectionLost_(){const t=this.secondaryConn_;this.secondaryConn_=null,(this.tx_===t||this.rx_===t)&&this.close()}onConnectionLost_(t){this.conn_=null,!t&&this.state_===0?(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(Jp.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)):this.state_===1&&this.log_("Realtime connection lost."),this.close()}onConnectionShutdown_(t){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(t),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(t){if(this.state_!==1)throw"Connection is not connected";this.tx_.send(t)}close(){this.state_!==2&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class hK{put(t,r,n,o){}merge(t,r,n,o){}refreshAuthToken(t){}refreshAppCheckToken(t){}onDisconnectPut(t,r,n){}onDisconnectMerge(t,r,n){}onDisconnectCancel(t,r){}reportStats(t){}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class gK{constructor(t){this.allowedEvents_=t,this.listeners_={},Wt(Array.isArray(t)&&t.length>0,"Requires a non-empty array")}trigger(t,...r){if(Array.isArray(this.listeners_[t])){const n=[...this.listeners_[t]];for(let o=0;o<n.length;o++)n[o].callback.apply(n[o].context,r)}}on(t,r,n){this.validateEventType_(t),this.listeners_[t]=this.listeners_[t]||[],this.listeners_[t].push({callback:r,context:n});const o=this.getInitialEvent(t);o&&r.apply(n,o)}off(t,r,n){this.validateEventType_(t);const o=this.listeners_[t]||[];for(let a=0;a<o.length;a++)if(o[a].callback===r&&(!n||n===o[a].context)){o.splice(a,1);return}}validateEventType_(t){Wt(this.allowedEvents_.find(r=>r===t),"Unknown event: "+t)}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class rw extends gK{static getInstance(){return new rw}constructor(){super(["online"]),this.online_=!0,typeof window<"u"&&typeof window.addEventListener<"u"&&!FG()&&(window.addEventListener("online",()=>{this.online_||(this.online_=!0,this.trigger("online",!0))},!1),window.addEventListener("offline",()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))},!1))}getInitialEvent(t){return Wt(t==="online","Unknown event type: "+t),[this.online_]}currentlyOnline(){return this.online_}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const yB=32,xB=768;class Wn{constructor(t,r){if(r===void 0){this.pieces_=t.split("/");let n=0;for(let o=0;o<this.pieces_.length;o++)this.pieces_[o].length>0&&(this.pieces_[n]=this.pieces_[o],n++);this.pieces_.length=n,this.pieceNum_=0}else this.pieces_=t,this.pieceNum_=r}toString(){let t="";for(let r=this.pieceNum_;r<this.pieces_.length;r++)this.pieces_[r]!==""&&(t+="/"+this.pieces_[r]);return t||"/"}}function hn(){return new Wn("")}function Vr(e){return e.pieceNum_>=e.pieces_.length?null:e.pieces_[e.pieceNum_]}function zf(e){return e.pieces_.length-e.pieceNum_}function Gn(e){let t=e.pieceNum_;return t<e.pieces_.length&&t++,new Wn(e.pieces_,t)}function mK(e){return e.pieceNum_<e.pieces_.length?e.pieces_[e.pieces_.length-1]:null}function r3e(e){let t="";for(let r=e.pieceNum_;r<e.pieces_.length;r++)e.pieces_[r]!==""&&(t+="/"+encodeURIComponent(String(e.pieces_[r])));return t||"/"}function vK(e,t=0){return e.pieces_.slice(e.pieceNum_+t)}function yK(e){if(e.pieceNum_>=e.pieces_.length)return null;const t=[];for(let r=e.pieceNum_;r<e.pieces_.length-1;r++)t.push(e.pieces_[r]);return new Wn(t,0)}function fo(e,t){const r=[];for(let n=e.pieceNum_;n<e.pieces_.length;n++)r.push(e.pieces_[n]);if(t instanceof Wn)for(let n=t.pieceNum_;n<t.pieces_.length;n++)r.push(t.pieces_[n]);else{const n=t.split("/");for(let o=0;o<n.length;o++)n[o].length>0&&r.push(n[o])}return new Wn(r,0)}function Yr(e){return e.pieceNum_>=e.pieces_.length}function ds(e,t){const r=Vr(e),n=Vr(t);if(r===null)return t;if(r===n)return ds(Gn(e),Gn(t));throw new Error("INTERNAL ERROR: innerPath ("+t+") is not within outerPath ("+e+")")}function GP(e,t){if(zf(e)!==zf(t))return!1;for(let r=e.pieceNum_,n=t.pieceNum_;r<=e.pieces_.length;r++,n++)if(e.pieces_[r]!==t.pieces_[n])return!1;return!0}function ic(e,t){let r=e.pieceNum_,n=t.pieceNum_;if(zf(e)>zf(t))return!1;for(;r<e.pieces_.length;){if(e.pieces_[r]!==t.pieces_[n])return!1;++r,++n}return!0}class n3e{constructor(t,r){this.errorPrefix_=r,this.parts_=vK(t,0),this.byteLength_=Math.max(1,this.parts_.length);for(let n=0;n<this.parts_.length;n++)this.byteLength_+=CS(this.parts_[n]);xK(this)}}function i3e(e,t){e.parts_.length>0&&(e.byteLength_+=1),e.parts_.push(t),e.byteLength_+=CS(t),xK(e)}function o3e(e){const t=e.parts_.pop();e.byteLength_-=CS(t),e.parts_.length>0&&(e.byteLength_-=1)}function xK(e){if(e.byteLength_>xB)throw new Error(e.errorPrefix_+"has a key path longer than "+xB+" bytes ("+e.byteLength_+").");if(e.parts_.length>yB)throw new Error(e.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+yB+") or object contains a cycle "+qp(e))}function qp(e){return e.parts_.length===0?"":"in property '"+e.parts_.join(".")+"'"}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class KP extends gK{static getInstance(){return new KP}constructor(){super(["visible"]);let t,r;typeof document<"u"&&typeof document.addEventListener<"u"&&(typeof document.hidden<"u"?(r="visibilitychange",t="hidden"):typeof document.mozHidden<"u"?(r="mozvisibilitychange",t="mozHidden"):typeof document.msHidden<"u"?(r="msvisibilitychange",t="msHidden"):typeof document.webkitHidden<"u"&&(r="webkitvisibilitychange",t="webkitHidden")),this.visible_=!0,r&&document.addEventListener(r,()=>{const n=!document[t];n!==this.visible_&&(this.visible_=n,this.trigger("visible",n))},!1)}getInitialEvent(t){return Wt(t==="visible","Unknown event type: "+t),[this.visible_]}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const by=1e3,a3e=300*1e3,bB=30*1e3,s3e=1.3,l3e=3e4,c3e="server_kill",wB=3;class cd extends hK{constructor(t,r,n,o,a,s,l,c){if(super(),this.repoInfo_=t,this.applicationId_=r,this.onDataUpdate_=n,this.onConnectStatus_=o,this.onServerInfoUpdate_=a,this.authTokenProvider_=s,this.appCheckTokenProvider_=l,this.authOverride_=c,this.id=cd.nextPersistentConnectionId_++,this.log_=Ab("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=by,this.maxReconnectDelay_=a3e,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,c)throw new Error("Auth override specified in options, but not supported on non Node.js platforms");KP.getInstance().on("visible",this.onVisible_,this),t.host.indexOf("fblocal")===-1&&rw.getInstance().on("online",this.onOnline_,this)}sendRequest(t,r,n){const o=++this.requestNumber_,a={r:o,a:t,b:r};this.log_(Mo(a)),Wt(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(a),n&&(this.requestCBHash_[o]=n)}get(t){this.initConnection_();const r=new WP,o={action:"g",request:{p:t._path.toString(),q:t._queryObject},onComplete:s=>{const l=s.d;s.s==="ok"?r.resolve(l):r.reject(l)}};this.outstandingGets_.push(o),this.outstandingGetCount_++;const a=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(a),r.promise}listen(t,r,n,o){this.initConnection_();const a=t._queryIdentifier,s=t._path.toString();this.log_("Listen called for "+s+" "+a),this.listens.has(s)||this.listens.set(s,new Map),Wt(t._queryParams.isDefault()||!t._queryParams.loadsAllData(),"listen() called for non-default but complete query"),Wt(!this.listens.get(s).has(a),"listen() called twice for same path/queryId.");const l={onComplete:o,hashFn:r,query:t,tag:n};this.listens.get(s).set(a,l),this.connected_&&this.sendListen_(l)}sendGet_(t){const r=this.outstandingGets_[t];this.sendRequest("g",r.request,n=>{delete this.outstandingGets_[t],this.outstandingGetCount_--,this.outstandingGetCount_===0&&(this.outstandingGets_=[]),r.onComplete&&r.onComplete(n)})}sendListen_(t){const r=t.query,n=r._path.toString(),o=r._queryIdentifier;this.log_("Listen on "+n+" for "+o);const a={p:n},s="q";t.tag&&(a.q=r._queryObject,a.t=t.tag),a.h=t.hashFn(),this.sendRequest(s,a,l=>{const c=l.d,u=l.s;cd.warnOnListenWarnings_(c,r),(this.listens.get(n)&&this.listens.get(n).get(o))===t&&(this.log_("listen response",l),u!=="ok"&&this.removeListen_(n,o),t.onComplete&&t.onComplete(u,c))})}static warnOnListenWarnings_(t,r){if(t&&typeof t=="object"&&Cd(t,"w")){const n=Qm(t,"w");if(Array.isArray(n)&&~n.indexOf("no_index")){const o='".indexOn": "'+r._queryParams.getIndex().toString()+'"',a=r._path.toString();Xs(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${o} at ${a} to your security rules for better performance.`)}}}refreshAuthToken(t){this.authToken_=t,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(t)}reduceReconnectDelayIfAdminCredential_(t){(t&&t.length===40||X_e(t))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=bB)}refreshAppCheckToken(t){this.appCheckToken_=t,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){const t=this.authToken_,r=Q_e(t)?"auth":"gauth",n={cred:t};this.authOverride_===null?n.noauth=!0:typeof this.authOverride_=="object"&&(n.authvar=this.authOverride_),this.sendRequest(r,n,o=>{const a=o.s,s=o.d||"error";this.authToken_===t&&(a==="ok"?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(a,s))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},t=>{const r=t.s,n=t.d||"error";r==="ok"?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(r,n)})}unlisten(t,r){const n=t._path.toString(),o=t._queryIdentifier;this.log_("Unlisten called for "+n+" "+o),Wt(t._queryParams.isDefault()||!t._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(n,o)&&this.connected_&&this.sendUnlisten_(n,o,t._queryObject,r)}sendUnlisten_(t,r,n,o){this.log_("Unlisten on "+t+" for "+r);const a={p:t},s="n";o&&(a.q=n,a.t=o),this.sendRequest(s,a)}onDisconnectPut(t,r,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",t,r,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"o",data:r,onComplete:n})}onDisconnectMerge(t,r,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",t,r,n):this.onDisconnectRequestQueue_.push({pathString:t,action:"om",data:r,onComplete:n})}onDisconnectCancel(t,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",t,null,r):this.onDisconnectRequestQueue_.push({pathString:t,action:"oc",data:null,onComplete:r})}sendOnDisconnect_(t,r,n,o){const a={p:r,d:n};this.log_("onDisconnect "+t,a),this.sendRequest(t,a,s=>{o&&setTimeout(()=>{o(s.s,s.d)},Math.floor(0))})}put(t,r,n,o){this.putInternal("p",t,r,n,o)}merge(t,r,n,o){this.putInternal("m",t,r,n,o)}putInternal(t,r,n,o,a){this.initConnection_();const s={p:r,d:n};a!==void 0&&(s.h=a),this.outstandingPuts_.push({action:t,request:s,onComplete:o}),this.outstandingPutCount_++;const l=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(l):this.log_("Buffering put: "+r)}sendPut_(t){const r=this.outstandingPuts_[t].action,n=this.outstandingPuts_[t].request,o=this.outstandingPuts_[t].onComplete;this.outstandingPuts_[t].queued=this.connected_,this.sendRequest(r,n,a=>{this.log_(r+" response",a),delete this.outstandingPuts_[t],this.outstandingPutCount_--,this.outstandingPutCount_===0&&(this.outstandingPuts_=[]),o&&o(a.s,a.d)})}reportStats(t){if(this.connected_){const r={c:t};this.log_("reportStats",r),this.sendRequest("s",r,n=>{if(n.s!=="ok"){const a=n.d;this.log_("reportStats","Error sending stats: "+a)}})}}onDataMessage_(t){if("r"in t){this.log_("from server: "+Mo(t));const r=t.r,n=this.requestCBHash_[r];n&&(delete this.requestCBHash_[r],n(t.b))}else{if("error"in t)throw"A server-side error has occurred: "+t.error;"a"in t&&this.onDataPush_(t.a,t.b)}}onDataPush_(t,r){this.log_("handleServerMessage",t,r),t==="d"?this.onDataUpdate_(r.p,r.d,!1,r.t):t==="m"?this.onDataUpdate_(r.p,r.d,!0,r.t):t==="c"?this.onListenRevoked_(r.p,r.q):t==="ac"?this.onAuthRevoked_(r.s,r.d):t==="apc"?this.onAppCheckRevoked_(r.s,r.d):t==="sd"?this.onSecurityDebugPacket_(r):$A("Unrecognized action received from server: "+Mo(t)+`
|
||
Are you using the latest client?`)}onReady_(t,r){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(t),this.lastSessionId=r,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(t){Wt(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(t))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(t){t&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=by,this.realtime_||this.scheduleConnect_(0)),this.visible_=t}onOnline_(t){t?(this.log_("Browser went online."),this.reconnectDelay_=by,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){this.visible_?this.lastConnectionEstablishedTime_&&(new Date().getTime()-this.lastConnectionEstablishedTime_>l3e&&(this.reconnectDelay_=by),this.lastConnectionEstablishedTime_=null):(this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=new Date().getTime());const t=Math.max(0,new Date().getTime()-this.lastConnectionAttemptTime_);let r=Math.max(0,this.reconnectDelay_-t);r=Math.random()*r,this.log_("Trying to reconnect in "+r+"ms"),this.scheduleConnect_(r),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*s3e)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=new Date().getTime(),this.lastConnectionEstablishedTime_=null;const t=this.onDataMessage_.bind(this),r=this.onReady_.bind(this),n=this.onRealtimeDisconnect_.bind(this),o=this.id+":"+cd.nextConnectionId_++,a=this.lastSessionId;let s=!1,l=null;const c=function(){l?l.close():(s=!0,n())},u=function(f){Wt(l,"sendRequest call when we're not connected not allowed."),l.sendRequest(f)};this.realtime_={close:c,sendRequest:u};const d=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{const[f,h]=await Promise.all([this.authTokenProvider_.getToken(d),this.appCheckTokenProvider_.getToken(d)]);s?ga("getToken() completed but was canceled"):(ga("getToken() completed. Creating connection."),this.authToken_=f&&f.accessToken,this.appCheckToken_=h&&h.token,l=new t3e(o,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,t,r,n,p=>{Xs(p+" ("+this.repoInfo_.toString()+")"),this.interrupt(c3e)},a))}catch(f){this.log_("Failed to get token: "+f),s||(this.repoInfo_.nodeAdmin&&Xs(f),c())}}}interrupt(t){ga("Interrupting connection for reason: "+t),this.interruptReasons_[t]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(t){ga("Resuming connection for reason: "+t),delete this.interruptReasons_[t],K7(this.interruptReasons_)&&(this.reconnectDelay_=by,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(t){const r=t-new Date().getTime();this.onServerInfoUpdate_({serverTimeOffset:r})}cancelSentTransactions_(){for(let t=0;t<this.outstandingPuts_.length;t++){const r=this.outstandingPuts_[t];r&&"h"in r.request&&r.queued&&(r.onComplete&&r.onComplete("disconnect"),delete this.outstandingPuts_[t],this.outstandingPutCount_--)}this.outstandingPutCount_===0&&(this.outstandingPuts_=[])}onListenRevoked_(t,r){let n;r?n=r.map(a=>UP(a)).join("$"):n="default";const o=this.removeListen_(t,n);o&&o.onComplete&&o.onComplete("permission_denied")}removeListen_(t,r){const n=new Wn(t).toString();let o;if(this.listens.has(n)){const a=this.listens.get(n);o=a.get(r),a.delete(r),a.size===0&&this.listens.delete(n)}else o=void 0;return o}onAuthRevoked_(t,r){ga("Auth token revoked: "+t+"/"+r),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),(t==="invalid_token"||t==="permission_denied")&&(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=wB&&(this.reconnectDelay_=bB,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(t,r){ga("App check token revoked: "+t+"/"+r),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(t==="invalid_token"||t==="permission_denied")&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=wB&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(t){this.securityDebugCallback_?this.securityDebugCallback_(t):"msg"in t&&console.log("FIREBASE: "+t.msg.replace(`
|
||
`,`
|
||
FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const t of this.listens.values())for(const r of t.values())this.sendListen_(r);for(let t=0;t<this.outstandingPuts_.length;t++)this.outstandingPuts_[t]&&this.sendPut_(t);for(;this.onDisconnectRequestQueue_.length;){const t=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(t.action,t.pathString,t.data,t.onComplete)}for(let t=0;t<this.outstandingGets_.length;t++)this.outstandingGets_[t]&&this.sendGet_(t)}sendConnectStats_(){const t={};let r="js";t["sdk."+r+"."+VG.replace(/\./g,"-")]=1,FG()?t["framework.cordova"]=1:$_e()&&(t["framework.reactnative"]=1),this.reportStats(t)}shouldReconnect_(){const t=rw.getInstance().currentlyOnline();return K7(this.interruptReasons_)&&t}}cd.nextPersistentConnectionId_=0;cd.nextConnectionId_=0;/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class qr{constructor(t,r){this.name=t,this.node=r}static Wrap(t,r){return new qr(t,r)}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class AS{getCompare(){return this.compare.bind(this)}indexedValueChanged(t,r){const n=new qr(Xm,t),o=new qr(Xm,r);return this.compare(n,o)!==0}minPost(){return qr.MIN}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/let J1;class bK extends AS{static get __EMPTY_NODE(){return J1}static set __EMPTY_NODE(t){J1=t}compare(t,r){return Cv(t.name,r.name)}isDefinedOn(t){throw _v("KeyIndex.isDefinedOn not expected to be called.")}indexedValueChanged(t,r){return!1}minPost(){return qr.MIN}maxPost(){return new qr(wh,J1)}makePost(t,r){return Wt(typeof t=="string","KeyIndex indexValue must always be a string."),new qr(t,J1)}toString(){return".key"}}const sm=new bK;/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class e0{constructor(t,r,n,o,a=null){this.isReverse_=o,this.resultGenerator_=a,this.nodeStack_=[];let s=1;for(;!t.isEmpty();)if(t=t,s=r?n(t.key,r):1,o&&(s*=-1),s<0)this.isReverse_?t=t.left:t=t.right;else if(s===0){this.nodeStack_.push(t);break}else this.nodeStack_.push(t),this.isReverse_?t=t.right:t=t.left}getNext(){if(this.nodeStack_.length===0)return null;let t=this.nodeStack_.pop(),r;if(this.resultGenerator_?r=this.resultGenerator_(t.key,t.value):r={key:t.key,value:t.value},this.isReverse_)for(t=t.left;!t.isEmpty();)this.nodeStack_.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack_.push(t),t=t.left;return r}hasNext(){return this.nodeStack_.length>0}peek(){if(this.nodeStack_.length===0)return null;const t=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(t.key,t.value):{key:t.key,value:t.value}}}class Ro{constructor(t,r,n,o,a){this.key=t,this.value=r,this.color=n??Ro.RED,this.left=o??fs.EMPTY_NODE,this.right=a??fs.EMPTY_NODE}copy(t,r,n,o,a){return new Ro(t??this.key,r??this.value,n??this.color,o??this.left,a??this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(t){return this.left.inorderTraversal(t)||!!t(this.key,this.value)||this.right.inorderTraversal(t)}reverseTraversal(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(t,r,n){let o=this;const a=n(t,o.key);return a<0?o=o.copy(null,null,null,o.left.insert(t,r,n),null):a===0?o=o.copy(null,r,null,null,null):o=o.copy(null,null,null,null,o.right.insert(t,r,n)),o.fixUp_()}removeMin_(){if(this.left.isEmpty())return fs.EMPTY_NODE;let t=this;return!t.left.isRed_()&&!t.left.left.isRed_()&&(t=t.moveRedLeft_()),t=t.copy(null,null,null,t.left.removeMin_(),null),t.fixUp_()}remove(t,r){let n,o;if(n=this,r(t,n.key)<0)!n.left.isEmpty()&&!n.left.isRed_()&&!n.left.left.isRed_()&&(n=n.moveRedLeft_()),n=n.copy(null,null,null,n.left.remove(t,r),null);else{if(n.left.isRed_()&&(n=n.rotateRight_()),!n.right.isEmpty()&&!n.right.isRed_()&&!n.right.left.isRed_()&&(n=n.moveRedRight_()),r(t,n.key)===0){if(n.right.isEmpty())return fs.EMPTY_NODE;o=n.right.min_(),n=n.copy(o.key,o.value,null,null,n.right.removeMin_())}n=n.copy(null,null,null,null,n.right.remove(t,r))}return n.fixUp_()}isRed_(){return this.color}fixUp_(){let t=this;return t.right.isRed_()&&!t.left.isRed_()&&(t=t.rotateLeft_()),t.left.isRed_()&&t.left.left.isRed_()&&(t=t.rotateRight_()),t.left.isRed_()&&t.right.isRed_()&&(t=t.colorFlip_()),t}moveRedLeft_(){let t=this.colorFlip_();return t.right.left.isRed_()&&(t=t.copy(null,null,null,null,t.right.rotateRight_()),t=t.rotateLeft_(),t=t.colorFlip_()),t}moveRedRight_(){let t=this.colorFlip_();return t.left.left.isRed_()&&(t=t.rotateRight_(),t=t.colorFlip_()),t}rotateLeft_(){const t=this.copy(null,null,Ro.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight_(){const t=this.copy(null,null,Ro.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip_(){const t=this.left.copy(null,null,!this.left.color,null,null),r=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,r)}checkMaxDepth_(){const t=this.check_();return Math.pow(2,t)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");const t=this.left.check_();if(t!==this.right.check_())throw new Error("Black depths differ");return t+(this.isRed_()?0:1)}}Ro.RED=!0;Ro.BLACK=!1;class u3e{copy(t,r,n,o,a){return this}insert(t,r,n){return new Ro(t,r,null)}remove(t,r){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(t){return!1}reverseTraversal(t){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}}class fs{constructor(t,r=fs.EMPTY_NODE){this.comparator_=t,this.root_=r}insert(t,r){return new fs(this.comparator_,this.root_.insert(t,r,this.comparator_).copy(null,null,Ro.BLACK,null,null))}remove(t){return new fs(this.comparator_,this.root_.remove(t,this.comparator_).copy(null,null,Ro.BLACK,null,null))}get(t){let r,n=this.root_;for(;!n.isEmpty();){if(r=this.comparator_(t,n.key),r===0)return n.value;r<0?n=n.left:r>0&&(n=n.right)}return null}getPredecessorKey(t){let r,n=this.root_,o=null;for(;!n.isEmpty();)if(r=this.comparator_(t,n.key),r===0){if(n.left.isEmpty())return o?o.key:null;for(n=n.left;!n.right.isEmpty();)n=n.right;return n.key}else r<0?n=n.left:r>0&&(o=n,n=n.right);throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(t){return this.root_.inorderTraversal(t)}reverseTraversal(t){return this.root_.reverseTraversal(t)}getIterator(t){return new e0(this.root_,null,this.comparator_,!1,t)}getIteratorFrom(t,r){return new e0(this.root_,t,this.comparator_,!1,r)}getReverseIteratorFrom(t,r){return new e0(this.root_,t,this.comparator_,!0,r)}getReverseIterator(t){return new e0(this.root_,null,this.comparator_,!0,t)}}fs.EMPTY_NODE=new u3e;/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function d3e(e,t){return Cv(e.name,t.name)}function QP(e,t){return Cv(e,t)}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/let HA;function f3e(e){HA=e}const wK=function(e){return typeof e=="number"?"number:"+XG(e):"string:"+e},SK=function(e){if(e.isLeafNode()){const t=e.val();Wt(typeof t=="string"||typeof t=="number"||typeof t=="object"&&Cd(t,".sv"),"Priority must be a string or number.")}else Wt(e===HA||e.isEmpty(),"priority of unexpected type.");Wt(e===HA||e.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/let SB;class Oo{static set __childrenNodeConstructor(t){SB=t}static get __childrenNodeConstructor(){return SB}constructor(t,r=Oo.__childrenNodeConstructor.EMPTY_NODE){this.value_=t,this.priorityNode_=r,this.lazyHash_=null,Wt(this.value_!==void 0&&this.value_!==null,"LeafNode shouldn't be created with null/undefined value."),SK(this.priorityNode_)}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(t){return new Oo(this.value_,t)}getImmediateChild(t){return t===".priority"?this.priorityNode_:Oo.__childrenNodeConstructor.EMPTY_NODE}getChild(t){return Yr(t)?this:Vr(t)===".priority"?this.priorityNode_:Oo.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(t,r){return null}updateImmediateChild(t,r){return t===".priority"?this.updatePriority(r):r.isEmpty()&&t!==".priority"?this:Oo.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(t,r).updatePriority(this.priorityNode_)}updateChild(t,r){const n=Vr(t);return n===null?r:r.isEmpty()&&n!==".priority"?this:(Wt(n!==".priority"||zf(t)===1,".priority must be the last token in a path"),this.updateImmediateChild(n,Oo.__childrenNodeConstructor.EMPTY_NODE.updateChild(Gn(t),r)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(t,r){return!1}val(t){return t&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(this.lazyHash_===null){let t="";this.priorityNode_.isEmpty()||(t+="priority:"+wK(this.priorityNode_.val())+":");const r=typeof this.value_;t+=r+":",r==="number"?t+=XG(this.value_):t+=this.value_,this.lazyHash_=GG(t)}return this.lazyHash_}getValue(){return this.value_}compareTo(t){return t===Oo.__childrenNodeConstructor.EMPTY_NODE?1:t instanceof Oo.__childrenNodeConstructor?-1:(Wt(t.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(t))}compareToLeafNode_(t){const r=typeof t.value_,n=typeof this.value_,o=Oo.VALUE_TYPE_ORDER.indexOf(r),a=Oo.VALUE_TYPE_ORDER.indexOf(n);return Wt(o>=0,"Unknown leaf type: "+r),Wt(a>=0,"Unknown leaf type: "+n),o===a?n==="object"?0:this.value_<t.value_?-1:this.value_===t.value_?0:1:a-o}withIndex(){return this}isIndexed(){return!0}equals(t){if(t===this)return!0;if(t.isLeafNode()){const r=t;return this.value_===r.value_&&this.priorityNode_.equals(r.priorityNode_)}else return!1}}Oo.VALUE_TYPE_ORDER=["object","boolean","number","string"];/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/let jK,kK;function p3e(e){jK=e}function h3e(e){kK=e}class g3e extends AS{compare(t,r){const n=t.node.getPriority(),o=r.node.getPriority(),a=n.compareTo(o);return a===0?Cv(t.name,r.name):a}isDefinedOn(t){return!t.getPriority().isEmpty()}indexedValueChanged(t,r){return!t.getPriority().equals(r.getPriority())}minPost(){return qr.MIN}maxPost(){return new qr(wh,new Oo("[PRIORITY-POST]",kK))}makePost(t,r){const n=jK(t);return new qr(r,new Oo("[PRIORITY-POST]",n))}toString(){return".priority"}}const Ti=new g3e;/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const m3e=Math.log(2);class v3e{constructor(t){const r=a=>parseInt(Math.log(a)/m3e,10),n=a=>parseInt(Array(a+1).join("1"),2);this.count=r(t+1),this.current_=this.count-1;const o=n(this.count);this.bits_=t+1&o}nextBitIsOne(){const t=!(this.bits_&1<<this.current_);return this.current_--,t}}const nw=function(e,t,r,n){e.sort(t);const o=function(c,u){const d=u-c;let f,h;if(d===0)return null;if(d===1)return f=e[c],h=r?r(f):f,new Ro(h,f.node,Ro.BLACK,null,null);{const p=parseInt(d/2,10)+c,y=o(c,p),m=o(p+1,u);return f=e[p],h=r?r(f):f,new Ro(h,f.node,Ro.BLACK,y,m)}},a=function(c){let u=null,d=null,f=e.length;const h=function(y,m){const x=f-y,b=f;f-=y;const w=o(x+1,b),k=e[x],S=r?r(k):k;p(new Ro(S,k.node,m,null,w))},p=function(y){u?(u.left=y,u=y):(d=y,u=y)};for(let y=0;y<c.count;++y){const m=c.nextBitIsOne(),x=Math.pow(2,c.count-(y+1));m?h(x,Ro.BLACK):(h(x,Ro.BLACK),h(x,Ro.RED))}return d},s=new v3e(e.length),l=a(s);return new fs(n||t,l)};/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/let V4;const Pg={};class rd{static get Default(){return Wt(Pg&&Ti,"ChildrenNode.ts has not been loaded"),V4=V4||new rd({".priority":Pg},{".priority":Ti}),V4}constructor(t,r){this.indexes_=t,this.indexSet_=r}get(t){const r=Qm(this.indexes_,t);if(!r)throw new Error("No index defined for "+t);return r instanceof fs?r:null}hasIndex(t){return Cd(this.indexSet_,t.toString())}addIndex(t,r){Wt(t!==sm,"KeyIndex always exists and isn't meant to be added to the IndexMap.");const n=[];let o=!1;const a=r.getIterator(qr.Wrap);let s=a.getNext();for(;s;)o=o||t.isDefinedOn(s.node),n.push(s),s=a.getNext();let l;o?l=nw(n,t.getCompare()):l=Pg;const c=t.toString(),u=Object.assign({},this.indexSet_);u[c]=t;const d=Object.assign({},this.indexes_);return d[c]=l,new rd(d,u)}addToIndexes(t,r){const n=Z2(this.indexes_,(o,a)=>{const s=Qm(this.indexSet_,a);if(Wt(s,"Missing index implementation for "+a),o===Pg)if(s.isDefinedOn(t.node)){const l=[],c=r.getIterator(qr.Wrap);let u=c.getNext();for(;u;)u.name!==t.name&&l.push(u),u=c.getNext();return l.push(t),nw(l,s.getCompare())}else return Pg;else{const l=r.get(t.name);let c=o;return l&&(c=c.remove(new qr(t.name,l))),c.insert(t,t.node)}});return new rd(n,this.indexSet_)}removeFromIndexes(t,r){const n=Z2(this.indexes_,o=>{if(o===Pg)return o;{const a=r.get(t.name);return a?o.remove(new qr(t.name,a)):o}});return new rd(n,this.indexSet_)}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/let wy;class kr{static get EMPTY_NODE(){return wy||(wy=new kr(new fs(QP),null,rd.Default))}constructor(t,r,n){this.children_=t,this.priorityNode_=r,this.indexMap_=n,this.lazyHash_=null,this.priorityNode_&&SK(this.priorityNode_),this.children_.isEmpty()&&Wt(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}isLeafNode(){return!1}getPriority(){return this.priorityNode_||wy}updatePriority(t){return this.children_.isEmpty()?this:new kr(this.children_,t,this.indexMap_)}getImmediateChild(t){if(t===".priority")return this.getPriority();{const r=this.children_.get(t);return r===null?wy:r}}getChild(t){const r=Vr(t);return r===null?this:this.getImmediateChild(r).getChild(Gn(t))}hasChild(t){return this.children_.get(t)!==null}updateImmediateChild(t,r){if(Wt(r,"We should always be passing snapshot nodes"),t===".priority")return this.updatePriority(r);{const n=new qr(t,r);let o,a;r.isEmpty()?(o=this.children_.remove(t),a=this.indexMap_.removeFromIndexes(n,this.children_)):(o=this.children_.insert(t,r),a=this.indexMap_.addToIndexes(n,this.children_));const s=o.isEmpty()?wy:this.priorityNode_;return new kr(o,s,a)}}updateChild(t,r){const n=Vr(t);if(n===null)return r;{Wt(Vr(t)!==".priority"||zf(t)===1,".priority must be the last token in a path");const o=this.getImmediateChild(n).updateChild(Gn(t),r);return this.updateImmediateChild(n,o)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(t){if(this.isEmpty())return null;const r={};let n=0,o=0,a=!0;if(this.forEachChild(Ti,(s,l)=>{r[s]=l.val(t),n++,a&&kr.INTEGER_REGEXP_.test(s)?o=Math.max(o,Number(s)):a=!1}),!t&&a&&o<2*n){const s=[];for(const l in r)s[l]=r[l];return s}else return t&&!this.getPriority().isEmpty()&&(r[".priority"]=this.getPriority().val()),r}hash(){if(this.lazyHash_===null){let t="";this.getPriority().isEmpty()||(t+="priority:"+wK(this.getPriority().val())+":"),this.forEachChild(Ti,(r,n)=>{const o=n.hash();o!==""&&(t+=":"+r+":"+o)}),this.lazyHash_=t===""?"":GG(t)}return this.lazyHash_}getPredecessorChildName(t,r,n){const o=this.resolveIndex_(n);if(o){const a=o.getPredecessorKey(new qr(t,r));return a?a.name:null}else return this.children_.getPredecessorKey(t)}getFirstChildName(t){const r=this.resolveIndex_(t);if(r){const n=r.minKey();return n&&n.name}else return this.children_.minKey()}getFirstChild(t){const r=this.getFirstChildName(t);return r?new qr(r,this.children_.get(r)):null}getLastChildName(t){const r=this.resolveIndex_(t);if(r){const n=r.maxKey();return n&&n.name}else return this.children_.maxKey()}getLastChild(t){const r=this.getLastChildName(t);return r?new qr(r,this.children_.get(r)):null}forEachChild(t,r){const n=this.resolveIndex_(t);return n?n.inorderTraversal(o=>r(o.name,o.node)):this.children_.inorderTraversal(r)}getIterator(t){return this.getIteratorFrom(t.minPost(),t)}getIteratorFrom(t,r){const n=this.resolveIndex_(r);if(n)return n.getIteratorFrom(t,o=>o);{const o=this.children_.getIteratorFrom(t.name,qr.Wrap);let a=o.peek();for(;a!=null&&r.compare(a,t)<0;)o.getNext(),a=o.peek();return o}}getReverseIterator(t){return this.getReverseIteratorFrom(t.maxPost(),t)}getReverseIteratorFrom(t,r){const n=this.resolveIndex_(r);if(n)return n.getReverseIteratorFrom(t,o=>o);{const o=this.children_.getReverseIteratorFrom(t.name,qr.Wrap);let a=o.peek();for(;a!=null&&r.compare(a,t)>0;)o.getNext(),a=o.peek();return o}}compareTo(t){return this.isEmpty()?t.isEmpty()?0:-1:t.isLeafNode()||t.isEmpty()?1:t===Pb?-1:0}withIndex(t){if(t===sm||this.indexMap_.hasIndex(t))return this;{const r=this.indexMap_.addIndex(t,this.children_);return new kr(this.children_,this.priorityNode_,r)}}isIndexed(t){return t===sm||this.indexMap_.hasIndex(t)}equals(t){if(t===this)return!0;if(t.isLeafNode())return!1;{const r=t;if(this.getPriority().equals(r.getPriority()))if(this.children_.count()===r.children_.count()){const n=this.getIterator(Ti),o=r.getIterator(Ti);let a=n.getNext(),s=o.getNext();for(;a&&s;){if(a.name!==s.name||!a.node.equals(s.node))return!1;a=n.getNext(),s=o.getNext()}return a===null&&s===null}else return!1;else return!1}}resolveIndex_(t){return t===sm?null:this.indexMap_.get(t.toString())}}kr.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/;class y3e extends kr{constructor(){super(new fs(QP),kr.EMPTY_NODE,rd.Default)}compareTo(t){return t===this?0:1}equals(t){return t===this}getPriority(){return this}getImmediateChild(t){return kr.EMPTY_NODE}isEmpty(){return!1}}const Pb=new y3e;Object.defineProperties(qr,{MIN:{value:new qr(Xm,kr.EMPTY_NODE)},MAX:{value:new qr(wh,Pb)}});bK.__EMPTY_NODE=kr.EMPTY_NODE;Oo.__childrenNodeConstructor=kr;f3e(Pb);h3e(Pb);/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const x3e=!0;function ma(e,t=null){if(e===null)return kr.EMPTY_NODE;if(typeof e=="object"&&".priority"in e&&(t=e[".priority"]),Wt(t===null||typeof t=="string"||typeof t=="number"||typeof t=="object"&&".sv"in t,"Invalid priority type found: "+typeof t),typeof e=="object"&&".value"in e&&e[".value"]!==null&&(e=e[".value"]),typeof e!="object"||".sv"in e){const r=e;return new Oo(r,ma(t))}if(!(e instanceof Array)&&x3e){const r=[];let n=!1;if(gs(e,(s,l)=>{if(s.substring(0,1)!=="."){const c=ma(l);c.isEmpty()||(n=n||!c.getPriority().isEmpty(),r.push(new qr(s,c)))}}),r.length===0)return kr.EMPTY_NODE;const a=nw(r,d3e,s=>s.name,QP);if(n){const s=nw(r,Ti.getCompare());return new kr(a,ma(t),new rd({".priority":s},{".priority":Ti}))}else return new kr(a,ma(t),rd.Default)}else{let r=kr.EMPTY_NODE;return gs(e,(n,o)=>{if(Cd(e,n)&&n.substring(0,1)!=="."){const a=ma(o);(a.isLeafNode()||!a.isEmpty())&&(r=r.updateImmediateChild(n,a))}}),r.updatePriority(ma(t))}}p3e(ma);/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class b3e extends AS{constructor(t){super(),this.indexPath_=t,Wt(!Yr(t)&&Vr(t)!==".priority","Can't create PathIndex with empty path or .priority key")}extractChild(t){return t.getChild(this.indexPath_)}isDefinedOn(t){return!t.getChild(this.indexPath_).isEmpty()}compare(t,r){const n=this.extractChild(t.node),o=this.extractChild(r.node),a=n.compareTo(o);return a===0?Cv(t.name,r.name):a}makePost(t,r){const n=ma(t),o=kr.EMPTY_NODE.updateChild(this.indexPath_,n);return new qr(r,o)}maxPost(){const t=kr.EMPTY_NODE.updateChild(this.indexPath_,Pb);return new qr(wh,t)}toString(){return vK(this.indexPath_,0).join("/")}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class w3e extends AS{compare(t,r){const n=t.node.compareTo(r.node);return n===0?Cv(t.name,r.name):n}isDefinedOn(t){return!0}indexedValueChanged(t,r){return!t.equals(r)}minPost(){return qr.MIN}maxPost(){return qr.MAX}makePost(t,r){const n=ma(t);return new qr(r,n)}toString(){return".value"}}const S3e=new w3e;/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function _K(e){return{type:"value",snapshotNode:e}}function Zm(e,t){return{type:"child_added",snapshotNode:t,childName:e}}function Kx(e,t){return{type:"child_removed",snapshotNode:t,childName:e}}function Qx(e,t,r){return{type:"child_changed",snapshotNode:t,childName:e,oldSnap:r}}function j3e(e,t){return{type:"child_moved",snapshotNode:t,childName:e}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class XP{constructor(t){this.index_=t}updateChild(t,r,n,o,a,s){Wt(t.isIndexed(this.index_),"A node must be indexed if only a child is updated");const l=t.getImmediateChild(r);return l.getChild(o).equals(n.getChild(o))&&l.isEmpty()===n.isEmpty()||(s!=null&&(n.isEmpty()?t.hasChild(r)?s.trackChildChange(Kx(r,l)):Wt(t.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):l.isEmpty()?s.trackChildChange(Zm(r,n)):s.trackChildChange(Qx(r,n,l))),t.isLeafNode()&&n.isEmpty())?t:t.updateImmediateChild(r,n).withIndex(this.index_)}updateFullNode(t,r,n){return n!=null&&(t.isLeafNode()||t.forEachChild(Ti,(o,a)=>{r.hasChild(o)||n.trackChildChange(Kx(o,a))}),r.isLeafNode()||r.forEachChild(Ti,(o,a)=>{if(t.hasChild(o)){const s=t.getImmediateChild(o);s.equals(a)||n.trackChildChange(Qx(o,a,s))}else n.trackChildChange(Zm(o,a))})),r.withIndex(this.index_)}updatePriority(t,r){return t.isEmpty()?kr.EMPTY_NODE:t.updatePriority(r)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class Xx{constructor(t){this.indexedFilter_=new XP(t.getIndex()),this.index_=t.getIndex(),this.startPost_=Xx.getStartPost_(t),this.endPost_=Xx.getEndPost_(t),this.startIsInclusive_=!t.startAfterSet_,this.endIsInclusive_=!t.endBeforeSet_}getStartPost(){return this.startPost_}getEndPost(){return this.endPost_}matches(t){const r=this.startIsInclusive_?this.index_.compare(this.getStartPost(),t)<=0:this.index_.compare(this.getStartPost(),t)<0,n=this.endIsInclusive_?this.index_.compare(t,this.getEndPost())<=0:this.index_.compare(t,this.getEndPost())<0;return r&&n}updateChild(t,r,n,o,a,s){return this.matches(new qr(r,n))||(n=kr.EMPTY_NODE),this.indexedFilter_.updateChild(t,r,n,o,a,s)}updateFullNode(t,r,n){r.isLeafNode()&&(r=kr.EMPTY_NODE);let o=r.withIndex(this.index_);o=o.updatePriority(kr.EMPTY_NODE);const a=this;return r.forEachChild(Ti,(s,l)=>{a.matches(new qr(s,l))||(o=o.updateImmediateChild(s,kr.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(t,o,n)}updatePriority(t,r){return t}filtersNodes(){return!0}getIndexedFilter(){return this.indexedFilter_}getIndex(){return this.index_}static getStartPost_(t){if(t.hasStart()){const r=t.getIndexStartName();return t.getIndex().makePost(t.getIndexStartValue(),r)}else return t.getIndex().minPost()}static getEndPost_(t){if(t.hasEnd()){const r=t.getIndexEndName();return t.getIndex().makePost(t.getIndexEndValue(),r)}else return t.getIndex().maxPost()}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class k3e{constructor(t){this.withinDirectionalStart=r=>this.reverse_?this.withinEndPost(r):this.withinStartPost(r),this.withinDirectionalEnd=r=>this.reverse_?this.withinStartPost(r):this.withinEndPost(r),this.withinStartPost=r=>{const n=this.index_.compare(this.rangedFilter_.getStartPost(),r);return this.startIsInclusive_?n<=0:n<0},this.withinEndPost=r=>{const n=this.index_.compare(r,this.rangedFilter_.getEndPost());return this.endIsInclusive_?n<=0:n<0},this.rangedFilter_=new Xx(t),this.index_=t.getIndex(),this.limit_=t.getLimit(),this.reverse_=!t.isViewFromLeft(),this.startIsInclusive_=!t.startAfterSet_,this.endIsInclusive_=!t.endBeforeSet_}updateChild(t,r,n,o,a,s){return this.rangedFilter_.matches(new qr(r,n))||(n=kr.EMPTY_NODE),t.getImmediateChild(r).equals(n)?t:t.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(t,r,n,o,a,s):this.fullLimitUpdateChild_(t,r,n,a,s)}updateFullNode(t,r,n){let o;if(r.isLeafNode()||r.isEmpty())o=kr.EMPTY_NODE.withIndex(this.index_);else if(this.limit_*2<r.numChildren()&&r.isIndexed(this.index_)){o=kr.EMPTY_NODE.withIndex(this.index_);let a;this.reverse_?a=r.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):a=r.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);let s=0;for(;a.hasNext()&&s<this.limit_;){const l=a.getNext();if(this.withinDirectionalStart(l))if(this.withinDirectionalEnd(l))o=o.updateImmediateChild(l.name,l.node),s++;else break;else continue}}else{o=r.withIndex(this.index_),o=o.updatePriority(kr.EMPTY_NODE);let a;this.reverse_?a=o.getReverseIterator(this.index_):a=o.getIterator(this.index_);let s=0;for(;a.hasNext();){const l=a.getNext();s<this.limit_&&this.withinDirectionalStart(l)&&this.withinDirectionalEnd(l)?s++:o=o.updateImmediateChild(l.name,kr.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(t,o,n)}updatePriority(t,r){return t}filtersNodes(){return!0}getIndexedFilter(){return this.rangedFilter_.getIndexedFilter()}getIndex(){return this.index_}fullLimitUpdateChild_(t,r,n,o,a){let s;if(this.reverse_){const f=this.index_.getCompare();s=(h,p)=>f(p,h)}else s=this.index_.getCompare();const l=t;Wt(l.numChildren()===this.limit_,"");const c=new qr(r,n),u=this.reverse_?l.getFirstChild(this.index_):l.getLastChild(this.index_),d=this.rangedFilter_.matches(c);if(l.hasChild(r)){const f=l.getImmediateChild(r);let h=o.getChildAfterChild(this.index_,u,this.reverse_);for(;h!=null&&(h.name===r||l.hasChild(h.name));)h=o.getChildAfterChild(this.index_,h,this.reverse_);const p=h==null?1:s(h,c);if(d&&!n.isEmpty()&&p>=0)return a!=null&&a.trackChildChange(Qx(r,n,f)),l.updateImmediateChild(r,n);{a!=null&&a.trackChildChange(Kx(r,f));const m=l.updateImmediateChild(r,kr.EMPTY_NODE);return h!=null&&this.rangedFilter_.matches(h)?(a!=null&&a.trackChildChange(Zm(h.name,h.node)),m.updateImmediateChild(h.name,h.node)):m}}else return n.isEmpty()?t:d&&s(u,c)>=0?(a!=null&&(a.trackChildChange(Kx(u.name,u.node)),a.trackChildChange(Zm(r,n))),l.updateImmediateChild(r,n).updateImmediateChild(u.name,kr.EMPTY_NODE)):t}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class ZP{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=Ti}hasStart(){return this.startSet_}isViewFromLeft(){return this.viewFrom_===""?this.startSet_:this.viewFrom_==="l"}getIndexStartValue(){return Wt(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return Wt(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:Xm}hasEnd(){return this.endSet_}getIndexEndValue(){return Wt(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return Wt(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:wh}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&this.viewFrom_!==""}getLimit(){return Wt(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===Ti}copy(){const t=new ZP;return t.limitSet_=this.limitSet_,t.limit_=this.limit_,t.startSet_=this.startSet_,t.startAfterSet_=this.startAfterSet_,t.indexStartValue_=this.indexStartValue_,t.startNameSet_=this.startNameSet_,t.indexStartName_=this.indexStartName_,t.endSet_=this.endSet_,t.endBeforeSet_=this.endBeforeSet_,t.indexEndValue_=this.indexEndValue_,t.endNameSet_=this.endNameSet_,t.indexEndName_=this.indexEndName_,t.index_=this.index_,t.viewFrom_=this.viewFrom_,t}}function _3e(e){return e.loadsAllData()?new XP(e.getIndex()):e.hasLimit()?new k3e(e):new Xx(e)}function jB(e){const t={};if(e.isDefault())return t;let r;if(e.index_===Ti?r="$priority":e.index_===S3e?r="$value":e.index_===sm?r="$key":(Wt(e.index_ instanceof b3e,"Unrecognized index type!"),r=e.index_.toString()),t.orderBy=Mo(r),e.startSet_){const n=e.startAfterSet_?"startAfter":"startAt";t[n]=Mo(e.indexStartValue_),e.startNameSet_&&(t[n]+=","+Mo(e.indexStartName_))}if(e.endSet_){const n=e.endBeforeSet_?"endBefore":"endAt";t[n]=Mo(e.indexEndValue_),e.endNameSet_&&(t[n]+=","+Mo(e.indexEndName_))}return e.limitSet_&&(e.isViewFromLeft()?t.limitToFirst=e.limit_:t.limitToLast=e.limit_),t}function kB(e){const t={};if(e.startSet_&&(t.sp=e.indexStartValue_,e.startNameSet_&&(t.sn=e.indexStartName_),t.sin=!e.startAfterSet_),e.endSet_&&(t.ep=e.indexEndValue_,e.endNameSet_&&(t.en=e.indexEndName_),t.ein=!e.endBeforeSet_),e.limitSet_){t.l=e.limit_;let r=e.viewFrom_;r===""&&(e.isViewFromLeft()?r="l":r="r"),t.vf=r}return e.index_!==Ti&&(t.i=e.index_.toString()),t}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class iw extends hK{reportStats(t){throw new Error("Method not implemented.")}static getListenId_(t,r){return r!==void 0?"tag$"+r:(Wt(t._queryParams.isDefault(),"should have a tag if it's not a default query."),t._path.toString())}constructor(t,r,n,o){super(),this.repoInfo_=t,this.onDataUpdate_=r,this.authTokenProvider_=n,this.appCheckTokenProvider_=o,this.log_=Ab("p:rest:"),this.listens_={}}listen(t,r,n,o){const a=t._path.toString();this.log_("Listen called for "+a+" "+t._queryIdentifier);const s=iw.getListenId_(t,n),l={};this.listens_[s]=l;const c=jB(t._queryParams);this.restRequest_(a+".json",c,(u,d)=>{let f=d;if(u===404&&(f=null,u=null),u===null&&this.onDataUpdate_(a,f,!1,n),Qm(this.listens_,s)===l){let h;u?u===401?h="permission_denied":h="rest_error:"+u:h="ok",o(h,null)}})}unlisten(t,r){const n=iw.getListenId_(t,r);delete this.listens_[n]}get(t){const r=jB(t._queryParams),n=t._path.toString(),o=new WP;return this.restRequest_(n+".json",r,(a,s)=>{let l=s;a===404&&(l=null,a=null),a===null?(this.onDataUpdate_(n,l,!1,null),o.resolve(l)):o.reject(new Error(l))}),o.promise}refreshAuthToken(t){}restRequest_(t,r={},n){return r.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([o,a])=>{o&&o.accessToken&&(r.auth=o.accessToken),a&&a.token&&(r.ac=a.token);const s=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+t+"?ns="+this.repoInfo_.namespace+Z_e(r);this.log_("Sending REST request for "+s);const l=new XMLHttpRequest;l.onreadystatechange=()=>{if(n&&l.readyState===4){this.log_("REST Response for "+s+" received. status:",l.status,"response:",l.responseText);let c=null;if(l.status>=200&&l.status<300){try{c=Ux(l.responseText)}catch{Xs("Failed to parse JSON response for "+s+": "+l.responseText)}n(null,c)}else l.status!==401&&l.status!==404&&Xs("Got unsuccessful REST response for "+s+" Status: "+l.status),n(l.status);n=null}},l.open("GET",s,!0),l.send()})}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class C3e{constructor(){this.rootNode_=kr.EMPTY_NODE}getNode(t){return this.rootNode_.getChild(t)}updateSnapshot(t,r){this.rootNode_=this.rootNode_.updateChild(t,r)}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function ow(){return{value:null,children:new Map}}function CK(e,t,r){if(Yr(t))e.value=r,e.children.clear();else if(e.value!==null)e.value=e.value.updateChild(t,r);else{const n=Vr(t);e.children.has(n)||e.children.set(n,ow());const o=e.children.get(n);t=Gn(t),CK(o,t,r)}}function VA(e,t,r){e.value!==null?r(t,e.value):E3e(e,(n,o)=>{const a=new Wn(t.toString()+"/"+n);VA(o,a,r)})}function E3e(e,t){e.children.forEach((r,n)=>{t(n,r)})}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class A3e{constructor(t){this.collection_=t,this.last_=null}get(){const t=this.collection_.get(),r=Object.assign({},t);return this.last_&&gs(this.last_,(n,o)=>{r[n]=r[n]-o}),this.last_=t,r}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const _B=10*1e3,T3e=30*1e3,P3e=300*1e3;class O3e{constructor(t,r){this.server_=r,this.statsToReport_={},this.statsListener_=new A3e(t);const n=_B+(T3e-_B)*Math.random();Ky(this.reportStats_.bind(this),Math.floor(n))}reportStats_(){const t=this.statsListener_.get(),r={};let n=!1;gs(t,(o,a)=>{a>0&&Cd(this.statsToReport_,o)&&(r[o]=a,n=!0)}),n&&this.server_.reportStats(r),Ky(this.reportStats_.bind(this),Math.floor(Math.random()*2*P3e))}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/var oc;(function(e){e[e.OVERWRITE=0]="OVERWRITE",e[e.MERGE=1]="MERGE",e[e.ACK_USER_WRITE=2]="ACK_USER_WRITE",e[e.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"})(oc||(oc={}));function EK(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function JP(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function e8(e){return{fromUser:!1,fromServer:!0,queryId:e,tagged:!0}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class aw{constructor(t,r,n){this.path=t,this.affectedTree=r,this.revert=n,this.type=oc.ACK_USER_WRITE,this.source=EK()}operationForChild(t){if(Yr(this.path)){if(this.affectedTree.value!=null)return Wt(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{const r=this.affectedTree.subtree(new Wn(t));return new aw(hn(),r,this.revert)}}else return Wt(Vr(this.path)===t,"operationForChild called for unrelated child."),new aw(Gn(this.path),this.affectedTree,this.revert)}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class Zx{constructor(t,r){this.source=t,this.path=r,this.type=oc.LISTEN_COMPLETE}operationForChild(t){return Yr(this.path)?new Zx(this.source,hn()):new Zx(this.source,Gn(this.path))}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class Sh{constructor(t,r,n){this.source=t,this.path=r,this.snap=n,this.type=oc.OVERWRITE}operationForChild(t){return Yr(this.path)?new Sh(this.source,hn(),this.snap.getImmediateChild(t)):new Sh(this.source,Gn(this.path),this.snap)}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class Jx{constructor(t,r,n){this.source=t,this.path=r,this.children=n,this.type=oc.MERGE}operationForChild(t){if(Yr(this.path)){const r=this.children.subtree(new Wn(t));return r.isEmpty()?null:r.value?new Sh(this.source,hn(),r.value):new Jx(this.source,hn(),r)}else return Wt(Vr(this.path)===t,"Can't get a merge for a child not on the path of the operation"),new Jx(this.source,Gn(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class jh{constructor(t,r,n){this.node_=t,this.fullyInitialized_=r,this.filtered_=n}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(t){if(Yr(t))return this.isFullyInitialized()&&!this.filtered_;const r=Vr(t);return this.isCompleteForChild(r)}isCompleteForChild(t){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(t)}getNode(){return this.node_}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class I3e{constructor(t){this.query_=t,this.index_=this.query_._queryParams.getIndex()}}function N3e(e,t,r,n){const o=[],a=[];return t.forEach(s=>{s.type==="child_changed"&&e.index_.indexedValueChanged(s.oldSnap,s.snapshotNode)&&a.push(j3e(s.childName,s.snapshotNode))}),Sy(e,o,"child_removed",t,n,r),Sy(e,o,"child_added",t,n,r),Sy(e,o,"child_moved",a,n,r),Sy(e,o,"child_changed",t,n,r),Sy(e,o,"value",t,n,r),o}function Sy(e,t,r,n,o,a){const s=n.filter(l=>l.type===r);s.sort((l,c)=>L3e(e,l,c)),s.forEach(l=>{const c=R3e(e,l,a);o.forEach(u=>{u.respondsTo(l.type)&&t.push(u.createEvent(c,e.query_))})})}function R3e(e,t,r){return t.type==="value"||t.type==="child_removed"||(t.prevName=r.getPredecessorChildName(t.childName,t.snapshotNode,e.index_)),t}function L3e(e,t,r){if(t.childName==null||r.childName==null)throw _v("Should only compare child_ events.");const n=new qr(t.childName,t.snapshotNode),o=new qr(r.childName,r.snapshotNode);return e.index_.compare(n,o)}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function TS(e,t){return{eventCache:e,serverCache:t}}function Qy(e,t,r,n){return TS(new jh(t,r,n),e.serverCache)}function AK(e,t,r,n){return TS(e.eventCache,new jh(t,r,n))}function YA(e){return e.eventCache.isFullyInitialized()?e.eventCache.getNode():null}function kh(e){return e.serverCache.isFullyInitialized()?e.serverCache.getNode():null}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/let Y4;const F3e=()=>(Y4||(Y4=new fs(w4e)),Y4);class ri{static fromObject(t){let r=new ri(null);return gs(t,(n,o)=>{r=r.set(new Wn(n),o)}),r}constructor(t,r=F3e()){this.value=t,this.children=r}isEmpty(){return this.value===null&&this.children.isEmpty()}findRootMostMatchingPathAndValue(t,r){if(this.value!=null&&r(this.value))return{path:hn(),value:this.value};if(Yr(t))return null;{const n=Vr(t),o=this.children.get(n);if(o!==null){const a=o.findRootMostMatchingPathAndValue(Gn(t),r);return a!=null?{path:fo(new Wn(n),a.path),value:a.value}:null}else return null}}findRootMostValueAndPath(t){return this.findRootMostMatchingPathAndValue(t,()=>!0)}subtree(t){if(Yr(t))return this;{const r=Vr(t),n=this.children.get(r);return n!==null?n.subtree(Gn(t)):new ri(null)}}set(t,r){if(Yr(t))return new ri(r,this.children);{const n=Vr(t),a=(this.children.get(n)||new ri(null)).set(Gn(t),r),s=this.children.insert(n,a);return new ri(this.value,s)}}remove(t){if(Yr(t))return this.children.isEmpty()?new ri(null):new ri(null,this.children);{const r=Vr(t),n=this.children.get(r);if(n){const o=n.remove(Gn(t));let a;return o.isEmpty()?a=this.children.remove(r):a=this.children.insert(r,o),this.value===null&&a.isEmpty()?new ri(null):new ri(this.value,a)}else return this}}get(t){if(Yr(t))return this.value;{const r=Vr(t),n=this.children.get(r);return n?n.get(Gn(t)):null}}setTree(t,r){if(Yr(t))return r;{const n=Vr(t),a=(this.children.get(n)||new ri(null)).setTree(Gn(t),r);let s;return a.isEmpty()?s=this.children.remove(n):s=this.children.insert(n,a),new ri(this.value,s)}}fold(t){return this.fold_(hn(),t)}fold_(t,r){const n={};return this.children.inorderTraversal((o,a)=>{n[o]=a.fold_(fo(t,o),r)}),r(t,this.value,n)}findOnPath(t,r){return this.findOnPath_(t,hn(),r)}findOnPath_(t,r,n){const o=this.value?n(r,this.value):!1;if(o)return o;if(Yr(t))return null;{const a=Vr(t),s=this.children.get(a);return s?s.findOnPath_(Gn(t),fo(r,a),n):null}}foreachOnPath(t,r){return this.foreachOnPath_(t,hn(),r)}foreachOnPath_(t,r,n){if(Yr(t))return this;{this.value&&n(r,this.value);const o=Vr(t),a=this.children.get(o);return a?a.foreachOnPath_(Gn(t),fo(r,o),n):new ri(null)}}foreach(t){this.foreach_(hn(),t)}foreach_(t,r){this.children.inorderTraversal((n,o)=>{o.foreach_(fo(t,n),r)}),this.value&&r(t,this.value)}foreachChild(t){this.children.inorderTraversal((r,n)=>{n.value&&t(r,n.value)})}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class sc{constructor(t){this.writeTree_=t}static empty(){return new sc(new ri(null))}}function Xy(e,t,r){if(Yr(t))return new sc(new ri(r));{const n=e.writeTree_.findRootMostValueAndPath(t);if(n!=null){const o=n.path;let a=n.value;const s=ds(o,t);return a=a.updateChild(s,r),new sc(e.writeTree_.set(o,a))}else{const o=new ri(r),a=e.writeTree_.setTree(t,o);return new sc(a)}}}function CB(e,t,r){let n=e;return gs(r,(o,a)=>{n=Xy(n,fo(t,o),a)}),n}function EB(e,t){if(Yr(t))return sc.empty();{const r=e.writeTree_.setTree(t,new ri(null));return new sc(r)}}function GA(e,t){return Mh(e,t)!=null}function Mh(e,t){const r=e.writeTree_.findRootMostValueAndPath(t);return r!=null?e.writeTree_.get(r.path).getChild(ds(r.path,t)):null}function AB(e){const t=[],r=e.writeTree_.value;return r!=null?r.isLeafNode()||r.forEachChild(Ti,(n,o)=>{t.push(new qr(n,o))}):e.writeTree_.children.inorderTraversal((n,o)=>{o.value!=null&&t.push(new qr(n,o.value))}),t}function If(e,t){if(Yr(t))return e;{const r=Mh(e,t);return r!=null?new sc(new ri(r)):new sc(e.writeTree_.subtree(t))}}function KA(e){return e.writeTree_.isEmpty()}function Jm(e,t){return TK(hn(),e.writeTree_,t)}function TK(e,t,r){if(t.value!=null)return r.updateChild(e,t.value);{let n=null;return t.children.inorderTraversal((o,a)=>{o===".priority"?(Wt(a.value!==null,"Priority writes must always be leaf nodes"),n=a.value):r=TK(fo(e,o),a,r)}),!r.getChild(e).isEmpty()&&n!==null&&(r=r.updateChild(fo(e,".priority"),n)),r}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function t8(e,t){return NK(t,e)}function M3e(e,t,r,n,o){Wt(n>e.lastWriteId,"Stacking an older write on top of newer ones"),o===void 0&&(o=!0),e.allWrites.push({path:t,snap:r,writeId:n,visible:o}),o&&(e.visibleWrites=Xy(e.visibleWrites,t,r)),e.lastWriteId=n}function D3e(e,t){for(let r=0;r<e.allWrites.length;r++){const n=e.allWrites[r];if(n.writeId===t)return n}return null}function z3e(e,t){const r=e.allWrites.findIndex(l=>l.writeId===t);Wt(r>=0,"removeWrite called with nonexistent writeId.");const n=e.allWrites[r];e.allWrites.splice(r,1);let o=n.visible,a=!1,s=e.allWrites.length-1;for(;o&&s>=0;){const l=e.allWrites[s];l.visible&&(s>=r&&B3e(l,n.path)?o=!1:ic(n.path,l.path)&&(a=!0)),s--}if(o){if(a)return W3e(e),!0;if(n.snap)e.visibleWrites=EB(e.visibleWrites,n.path);else{const l=n.children;gs(l,c=>{e.visibleWrites=EB(e.visibleWrites,fo(n.path,c))})}return!0}else return!1}function B3e(e,t){if(e.snap)return ic(e.path,t);for(const r in e.children)if(e.children.hasOwnProperty(r)&&ic(fo(e.path,r),t))return!0;return!1}function W3e(e){e.visibleWrites=PK(e.allWrites,q3e,hn()),e.allWrites.length>0?e.lastWriteId=e.allWrites[e.allWrites.length-1].writeId:e.lastWriteId=-1}function q3e(e){return e.visible}function PK(e,t,r){let n=sc.empty();for(let o=0;o<e.length;++o){const a=e[o];if(t(a)){const s=a.path;let l;if(a.snap)ic(r,s)?(l=ds(r,s),n=Xy(n,l,a.snap)):ic(s,r)&&(l=ds(s,r),n=Xy(n,hn(),a.snap.getChild(l)));else if(a.children){if(ic(r,s))l=ds(r,s),n=CB(n,l,a.children);else if(ic(s,r))if(l=ds(s,r),Yr(l))n=CB(n,hn(),a.children);else{const c=Qm(a.children,Vr(l));if(c){const u=c.getChild(Gn(l));n=Xy(n,hn(),u)}}}else throw _v("WriteRecord should have .snap or .children")}}return n}function OK(e,t,r,n,o){if(!n&&!o){const a=Mh(e.visibleWrites,t);if(a!=null)return a;{const s=If(e.visibleWrites,t);if(KA(s))return r;if(r==null&&!GA(s,hn()))return null;{const l=r||kr.EMPTY_NODE;return Jm(s,l)}}}else{const a=If(e.visibleWrites,t);if(!o&&KA(a))return r;if(!o&&r==null&&!GA(a,hn()))return null;{const s=function(u){return(u.visible||o)&&(!n||!~n.indexOf(u.writeId))&&(ic(u.path,t)||ic(t,u.path))},l=PK(e.allWrites,s,t),c=r||kr.EMPTY_NODE;return Jm(l,c)}}}function $3e(e,t,r){let n=kr.EMPTY_NODE;const o=Mh(e.visibleWrites,t);if(o)return o.isLeafNode()||o.forEachChild(Ti,(a,s)=>{n=n.updateImmediateChild(a,s)}),n;if(r){const a=If(e.visibleWrites,t);return r.forEachChild(Ti,(s,l)=>{const c=Jm(If(a,new Wn(s)),l);n=n.updateImmediateChild(s,c)}),AB(a).forEach(s=>{n=n.updateImmediateChild(s.name,s.node)}),n}else{const a=If(e.visibleWrites,t);return AB(a).forEach(s=>{n=n.updateImmediateChild(s.name,s.node)}),n}}function U3e(e,t,r,n,o){Wt(n||o,"Either existingEventSnap or existingServerSnap must exist");const a=fo(t,r);if(GA(e.visibleWrites,a))return null;{const s=If(e.visibleWrites,a);return KA(s)?o.getChild(r):Jm(s,o.getChild(r))}}function H3e(e,t,r,n){const o=fo(t,r),a=Mh(e.visibleWrites,o);if(a!=null)return a;if(n.isCompleteForChild(r)){const s=If(e.visibleWrites,o);return Jm(s,n.getNode().getImmediateChild(r))}else return null}function V3e(e,t){return Mh(e.visibleWrites,t)}function Y3e(e,t,r,n,o,a,s){let l;const c=If(e.visibleWrites,t),u=Mh(c,hn());if(u!=null)l=u;else if(r!=null)l=Jm(c,r);else return[];if(l=l.withIndex(s),!l.isEmpty()&&!l.isLeafNode()){const d=[],f=s.getCompare(),h=a?l.getReverseIteratorFrom(n,s):l.getIteratorFrom(n,s);let p=h.getNext();for(;p&&d.length<o;)f(p,n)!==0&&d.push(p),p=h.getNext();return d}else return[]}function G3e(){return{visibleWrites:sc.empty(),allWrites:[],lastWriteId:-1}}function sw(e,t,r,n){return OK(e.writeTree,e.treePath,t,r,n)}function r8(e,t){return $3e(e.writeTree,e.treePath,t)}function TB(e,t,r,n){return U3e(e.writeTree,e.treePath,t,r,n)}function lw(e,t){return V3e(e.writeTree,fo(e.treePath,t))}function K3e(e,t,r,n,o,a){return Y3e(e.writeTree,e.treePath,t,r,n,o,a)}function n8(e,t,r){return H3e(e.writeTree,e.treePath,t,r)}function IK(e,t){return NK(fo(e.treePath,t),e.writeTree)}function NK(e,t){return{treePath:e,writeTree:t}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class Q3e{constructor(){this.changeMap=new Map}trackChildChange(t){const r=t.type,n=t.childName;Wt(r==="child_added"||r==="child_changed"||r==="child_removed","Only child changes supported for tracking"),Wt(n!==".priority","Only non-priority child changes can be tracked.");const o=this.changeMap.get(n);if(o){const a=o.type;if(r==="child_added"&&a==="child_removed")this.changeMap.set(n,Qx(n,t.snapshotNode,o.snapshotNode));else if(r==="child_removed"&&a==="child_added")this.changeMap.delete(n);else if(r==="child_removed"&&a==="child_changed")this.changeMap.set(n,Kx(n,o.oldSnap));else if(r==="child_changed"&&a==="child_added")this.changeMap.set(n,Zm(n,t.snapshotNode));else if(r==="child_changed"&&a==="child_changed")this.changeMap.set(n,Qx(n,t.snapshotNode,o.oldSnap));else throw _v("Illegal combination of changes: "+t+" occurred after "+o)}else this.changeMap.set(n,t)}getChanges(){return Array.from(this.changeMap.values())}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class X3e{getCompleteChild(t){return null}getChildAfterChild(t,r,n){return null}}const RK=new X3e;class i8{constructor(t,r,n=null){this.writes_=t,this.viewCache_=r,this.optCompleteServerCache_=n}getCompleteChild(t){const r=this.viewCache_.eventCache;if(r.isCompleteForChild(t))return r.getNode().getImmediateChild(t);{const n=this.optCompleteServerCache_!=null?new jh(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return n8(this.writes_,t,n)}}getChildAfterChild(t,r,n){const o=this.optCompleteServerCache_!=null?this.optCompleteServerCache_:kh(this.viewCache_),a=K3e(this.writes_,o,r,1,n,t);return a.length===0?null:a[0]}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function Z3e(e){return{filter:e}}function J3e(e,t){Wt(t.eventCache.getNode().isIndexed(e.filter.getIndex()),"Event snap not indexed"),Wt(t.serverCache.getNode().isIndexed(e.filter.getIndex()),"Server snap not indexed")}function eEe(e,t,r,n,o){const a=new Q3e;let s,l;if(r.type===oc.OVERWRITE){const u=r;u.source.fromUser?s=QA(e,t,u.path,u.snap,n,o,a):(Wt(u.source.fromServer,"Unknown source."),l=u.source.tagged||t.serverCache.isFiltered()&&!Yr(u.path),s=cw(e,t,u.path,u.snap,n,o,l,a))}else if(r.type===oc.MERGE){const u=r;u.source.fromUser?s=rEe(e,t,u.path,u.children,n,o,a):(Wt(u.source.fromServer,"Unknown source."),l=u.source.tagged||t.serverCache.isFiltered(),s=XA(e,t,u.path,u.children,n,o,l,a))}else if(r.type===oc.ACK_USER_WRITE){const u=r;u.revert?s=oEe(e,t,u.path,n,o,a):s=nEe(e,t,u.path,u.affectedTree,n,o,a)}else if(r.type===oc.LISTEN_COMPLETE)s=iEe(e,t,r.path,n,a);else throw _v("Unknown operation type: "+r.type);const c=a.getChanges();return tEe(t,s,c),{viewCache:s,changes:c}}function tEe(e,t,r){const n=t.eventCache;if(n.isFullyInitialized()){const o=n.getNode().isLeafNode()||n.getNode().isEmpty(),a=YA(e);(r.length>0||!e.eventCache.isFullyInitialized()||o&&!n.getNode().equals(a)||!n.getNode().getPriority().equals(a.getPriority()))&&r.push(_K(YA(t)))}}function LK(e,t,r,n,o,a){const s=t.eventCache;if(lw(n,r)!=null)return t;{let l,c;if(Yr(r))if(Wt(t.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),t.serverCache.isFiltered()){const u=kh(t),d=u instanceof kr?u:kr.EMPTY_NODE,f=r8(n,d);l=e.filter.updateFullNode(t.eventCache.getNode(),f,a)}else{const u=sw(n,kh(t));l=e.filter.updateFullNode(t.eventCache.getNode(),u,a)}else{const u=Vr(r);if(u===".priority"){Wt(zf(r)===1,"Can't have a priority with additional path components");const d=s.getNode();c=t.serverCache.getNode();const f=TB(n,r,d,c);f!=null?l=e.filter.updatePriority(d,f):l=s.getNode()}else{const d=Gn(r);let f;if(s.isCompleteForChild(u)){c=t.serverCache.getNode();const h=TB(n,r,s.getNode(),c);h!=null?f=s.getNode().getImmediateChild(u).updateChild(d,h):f=s.getNode().getImmediateChild(u)}else f=n8(n,u,t.serverCache);f!=null?l=e.filter.updateChild(s.getNode(),u,f,d,o,a):l=s.getNode()}}return Qy(t,l,s.isFullyInitialized()||Yr(r),e.filter.filtersNodes())}}function cw(e,t,r,n,o,a,s,l){const c=t.serverCache;let u;const d=s?e.filter:e.filter.getIndexedFilter();if(Yr(r))u=d.updateFullNode(c.getNode(),n,null);else if(d.filtersNodes()&&!c.isFiltered()){const p=c.getNode().updateChild(r,n);u=d.updateFullNode(c.getNode(),p,null)}else{const p=Vr(r);if(!c.isCompleteForPath(r)&&zf(r)>1)return t;const y=Gn(r),x=c.getNode().getImmediateChild(p).updateChild(y,n);p===".priority"?u=d.updatePriority(c.getNode(),x):u=d.updateChild(c.getNode(),p,x,y,RK,null)}const f=AK(t,u,c.isFullyInitialized()||Yr(r),d.filtersNodes()),h=new i8(o,f,a);return LK(e,f,r,o,h,l)}function QA(e,t,r,n,o,a,s){const l=t.eventCache;let c,u;const d=new i8(o,t,a);if(Yr(r))u=e.filter.updateFullNode(t.eventCache.getNode(),n,s),c=Qy(t,u,!0,e.filter.filtersNodes());else{const f=Vr(r);if(f===".priority")u=e.filter.updatePriority(t.eventCache.getNode(),n),c=Qy(t,u,l.isFullyInitialized(),l.isFiltered());else{const h=Gn(r),p=l.getNode().getImmediateChild(f);let y;if(Yr(h))y=n;else{const m=d.getCompleteChild(f);m!=null?mK(h)===".priority"&&m.getChild(yK(h)).isEmpty()?y=m:y=m.updateChild(h,n):y=kr.EMPTY_NODE}if(p.equals(y))c=t;else{const m=e.filter.updateChild(l.getNode(),f,y,h,d,s);c=Qy(t,m,l.isFullyInitialized(),e.filter.filtersNodes())}}}return c}function PB(e,t){return e.eventCache.isCompleteForChild(t)}function rEe(e,t,r,n,o,a,s){let l=t;return n.foreach((c,u)=>{const d=fo(r,c);PB(t,Vr(d))&&(l=QA(e,l,d,u,o,a,s))}),n.foreach((c,u)=>{const d=fo(r,c);PB(t,Vr(d))||(l=QA(e,l,d,u,o,a,s))}),l}function OB(e,t,r){return r.foreach((n,o)=>{t=t.updateChild(n,o)}),t}function XA(e,t,r,n,o,a,s,l){if(t.serverCache.getNode().isEmpty()&&!t.serverCache.isFullyInitialized())return t;let c=t,u;Yr(r)?u=n:u=new ri(null).setTree(r,n);const d=t.serverCache.getNode();return u.children.inorderTraversal((f,h)=>{if(d.hasChild(f)){const p=t.serverCache.getNode().getImmediateChild(f),y=OB(e,p,h);c=cw(e,c,new Wn(f),y,o,a,s,l)}}),u.children.inorderTraversal((f,h)=>{const p=!t.serverCache.isCompleteForChild(f)&&h.value===null;if(!d.hasChild(f)&&!p){const y=t.serverCache.getNode().getImmediateChild(f),m=OB(e,y,h);c=cw(e,c,new Wn(f),m,o,a,s,l)}}),c}function nEe(e,t,r,n,o,a,s){if(lw(o,r)!=null)return t;const l=t.serverCache.isFiltered(),c=t.serverCache;if(n.value!=null){if(Yr(r)&&c.isFullyInitialized()||c.isCompleteForPath(r))return cw(e,t,r,c.getNode().getChild(r),o,a,l,s);if(Yr(r)){let u=new ri(null);return c.getNode().forEachChild(sm,(d,f)=>{u=u.set(new Wn(d),f)}),XA(e,t,r,u,o,a,l,s)}else return t}else{let u=new ri(null);return n.foreach((d,f)=>{const h=fo(r,d);c.isCompleteForPath(h)&&(u=u.set(d,c.getNode().getChild(h)))}),XA(e,t,r,u,o,a,l,s)}}function iEe(e,t,r,n,o){const a=t.serverCache,s=AK(t,a.getNode(),a.isFullyInitialized()||Yr(r),a.isFiltered());return LK(e,s,r,n,RK,o)}function oEe(e,t,r,n,o,a){let s;if(lw(n,r)!=null)return t;{const l=new i8(n,t,o),c=t.eventCache.getNode();let u;if(Yr(r)||Vr(r)===".priority"){let d;if(t.serverCache.isFullyInitialized())d=sw(n,kh(t));else{const f=t.serverCache.getNode();Wt(f instanceof kr,"serverChildren would be complete if leaf node"),d=r8(n,f)}d=d,u=e.filter.updateFullNode(c,d,a)}else{const d=Vr(r);let f=n8(n,d,t.serverCache);f==null&&t.serverCache.isCompleteForChild(d)&&(f=c.getImmediateChild(d)),f!=null?u=e.filter.updateChild(c,d,f,Gn(r),l,a):t.eventCache.getNode().hasChild(d)?u=e.filter.updateChild(c,d,kr.EMPTY_NODE,Gn(r),l,a):u=c,u.isEmpty()&&t.serverCache.isFullyInitialized()&&(s=sw(n,kh(t)),s.isLeafNode()&&(u=e.filter.updateFullNode(u,s,a)))}return s=t.serverCache.isFullyInitialized()||lw(n,hn())!=null,Qy(t,u,s,e.filter.filtersNodes())}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class aEe{constructor(t,r){this.query_=t,this.eventRegistrations_=[];const n=this.query_._queryParams,o=new XP(n.getIndex()),a=_3e(n);this.processor_=Z3e(a);const s=r.serverCache,l=r.eventCache,c=o.updateFullNode(kr.EMPTY_NODE,s.getNode(),null),u=a.updateFullNode(kr.EMPTY_NODE,l.getNode(),null),d=new jh(c,s.isFullyInitialized(),o.filtersNodes()),f=new jh(u,l.isFullyInitialized(),a.filtersNodes());this.viewCache_=TS(f,d),this.eventGenerator_=new I3e(this.query_)}get query(){return this.query_}}function sEe(e){return e.viewCache_.serverCache.getNode()}function lEe(e,t){const r=kh(e.viewCache_);return r&&(e.query._queryParams.loadsAllData()||!Yr(t)&&!r.getImmediateChild(Vr(t)).isEmpty())?r.getChild(t):null}function IB(e){return e.eventRegistrations_.length===0}function cEe(e,t){e.eventRegistrations_.push(t)}function NB(e,t,r){const n=[];if(r){Wt(t==null,"A cancel should cancel all event registrations.");const o=e.query._path;e.eventRegistrations_.forEach(a=>{const s=a.createCancelEvent(r,o);s&&n.push(s)})}if(t){let o=[];for(let a=0;a<e.eventRegistrations_.length;++a){const s=e.eventRegistrations_[a];if(!s.matches(t))o.push(s);else if(t.hasAnyCallback()){o=o.concat(e.eventRegistrations_.slice(a+1));break}}e.eventRegistrations_=o}else e.eventRegistrations_=[];return n}function RB(e,t,r,n){t.type===oc.MERGE&&t.source.queryId!==null&&(Wt(kh(e.viewCache_),"We should always have a full cache before handling merges"),Wt(YA(e.viewCache_),"Missing event cache, even though we have a server cache"));const o=e.viewCache_,a=eEe(e.processor_,o,t,r,n);return J3e(e.processor_,a.viewCache),Wt(a.viewCache.serverCache.isFullyInitialized()||!o.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),e.viewCache_=a.viewCache,FK(e,a.changes,a.viewCache.eventCache.getNode(),null)}function uEe(e,t){const r=e.viewCache_.eventCache,n=[];return r.getNode().isLeafNode()||r.getNode().forEachChild(Ti,(a,s)=>{n.push(Zm(a,s))}),r.isFullyInitialized()&&n.push(_K(r.getNode())),FK(e,n,r.getNode(),t)}function FK(e,t,r,n){const o=n?[n]:e.eventRegistrations_;return N3e(e.eventGenerator_,t,r,o)}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/let uw;class dEe{constructor(){this.views=new Map}}function fEe(e){Wt(!uw,"__referenceConstructor has already been defined"),uw=e}function pEe(){return Wt(uw,"Reference.ts has not been loaded"),uw}function hEe(e){return e.views.size===0}function o8(e,t,r,n){const o=t.source.queryId;if(o!==null){const a=e.views.get(o);return Wt(a!=null,"SyncTree gave us an op for an invalid query."),RB(a,t,r,n)}else{let a=[];for(const s of e.views.values())a=a.concat(RB(s,t,r,n));return a}}function gEe(e,t,r,n,o){const a=t._queryIdentifier,s=e.views.get(a);if(!s){let l=sw(r,o?n:null),c=!1;l?c=!0:n instanceof kr?(l=r8(r,n),c=!1):(l=kr.EMPTY_NODE,c=!1);const u=TS(new jh(l,c,!1),new jh(n,o,!1));return new aEe(t,u)}return s}function mEe(e,t,r,n,o,a){const s=gEe(e,t,n,o,a);return e.views.has(t._queryIdentifier)||e.views.set(t._queryIdentifier,s),cEe(s,r),uEe(s,r)}function vEe(e,t,r,n){const o=t._queryIdentifier,a=[];let s=[];const l=Bf(e);if(o==="default")for(const[c,u]of e.views.entries())s=s.concat(NB(u,r,n)),IB(u)&&(e.views.delete(c),u.query._queryParams.loadsAllData()||a.push(u.query));else{const c=e.views.get(o);c&&(s=s.concat(NB(c,r,n)),IB(c)&&(e.views.delete(o),c.query._queryParams.loadsAllData()||a.push(c.query)))}return l&&!Bf(e)&&a.push(new(pEe())(t._repo,t._path)),{removed:a,events:s}}function MK(e){const t=[];for(const r of e.views.values())r.query._queryParams.loadsAllData()||t.push(r);return t}function lm(e,t){let r=null;for(const n of e.views.values())r=r||lEe(n,t);return r}function DK(e,t){if(t._queryParams.loadsAllData())return PS(e);{const n=t._queryIdentifier;return e.views.get(n)}}function zK(e,t){return DK(e,t)!=null}function Bf(e){return PS(e)!=null}function PS(e){for(const t of e.views.values())if(t.query._queryParams.loadsAllData())return t;return null}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/let dw;function yEe(e){Wt(!dw,"__referenceConstructor has already been defined"),dw=e}function xEe(){return Wt(dw,"Reference.ts has not been loaded"),dw}let bEe=1;class LB{constructor(t){this.listenProvider_=t,this.syncPointTree_=new ri(null),this.pendingWriteTree_=G3e(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}}function wEe(e,t,r,n,o){return M3e(e.pendingWriteTree_,t,r,n,o),o?Ob(e,new Sh(EK(),t,r)):[]}function Kg(e,t,r=!1){const n=D3e(e.pendingWriteTree_,t);if(z3e(e.pendingWriteTree_,t)){let a=new ri(null);return n.snap!=null?a=a.set(hn(),!0):gs(n.children,s=>{a=a.set(new Wn(s),!0)}),Ob(e,new aw(n.path,a,r))}else return[]}function OS(e,t,r){return Ob(e,new Sh(JP(),t,r))}function SEe(e,t,r){const n=ri.fromObject(r);return Ob(e,new Jx(JP(),t,n))}function jEe(e,t){return Ob(e,new Zx(JP(),t))}function kEe(e,t,r){const n=a8(e,r);if(n){const o=s8(n),a=o.path,s=o.queryId,l=ds(a,t),c=new Zx(e8(s),l);return l8(e,a,c)}else return[]}function ZA(e,t,r,n,o=!1){const a=t._path,s=e.syncPointTree_.get(a);let l=[];if(s&&(t._queryIdentifier==="default"||zK(s,t))){const c=vEe(s,t,r,n);hEe(s)&&(e.syncPointTree_=e.syncPointTree_.remove(a));const u=c.removed;if(l=c.events,!o){const d=u.findIndex(h=>h._queryParams.loadsAllData())!==-1,f=e.syncPointTree_.findOnPath(a,(h,p)=>Bf(p));if(d&&!f){const h=e.syncPointTree_.subtree(a);if(!h.isEmpty()){const p=EEe(h);for(let y=0;y<p.length;++y){const m=p[y],x=m.query,b=$K(e,m);e.listenProvider_.startListening(Zy(x),fw(e,x),b.hashFn,b.onComplete)}}}!f&&u.length>0&&!n&&(d?e.listenProvider_.stopListening(Zy(t),null):u.forEach(h=>{const p=e.queryToTagMap.get(IS(h));e.listenProvider_.stopListening(Zy(h),p)}))}AEe(e,u)}return l}function _Ee(e,t,r,n){const o=a8(e,n);if(o!=null){const a=s8(o),s=a.path,l=a.queryId,c=ds(s,t),u=new Sh(e8(l),c,r);return l8(e,s,u)}else return[]}function CEe(e,t,r,n){const o=a8(e,n);if(o){const a=s8(o),s=a.path,l=a.queryId,c=ds(s,t),u=ri.fromObject(r),d=new Jx(e8(l),c,u);return l8(e,s,d)}else return[]}function FB(e,t,r,n=!1){const o=t._path;let a=null,s=!1;e.syncPointTree_.foreachOnPath(o,(h,p)=>{const y=ds(h,o);a=a||lm(p,y),s=s||Bf(p)});let l=e.syncPointTree_.get(o);l?(s=s||Bf(l),a=a||lm(l,hn())):(l=new dEe,e.syncPointTree_=e.syncPointTree_.set(o,l));let c;a!=null?c=!0:(c=!1,a=kr.EMPTY_NODE,e.syncPointTree_.subtree(o).foreachChild((p,y)=>{const m=lm(y,hn());m&&(a=a.updateImmediateChild(p,m))}));const u=zK(l,t);if(!u&&!t._queryParams.loadsAllData()){const h=IS(t);Wt(!e.queryToTagMap.has(h),"View does not exist, but we have a tag");const p=TEe();e.queryToTagMap.set(h,p),e.tagToQueryMap.set(p,h)}const d=t8(e.pendingWriteTree_,o);let f=mEe(l,t,r,d,a,c);if(!u&&!s&&!n){const h=DK(l,t);f=f.concat(PEe(e,t,h))}return f}function BK(e,t,r){const o=e.pendingWriteTree_,a=e.syncPointTree_.findOnPath(t,(s,l)=>{const c=ds(s,t),u=lm(l,c);if(u)return u});return OK(o,t,a,r,!0)}function Ob(e,t){return WK(t,e.syncPointTree_,null,t8(e.pendingWriteTree_,hn()))}function WK(e,t,r,n){if(Yr(e.path))return qK(e,t,r,n);{const o=t.get(hn());r==null&&o!=null&&(r=lm(o,hn()));let a=[];const s=Vr(e.path),l=e.operationForChild(s),c=t.children.get(s);if(c&&l){const u=r?r.getImmediateChild(s):null,d=IK(n,s);a=a.concat(WK(l,c,u,d))}return o&&(a=a.concat(o8(o,e,n,r))),a}}function qK(e,t,r,n){const o=t.get(hn());r==null&&o!=null&&(r=lm(o,hn()));let a=[];return t.children.inorderTraversal((s,l)=>{const c=r?r.getImmediateChild(s):null,u=IK(n,s),d=e.operationForChild(s);d&&(a=a.concat(qK(d,l,c,u)))}),o&&(a=a.concat(o8(o,e,n,r))),a}function $K(e,t){const r=t.query,n=fw(e,r);return{hashFn:()=>(sEe(t)||kr.EMPTY_NODE).hash(),onComplete:o=>{if(o==="ok")return n?kEe(e,r._path,n):jEe(e,r._path);{const a=k4e(o,r);return ZA(e,r,null,a)}}}}function fw(e,t){const r=IS(t);return e.queryToTagMap.get(r)}function IS(e){return e._path.toString()+"$"+e._queryIdentifier}function a8(e,t){return e.tagToQueryMap.get(t)}function s8(e){const t=e.indexOf("$");return Wt(t!==-1&&t<e.length-1,"Bad queryKey."),{queryId:e.substr(t+1),path:new Wn(e.substr(0,t))}}function l8(e,t,r){const n=e.syncPointTree_.get(t);Wt(n,"Missing sync point for query tag that we're tracking");const o=t8(e.pendingWriteTree_,t);return o8(n,r,o,null)}function EEe(e){return e.fold((t,r,n)=>{if(r&&Bf(r))return[PS(r)];{let o=[];return r&&(o=MK(r)),gs(n,(a,s)=>{o=o.concat(s)}),o}})}function Zy(e){return e._queryParams.loadsAllData()&&!e._queryParams.isDefault()?new(xEe())(e._repo,e._path):e}function AEe(e,t){for(let r=0;r<t.length;++r){const n=t[r];if(!n._queryParams.loadsAllData()){const o=IS(n),a=e.queryToTagMap.get(o);e.queryToTagMap.delete(o),e.tagToQueryMap.delete(a)}}}function TEe(){return bEe++}function PEe(e,t,r){const n=t._path,o=fw(e,t),a=$K(e,r),s=e.listenProvider_.startListening(Zy(t),o,a.hashFn,a.onComplete),l=e.syncPointTree_.subtree(n);if(o)Wt(!Bf(l.value),"If we're adding a query, it shouldn't be shadowed");else{const c=l.fold((u,d,f)=>{if(!Yr(u)&&d&&Bf(d))return[PS(d).query];{let h=[];return d&&(h=h.concat(MK(d).map(p=>p.query))),gs(f,(p,y)=>{h=h.concat(y)}),h}});for(let u=0;u<c.length;++u){const d=c[u];e.listenProvider_.stopListening(Zy(d),fw(e,d))}}return s}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class c8{constructor(t){this.node_=t}getImmediateChild(t){const r=this.node_.getImmediateChild(t);return new c8(r)}node(){return this.node_}}class u8{constructor(t,r){this.syncTree_=t,this.path_=r}getImmediateChild(t){const r=fo(this.path_,t);return new u8(this.syncTree_,r)}node(){return BK(this.syncTree_,this.path_)}}const OEe=function(e){return e=e||{},e.timestamp=e.timestamp||new Date().getTime(),e},MB=function(e,t,r){if(!e||typeof e!="object")return e;if(Wt(".sv"in e,"Unexpected leaf node or priority contents"),typeof e[".sv"]=="string")return IEe(e[".sv"],t,r);if(typeof e[".sv"]=="object")return NEe(e[".sv"],t);Wt(!1,"Unexpected server value: "+JSON.stringify(e,null,2))},IEe=function(e,t,r){switch(e){case"timestamp":return r.timestamp;default:Wt(!1,"Unexpected server value: "+e)}},NEe=function(e,t,r){e.hasOwnProperty("increment")||Wt(!1,"Unexpected server value: "+JSON.stringify(e,null,2));const n=e.increment;typeof n!="number"&&Wt(!1,"Unexpected increment value: "+n);const o=t.node();if(Wt(o!==null&&typeof o<"u","Expected ChildrenNode.EMPTY_NODE for nulls"),!o.isLeafNode())return n;const s=o.getValue();return typeof s!="number"?n:s+n},REe=function(e,t,r,n){return d8(t,new u8(r,e),n)},LEe=function(e,t,r){return d8(e,new c8(t),r)};function d8(e,t,r){const n=e.getPriority().val(),o=MB(n,t.getImmediateChild(".priority"),r);let a;if(e.isLeafNode()){const s=e,l=MB(s.getValue(),t,r);return l!==s.getValue()||o!==s.getPriority().val()?new Oo(l,ma(o)):e}else{const s=e;return a=s,o!==s.getPriority().val()&&(a=a.updatePriority(new Oo(o))),s.forEachChild(Ti,(l,c)=>{const u=d8(c,t.getImmediateChild(l),r);u!==c&&(a=a.updateImmediateChild(l,u))}),a}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class f8{constructor(t="",r=null,n={children:{},childCount:0}){this.name=t,this.parent=r,this.node=n}}function p8(e,t){let r=t instanceof Wn?t:new Wn(t),n=e,o=Vr(r);for(;o!==null;){const a=Qm(n.node.children,o)||{children:{},childCount:0};n=new f8(o,n,a),r=Gn(r),o=Vr(r)}return n}function Ev(e){return e.node.value}function UK(e,t){e.node.value=t,JA(e)}function HK(e){return e.node.childCount>0}function FEe(e){return Ev(e)===void 0&&!HK(e)}function NS(e,t){gs(e.node.children,(r,n)=>{t(new f8(r,e,n))})}function VK(e,t,r,n){r&&t(e),NS(e,o=>{VK(o,t,!0)})}function MEe(e,t,r){let n=e.parent;for(;n!==null;){if(t(n))return!0;n=n.parent}return!1}function Ib(e){return new Wn(e.parent===null?e.name:Ib(e.parent)+"/"+e.name)}function JA(e){e.parent!==null&&DEe(e.parent,e.name,e)}function DEe(e,t,r){const n=FEe(r),o=Cd(e.node.children,t);n&&o?(delete e.node.children[t],e.node.childCount--,JA(e)):!n&&!o&&(e.node.children[t]=r.node,e.node.childCount++,JA(e))}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const zEe=/[\[\].#$\/\u0000-\u001F\u007F]/,BEe=/[\[\].#$\u0000-\u001F\u007F]/,G4=10*1024*1024,YK=function(e){return typeof e=="string"&&e.length!==0&&!zEe.test(e)},GK=function(e){return typeof e=="string"&&e.length!==0&&!BEe.test(e)},WEe=function(e){return e&&(e=e.replace(/^\/*\.info(\/|$)/,"/")),GK(e)},KK=function(e,t,r){const n=r instanceof Wn?new n3e(r,e):r;if(t===void 0)throw new Error(e+"contains undefined "+qp(n));if(typeof t=="function")throw new Error(e+"contains a function "+qp(n)+" with contents = "+t.toString());if(KG(t))throw new Error(e+"contains "+t.toString()+" "+qp(n));if(typeof t=="string"&&t.length>G4/3&&CS(t)>G4)throw new Error(e+"contains a string greater than "+G4+" utf8 bytes "+qp(n)+" ('"+t.substring(0,50)+"...')");if(t&&typeof t=="object"){let o=!1,a=!1;if(gs(t,(s,l)=>{if(s===".value")o=!0;else if(s!==".priority"&&s!==".sv"&&(a=!0,!YK(s)))throw new Error(e+" contains an invalid key ("+s+") "+qp(n)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);i3e(n,s),KK(e,l,n),o3e(n)}),o&&a)throw new Error(e+' contains ".value" child '+qp(n)+" in addition to actual children.")}},QK=function(e,t,r,n){if(!GK(r))throw new Error(zG(e,t)+'was an invalid path = "'+r+`". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"`)},qEe=function(e,t,r,n){r&&(r=r.replace(/^\/*\.info(\/|$)/,"/")),QK(e,t,r)},$Ee=function(e,t){const r=t.path.toString();if(typeof t.repoInfo.host!="string"||t.repoInfo.host.length===0||!YK(t.repoInfo.namespace)&&t.repoInfo.host.split(":")[0]!=="localhost"||r.length!==0&&!WEe(r))throw new Error(zG(e,"url")+`must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]".`)};/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class UEe{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function XK(e,t){let r=null;for(let n=0;n<t.length;n++){const o=t[n],a=o.getPath();r!==null&&!GP(a,r.path)&&(e.eventLists_.push(r),r=null),r===null&&(r={events:[],path:a}),r.events.push(o)}r&&e.eventLists_.push(r)}function ZK(e,t,r){XK(e,r),JK(e,n=>GP(n,t))}function Dh(e,t,r){XK(e,r),JK(e,n=>ic(n,t)||ic(t,n))}function JK(e,t){e.recursionDepth_++;let r=!0;for(let n=0;n<e.eventLists_.length;n++){const o=e.eventLists_[n];if(o){const a=o.path;t(a)?(HEe(e.eventLists_[n]),e.eventLists_[n]=null):r=!1}}r&&(e.eventLists_=[]),e.recursionDepth_--}function HEe(e){for(let t=0;t<e.events.length;t++){const r=e.events[t];if(r!==null){e.events[t]=null;const n=r.getEventRunner();Gy&&ga("event: "+r.toString()),Tb(n)}}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const VEe="repo_interrupt",YEe=25;class GEe{constructor(t,r,n,o){this.repoInfo_=t,this.forceRestClient_=r,this.authTokenProvider_=n,this.appCheckProvider_=o,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new UEe,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=ow(),this.transactionQueueTree_=new f8,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}toString(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host}}function KEe(e,t,r){if(e.stats_=VP(e.repoInfo_),e.forceRestClient_||A4e())e.server_=new iw(e.repoInfo_,(n,o,a,s)=>{DB(e,n,o,a,s)},e.authTokenProvider_,e.appCheckProvider_),setTimeout(()=>zB(e,!0),0);else{if(typeof r<"u"&&r!==null){if(typeof r!="object")throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{Mo(r)}catch(n){throw new Error("Invalid authOverride provided: "+n)}}e.persistentConnection_=new cd(e.repoInfo_,t,(n,o,a,s)=>{DB(e,n,o,a,s)},n=>{zB(e,n)},n=>{XEe(e,n)},e.authTokenProvider_,e.appCheckProvider_,r),e.server_=e.persistentConnection_}e.authTokenProvider_.addTokenChangeListener(n=>{e.server_.refreshAuthToken(n)}),e.appCheckProvider_.addTokenChangeListener(n=>{e.server_.refreshAppCheckToken(n.token)}),e.statsReporter_=N4e(e.repoInfo_,()=>new O3e(e.stats_,e.server_)),e.infoData_=new C3e,e.infoSyncTree_=new LB({startListening:(n,o,a,s)=>{let l=[];const c=e.infoData_.getNode(n._path);return c.isEmpty()||(l=OS(e.infoSyncTree_,n._path,c),setTimeout(()=>{s("ok")},0)),l},stopListening:()=>{}}),h8(e,"connected",!1),e.serverSyncTree_=new LB({startListening:(n,o,a,s)=>(e.server_.listen(n,a,o,(l,c)=>{const u=s(l,c);Dh(e.eventQueue_,n._path,u)}),[]),stopListening:(n,o)=>{e.server_.unlisten(n,o)}})}function QEe(e){const r=e.infoData_.getNode(new Wn(".info/serverTimeOffset")).val()||0;return new Date().getTime()+r}function eQ(e){return OEe({timestamp:QEe(e)})}function DB(e,t,r,n,o){e.dataUpdateCount++;const a=new Wn(t);r=e.interceptServerDataCallback_?e.interceptServerDataCallback_(t,r):r;let s=[];if(o)if(n){const c=Z2(r,u=>ma(u));s=CEe(e.serverSyncTree_,a,c,o)}else{const c=ma(r);s=_Ee(e.serverSyncTree_,a,c,o)}else if(n){const c=Z2(r,u=>ma(u));s=SEe(e.serverSyncTree_,a,c)}else{const c=ma(r);s=OS(e.serverSyncTree_,a,c)}let l=a;s.length>0&&(l=m8(e,a)),Dh(e.eventQueue_,l,s)}function zB(e,t){h8(e,"connected",t),t===!1&&JEe(e)}function XEe(e,t){gs(t,(r,n)=>{h8(e,r,n)})}function h8(e,t,r){const n=new Wn("/.info/"+t),o=ma(r);e.infoData_.updateSnapshot(n,o);const a=OS(e.infoSyncTree_,n,o);Dh(e.eventQueue_,n,a)}function ZEe(e){return e.nextWriteId_++}function JEe(e){tQ(e,"onDisconnectEvents");const t=eQ(e),r=ow();VA(e.onDisconnect_,hn(),(o,a)=>{const s=REe(o,a,e.serverSyncTree_,t);CK(r,o,s)});let n=[];VA(r,hn(),(o,a)=>{n=n.concat(OS(e.serverSyncTree_,o,a));const s=iAe(e,o);m8(e,s)}),e.onDisconnect_=ow(),Dh(e.eventQueue_,hn(),n)}function eAe(e,t,r){let n;Vr(t._path)===".info"?n=FB(e.infoSyncTree_,t,r):n=FB(e.serverSyncTree_,t,r),ZK(e.eventQueue_,t._path,n)}function BB(e,t,r){let n;Vr(t._path)===".info"?n=ZA(e.infoSyncTree_,t,r):n=ZA(e.serverSyncTree_,t,r),ZK(e.eventQueue_,t._path,n)}function tAe(e){e.persistentConnection_&&e.persistentConnection_.interrupt(VEe)}function tQ(e,...t){let r="";e.persistentConnection_&&(r=e.persistentConnection_.id+":"),ga(r,...t)}function rQ(e,t,r){return BK(e.serverSyncTree_,t,r)||kr.EMPTY_NODE}function g8(e,t=e.transactionQueueTree_){if(t||RS(e,t),Ev(t)){const r=iQ(e,t);Wt(r.length>0,"Sending zero length transaction queue"),r.every(o=>o.status===0)&&rAe(e,Ib(t),r)}else HK(t)&&NS(t,r=>{g8(e,r)})}function rAe(e,t,r){const n=r.map(u=>u.currentWriteId),o=rQ(e,t,n);let a=o;const s=o.hash();for(let u=0;u<r.length;u++){const d=r[u];Wt(d.status===0,"tryToSendTransactionQueue_: items in queue should all be run."),d.status=1,d.retryCount++;const f=ds(t,d.path);a=a.updateChild(f,d.currentOutputSnapshotRaw)}const l=a.val(!0),c=t;e.server_.put(c.toString(),l,u=>{tQ(e,"transaction put response",{path:c.toString(),status:u});let d=[];if(u==="ok"){const f=[];for(let h=0;h<r.length;h++)r[h].status=2,d=d.concat(Kg(e.serverSyncTree_,r[h].currentWriteId)),r[h].onComplete&&f.push(()=>r[h].onComplete(null,!0,r[h].currentOutputSnapshotResolved)),r[h].unwatcher();RS(e,p8(e.transactionQueueTree_,t)),g8(e,e.transactionQueueTree_),Dh(e.eventQueue_,t,d);for(let h=0;h<f.length;h++)Tb(f[h])}else{if(u==="datastale")for(let f=0;f<r.length;f++)r[f].status===3?r[f].status=4:r[f].status=0;else{Xs("transaction at "+c.toString()+" failed: "+u);for(let f=0;f<r.length;f++)r[f].status=4,r[f].abortReason=u}m8(e,t)}},s)}function m8(e,t){const r=nQ(e,t),n=Ib(r),o=iQ(e,r);return nAe(e,o,n),n}function nAe(e,t,r){if(t.length===0)return;const n=[];let o=[];const s=t.filter(l=>l.status===0).map(l=>l.currentWriteId);for(let l=0;l<t.length;l++){const c=t[l],u=ds(r,c.path);let d=!1,f;if(Wt(u!==null,"rerunTransactionsUnderNode_: relativePath should not be null."),c.status===4)d=!0,f=c.abortReason,o=o.concat(Kg(e.serverSyncTree_,c.currentWriteId,!0));else if(c.status===0)if(c.retryCount>=YEe)d=!0,f="maxretry",o=o.concat(Kg(e.serverSyncTree_,c.currentWriteId,!0));else{const h=rQ(e,c.path,s);c.currentInputSnapshot=h;const p=t[l].update(h.val());if(p!==void 0){KK("transaction failed: Data returned ",p,c.path);let y=ma(p);typeof p=="object"&&p!=null&&Cd(p,".priority")||(y=y.updatePriority(h.getPriority()));const x=c.currentWriteId,b=eQ(e),w=LEe(y,h,b);c.currentOutputSnapshotRaw=y,c.currentOutputSnapshotResolved=w,c.currentWriteId=ZEe(e),s.splice(s.indexOf(x),1),o=o.concat(wEe(e.serverSyncTree_,c.path,w,c.currentWriteId,c.applyLocally)),o=o.concat(Kg(e.serverSyncTree_,x,!0))}else d=!0,f="nodata",o=o.concat(Kg(e.serverSyncTree_,c.currentWriteId,!0))}Dh(e.eventQueue_,r,o),o=[],d&&(t[l].status=2,(function(h){setTimeout(h,Math.floor(0))})(t[l].unwatcher),t[l].onComplete&&(f==="nodata"?n.push(()=>t[l].onComplete(null,!1,t[l].currentInputSnapshot)):n.push(()=>t[l].onComplete(new Error(f),!1,null))))}RS(e,e.transactionQueueTree_);for(let l=0;l<n.length;l++)Tb(n[l]);g8(e,e.transactionQueueTree_)}function nQ(e,t){let r,n=e.transactionQueueTree_;for(r=Vr(t);r!==null&&Ev(n)===void 0;)n=p8(n,r),t=Gn(t),r=Vr(t);return n}function iQ(e,t){const r=[];return oQ(e,t,r),r.sort((n,o)=>n.order-o.order),r}function oQ(e,t,r){const n=Ev(t);if(n)for(let o=0;o<n.length;o++)r.push(n[o]);NS(t,o=>{oQ(e,o,r)})}function RS(e,t){const r=Ev(t);if(r){let n=0;for(let o=0;o<r.length;o++)r[o].status!==2&&(r[n]=r[o],n++);r.length=n,UK(t,r.length>0?r:void 0)}NS(t,n=>{RS(e,n)})}function iAe(e,t){const r=Ib(nQ(e,t)),n=p8(e.transactionQueueTree_,t);return MEe(n,o=>{K4(e,o)}),K4(e,n),VK(n,o=>{K4(e,o)}),r}function K4(e,t){const r=Ev(t);if(r){const n=[];let o=[],a=-1;for(let s=0;s<r.length;s++)r[s].status===3||(r[s].status===1?(Wt(a===s-1,"All SENT items should be at beginning of queue."),a=s,r[s].status=3,r[s].abortReason="set"):(Wt(r[s].status===0,"Unexpected transaction status in abort"),r[s].unwatcher(),o=o.concat(Kg(e.serverSyncTree_,r[s].currentWriteId,!0)),r[s].onComplete&&n.push(r[s].onComplete.bind(null,new Error("set"),!1,null))));a===-1?UK(t,void 0):r.length=a+1,Dh(e.eventQueue_,Ib(t),o);for(let s=0;s<n.length;s++)Tb(n[s])}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function oAe(e){let t="";const r=e.split("/");for(let n=0;n<r.length;n++)if(r[n].length>0){let o=r[n];try{o=decodeURIComponent(o.replace(/\+/g," "))}catch{}t+="/"+o}return t}function aAe(e){const t={};e.charAt(0)==="?"&&(e=e.substring(1));for(const r of e.split("&")){if(r.length===0)continue;const n=r.split("=");n.length===2?t[decodeURIComponent(n[0])]=decodeURIComponent(n[1]):Xs(`Invalid query segment '${r}' in query '${e}'`)}return t}const WB=function(e,t){const r=sAe(e),n=r.namespace;r.domain==="firebase.com"&&vd(r.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),(!n||n==="undefined")&&r.domain!=="localhost"&&vd("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),r.secure||x4e();const o=r.scheme==="ws"||r.scheme==="wss";return{repoInfo:new sK(r.host,r.secure,n,o,t,"",n!==r.subdomain),path:new Wn(r.pathString)}},sAe=function(e){let t="",r="",n="",o="",a="",s=!0,l="https",c=443;if(typeof e=="string"){let u=e.indexOf("//");u>=0&&(l=e.substring(0,u-1),e=e.substring(u+2));let d=e.indexOf("/");d===-1&&(d=e.length);let f=e.indexOf("?");f===-1&&(f=e.length),t=e.substring(0,Math.min(d,f)),d<f&&(o=oAe(e.substring(d,f)));const h=aAe(e.substring(Math.min(e.length,f)));u=t.indexOf(":"),u>=0?(s=l==="https"||l==="wss",c=parseInt(t.substring(u+1),10)):u=t.length;const p=t.slice(0,u);if(p.toLowerCase()==="localhost")r="localhost";else if(p.split(".").length<=2)r=p;else{const y=t.indexOf(".");n=t.substring(0,y).toLowerCase(),r=t.substring(y+1),a=n}"ns"in h&&(a=h.ns)}return{host:t,port:c,domain:r,subdomain:n,secure:s,scheme:l,pathString:o,namespace:a}};/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class lAe{constructor(t,r,n,o){this.eventType=t,this.eventRegistration=r,this.snapshot=n,this.prevName=o}getPath(){const t=this.snapshot.ref;return this.eventType==="value"?t._path:t.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+Mo(this.snapshot.exportVal())}}class cAe{constructor(t,r,n){this.eventRegistration=t,this.error=r,this.path=n}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}}/**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class uAe{constructor(t,r){this.snapshotCallback=t,this.cancelCallback=r}onValue(t,r){this.snapshotCallback.call(null,t,r)}onCancel(t){return Wt(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,t)}get hasCancelCallback(){return!!this.cancelCallback}matches(t){return this.snapshotCallback===t.snapshotCallback||this.snapshotCallback.userCallback!==void 0&&this.snapshotCallback.userCallback===t.snapshotCallback.userCallback&&this.snapshotCallback.context===t.snapshotCallback.context}}/**
|
||
* @license
|
||
* Copyright 2020 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/class v8{constructor(t,r,n,o){this._repo=t,this._path=r,this._queryParams=n,this._orderByCalled=o}get key(){return Yr(this._path)?null:mK(this._path)}get ref(){return new Qf(this._repo,this._path)}get _queryIdentifier(){const t=kB(this._queryParams),r=UP(t);return r==="{}"?"default":r}get _queryObject(){return kB(this._queryParams)}isEqual(t){if(t=ES(t),!(t instanceof v8))return!1;const r=this._repo===t._repo,n=GP(this._path,t._path),o=this._queryIdentifier===t._queryIdentifier;return r&&n&&o}toJSON(){return this.toString()}toString(){return this._repo.toString()+r3e(this._path)}}class Qf extends v8{constructor(t,r){super(t,r,new ZP,!1)}get parent(){const t=yK(this._path);return t===null?null:new Qf(this._repo,t)}get root(){let t=this;for(;t.parent!==null;)t=t.parent;return t}}class pw{constructor(t,r,n){this._node=t,this.ref=r,this._index=n}get priority(){return this._node.getPriority().val()}get key(){return this.ref.key}get size(){return this._node.numChildren()}child(t){const r=new Wn(t),n=e6(this.ref,t);return new pw(this._node.getChild(r),n,Ti)}exists(){return!this._node.isEmpty()}exportVal(){return this._node.val(!0)}forEach(t){return this._node.isLeafNode()?!1:!!this._node.forEachChild(this._index,(n,o)=>t(new pw(o,e6(this.ref,n),Ti)))}hasChild(t){const r=new Wn(t);return!this._node.getChild(r).isEmpty()}hasChildren(){return this._node.isLeafNode()?!1:!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}}function dAe(e,t){return e=ES(e),e._checkNotDeleted("ref"),t!==void 0?e6(e._root,t):e._root}function e6(e,t){return e=ES(e),Vr(e._path)===null?qEe("child","path",t):QK("child","path",t),new Qf(e._repo,fo(e._path,t))}class y8{constructor(t){this.callbackContext=t}respondsTo(t){return t==="value"}createEvent(t,r){const n=r._queryParams.getIndex();return new lAe("value",this,new pw(t.snapshotNode,new Qf(r._repo,r._path),n))}getEventRunner(t){return t.getEventType()==="cancel"?()=>this.callbackContext.onCancel(t.error):()=>this.callbackContext.onValue(t.snapshot,null)}createCancelEvent(t,r){return this.callbackContext.hasCancelCallback?new cAe(this,t,r):null}matches(t){return t instanceof y8?!t.callbackContext||!this.callbackContext?!0:t.callbackContext.matches(this.callbackContext):!1}hasAnyCallback(){return this.callbackContext!==null}}function fAe(e,t,r,n,o){let a;if(typeof n=="object"&&(a=void 0,o=n),typeof n=="function"&&(a=n),o&&o.onlyOnce){const c=r,u=(d,f)=>{BB(e._repo,e,l),c(d,f)};u.userCallback=r.userCallback,u.context=r.context,r=u}const s=new uAe(r,a||void 0),l=new y8(s);return eAe(e._repo,e,l),()=>BB(e._repo,e,l)}function pAe(e,t,r,n){return fAe(e,"value",t,r,n)}fEe(Qf);yEe(Qf);/**
|
||
* @license
|
||
* Copyright 2020 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/const hAe="FIREBASE_DATABASE_EMULATOR_HOST",t6={};let gAe=!1;function mAe(e,t,r,n){const o=t.lastIndexOf(":"),a=t.substring(0,o),s=qP(a);e.repoInfo_=new sK(t,s,e.repoInfo_.namespace,e.repoInfo_.webSocketOnly,e.repoInfo_.nodeAdmin,e.repoInfo_.persistenceKey,e.repoInfo_.includeNamespaceInQueryParams,!0,r),n&&(e.authTokenProvider_=n)}function vAe(e,t,r,n,o){let a=n||e.options.databaseURL;a===void 0&&(e.options.projectId||vd("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),ga("Using default host for project ",e.options.projectId),a=`${e.options.projectId}-default-rtdb.firebaseio.com`);let s=WB(a,o),l=s.repoInfo,c;typeof process<"u"&&aB&&(c=aB[hAe]),c?(a=`http://${c}?ns=${l.namespace}`,s=WB(a,o),l=s.repoInfo):s.repoInfo.secure;const u=new P4e(e.name,e.options,t);$Ee("Invalid Firebase Database URL",s),Yr(s.path)||vd("Database URL must point to the root of a Firebase Database (not including a child path).");const d=xAe(l,e,u,new T4e(e,r));return new bAe(d,e)}function yAe(e,t){const r=t6[t];(!r||r[e.key]!==e)&&vd(`Database ${t}(${e.repoInfo_}) has already been deleted.`),tAe(e),delete r[e.key]}function xAe(e,t,r,n){let o=t6[t.name];o||(o={},t6[t.name]=o);let a=o[e.toURLString()];return a&&vd("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),a=new GEe(e,gAe,r,n),o[e.toURLString()]=a,a}class bAe{constructor(t,r){this._repoInternal=t,this.app=r,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(KEe(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new Qf(this._repo,hn())),this._rootInternal}_delete(){return this._rootInternal!==null&&(yAe(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(t){this._rootInternal===null&&vd("Cannot call "+t+" on a deleted database.")}}function wAe(e=r4e(),t){const r=XCe(e,"database").getImmediate({identifier:t});if(!r._instanceStarted){const n=F_e("database");n&&SAe(r,...n)}return r}function SAe(e,t,r,n={}){e=ES(e),e._checkNotDeleted("useEmulator");const o=`${t}:${r}`,a=e._repoInternal;if(e._instanceStarted){if(o===e._repoInternal.repoInfo_.host&&J2(n,a.repoInfo_.emulatorOptions))return;vd("connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.")}let s;if(a.repoInfo_.nodeAdmin)n.mockUserToken&&vd('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),s=new b0(b0.OWNER);else if(n.mockUserToken){const l=typeof n.mockUserToken=="string"?n.mockUserToken:D_e(n.mockUserToken,e.app.options.projectId);s=new b0(l)}qP(t)&&(M_e(t),W_e("Database",!0)),mAe(a,o,n,s)}/**
|
||
* @license
|
||
* Copyright 2021 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/function jAe(e){p4e(t4e),ew(new Hx("database",(t,{instanceIdentifier:r})=>{const n=t.getProvider("app").getImmediate(),o=t.getProvider("auth-internal"),a=t.getProvider("app-check-internal");return vAe(n,o,a,r)},"PUBLIC").setMultipleInstances(!0)),om(sB,lB,e),om(sB,lB,"esm2017")}cd.prototype.simpleListen=function(e,t){this.sendRequest("q",{p:e},t)};cd.prototype.echo=function(e,t){this.sendRequest("echo",{d:e},t)};jAe();var kAe="firebase",_Ae="11.10.0";/**
|
||
* @license
|
||
* Copyright 2020 Google LLC
|
||
*
|
||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
* you may not use this file except in compliance with the License.
|
||
* You may obtain a copy of the License at
|
||
*
|
||
* http://www.apache.org/licenses/LICENSE-2.0
|
||
*
|
||
* Unless required by applicable law or agreed to in writing, software
|
||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
* See the License for the specific language governing permissions and
|
||
* limitations under the License.
|
||
*/om(kAe,_Ae,"app");const aQ="AIzaSyBbrU8aLBBUyXPYWRSlVBNGYRRq1AcdXQ4",sQ="https://eventbuzz-live-default-rtdb.asia-southeast1.firebasedatabase.app";let t0=null;function lQ(){return!!(aQ.trim()&&sQ.trim())}function CAe(){if(!lQ())throw new Error("VITE_FIREBASE_API_KEY and VITE_FIREBASE_DATABASE_URL must be set.");return t0||(rB().length?t0=rB()[0]:t0=$G({apiKey:aQ.trim(),databaseURL:sQ.trim()})),t0}function EAe(){return wAe(CAe())}function hw(e){if(typeof e=="number"&&!Number.isNaN(e))return e;const t=Number(e);return Number.isFinite(t)?t:0}function AAe(e){return!e||typeof e!="object"||Array.isArray(e)?[]:Object.entries(e).map(([r,n])=>{if(!n||typeof n!="object")return null;const o=n,s=(o._id!=null&&String(o._id).trim()!==""?String(o._id).trim():"")||r,l=o.status!=null?String(o.status):"pending";return{_id:s,author:String(o.authorName??"Anonymous"),text:String(o.question??""),up:hw(o.upvotes),down:hw(o.downvotes),createdAt:o.createdAt!=null?String(o.createdAt):void 0,status:l,shortlisted:!!o.shortlisted,audienceListed:o.audienceListed!==!1}}).filter(r=>r!=null).sort((r,n)=>{if(n.up!==r.up)return n.up-r.up;const o=r.createdAt?Date.parse(r.createdAt):0;return(n.createdAt?Date.parse(n.createdAt):0)-o})}function TAe(e){if(!Array.isArray(e))return[];const t=[];for(const r of e){if(!r||typeof r!="object")continue;const n=r,o=n._id!=null?String(n._id):"";if(!o)continue;const a=n.participant&&typeof n.participant=="object"&&!Array.isArray(n.participant)?n.participant:null;let s="Anonymous";if(!n.isAnonymous&&a){const u=a.displayName!=null?String(a.displayName).trim():"",d=[a.firstName,a.lastName].filter(h=>h!=null&&String(h).trim()).map(h=>String(h).trim()).join(" ").trim(),f=a.email!=null?String(a.email).trim():"";s=u||d||f&&f.split("@")[0]||"Guest"}const l=n.status!=null?String(n.status):"pending",c=n.createdAt!=null?typeof n.createdAt=="string"?n.createdAt:new Date(n.createdAt).toISOString():void 0;t.push({_id:o,author:s,text:n.question!=null?String(n.question):"",up:hw(n.upvotes),down:hw(n.downvotes),createdAt:c,status:l,shortlisted:!!n.shortlisted,audienceListed:n.audienceListed!==!1})}return t.sort((r,n)=>{if(n.up!==r.up)return n.up-r.up;const o=r.createdAt?Date.parse(r.createdAt):0;return(n.createdAt?Date.parse(n.createdAt):0)-o}),t}function PAe(e,t,r){const n=EAe(),o=dAe(n,`sessions/${e}/questions`);return pAe(o,a=>{try{t(AAe(a.val()))}catch(s){r==null||r(s instanceof Error?s:new Error(String(s)))}},a=>{r==null||r(a instanceof Error?a:new Error(String(a)))})}const cQ={listBySession(e){return Xe.get(`/sessions/${e}/questions`)},patch(e,t){return Fg(`/questions/${e}`,{method:"PATCH",body:JSON.stringify(t),skipGlobalLoading:!0})}},OAe=4e3;function IAe(e){return/permission_denied|PERMISSION_DENIED|permission denied/i.test(e)}function NAe(e){const[t,r]=j.useState([]),[n,o]=j.useState(!0),[a,s]=j.useState(null),l=(e==null?void 0:e.trim())??"";return j.useEffect(()=>{if(!l){r([]),o(!1),s(null);return}let c=!1,u=null,d=null,f=!1;const h=async()=>{var x;const y=await cQ.listBySession(l);if(c)return;if(y.error){s(y.error),r([]),o(!1);return}const m=TAe(((x=y.data)==null?void 0:x.questions)??[]);r(m),o(!1),s(null)},p=()=>{f||(f=!0,d&&(d(),d=null),h(),u=setInterval(()=>{c||document.visibilityState!=="visible"||h()},OAe))};return o(!0),s(null),lQ()?d=PAe(l,y=>{c||f||(r(y),o(!1),s(null))},y=>{if(c)return;const m=y.message||String(y);if(IAe(m)){p();return}s(m),r([]),o(!1)}):p(),()=>{c=!0,d&&d(),u&&clearInterval(u)}},[l]),{items:t,loading:n,error:a}}function x8(e){return!Number.isNaN(e.getTime())}function b8(e){if(e==null||String(e).trim()==="")return"—";const t=new Date(e);return x8(t)?t.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"}):String(e)}function uQ(e){if(e==null||String(e).trim()==="")return"";const t=String(e).trim(),r=t.match(/^(\d{4}-\d{2}-\d{2})/);if(r)return r[1];const n=new Date(t);return x8(n)?n.toISOString().slice(0,10):""}function RAe(e){if(!e||!/^\d{4}-\d{2}-\d{2}$/.test(e))return"Date TBD";const t=new Date(`${e}T12:00:00`);return x8(t)?t.toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric",year:"numeric"}):e}function LAe(e){return e===new Date().toISOString().slice(0,10)}function dQ(e){const t=new Map;for(const n of e){const o=n.trackId??null,a=n.name||"Unassigned";for(const s of n.sessions){const c=uQ(s.startTime)||"_nodate";t.has(c)||t.set(c,[]),t.get(c).push({trackId:o,trackName:a,sessionId:s.sessionId,title:s.title,startTime:s.startTime})}}return Array.from(t.keys()).sort((n,o)=>n==="_nodate"?1:o==="_nodate"?-1:n.localeCompare(o)).map(n=>{const o=t.get(n),a=new Map;for(const s of o){const l=s.trackId??s.trackName;a.has(l)||a.set(l,{trackId:s.trackId,trackName:s.trackName,sessions:[]}),a.get(l).sessions.push({sessionId:s.sessionId,title:s.title,startTime:s.startTime})}return a.forEach(s=>s.sessions.sort((l,c)=>l.startTime.localeCompare(c.startTime))),{dateKey:n,dateLabel:n==="_nodate"?"No date":RAe(n),tracks:Array.from(a.values())}})}function fQ(e){const t=[];for(const r of e)for(const n of r.sessions)t.push({id:n.sessionId,trackName:r.name||"Unassigned",label:n.title,startTime:n.startTime,timeLabel:b8(n.startTime),dateKey:uQ(n.startTime)||"_nodate"});return t.sort((r,n)=>r.startTime.localeCompare(n.startTime)),t}function pQ({sessions:e,sessionId:t,onOpenSessionPicker:r}){const n=e.find(a=>a.id===t)??e[0],o=e.length>1;return e.length===0?null:i.jsxs("div",{style:{display:"flex",alignItems:"stretch",background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",overflow:"hidden"},children:[i.jsxs("div",{style:{padding:"7px 14px",flex:1},children:[i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"1px",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Session"}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.3"},children:[(n==null?void 0:n.label)??"—",i.jsx("span",{style:{color:"var(--muted)",fontWeight:"var(--font-weight-normal)",marginLeft:"6px"},children:(n==null?void 0:n.timeLabel)??""})]})]}),o?i.jsx("button",{type:"button",onClick:r,style:{padding:"0 14px",background:"var(--secondary)",border:"none",borderLeft:"1px solid var(--border)",cursor:"pointer",display:"flex",alignItems:"center",color:"var(--primary)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:"Change"}):null]})}function hQ({dateGroups:e,onSelectSession:t,selectPrompt:r}){var f;const n=new Date().toISOString().slice(0,10),o=e.some(h=>h.dateKey===n)?n:((f=e[0])==null?void 0:f.dateKey)??"",[a,s]=j.useState(o),[l,c]=j.useState(new Set);j.useEffect(()=>{e.length&&o&&s(o)},[e.length,o]);const u=e.find(h=>h.dateKey===a)??e[0];j.useEffect(()=>{const h=e.find(y=>y.dateKey===a)??e[0];if(!(h!=null&&h.tracks.length)){c(new Set);return}const p=h.tracks.map((y,m)=>String(y.trackId??y.trackName??`t-${m}`));c(new Set(p))},[a,e]);const d=h=>{c(p=>{const y=new Set(p);return y.has(h)?y.delete(h):y.add(h),y})};return e.length===0?i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:320,padding:24,textAlign:"center"},children:[i.jsx(Jee,{size:40,style:{color:"var(--border)",marginBottom:12}}),i.jsx("p",{style:{fontSize:"var(--text-base)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"No sessions in this event. Add tracks and sessions in Agenda first."})]}):i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:380,padding:24},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:16},children:r??"Select a session"}),i.jsx("div",{style:{display:"flex",gap:4,marginBottom:20,flexWrap:"wrap",justifyContent:"center"},children:e.map(h=>i.jsx("button",{type:"button",onClick:()=>s(h.dateKey),style:{padding:"8px 16px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:a===h.dateKey?"var(--primary)":"var(--card)",color:a===h.dateKey?"var(--primary-foreground)":"var(--foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:a===h.dateKey?600:400,cursor:"pointer"},children:h.dateKey!=="_nodate"&&LAe(h.dateKey)?"Today":h.dateLabel},h.dateKey))}),i.jsx("div",{style:{width:"100%",maxWidth:920,border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden",background:"var(--card)"},children:u==null?void 0:u.tracks.map((h,p)=>{const y=String(h.trackId??h.trackName??`t-${p}`),m=l.has(y);return i.jsxs("div",{style:{borderBottom:p<u.tracks.length-1?"1px solid var(--border)":"none"},children:[i.jsxs("button",{type:"button",onClick:()=>d(y),style:{width:"100%",display:"flex",alignItems:"center",gap:8,padding:"12px 16px",background:"var(--secondary)",border:"none",cursor:"pointer",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",fontWeight:600,color:"var(--foreground)",textAlign:"left"},children:[i.jsx(po,{size:14,style:{transform:m?"rotate(180deg)":"none",transition:"transform 0.2s"}}),h.trackName,i.jsxs("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",fontWeight:400},children:["(",h.sessions.length," session",h.sessions.length!==1?"s":"",")"]})]}),m&&i.jsx("div",{style:{padding:"4px 0"},children:h.sessions.map(x=>i.jsxs("button",{type:"button",onClick:()=>t(x.sessionId),style:{width:"100%",padding:"10px 16px 10px 44px",border:"none",background:"none",cursor:"pointer",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--foreground)",textAlign:"left"},onMouseEnter:b=>{b.currentTarget.style.background="var(--secondary)"},onMouseLeave:b=>{b.currentTarget.style.background="none"},children:[x.title,i.jsx("span",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginTop:2},children:b8(x.startTime)})]},x.sessionId))})]},y)})})]})}function FAe(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length>=2?(t[0][0]+t[t.length-1][0]).toUpperCase():(t[0]||"?").slice(0,2).toUpperCase()}const qB=["#16a34a","#2563eb","#d97706","#7c3aed","#0891b2","#be185d","#0d9488","#ea580c"];function MAe(e){let t=0;for(let r=0;r<e.length;r++)t=(t+e.charCodeAt(r)*(r+1))%qB.length;return qB[t]??"#64748b"}function DAe(e){if(!e)return"—";const t=Date.parse(e);return Number.isNaN(t)?"—":new Date(t).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function zAe({q:e,busy:t,onShortlist:r,onAudienceToggle:n,onArchive:o,onRestore:a}){const[s,l]=j.useState(!1),c=FAe(e.author),u=MAe(e._id),d=e.status==="archived",f=(h,p,y,m,x)=>i.jsxs("button",{type:"button",disabled:x||t,onClick:y,style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:x||t?"not-allowed":"pointer",opacity:x||t?.55:1,transition:"all 0.1s"},onMouseEnter:b=>{x||t||(b.currentTarget.style.borderColor=m,b.currentTarget.style.color=m,b.currentTarget.style.background=m+"10")},onMouseLeave:b=>{b.currentTarget.style.borderColor="var(--border)",b.currentTarget.style.color="var(--muted)",b.currentTarget.style.background="var(--card)"},children:[h," ",p]});return i.jsxs("div",{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{display:"flex",gap:"0",background:"var(--card)",borderRadius:"var(--radius-card)",border:"1px solid var(--border)",overflow:"hidden",boxShadow:s?"var(--elevation-sm)":"none",transition:"box-shadow 0.15s"},children:[i.jsxs("div",{style:{width:"72px",flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"2px",padding:"16px 0",borderRight:"1px solid var(--border)",background:"var(--secondary)"},children:[i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1"},children:e.up}),i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"upvotes"}),i.jsxs("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[e.down," down"]})]}),i.jsxs("div",{style:{flex:1,padding:"14px 16px",minWidth:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"7px",flexWrap:"wrap"},children:[i.jsx("div",{style:{width:"22px",height:"22px",borderRadius:"50%",background:u,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:i.jsx("span",{style:{color:"#fff",fontSize:"8px",fontFamily:"var(--font-inter)",fontWeight:"600"},children:c})}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)"},children:e.author}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"·"}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:DAe(e.createdAt)}),i.jsxs("span",{style:{marginLeft:"auto",display:"flex",gap:"4px",flexWrap:"wrap"},children:[e.shortlisted&&i.jsx("span",{style:{padding:"2px 8px",borderRadius:"999px",background:"#dcfce7",color:"#15803d",fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600"},children:"Shortlisted"}),!e.audienceListed&&i.jsx("span",{style:{padding:"2px 8px",borderRadius:"999px",background:"#fee2e2",color:"#b91c1c",fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600"},children:"Hidden"}),d&&i.jsx("span",{style:{padding:"2px 8px",borderRadius:"999px",background:"#f1f5f9",color:"#475569",fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600"},children:"Archived"}),e.status==="answered"&&!d&&i.jsx("span",{style:{padding:"2px 8px",borderRadius:"999px",background:"#e0f2fe",color:"#0369a1",fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600"},children:"Answered"})]})]}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)",lineHeight:"1.6",marginBottom:"10px"},children:e.text}),i.jsxs("div",{style:{display:"flex",gap:"6px",flexWrap:"wrap"},children:[e.shortlisted?f(i.jsx(tI,{size:11}),"Remove shortlist",()=>r(!1),"#15803d",d):f(i.jsx(tI,{size:11}),"Shortlist",()=>r(!0),"#15803d",d),e.audienceListed?f(i.jsx(R6,{size:11}),"Hide from audience",()=>n(!1),"#b91c1c",d):f(i.jsx(Ah,{size:11}),"Show to audience",()=>n(!0),"#15803d",d),d?f(i.jsx(Ite,{size:11}),"Restore",a,"#2563eb",!1):f(i.jsx(QJ,{size:11}),"Archive",o,"#475569",!1)]})]})]})}function gQ({fixedSessionId:e=null,compactChrome:t=!1}={}){const n=qi()==="mobile",{selectedEventId:o}=eo(),[a,s]=j.useState(e??null),[l,c]=j.useState([]),[u,d]=j.useState(!1),[f,h]=j.useState(null),[p,y]=j.useState("All"),[m,x]=j.useState("votes"),[b,w]=j.useState(""),[k,S]=j.useState(!1),[_,P]=j.useState(null),[O,T]=j.useState(null),R=j.useMemo(()=>dQ(l),[l]),I=j.useMemo(()=>fQ(l),[l]),{items:E,loading:A,error:F}=NAe(a);j.useEffect(()=>{if(!o){h(null);return}zr.get(o).then(H=>{var B;(B=H.data)!=null&&B.name?h(H.data.name):h(null)})},[o]),j.useEffect(()=>{if(!o){c([]),s(null);return}d(!0),za.agendaTree(o).then(H=>{var B;d(!1),c(((B=H.data)==null?void 0:B.tracks)??[])})},[o]),j.useLayoutEffect(()=>{if(e){s(e);return}!o||u||a===null&&I.length===1&&s(I[0].id)},[o,u,a,I,e]);const L=j.useMemo(()=>{const H=E.length,B=E.filter(q=>q.shortlisted).length,M=E.filter(q=>!q.audienceListed).length,$=E.filter(q=>q.status==="archived").length;return{All:H,Shortlisted:B,Hidden:M,Archived:$}},[E]),z=j.useMemo(()=>{let H=E;p==="Shortlisted"?H=H.filter(M=>M.shortlisted):p==="Hidden"?H=H.filter(M=>!M.audienceListed):p==="Archived"&&(H=H.filter(M=>M.status==="archived")),H=H.filter(M=>!b||M.text.toLowerCase().includes(b.toLowerCase())||M.author.toLowerCase().includes(b.toLowerCase()));const B=[...H];return m==="votes"?B.sort((M,$)=>$.up-M.up||($.createdAt?Date.parse($.createdAt):0)-(M.createdAt?Date.parse(M.createdAt):0)):B.sort((M,$)=>($.createdAt?Date.parse($.createdAt):0)-(M.createdAt?Date.parse(M.createdAt):0)),B},[E,p,b,m]),V=async(H,B)=>{T(null),P(H);const M=await cQ.patch(H,B);P(null),M.error&&T(M.error)},Q=["All","Shortlisted","Hidden","Archived"];if(!o)return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:24,alignItems:"center",justifyContent:"center",minHeight:280},children:[i.jsx(Wi,{size:40,style:{color:"var(--border)"}}),i.jsx("p",{style:{fontSize:"var(--text-base)",color:"var(--muted)"},children:"Select an event to manage audience questions."})]});const U=!e&&a===null,ee=I.find(H=>H.id===a);return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[t?i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:[L.All," in session · ",i.jsxs("span",{style:{color:"#15803d"},children:[L.Shortlisted," shortlisted"]})," · ",i.jsxs("span",{style:{color:"#b91c1c"},children:[L.Hidden," hidden"]})," · ",i.jsxs("span",{children:[L.Archived," archived"]})]}):i.jsxs("div",{style:{display:"flex",alignItems:n?"stretch":"flex-start",flexDirection:n?"column":"row",justifyContent:"space-between",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:f??"Event"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:n?"var(--text-xl)":"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"6px"},children:"Questions"}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[L.All," in session · ",i.jsxs("span",{style:{color:"#15803d"},children:[L.Shortlisted," shortlisted"]})," · ",i.jsxs("span",{style:{color:"#b91c1c"},children:[L.Hidden," hidden"]})," · ",i.jsxs("span",{children:[L.Archived," archived"]})]})]}),!U&&!e?i.jsx("div",{style:{flex:n?1:"none",minWidth:0,maxWidth:n?"100%":360},children:i.jsx(pQ,{sessions:I,sessionId:a,onOpenSessionPicker:()=>s(null)})}):null]}),O&&i.jsx("div",{style:{padding:"10px 14px",borderRadius:"var(--radius-button)",background:"#fef2f2",border:"1px solid #fecaca",color:"#b91c1c",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:O}),U?u?i.jsx("div",{style:{padding:48,textAlign:"center",color:"var(--muted)"},children:"Loading sessions…"}):i.jsx(hQ,{dateGroups:R,onSelectSession:H=>s(H),selectPrompt:"Select a session to view and moderate audience questions"}):i.jsxs(i.Fragment,{children:[ee&&!t&&i.jsxs("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)"},children:["Session: ",i.jsx("strong",{style:{color:"var(--foreground)"},children:ee.label}),i.jsx("span",{style:{marginLeft:8},children:ee.trackName}),i.jsx("span",{style:{marginLeft:8,color:"var(--muted)"},children:b8(ee.startTime)})]}),F&&i.jsx("div",{style:{padding:"12px 16px",borderRadius:"var(--radius-button)",background:"#fff7ed",border:"1px solid #fed7aa",color:"#9a3412",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:F}),A&&!F?i.jsx("div",{style:{padding:48,textAlign:"center",color:"var(--muted)"},children:"Loading questions…"}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[i.jsx("div",{style:{display:"flex",background:"var(--secondary)",borderRadius:"var(--radius-button)",padding:"2px",gap:"2px"},children:Q.map(H=>i.jsxs("button",{type:"button",onClick:()=>y(H),style:{padding:"5px 12px",borderRadius:"var(--radius-button)",border:"none",background:p===H?"var(--card)":"transparent",color:p===H?"var(--foreground)":"var(--muted)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:p===H?"var(--font-weight-medium)":"var(--font-weight-normal)",cursor:"pointer",transition:"all 0.12s",boxShadow:p===H?"var(--elevation-sm)":"none",display:"flex",alignItems:"center",gap:"5px"},children:[H==="Hidden"?"Hidden from audience":H,L[H]>0&&i.jsx("span",{style:{padding:"0 5px",borderRadius:"999px",background:p===H?"var(--accent)":"transparent",color:p===H?"var(--primary)":"var(--muted)",fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600"},children:L[H]})]},H))}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"7px",padding:"0 10px",height:"32px",flex:"1 1 180px",background:"var(--card)",border:`1px solid ${k?"var(--ring)":"var(--border)"}`,borderRadius:"var(--radius-button)",transition:"border-color 0.12s"},children:[i.jsx(Pi,{size:12,style:{color:"var(--muted)",flexShrink:0}}),i.jsx("input",{value:b,onChange:H=>w(H.target.value),placeholder:"Search questions or authors…",onFocus:()=>S(!0),onBlur:()=>S(!1),style:{background:"transparent",border:"none",outline:"none",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)",width:"100%"}}),b&&i.jsx("button",{type:"button",onClick:()=>w(""),style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",padding:0},children:i.jsx(er,{size:11})})]}),i.jsxs("button",{type:"button",onClick:()=>x(H=>H==="votes"?"recent":"votes"),style:{display:"flex",alignItems:"center",gap:"5px",height:"32px",padding:"0 12px",borderRadius:"var(--radius-button)",background:"var(--card)",border:"1px solid var(--border)",color:"var(--muted)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},onMouseEnter:H=>{H.currentTarget.style.borderColor="var(--primary)",H.currentTarget.style.color="var(--primary)"},onMouseLeave:H=>{H.currentTarget.style.borderColor="var(--border)",H.currentTarget.style.color="var(--muted)"},children:[i.jsx(eee,{size:12}),m==="votes"?"Most upvoted":"Most recent"]})]}),z.length===0?i.jsxs("div",{style:{textAlign:"center",padding:"64px 20px",border:"2px dashed var(--border)",borderRadius:"var(--radius-card)"},children:[i.jsx(ch,{size:32,style:{color:"var(--border)",margin:"0 auto 12px"}}),i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"6px"},children:b?"No questions match your search":"No questions yet"}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--muted)"},children:b?"Try different keywords.":"Audience questions will appear here when submitted for this session."})]}):i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:z.map(H=>i.jsx(zAe,{q:H,busy:_===H._id,onShortlist:B=>void V(H._id,{shortlisted:B}),onAudienceToggle:B=>void V(H._id,{audienceListed:B}),onArchive:()=>void V(H._id,{status:"archived"}),onRestore:()=>void V(H._id,{status:"pending"})},H._id))})]})]}),t?null:i.jsx("div",{style:{paddingTop:"8px",borderTop:"1px solid var(--border)",textAlign:"center"},children:i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"© 2026 Stratawiz Technologies Pvt Ltd · EventBuzz"})})]})}const BAe=[{rank:1,name:"Ravi Gulhane",polls:18,quiz:27,total:45},{rank:2,name:"Pawankumar J.",polls:15,quiz:23,total:38},{rank:3,name:"Zeeshan",polls:12,quiz:20,total:32},{rank:4,name:"Amey Bhagwat",polls:10,quiz:18,total:28},{rank:5,name:"Abhijit Aundhkar",polls:8,quiz:16,total:24},{rank:6,name:"Shabareesh D.",polls:7,quiz:14,total:21}],WAe={Active:{bg:"#dcfce7",color:"#15803d"},Completed:{bg:"var(--secondary)",color:"var(--muted)"},Draft:{bg:"#f3f4f6",color:"#6b7280"}},qAe={1:{bg:"#fef3c7",color:"#92400e",medal:"🥇"},2:{bg:"#f1f5f9",color:"#475569",medal:"🥈"},3:{bg:"#ffedd5",color:"#c2410c",medal:"🥉"}},Q4={width:28,height:28,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",cursor:"pointer",color:"var(--muted)",flexShrink:0};function $Ae({sessions:e,itemId:t,itemType:r,eventId:n,onClose:o,onDone:a}){const[s,l]=j.useState(""),[c,u]=j.useState(!1),[d,f]=j.useState(!1),[h,p]=j.useState(null);j.useEffect(()=>{t&&(l(""),u(!0),p(null),Oa.get(t).then(m=>{var x;u(!1),(x=m.data)!=null&&x.session?l(String(m.data.session)):e.length&&l(e[0].id)}))},[t,e.length]);const y=async()=>{if(!s||!n)return;f(!0),p(null);const m=await Oa.get(t);if(m.error||!m.data){p(m.error||"Failed to load item"),f(!1);return}const x=m.data,b={session:s,title:(x.title||"").trim()+" (Copy)",type:x.type,description:x.description,questions:(x.questions||[]).map(k=>({question:k.question,type:k.type,options:k.options,points:k.points,required:k.required})),settings:x.settings?{...x.settings,isLive:!1}:void 0},w=await Oa.create(n,b);if(f(!1),w.error){p(w.error);return}a(),o()};return c?i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.35)",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx("div",{style:{background:"var(--card)",padding:24,borderRadius:"var(--radius-card)"},children:"Loading…"})}):i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.35)",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",padding:24},onClick:o,children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"100%",maxWidth:420,boxShadow:"var(--elevation-sm)"},onClick:m=>m.stopPropagation(),children:[i.jsxs("div",{style:{padding:"20px 24px",borderBottom:"1px solid var(--border)"},children:[i.jsxs("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:600,color:"var(--foreground)",marginBottom:4},children:["Copy ",r==="poll"?"Poll":"Quiz"]}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:["Select the session to copy this ",r," to (with all questions)."]})]}),i.jsxs("div",{style:{padding:"20px 24px"},children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:500,marginBottom:8},children:"Session"}),i.jsxs("select",{value:s,onChange:m=>l(m.target.value),style:{width:"100%",height:40,padding:"0 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",fontSize:"var(--text-sm)"},children:[i.jsx("option",{value:"",children:"Select session"}),e.map(m=>i.jsxs("option",{value:m.id,children:[m.label," · ",m.trackName]},m.id))]}),h&&i.jsx("p",{style:{marginTop:8,fontSize:"var(--text-sm)",color:"var(--destructive)"},children:h})]}),i.jsxs("div",{style:{padding:"14px 24px",borderTop:"1px solid var(--border)",display:"flex",justifyContent:"flex-end",gap:8},children:[i.jsx("button",{type:"button",onClick:o,style:{padding:"8px 16px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",fontSize:"var(--text-sm)"},children:"Cancel"}),i.jsx("button",{type:"button",onClick:y,disabled:!s||d,style:{padding:"8px 16px",borderRadius:"var(--radius-button)",border:"none",background:s&&!d?"var(--primary)":"var(--border)",color:s&&!d?"var(--primary-foreground)":"var(--muted)",cursor:s&&!d?"pointer":"not-allowed",fontSize:"var(--text-sm)",fontWeight:600},children:d?"Copying…":"Copy here"})]})]})})}function UAe({live:e,onChange:t}){return i.jsxs("button",{onClick:t,style:{display:"flex",alignItems:"center",gap:"6px",padding:"4px 10px",borderRadius:"999px",background:e?"#f0fdf4":"var(--secondary)",border:`1px solid ${e?"#bbf7d0":"var(--border)"}`,cursor:"pointer",transition:"all 0.15s",whiteSpace:"nowrap"},children:[i.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:e?"#16a34a":"var(--border)",display:"block",flexShrink:0}}),i.jsx("span",{style:{fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:e?"#15803d":"var(--muted)"},children:e?"Live":"Not Live"})]})}function X4({checked:e,onChange:t}){return i.jsxs("button",{onClick:t,style:{width:"16px",height:"16px",borderRadius:"3px",border:`1.5px solid ${e?"var(--primary)":"var(--border)"}`,background:e===!0?"var(--primary)":"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexShrink:0,padding:0},children:[e===!0&&i.jsx(Oi,{size:10,strokeWidth:3,color:"#fff"}),e==="indeterminate"&&i.jsx(Ow,{size:10,strokeWidth:3,color:"var(--primary)"})]})}function HAe({polls:e,quizzes:t,onClose:r}){const[n,o]=j.useState(new Set),[a,s]=j.useState(new Set),[l,c]=j.useState(!0),[u,d]=j.useState(!1),f=_=>o(P=>{const O=new Set(P);return O.has(_)?O.delete(_):O.add(_),O}),h=_=>s(P=>{const O=new Set(P);return O.has(_)?O.delete(_):O.add(_),O}),p=e.map(_=>_.id),y=t.map(_=>_.id),m=n.size+a.size,x=p.length+y.length,b=n.size===p.length&&a.size===y.length,w=m>0,k=()=>m===0?!1:m===x?!0:"indeterminate",S=()=>{b?(o(new Set),s(new Set)):(o(new Set(p)),s(new Set(y)))};return i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(15,48,114,0.3)",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",backdropFilter:"blur(2px)"},children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"100%",maxWidth:"680px",maxHeight:"90vh",display:"flex",flexDirection:"column",boxShadow:"var(--elevation-sm)",overflow:"hidden"},children:[i.jsxs("div",{style:{background:"var(--primary)",padding:"16px 20px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx(od,{size:15,color:"rgba(255,255,255,0.9)"}),i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"#fff"},children:"Session Leaderboard"})]}),i.jsx("button",{onClick:r,style:{background:"none",border:"none",cursor:"pointer",color:"rgba(255,255,255,0.7)",display:"flex"},children:i.jsx(er,{size:16})})]}),i.jsxs("div",{style:{flex:1,overflowY:"auto"},children:[i.jsxs("div",{style:{borderBottom:"1px solid var(--border)"},children:[i.jsxs("button",{onClick:()=>c(_=>!_),style:{width:"100%",display:"flex",alignItems:"center",gap:"10px",padding:"12px 20px",background:"var(--secondary)",border:"none",cursor:"pointer",borderBottom:l?"1px solid var(--border)":"none"},children:[i.jsx(hee,{size:13,style:{color:"var(--muted)"}}),i.jsx("span",{style:{flex:1,textAlign:"left",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:"Filter Quizzes & Polls"}),m>0&&!u&&i.jsxs("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",background:"var(--accent)",color:"var(--primary)",padding:"2px 7px",borderRadius:"999px",fontWeight:"600"},children:[m," selected"]}),i.jsx(po,{size:13,style:{color:"var(--muted)",transform:l?"rotate(180deg)":"none",transition:"transform 0.15s"}})]}),l&&i.jsxs("div",{style:{padding:"16px 20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"14px",paddingBottom:"12px",borderBottom:"1px solid var(--border)"},children:[i.jsx(X4,{checked:k(),onChange:S}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)"},children:"Select all"}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginLeft:"auto"},children:[m," of ",x," selected"]})]}),i.jsxs("div",{style:{marginBottom:"14px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"8px"},children:[i.jsx(nu,{size:12,style:{color:"#16a34a"}}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"#16a34a",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Polls"})]}),e.map(_=>i.jsxs("div",{onClick:()=>f(_.id),style:{width:"100%",display:"flex",alignItems:"center",gap:"8px",padding:"7px 0 7px 16px",borderBottom:"1px solid var(--border)",cursor:"pointer"},children:[i.jsx(X4,{checked:n.has(_.id),onChange:()=>{}}),i.jsx("span",{style:{flex:1,textAlign:"left",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:_.name})]},_.id))]}),i.jsxs("div",{children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginBottom:"8px"},children:[i.jsx(M6,{size:12,style:{color:"var(--primary)"}}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--primary)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Quizzes"})]}),t.map(_=>i.jsxs("div",{onClick:()=>h(_.id),style:{width:"100%",display:"flex",alignItems:"center",gap:"8px",padding:"7px 0 7px 16px",borderBottom:"1px solid var(--border)",cursor:"pointer"},children:[i.jsx(X4,{checked:a.has(_.id),onChange:()=>{}}),i.jsx("span",{style:{flex:1,textAlign:"left",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:_.name})]},_.id))]}),i.jsxs("button",{onClick:()=>w&&d(!0),style:{width:"100%",marginTop:"16px",padding:"11px",borderRadius:"var(--radius-button)",background:w?"var(--primary)":"var(--border)",color:w?"var(--primary-foreground)":"var(--muted)",border:"none",cursor:w?"pointer":"not-allowed",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"background 0.15s"},children:[i.jsx(od,{size:13})," Generate Leaderboard"]})]})]}),u?i.jsxs("div",{style:{padding:"20px"},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:"14px"},children:"Results"}),i.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:[i.jsx("div",{style:{display:"grid",gridTemplateColumns:"48px 1fr 80px 80px 80px",background:"var(--secondary)",borderBottom:"1px solid var(--border)"},children:["#","Participant","Polls","Quiz","Total"].map((_,P)=>i.jsx("div",{style:{padding:"8px 12px",fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.04em",textAlign:P>1?"right":"left"},children:_},_))}),BAe.map(_=>{const P=qAe[_.rank];return i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"48px 1fr 80px 80px 80px",alignItems:"center",borderBottom:"1px solid var(--border)",background:"var(--card)"},children:[i.jsx("div",{style:{padding:"10px 12px"},children:P?i.jsx("span",{style:{fontSize:"13px"},children:P.medal}):i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:["#",_.rank]})}),i.jsx("div",{style:{padding:"10px 12px"},children:i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)",fontWeight:"var(--font-weight-medium)"},children:_.name})}),i.jsx("div",{style:{padding:"10px 12px",textAlign:"right"},children:i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:_.polls})}),i.jsx("div",{style:{padding:"10px 12px",textAlign:"right"},children:i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:_.quiz})}),i.jsx("div",{style:{padding:"10px 12px",textAlign:"right"},children:i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:_.total})})]},_.rank)})]})]}):l?null:i.jsxs("div",{style:{padding:"60px 20px",textAlign:"center"},children:[i.jsx(od,{size:40,style:{color:"var(--border)",margin:"0 auto 14px"}}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"6px"},children:"Select quizzes and polls to generate"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Use the filter section above to pick items, then click Generate Leaderboard."})]})]})]})})}function $B({name:e,description:t,badge:r,status:n,live:o,onToggleLive:a,onDuplicate:s,onEdit:l,onDelete:c}){const[u,d]=j.useState(!1),f=WAe[n];return i.jsxs("div",{onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{display:"flex",alignItems:"center",gap:"12px",padding:"13px 18px",borderBottom:"1px solid var(--border)",background:u?"var(--secondary)":"var(--card)",transition:"background 0.12s"},children:[i.jsx(sv,{size:13,style:{color:"var(--border)",flexShrink:0}}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"7px",marginBottom:"3px",flexWrap:"wrap"},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:e}),i.jsx("span",{style:{padding:"1px 7px",borderRadius:"3px",background:f.bg,color:f.color,fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600"},children:n}),r&&i.jsx("span",{style:{padding:"1px 7px",borderRadius:"3px",background:"var(--accent)",color:"var(--accent-foreground)",fontSize:"10px",fontFamily:"var(--font-noto-sans)"},children:r})]}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",lineHeight:"1.45",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"480px"},children:t})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",flexShrink:0},children:[i.jsx(UAe,{live:o,onChange:a}),i.jsx("button",{type:"button",onClick:s,style:Q4,title:"Duplicate",onMouseEnter:h=>{h.currentTarget.style.borderColor="var(--primary)",h.currentTarget.style.color="var(--primary)"},onMouseLeave:h=>{h.currentTarget.style.borderColor="var(--border)",h.currentTarget.style.color="var(--muted)"},children:i.jsx(iu,{size:12})}),i.jsx("button",{type:"button",onClick:l,style:Q4,title:"Edit",onMouseEnter:h=>{h.currentTarget.style.borderColor="var(--primary)",h.currentTarget.style.color="var(--primary)"},onMouseLeave:h=>{h.currentTarget.style.borderColor="var(--border)",h.currentTarget.style.color="var(--muted)"},children:i.jsx(Ii,{size:12})}),i.jsx("button",{type:"button",onClick:c,style:{...Q4,color:"var(--muted)"},title:"Delete",onMouseEnter:h=>{h.currentTarget.style.borderColor="var(--destructive)",h.currentTarget.style.color="var(--destructive)"},onMouseLeave:h=>{h.currentTarget.style.borderColor="var(--border)",h.currentTarget.style.color="var(--muted)"},children:i.jsx(gn,{size:12})})]})]})}function UB(e){var a,s,l,c,u,d;const t=(a=e.settings)==null?void 0:a.status,r=!t&&(((s=e.settings)==null?void 0:s.isLive)===!1||((l=e.settings)==null?void 0:l.isLive)===void 0&&((c=e.settings)==null?void 0:c.isActive)===!1),n=t==="draft"||r,o=((u=e.settings)==null?void 0:u.isLive)??((d=e.settings)==null?void 0:d.isActive)??!1;return{id:e._id,name:e.title,description:e.description??"",status:n?"Draft":"Active",live:o,type:e.type==="quiz"?"Quiz":void 0}}function VAe(e){return e!=null&&e.length?e.map((t,r)=>{const n=(t.options||[]).map((a,s)=>({id:`o-${r}-${s}`,text:a.text||"",isCorrect:!!a.isCorrect,imageUrl:a.imageUrl})),o=n.some(a=>a.imageUrl);return{id:`q-${r}`,text:t.question||"",imageUrl:t.imageUrl,useImagesOptions:o,type:t.type==="multiple"?"Multiple Choice":(t.type==="text"||t.type==="rating","Single Choice"),order:r,options:n,status:"Active"}}):[]}function HB({icon:e,iconColor:t,title:r,count:n,addLabel:o,onAdd:a,children:s}){return i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"13px 18px",borderBottom:"1px solid var(--border)",background:"var(--secondary)"},children:[i.jsx("span",{style:{color:t},children:e}),i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:r}),i.jsx("span",{style:{width:"18px",height:"18px",borderRadius:"50%",background:t,color:"#fff",fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",display:"flex",alignItems:"center",justifyContent:"center"},children:n}),i.jsx("div",{style:{flex:1}}),i.jsxs("button",{onClick:a,style:{display:"flex",alignItems:"center",gap:"5px",padding:"5px 12px",borderRadius:"var(--radius-button)",background:t,color:"#fff",border:"none",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:12})," ",o]})]}),s]})}function mQ({fixedSessionId:e=null,compactChrome:t=!1,onQuizPollPersisted:r}={}){const o=qi()==="mobile",{selectedEventId:a}=eo(),[s,l]=j.useState(e??null),[c,u]=j.useState(!1),[d,f]=j.useState(null),[h,p]=j.useState(null),[y,m]=j.useState(null),[x,b]=j.useState([]),[w,k]=j.useState([]),[S,_]=j.useState(!1),[P,O]=j.useState(!1),T=j.useMemo(()=>dQ(x),[x]),R=j.useMemo(()=>fQ(x),[x]);j.useEffect(()=>{if(!a){b([]),l(null);return}_(!0),za.agendaTree(a).then(B=>{var M;_(!1),b(((M=B.data)==null?void 0:M.tracks)??[])})},[a]),j.useLayoutEffect(()=>{if(e){l(e);return}!a||S||s===null&&R.length===1&&l(R[0].id)},[a,S,s,R,e]);const I=()=>{s&&(O(!0),Oa.listBySession(s).then(B=>{var M;O(!1),k(((M=B.data)==null?void 0:M.quizPolls)??[])}))};j.useEffect(()=>{if(!s){k([]);return}I()},[s]),j.useEffect(()=>{if(!d||d.mode!=="edit"){p(null);return}p(null),Oa.get(d.id).then(B=>{if(!B.data)return;const M=B.data,$=M.type==="quiz"?"quiz":"poll",q=Aoe(M,VAe(M.questions));p({kind:$,form:q.form,questions:q.questions})})},[d]);const E=j.useMemo(()=>w.filter(B=>B.type==="poll").map(UB),[w]),A=j.useMemo(()=>w.filter(B=>B.type==="quiz").map(UB),[w]),F=async B=>{var q,Y,K;const M=w.find(G=>G._id===B);if(!M)return;const $=!(((q=M.settings)==null?void 0:q.isLive)??((Y=M.settings)==null?void 0:Y.isActive));if(await Oa[$?"publish":"close"](B),s){const G=await Oa.listBySession(s);k(((K=G.data)==null?void 0:K.quizPolls)??[])}},L=async B=>{var q,Y,K;const M=w.find(G=>G._id===B);if(!M)return;const $=!(((q=M.settings)==null?void 0:q.isLive)??((Y=M.settings)==null?void 0:Y.isActive));if(await Oa[$?"publish":"close"](B),s){const G=await Oa.listBySession(s);k(((K=G.data)==null?void 0:K.quizPolls)??[])}},z=()=>{f(null),p(null)},V=async B=>{if(!a||!s||!d)return;const M=d.mode==="create"?d.kind:(h==null?void 0:h.kind)??"poll",$=d.mode==="edit"?d.id:null,q=G=>{var re,J;return{question:G.text,imageUrl:(re=G.imageUrl)!=null&&re.trim()?G.imageUrl.trim():null,type:G.type==="Single Choice"||G.type==="True / False"?"single":G.type==="Multiple Choice"?"multiple":"text",options:(J=G.options)==null?void 0:J.map(ae=>{var le;return{text:ae.text,isCorrect:ae.isCorrect,imageUrl:(le=ae.imageUrl)!=null&&le.trim()?ae.imageUrl.trim():null}}),required:!0,...M==="quiz"?{points:1}:{}}},Y={session:s,title:B.form.title,type:M,description:B.form.description||void 0,questions:B.questions.map(q),settings:iT(B.form,M)};if($){(await Oa.update($,Y)).error||(I(),z(),await(r==null?void 0:r()));return}(await Oa.create(a,Y)).error||(I(),z(),await(r==null?void 0:r()))},Q=async B=>{if(!confirm("Delete this poll? You can restore it later if needed (soft delete)."))return;(await Oa.remove(B)).error||I()},U=async B=>{if(!confirm("Delete this quiz? You can restore it later if needed (soft delete)."))return;(await Oa.remove(B)).error||I()};if(!a)return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:24,alignItems:"center",justifyContent:"center",minHeight:280},children:[i.jsx(Wi,{size:40,style:{color:"var(--border)"}}),i.jsx("p",{style:{fontSize:"var(--text-base)",color:"var(--muted)"},children:"Select an event to manage quizzes and polls."})]});const ee=!e&&s===null,H=R.find(B=>B.id===s);return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[t?ee?null:i.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:i.jsxs("button",{type:"button",onClick:()=>u(!0),style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",flexShrink:0},children:[i.jsx(od,{size:13})," ",o?"Leaderboard":"Session Leaderboard"]})}):i.jsxs("div",{style:{display:"flex",alignItems:o?"stretch":"flex-start",flexDirection:o?"column":"row",justifyContent:"space-between",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:"Quiz & Polls"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:o?"var(--text-xl)":"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:"Quiz & Polls"})]}),!ee&&i.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:o?"wrap":"nowrap"},children:[e?null:i.jsx("div",{style:{flex:o?1:"none",minWidth:0},children:i.jsx(pQ,{sessions:R,sessionId:s,onOpenSessionPicker:()=>l(null)})}),i.jsxs("button",{type:"button",onClick:()=>u(!0),style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",flexShrink:0},children:[i.jsx(od,{size:13})," ",o?"Leaderboard":"Session Leaderboard"]})]})]}),ee?S?i.jsx("div",{style:{padding:48,textAlign:"center",color:"var(--muted)"},children:"Loading sessions…"}):i.jsx(hQ,{dateGroups:T,onSelectSession:B=>l(B),selectPrompt:"Select a session to manage quizzes and polls"}):i.jsxs(i.Fragment,{children:[H&&!t&&i.jsxs("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)"},children:["Session: ",i.jsx("strong",{style:{color:"var(--foreground)"},children:H.label}),i.jsx("span",{style:{marginLeft:8},children:H.trackName})]}),P?i.jsx("div",{style:{padding:48,textAlign:"center",color:"var(--muted)"},children:"Loading quizzes & polls…"}):i.jsxs(i.Fragment,{children:[i.jsx(HB,{icon:i.jsx(nu,{size:15}),iconColor:"#16a34a",title:"Polls",count:E.length,addLabel:"Add Poll",onAdd:()=>f({mode:"create",kind:"poll"}),children:E.map(B=>i.jsx($B,{name:B.name,description:B.description,status:B.status,live:B.live,onToggleLive:()=>F(B.id),onDuplicate:()=>m({id:B.id,type:"poll"}),onEdit:()=>f({mode:"edit",id:B.id}),onDelete:()=>Q(B.id)},B.id))}),i.jsx(HB,{icon:i.jsx(M6,{size:15}),iconColor:"var(--primary)",title:"Quizzes",count:A.length,addLabel:"Add Quiz",onAdd:()=>f({mode:"create",kind:"quiz"}),children:A.map(B=>i.jsx($B,{name:B.name,description:B.description,badge:B.type,status:B.status,live:B.live,onToggleLive:()=>L(B.id),onDuplicate:()=>m({id:B.id,type:"quiz"}),onEdit:()=>f({mode:"edit",id:B.id}),onDelete:()=>U(B.id)},B.id))})]})]}),t?null:i.jsx("div",{style:{paddingTop:"8px",borderTop:"1px solid var(--border)",textAlign:"center"},children:i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"© 2026 Stratawiz Technologies Pvt Ltd · EventBuzz"})}),c&&i.jsx(HAe,{polls:E,quizzes:A,onClose:()=>u(!1)}),d&&(d.mode==="create"||h)&&i.jsx(ax,{kind:d.mode==="create"?d.kind:h.kind,initial:d.mode==="edit"?{form:h.form,questions:h.questions}:void 0,eventId:a,onClose:z,onSave:B=>void V(B)},d.mode==="edit"?d.id:`new-${d.kind}`),y&&a&&R.length>0&&i.jsx($Ae,{sessions:R,itemId:y.id,itemType:y.type,eventId:a,onClose:()=>m(null),onDone:I})]})}function r6(e){if(typeof e.enableQnA=="boolean")return e.enableQnA;const t=e.qnaEnabled;return typeof t=="boolean"?t:!0}function n6(e){return typeof e.enableQnP=="boolean"?e.enableQnP:!0}function YAe(e){const t=e.track;let r=null;t&&typeof t=="object"&&"_id"in t?r=String(t._id):typeof t=="string"&&t.trim()&&(r=t);const n=(e.speakers||[]).map(o=>typeof o=="string"?o:o._id);return{title:e.title,description:e.description??"",type:e.type,startTime:e.startTime,endTime:e.endTime,location:e.location,track:r,speakers:n,moderator:e.moderator??null,capacity:e.capacity,status:e.status,resources:e.resources,audienceFeedbackEnabled:e.audienceFeedbackEnabled,audienceRatingsEnabled:e.audienceRatingsEnabled,audienceFeedbackForm:e.audienceFeedbackForm??null,audienceRatingsForm:e.audienceRatingsForm??null,enableQnA:r6(e),enableQnP:n6(e)}}function GAe({event:e,session:t,selectedEventId:r,onSaved:n}){const[o,a]=j.useState(1),[s,l]=j.useState(()=>new Set([1,2,3,4])),[c,u]=j.useState(()=>z0(e)),[d,f]=j.useState(()=>r6(t)),[h,p]=j.useState(()=>n6(t)),[y,m]=j.useState({}),[x,b]=j.useState(!1),[w,k]=j.useState(null),S=j.useRef(null),_=j.useRef(null);j.useEffect(()=>{u(z0(e)),f(r6(t)),p(n6(t)),m({}),k(null)},[e._id,e.updatedAt,t._id,t]);const P=j.useCallback((H,B)=>{u(M=>({...M,[H]:B}))},[]),O=H=>y[H],T=H=>a(B=>B===H?0:H),R=()=>u(H=>({...H,customFields:[...H.customFields,$$()]})),I=H=>{u(B=>({...B,customFields:B.customFields.filter(M=>M.id!==H)})),m(B=>{const M={...B};return Object.keys(M).forEach($=>{($.startsWith(`cf_${H}_`)||$===`cf_${H}_label`)&&delete M[$]}),M})},E=(H,B)=>{u(M=>({...M,customFields:M.customFields.map($=>{if($.id!==H)return $;const q={...$,label:B};return $.codeAuto&&(q.code=ph(B)),q})}))},A=(H,B)=>{u(M=>({...M,customFields:M.customFields.map($=>$.id===H?{...$,code:B,codeAuto:!1}:$)}))},F=(H,B)=>{u(M=>({...M,customFields:M.customFields.map($=>{if($.id!==H)return $;const q={...$,fieldType:B};return nc(B)&&$.options.length===0&&(q.options=[{id:Math.random().toString(36).slice(2),value:"",label:""}]),nc(B)||(q.options=[]),q})}))},L=H=>{u(B=>({...B,customFields:B.customFields.map(M=>M.id===H?{...M,options:[...M.options,{id:Math.random().toString(36).slice(2),value:"",label:""}]}:M)}))},z=(H,B)=>{u(M=>({...M,customFields:M.customFields.map($=>$.id===H?{...$,options:$.options.filter(q=>q.id!==B)}:$)})),m(M=>{const $={...M};return delete $[`cf_${H}_opt_${B}`],$})},V=(H,B,M,$)=>{u(q=>({...q,customFields:q.customFields.map(Y=>Y.id===H?{...Y,options:Y.options.map(K=>K.id===B?{...K,[M]:$}:K)}:Y)}))},Q=H=>{k(null),m({}),l(B=>new Set([...B,H])),H<Zg&&a(H+1)},U=async()=>{k(null);const H=eoe(c,e),B=H.customFields.filter(q=>!(!q.label.trim()||nc(q.fieldType)&&q.options.filter(K=>K.label.trim()&&K.value.trim()).length===0)),M={...H,customFields:B},$=toe(M);if(Object.keys($).length>0){m($),($.virtualLink||$.endDate)&&a(2),k("Fix the highlighted fields, then save again.");return}m({}),b(!0);try{const Y={...B$(M),recordKind:e.recordKind??"activity",activitySubtype:e.activitySubtype},K=await zr.update(r,Y);if(K.error){k(K.error);return}const G=await Da.update(t._id,{...YAe(t),enableQnA:d,enableQnP:h});if(G.error){k(G.error);return}k("Saved."),await n()}finally{b(!1)}},ee=Math.round(s.size/Zg*100);return i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",border:"1px solid var(--border)",overflow:"hidden"},children:[i.jsxs("div",{style:{padding:"14px 20px",borderBottom:"1px solid var(--border)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"6px",flexWrap:"wrap",gap:"10px"},children:[i.jsxs("div",{children:[i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:"Activity settings"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"4px 0 0"},children:"Empty fields keep existing saved values. Session Q&A and quiz toggles are under Basic."})]}),i.jsx("button",{type:"button",disabled:x,onClick:()=>void U(),style:{padding:"8px 18px",borderRadius:"var(--radius-button)",background:x?"var(--secondary)":"var(--primary)",color:x?"var(--muted)":"var(--primary-foreground)",border:"none",cursor:x?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:x?"Saving…":"Save settings"})]}),w&&i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:w==="Saved."?"#15803d":"#b91c1c",margin:"8px 0 0"},children:w}),i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"10px",marginBottom:"6px"},children:[i.jsxs("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:[s.size," of ",Zg," sections complete"]}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",color:"var(--primary)",fontWeight:"var(--font-weight-medium)"},children:[ee,"%"]})]}),i.jsx("div",{style:{height:"6px",borderRadius:"99px",background:"var(--border)",overflow:"hidden"},children:i.jsx("div",{style:{height:"100%",width:`${ee}%`,background:"#22c55e",borderRadius:"99px",transition:"width 0.3s ease"}})})]}),i.jsxs("div",{style:{maxHeight:"min(70vh, 640px)",overflowY:"auto"},children:[i.jsxs(Sf,{n:1,title:"Basic",subtitle:"Name, description, and session features",open:o===1,completed:s.has(1),onToggle:()=>T(1),onNext:()=>Q(1),nextLabel:"Continue to Schedule & Location",nextDisabled:x,children:[i.jsxs(lr,{error:O("eventName"),children:[i.jsx(ur,{text:"Activity name"}),i.jsx("input",{style:{...Xr,...O("eventName")?{borderColor:"var(--destructive)"}:{}},value:c.eventName,onChange:H=>P("eventName",H.target.value)})]}),i.jsxs(lr,{error:O("description"),children:[i.jsx(ur,{text:"Description"}),i.jsx("textarea",{style:{...Xr,resize:"vertical",minHeight:"80px",...O("description")?{borderColor:"var(--destructive)"}:{}},value:c.description,onChange:H=>P("description",H.target.value)})]}),i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:10,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)",cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:d,onChange:H=>f(H.target.checked)}),"Enable Q&A (Questions tab)"]}),i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:10,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)",cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:h,onChange:H=>p(H.target.checked)}),"Enable quiz & polls (Quiz & Polls tab)"]})]}),i.jsxs(Sf,{n:2,title:"Schedule & Location",subtitle:"When and where",open:o===2,completed:s.has(2),onToggle:()=>T(2),onNext:()=>Q(2),nextLabel:"Continue to Media & Tags",nextDisabled:x,children:[i.jsxs(No,{children:[i.jsxs(lr,{error:O("status"),children:[i.jsx(ur,{text:"Status"}),i.jsx(La,{children:i.jsxs("select",{style:{...Ra,...O("status")?{borderColor:"var(--destructive)"}:{}},value:c.status,onChange:H=>P("status",H.target.value),children:[i.jsx("option",{value:"",children:"Select Status"}),i.jsx("option",{children:"Draft"}),i.jsx("option",{children:"Upcoming"}),i.jsx("option",{children:"Live"}),i.jsx("option",{children:"Completed"})]})})]}),i.jsxs(lr,{error:O("locationType"),children:[i.jsx(ur,{text:"Location Type"}),i.jsx(La,{children:i.jsxs("select",{style:{...Ra,...O("locationType")?{borderColor:"var(--destructive)"}:{}},value:c.locationType,onChange:H=>P("locationType",H.target.value),children:[i.jsx("option",{value:"",children:"Select"}),i.jsx("option",{children:"Physical"}),i.jsx("option",{children:"Virtual"}),i.jsx("option",{children:"Hybrid"})]})})]})]}),(c.locationType==="Physical"||c.locationType==="Hybrid")&&i.jsxs(lr,{error:O("venue"),children:[i.jsx(ur,{text:"Venue / Address"}),i.jsx("input",{style:{...Xr,...O("venue")?{borderColor:"var(--destructive)"}:{}},value:c.venue,onChange:H=>P("venue",H.target.value)})]}),(c.locationType==="Virtual"||c.locationType==="Hybrid")&&i.jsxs(lr,{error:O("virtualLink"),children:[i.jsx(ur,{text:"Virtual link"}),i.jsx("input",{style:{...Xr,...O("virtualLink")?{borderColor:"var(--destructive)"}:{}},placeholder:"https://…",value:c.virtualLink,onChange:H=>P("virtualLink",H.target.value)})]}),i.jsxs(No,{children:[i.jsxs(lr,{error:O("startDate"),children:[i.jsx(ur,{text:"Start Date"}),i.jsx("input",{type:"date",style:{...Xr,...O("startDate")?{borderColor:"var(--destructive)"}:{}},value:c.startDate,onChange:H=>P("startDate",H.target.value)})]}),i.jsxs(lr,{error:O("endDate"),children:[i.jsx(ur,{text:"End Date"}),i.jsx("input",{type:"date",style:{...Xr,...O("endDate")?{borderColor:"var(--destructive)"}:{}},value:c.endDate,onChange:H=>P("endDate",H.target.value)})]})]})]}),i.jsxs(Sf,{n:3,title:"Media & Tags",subtitle:"Logo, banner, and tags",open:o===3,completed:s.has(3),onToggle:()=>T(3),onNext:()=>Q(3),nextLabel:"Continue to Registration & Form Fields",nextDisabled:x,children:[i.jsxs(lr,{children:[i.jsx(ur,{text:"Key People (tags)"}),i.jsxs("div",{style:{position:"relative"},children:[i.jsx(Pi,{size:13,style:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)",color:"var(--muted)",pointerEvents:"none"}}),i.jsx("input",{style:{...Xr,paddingLeft:"30px"},placeholder:"Comma-separated",value:c.keyPeople,onChange:H=>P("keyPeople",H.target.value)})]})]}),i.jsxs(No,{children:[i.jsxs(lr,{children:[i.jsx(ur,{text:"Event Logo"}),i.jsx(D0,{label:"logo",preview:c.eventLogo,error:O("eventLogo"),inputRef:S,onFile:H=>{P("eventLogo",H),m(B=>{const M={...B};return delete M.eventLogo,M})}})]}),i.jsxs(lr,{children:[i.jsx(ur,{text:"Banner Image"}),i.jsx(D0,{label:"banner",preview:c.eventBanner,error:O("eventBanner"),inputRef:_,onFile:H=>{P("eventBanner",H),m(B=>{const M={...B};return delete M.eventBanner,M})}})]})]}),i.jsxs(No,{children:[i.jsxs(lr,{children:[i.jsx(ur,{text:"Enable Feedback"}),i.jsx(wf,{name:"enableFeedback",value:c.enableFeedback,onChange:H=>P("enableFeedback",H),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]})]}),i.jsxs(lr,{children:[i.jsx(ur,{text:"Enable Ratings"}),i.jsx(wf,{name:"enableRatings",value:c.enableRatings,onChange:H=>P("enableRatings",H),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]})]})]})]}),i.jsxs(Sf,{n:4,title:"Registration & Form Fields",subtitle:"Registration rules and custom registration fields",open:o===4,completed:s.has(4),onToggle:()=>T(4),onNext:()=>void U(),nextLabel:"Save settings",nextDisabled:x,children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:0,fontFamily:"var(--font-noto-sans)"},children:"Registration settings"}),i.jsxs(No,{children:[i.jsxs(lr,{children:[i.jsx(ur,{text:"Registration Required"}),i.jsx(wf,{name:"regRequired",value:c.registrationRequired,onChange:H=>P("registrationRequired",H),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]})]}),i.jsxs(lr,{error:O("registrationMode"),children:[i.jsx(ur,{text:"Registration Mode"}),i.jsx(La,{children:i.jsxs("select",{style:{...Ra,...O("registrationMode")?{borderColor:"var(--destructive)"}:{}},value:c.registrationMode,onChange:H=>P("registrationMode",H.target.value),disabled:c.registrationRequired!=="Yes",children:[i.jsx("option",{value:"",children:c.registrationRequired==="Yes"?"Select mode":"N/A"}),i.jsx("option",{children:"Open"}),i.jsx("option",{children:"Invite Only"}),i.jsx("option",{children:"Approval Required"})]})})]})]}),i.jsxs(No,{children:[i.jsxs(lr,{children:[i.jsx(ur,{text:"Verify Email"}),i.jsx(wf,{name:"verifyEmail",value:c.verifyEmail,onChange:H=>P("verifyEmail",H),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]})]}),i.jsxs(lr,{children:[i.jsx(ur,{text:"Registration Deadline"}),i.jsx("input",{type:"date",style:Xr,value:c.registrationDeadline,onChange:H=>P("registrationDeadline",H.target.value)})]})]}),i.jsxs(No,{children:[i.jsxs(lr,{error:O("authenticationType"),children:[i.jsx(ur,{text:"Authentication Type"}),i.jsx(La,{children:i.jsx("select",{style:{...Ra,...O("authenticationType")?{borderColor:"var(--destructive)"}:{}},value:c.authenticationType,onChange:H=>P("authenticationType",H.target.value),disabled:c.registrationRequired!=="Yes",children:tT.map(H=>i.jsx("option",{value:H.value,children:H.label},H.value))})})]}),i.jsxs(lr,{error:O("registrationBaseFields"),children:[i.jsx(ur,{text:"Registration Base Fields"}),i.jsx(La,{children:i.jsx("select",{style:{...Ra,...O("registrationBaseFields")?{borderColor:"var(--destructive)"}:{}},value:c.registrationBaseFields,onChange:H=>P("registrationBaseFields",H.target.value),disabled:c.registrationRequired!=="Yes",children:rT.map(H=>i.jsx("option",{value:H.value,children:H.label},H.value))})})]})]}),i.jsxs("div",{style:{borderTop:"1px solid var(--border)",paddingTop:"12px",marginTop:"4px"},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 10px",fontFamily:"var(--font-noto-sans)"},children:"Custom registration fields (optional)"}),c.customFields.map((H,B)=>i.jsxs("div",{style:{background:"var(--secondary)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"12px",marginBottom:"10px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"10px"},children:[i.jsxs("span",{style:{fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",fontFamily:"var(--font-noto-sans)"},children:["Field ",B+1]}),i.jsx("button",{type:"button",onClick:()=>I(H.id),style:{background:"none",border:"none",cursor:"pointer",color:"var(--destructive)"},children:i.jsx(gn,{size:14})})]}),i.jsxs(No,{children:[i.jsxs(lr,{error:O(`cf_${H.id}_label`),children:[i.jsx(ur,{text:"Field Label"}),i.jsx("input",{style:{...Xr,...O(`cf_${H.id}_label`)?{borderColor:"var(--destructive)"}:{}},placeholder:"e.g. Dietary preference",value:H.label,onChange:M=>E(H.id,M.target.value)})]}),i.jsxs(lr,{error:O(`cf_${H.id}_code`),children:[i.jsx(ur,{text:"Field Code"}),i.jsx("input",{style:{...Xr,...O(`cf_${H.id}_code`)?{borderColor:"var(--destructive)"}:{},opacity:H.codeAuto?.92:1},placeholder:"auto from label",value:H.code||(H.codeAuto?ph(H.label):""),onChange:M=>A(H.id,M.target.value)}),i.jsx("p",{style:{fontSize:"10px",color:"var(--muted)",margin:"4px 0 0"},children:"Auto-updates from label until you edit it."})]})]}),i.jsxs(lr,{error:O(`cf_${H.id}_type`),children:[i.jsx(ur,{text:"Field Type"}),i.jsx(La,{children:i.jsx("select",{style:{...Ra,...O(`cf_${H.id}_type`)?{borderColor:"var(--destructive)"}:{}},value:H.fieldType,onChange:M=>F(H.id,M.target.value),children:eT.map(M=>i.jsx("option",{value:M.value,children:M.label},M.value))})})]}),nc(H.fieldType)&&i.jsxs("div",{style:{marginTop:"10px"},children:[i.jsx(ur,{text:"Options (Value & Label)"}),O(`cf_${H.id}_options`)&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",margin:"0 0 6px"},children:O(`cf_${H.id}_options`)}),H.options.map(M=>i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr auto",gap:"8px",alignItems:"start",marginBottom:"8px"},children:[i.jsx(lr,{error:O(`cf_${H.id}_opt_${M.id}`),children:i.jsx("input",{style:{...Xr,...O(`cf_${H.id}_opt_${M.id}`)?{borderColor:"var(--destructive)"}:{}},placeholder:"Value",value:M.value,onChange:$=>V(H.id,M.id,"value",$.target.value)})}),i.jsx(lr,{error:O(`cf_${H.id}_opt_${M.id}`),children:i.jsx("input",{style:{...Xr,...O(`cf_${H.id}_opt_${M.id}`)?{borderColor:"var(--destructive)"}:{}},placeholder:"Label",value:M.label,onChange:$=>V(H.id,M.id,"label",$.target.value)})}),i.jsx("button",{type:"button",onClick:()=>z(H.id,M.id),style:{padding:"8px",border:"none",background:"transparent",cursor:"pointer",color:"var(--destructive)",marginTop:"4px"},"aria-label":"Remove option",children:i.jsx(gn,{size:14})})]},M.id)),i.jsxs("button",{type:"button",onClick:()=>L(H.id),style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"var(--radius-button)",border:"1px dashed var(--primary)",background:"var(--card)",color:"var(--primary)",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(wr,{size:12})," Add option"]})]})]},H.id)),i.jsxs("button",{type:"button",onClick:R,style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--primary)",background:"var(--secondary)",color:"var(--primary)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:13})," Add custom field"]})]})]})]})]})}function KAe(e,t){var r,n;return{question:e.text,imageUrl:(r=e.imageUrl)!=null&&r.trim()?e.imageUrl.trim():null,type:e.type==="Single Choice"||e.type==="True / False"?"single":e.type==="Multiple Choice"?"multiple":"text",options:(n=e.options)==null?void 0:n.map(o=>{var a;return{text:o.text,isCorrect:o.isCorrect,imageUrl:(a=o.imageUrl)!=null&&a.trim()?o.imageUrl.trim():null}}),required:!0,...t==="quiz"?{points:1}:{}}}function QAe(e){const t=e.activityStats;if(!t)return 0;const r=Math.min(t.questionCount*12,35),n=Math.min(t.participantCount*6,35),o=Math.min(t.responseCount*3,30);return Math.min(100,Math.round(r+n+o))}function Ry(e){if(typeof e.enableQnA=="boolean")return e.enableQnA;const t=e.qnaEnabled;return typeof t=="boolean"?t:!0}function Ly(e){return typeof e.enableQnP=="boolean"?e.enableQnP:!0}function Z4(e){const t=e.track;let r=null;t&&typeof t=="object"&&"_id"in t?r=String(t._id):typeof t=="string"&&t.trim()&&(r=t);const n=(e.speakers||[]).map(o=>typeof o=="string"?o:o._id);return{title:e.title,description:e.description??"",type:e.type,startTime:e.startTime,endTime:e.endTime,location:e.location,track:r,speakers:n,moderator:e.moderator??null,capacity:e.capacity,status:e.status,resources:e.resources,audienceFeedbackEnabled:e.audienceFeedbackEnabled,audienceRatingsEnabled:e.audienceRatingsEnabled,audienceFeedbackForm:e.audienceFeedbackForm??null,audienceRatingsForm:e.audienceRatingsForm??null,enableQnA:Ry(e),enableQnP:Ly(e)}}function XAe(){var L,z,V,Q;const{selectedEventId:e,setActiveNav:t}=eo(),n=qi()==="mobile",[o,a]=j.useState(null),[s,l]=j.useState(null),[c,u]=j.useState(!0),[d,f]=j.useState(null),[h,p]=j.useState("questions"),[y,m]=j.useState(!1),[x,b]=j.useState(!1),[w,k]=j.useState(null),S=j.useCallback(async()=>{var U;if(e){u(!0),f(null);try{const[ee,H]=await Promise.all([zr.get(e),Da.list(e)]);if(ee.error||!ee.data){f(ee.error||"Could not load activity."),a(null),l(null);return}const B=ee.data;a(B);const $=(((U=H.data)==null?void 0:U.sessions)??[])[0]??null;l($)}finally{u(!1)}}},[e]);j.useEffect(()=>{S()},[S]);const _=s?Ry(s):!0,P=s?Ly(s):!0,O=j.useMemo(()=>{const U=[];return _&&U.push({id:"questions",label:"Questions"}),P&&U.push({id:"quiz-polls",label:"Quiz & Polls"}),U.push({id:"participants",label:"Participants"},{id:"settings",label:"Settings"}),U},[_,P]);j.useEffect(()=>{var U;O.some(ee=>ee.id===h)||p(((U=O[0])==null?void 0:U.id)??"participants")},[O,h]),o&&QAe(o);const T=s?Ry(s):!0,R=s?Ly(s):!0;o!=null&&o.activitySubtype;const I=async()=>{if(!(!s||x)){b(!0);try{(await Da.update(s._id,{...Z4(s),enableQnA:!0,enableQnP:Ly(s)})).error||await S()}finally{b(!1)}}},E=j.useCallback(async()=>{if(!s||Ly(s))return;(await Da.update(s._id,{...Z4(s),enableQnP:!0,enableQnA:Ry(s)})).error||await S()},[s,S]),A=j.useMemo(()=>{var ee;if(!w||!o)return;const U=nT();return U.title=(ee=o.name)!=null&&ee.trim()?o.name.trim().slice(0,200):w==="quiz"?"New quiz":"New poll",{form:U,questions:[]}},[w,o]),F=async U=>{if(!e||!s||!w)return;const ee=w,H={session:s._id,title:U.form.title,type:ee,description:U.form.description||void 0,questions:U.questions.map($=>KAe($,ee)),settings:iT(U.form,ee)};if((await Oa.create(e,H)).error)return;k(null),(await Da.update(s._id,{...Z4(s),enableQnP:!0,enableQnA:Ry(s)})).error||await S()};return e?c&&!o?i.jsx("div",{style:{padding:48,textAlign:"center",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"Loading activity…"}):d||!o||!s?i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:"center",padding:40},children:[i.jsx("p",{style:{color:"#b91c1c",fontFamily:"var(--font-noto-sans)"},children:d||"This activity has no session yet."}),i.jsx("button",{type:"button",onClick:()=>t("activities"),style:{padding:"8px 18px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"Back to activities"})]}):o.recordKind&&o.recordKind!=="activity"?i.jsx("div",{style:{padding:24,fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"This view is for standalone activities. Use the main event dashboard for conference-style events."}):i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"16px",flexWrap:"wrap"},children:[i.jsx("div",{style:{flex:1,minWidth:0},children:i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:n?"var(--text-xl)":"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:o.name})}),i.jsxs("button",{type:"button",disabled:!((L=s.joinCode)!=null&&L.trim()),title:(z=s.joinCode)!=null&&z.trim()?"QR code":"Join code not available yet",onClick:()=>m(!0),style:{display:"flex",alignItems:"center",gap:"6px",padding:n?"8px 12px":"6px 14px",borderRadius:"var(--radius-button)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",cursor:(V=s.joinCode)!=null&&V.trim()?"pointer":"not-allowed",flexShrink:0,opacity:(Q=s.joinCode)!=null&&Q.trim()?1:.55,transition:"all 0.15s"},onMouseEnter:U=>{var H;if(!((H=s.joinCode)!=null&&H.trim()))return;const ee=U.currentTarget;ee.style.background="var(--secondary)",ee.style.borderColor="var(--primary)",ee.style.color="var(--primary)"},onMouseLeave:U=>{var H;if(!((H=s.joinCode)!=null&&H.trim()))return;const ee=U.currentTarget;ee.style.background="var(--card)",ee.style.borderColor="var(--border)",ee.style.color="var(--card-foreground)"},children:[i.jsx(lv,{size:n?18:15,"aria-hidden":!0}),"Generate QR Code"]})]}),i.jsx("div",{style:{borderBottom:"1px solid var(--border)"},children:i.jsx("div",{style:{display:"flex",gap:n?"8px":"0",flexWrap:"wrap"},children:O.map(U=>i.jsx("button",{type:"button",onClick:()=>p(U.id),style:{padding:n?"10px 16px":"12px 24px",background:"none",border:"none",borderBottom:h===U.id?"2px solid var(--primary)":"2px solid transparent",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:h===U.id?"var(--font-weight-medium)":"var(--font-weight-normal)",color:h===U.id?"var(--primary)":"var(--card-foreground)",transition:"all 0.15s"},children:U.label},U.id))})}),i.jsxs("div",{style:{minHeight:"240px"},children:[h==="questions"&&_?i.jsx(gQ,{fixedSessionId:s._id,compactChrome:!0}):null,h==="quiz-polls"&&P?i.jsx(mQ,{fixedSessionId:s._id,compactChrome:!0,onQuizPollPersisted:E}):null,h==="participants"?i.jsx(kY,{compactChrome:!0}):null,h==="settings"?i.jsx("div",{style:{padding:"20px"},children:i.jsx(GAe,{event:o,session:s,selectedEventId:e,onSaved:S})}):null]}),!T||!R?i.jsxs("div",{style:{paddingTop:"16px",borderTop:"1px solid var(--border)"},children:[i.jsx("h2",{style:{fontSize:"var(--text-lg)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"0 0 8px"},children:"Next steps"}),T?null:i.jsxs("div",{style:{marginBottom:R?0:"24px"},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"0 0 16px",lineHeight:1.5},children:"Turn on Q&A to collect and moderate audience questions for this session. This will show the Questions tab."}),i.jsx("button",{type:"button",disabled:x,onClick:()=>void I(),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"14px 32px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:x?"wait":"pointer",fontSize:"var(--text-base)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",opacity:x?.85:1},children:x?"Enabling…":"Enable Q&A"})]}),R?null:i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"0 0 16px",lineHeight:1.5},children:"Add a quiz or add a poll to engage your audience. Saving either one will enable the Quiz & Polls tab for this session."}),i.jsxs("div",{style:{display:"flex",gap:"16px",flexWrap:"wrap"},children:[i.jsx("button",{type:"button",onClick:()=>k("quiz"),style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"14px 32px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-base)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",flex:n?"1 1 100%":"0 1 auto"},children:"Add a quiz"}),i.jsx("button",{type:"button",onClick:()=>k("poll"),style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"14px 32px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-base)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",flex:n?"1 1 100%":"0 1 auto"},children:"Add a poll"})]})]})]}):null,w&&A?i.jsx(ax,{kind:w,initial:A,eventId:e,onClose:()=>k(null),onSave:U=>void F(U)},w):null,i.jsx(aT,{open:y,onClose:()=>m(!1),kind:"session",joinCode:s.joinCode??"",label:s.title||o.name})]}):i.jsx("div",{style:{padding:40,textAlign:"center",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"Select an activity from the list to view details."})}const w8=["Moderator","Presenter","Co-organiser","Viewer"];function vQ(e,t,r){return e||t?[e==null?void 0:e[0],t==null?void 0:t[0]].filter(Boolean).join("").toUpperCase().slice(0,2):r?r.slice(0,2).toUpperCase():"??"}const VB=["#f97316","#16a34a","#7c3aed","#0891b2","#be185d","#0d9488"];function i6(e){let t=0;for(let r=0;r<e.length;r++)t+=e.charCodeAt(r);return VB[t%VB.length]}function J4({checked:e,onChange:t}){return i.jsxs("button",{type:"button",onClick:t,style:{width:16,height:16,borderRadius:3,border:`1.5px solid ${e?"var(--primary)":"var(--border)"}`,background:e===!0?"var(--primary)":"var(--card)",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexShrink:0,padding:0},children:[e===!0&&i.jsx(Oi,{size:10,strokeWidth:3,color:"#fff"}),e==="indeterminate"&&i.jsx(Ow,{size:10,strokeWidth:3,color:"var(--primary)"})]})}function o6({initials:e,color:t,size:r=34}){return i.jsx("div",{style:{width:r,height:r,borderRadius:"50%",background:t,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:i.jsx("span",{style:{color:"#fff",fontSize:r<30?9:11,fontFamily:"var(--font-inter)",fontWeight:600},children:e})})}function LS(e){return e.flatMap(t=>t.sessions.map(r=>r.sessionId))}function S8({tracks:e,selected:t,onToggle:r,onSelectGroup:n,onSelectAll:o}){const a=j.useMemo(()=>LS(e),[e]),s=c=>{const u=c.filter(d=>t.has(d)).length;return u===0?!1:u===c.length?!0:"indeterminate"},l=s(a);return a.length===0?i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)"},children:"No tracks or sessions for this event. Add them in Agenda first."}):i.jsxs("div",{children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Session access"}),i.jsxs("div",{style:{display:"flex",gap:6},children:[i.jsxs("button",{type:"button",onClick:()=>o(!0),style:{display:"flex",alignItems:"center",gap:4,padding:"4px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--primary)",background:"var(--primary)",color:"#fff",fontSize:"var(--text-xs)",cursor:"pointer"},children:[i.jsx(Oi,{size:11})," Select all"]}),i.jsxs("button",{type:"button",onClick:()=>o(!1),style:{display:"flex",alignItems:"center",gap:4,padding:"4px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-xs)",cursor:"pointer"},children:[i.jsx(Ow,{size:11})," Clear"]})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 0",marginBottom:10,borderBottom:"1px solid var(--border)"},children:[i.jsx(J4,{checked:l,onChange:()=>o(l!==!0)}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",fontWeight:600},children:[t.size," of ",a.length," sessions"]})]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:e.map((c,u)=>{const d=c.sessions.map(h=>h.sessionId),f=s(d);return i.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 14px",background:"var(--secondary)",borderBottom:"1px solid var(--border)"},children:[i.jsx(J4,{checked:f,onChange:()=>n(d,f!==!0)}),i.jsx("span",{style:{flex:1,fontSize:"var(--text-sm)",fontWeight:600,color:"var(--foreground)"},children:c.name||"Unassigned"}),i.jsxs("span",{style:{fontSize:11,color:"var(--muted)"},children:[d.filter(h=>t.has(h)).length,"/",d.length]})]}),c.sessions.map(h=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"8px 14px 8px 38px",background:"var(--card)",borderBottom:"1px solid var(--border)"},children:[i.jsx(J4,{checked:t.has(h.sessionId),onChange:()=>r(h.sessionId)}),i.jsx("span",{style:{flex:1,fontSize:"var(--text-sm)",color:"var(--card-foreground)"},children:h.title}),i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:h.startTime?new Date(h.startTime).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):""})]},h.sessionId))]},c.trackId??u)})})]})}function ZAe({eventId:e,onClose:t,onSuccess:r}){const[n,o]=j.useState("users"),[a,s]=j.useState([]),[l,c]=j.useState([]),[u,d]=j.useState(!0),[f,h]=j.useState(!1),[p,y]=j.useState(null),[m,x]=j.useState(new Set),[b,w]=j.useState("Viewer"),[k,S]=j.useState(new Set),_=j.useMemo(()=>LS(l),[l]);j.useEffect(()=>{let A=!1;return d(!0),Promise.all([za.listAvailableUsers(e),za.agendaTree(e)]).then(([F,L])=>{var z,V;A||(d(!1),(z=F.data)!=null&&z.users&&s(F.data.users),(V=L.data)!=null&&V.tracks&&c(L.data.tracks))}),()=>{A=!0}},[e]);const P=A=>{x(F=>{const L=new Set(F);return L.has(A)?L.delete(A):L.add(A),L})},O=A=>{S(F=>{const L=new Set(F);return L.has(A)?L.delete(A):L.add(A),L})},T=(A,F)=>{S(L=>{const z=new Set(L);return A.forEach(V=>F?z.add(V):z.delete(V)),z})},R=A=>S(A?new Set(_):new Set),I=m.size>0&&b,E=async()=>{y(null),h(!0);const A=await za.addStaff(e,{userIds:Array.from(m),sessionIds:Array.from(k),eventRole:b});if(h(!1),A.error){y(A.error);return}r(),t()};return i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.35)",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",padding:24,backdropFilter:"blur(2px)"},children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"100%",maxWidth:560,maxHeight:"88vh",display:"flex",flexDirection:"column",boxShadow:"var(--elevation-sm)"},children:[i.jsxs("div",{style:{padding:"20px 24px 16px",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:600,color:"var(--foreground)",marginBottom:2},children:"Add users to event"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Select organisation members and their session access."})]}),i.jsx("button",{type:"button",onClick:t,style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",padding:2},children:i.jsx(er,{size:16})})]}),i.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--border)",padding:"0 24px"},children:["users","sessions"].map((A,F)=>i.jsxs("button",{type:"button",onClick:()=>o(A),style:{padding:"10px 0",marginRight:24,background:"none",border:"none",borderBottom:`2px solid ${n===A?"var(--primary)":"transparent"}`,cursor:"pointer",fontSize:"var(--text-sm)",fontWeight:n===A?600:400,color:n===A?"var(--primary)":"var(--muted)"},children:[i.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:18,height:18,borderRadius:"50%",background:n===A?"var(--primary)":"var(--border)",color:"#fff",fontSize:10,marginRight:6},children:F+1}),A==="users"?"Users & role":"Session access"]},A))}),i.jsx("div",{style:{flex:1,overflowY:"auto",padding:"20px 24px"},children:u?i.jsx("p",{style:{color:"var(--muted)"},children:"Loading…"}):n==="users"?i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:8},children:"Event role (applies to all selected)"}),i.jsx("div",{style:{marginBottom:16},children:i.jsx("select",{value:b,onChange:A=>w(A.target.value),style:{width:"100%",maxWidth:200,height:36,padding:"0 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",fontSize:"var(--text-sm)"},children:w8.map(A=>i.jsx("option",{value:A,children:A},A))})}),i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:10},children:"Select users"}),a.length===0?i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)"},children:"No other users available; they may already be on this event."}):i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:a.map(A=>i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:10,padding:10,background:"var(--secondary)",borderRadius:"var(--radius-button)",cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:m.has(A._id),onChange:()=>P(A._id)}),i.jsx(o6,{initials:vQ(A.firstName,A.lastName,A.email),color:i6(A.email),size:28}),i.jsx("span",{style:{flex:1,fontSize:"var(--text-sm)",fontWeight:500},children:[A.firstName,A.lastName].filter(Boolean).join(" ")||A.email}),i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:A.email})]},A._id))})]}):i.jsx(S8,{tracks:l,selected:k,onToggle:O,onSelectGroup:T,onSelectAll:R})}),p&&i.jsx("div",{style:{padding:"8px 24px",background:"#fef2f2",color:"#b91c1c",fontSize:"var(--text-sm)"},children:p}),i.jsxs("div",{style:{padding:"14px 24px",borderTop:"1px solid var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[i.jsx("div",{children:n==="sessions"&&i.jsx("button",{type:"button",onClick:()=>o("users"),style:{background:"none",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",color:"var(--muted)"},children:"← Back"})}),i.jsxs("div",{style:{display:"flex",gap:8},children:[i.jsx("button",{type:"button",onClick:t,style:{padding:"8px 18px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",cursor:"pointer"},children:"Cancel"}),n==="users"?i.jsx("button",{type:"button",onClick:()=>o("sessions"),disabled:!I,style:{padding:"8px 18px",borderRadius:"var(--radius-button)",border:"none",background:I?"var(--primary)":"var(--border)",color:I?"var(--primary-foreground)":"var(--muted)",fontSize:"var(--text-sm)",fontWeight:600,cursor:I?"pointer":"not-allowed"},children:"Next: Session access →"}):i.jsx("button",{type:"button",onClick:E,disabled:f,style:{display:"flex",alignItems:"center",gap:6,padding:"8px 18px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",fontSize:"var(--text-sm)",fontWeight:600,cursor:f?"wait":"pointer"},children:f?"Adding…":"Add to event"})]})]})]})})}function JAe({eventId:e,onClose:t,onSuccess:r}){const[n,o]=j.useState([{id:"r1",email:"",role:"Viewer"}]),[a,s]=j.useState("users"),[l,c]=j.useState([]),[u,d]=j.useState(new Set),[f,h]=j.useState(!1),[p,y]=j.useState(!1),[m,x]=j.useState(null),b=j.useMemo(()=>LS(l),[l]);j.useEffect(()=>{a==="sessions"&&(h(!0),za.agendaTree(e).then(E=>{var A;h(!1),(A=E.data)!=null&&A.tracks&&c(E.data.tracks)}))},[e,a]);const w=()=>o(E=>[...E,{id:`r${Date.now()}`,email:"",role:"Viewer"}]),k=E=>o(A=>A.filter(F=>F.id!==E)),S=(E,A,F)=>o(L=>L.map(z=>z.id===E?{...z,[A]:F}:z)),_=E=>d(A=>{const F=new Set(A);return F.has(E)?F.delete(E):F.add(E),F}),P=(E,A)=>d(F=>{const L=new Set(F);return E.forEach(z=>A?L.add(z):L.delete(z)),L}),O=E=>d(E?new Set(b):new Set),T=n.filter(E=>E.email.trim()&&E.role),R=T.length>0,I=async()=>{var A;x(null),y(!0);const E=await za.sendInvites(e,{invites:T.map(F=>({email:F.email.trim(),eventRole:F.role||"Viewer"})),sessionIds:Array.from(u)});y(!1),E.data&&x(E.data),!(E.error&&!E.data)&&E.data&&(E.data.sent>0||((A=E.data.errors)==null?void 0:A.length)===0)&&(r(),t())};return i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.35)",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",padding:24,backdropFilter:"blur(2px)"},children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"100%",maxWidth:680,maxHeight:"88vh",display:"flex",flexDirection:"column",boxShadow:"var(--elevation-sm)"},children:[i.jsxs("div",{style:{padding:"20px 24px 16px",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:600,color:"var(--foreground)",marginBottom:2},children:"Invite by email"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"They will receive an email to join this event (and organisation if new)."})]}),i.jsx("button",{type:"button",onClick:t,style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",padding:2},children:i.jsx(er,{size:16})})]}),i.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--border)",padding:"0 24px"},children:["users","sessions"].map((E,A)=>i.jsxs("button",{type:"button",onClick:()=>s(E),style:{padding:"10px 0",marginRight:24,background:"none",border:"none",borderBottom:`2px solid ${a===E?"var(--primary)":"transparent"}`,cursor:"pointer",fontSize:"var(--text-sm)",fontWeight:a===E?600:400,color:a===E?"var(--primary)":"var(--muted)"},children:[i.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:18,height:18,borderRadius:"50%",background:a===E?"var(--primary)":"var(--border)",color:"#fff",fontSize:10,marginRight:6},children:A+1}),E==="users"?"Emails & roles":"Session access"]},E))}),i.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"20px 24px"},children:[a==="users"&&i.jsxs("div",{children:[i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10,marginBottom:16},children:n.map(E=>i.jsxs("div",{style:{display:"flex",gap:10,alignItems:"flex-start",background:"var(--secondary)",borderRadius:"var(--radius-card)",padding:14},children:[i.jsxs("div",{style:{flex:1},children:[i.jsxs("p",{style:{fontSize:"var(--text-xs)",marginBottom:5},children:["Email ",i.jsx("span",{style:{color:"var(--destructive)"},children:"*"})]}),i.jsx("input",{type:"email",placeholder:"user@example.com",value:E.email,onChange:A=>S(E.id,"email",A.target.value),style:{width:"100%",height:36,padding:"0 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{style:{width:160},children:[i.jsxs("p",{style:{fontSize:"var(--text-xs)",marginBottom:5},children:["Role ",i.jsx("span",{style:{color:"var(--destructive)"},children:"*"})]}),i.jsx("select",{value:E.role,onChange:A=>S(E.id,"role",A.target.value),style:{width:"100%",height:36,padding:"0 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",fontSize:"var(--text-sm)"},children:w8.map(A=>i.jsx("option",{value:A,children:A},A))})]}),n.length>1&&i.jsx("button",{type:"button",onClick:()=>k(E.id),style:{width:36,height:36,marginTop:18,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--card)",cursor:"pointer",color:"var(--muted)"},children:i.jsx(er,{size:12})})]},E.id))}),i.jsxs("button",{type:"button",onClick:w,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"6px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--primary)",background:"transparent",color:"var(--primary)",fontSize:"var(--text-sm)",cursor:"pointer"},children:[i.jsx(z6,{size:13})," Add another"]})]}),a==="sessions"&&(f?i.jsx("p",{style:{color:"var(--muted)"},children:"Loading sessions…"}):i.jsx(S8,{tracks:l,selected:u,onToggle:_,onSelectGroup:P,onSelectAll:O}))]}),(m==null?void 0:m.errors)&&m.errors.length>0&&i.jsx("div",{style:{padding:"8px 24px",background:"#fef2f2",color:"#b91c1c",fontSize:"var(--text-sm)"},children:m.errors.map((E,A)=>i.jsxs("div",{children:[E.email,": ",E.message]},A))}),i.jsxs("div",{style:{padding:"14px 24px",borderTop:"1px solid var(--border)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[i.jsx("div",{children:a==="sessions"&&i.jsx("button",{type:"button",onClick:()=>s("users"),style:{background:"none",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",color:"var(--muted)"},children:"← Back"})}),i.jsxs("div",{style:{display:"flex",gap:8},children:[i.jsx("button",{type:"button",onClick:t,style:{padding:"8px 18px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",cursor:"pointer"},children:"Cancel"}),a==="users"?i.jsx("button",{type:"button",onClick:()=>s("sessions"),disabled:!R,style:{padding:"8px 18px",borderRadius:"var(--radius-button)",border:"none",background:R?"var(--primary)":"var(--border)",color:R?"var(--primary-foreground)":"var(--muted)",fontSize:"var(--text-sm)",fontWeight:600,cursor:R?"pointer":"not-allowed"},children:"Next: Session access →"}):i.jsxs("button",{type:"button",onClick:I,disabled:p,style:{display:"flex",alignItems:"center",gap:6,padding:"8px 18px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",fontSize:"var(--text-sm)",fontWeight:600,cursor:p?"wait":"pointer"},children:[i.jsx(kq,{size:13})," Send invitations"]})]})]})]})})}function e6e({eventId:e,member:t,onClose:r,onSuccess:n}){const[o,a]=j.useState([]),[s,l]=j.useState(!0),[c,u]=j.useState(!1),[d,f]=j.useState(new Set(t.sessionIds)),[h,p]=j.useState(t.eventRole||"Viewer"),y=j.useMemo(()=>LS(o),[o]);j.useEffect(()=>{za.agendaTree(e).then(k=>{var S;l(!1),(S=k.data)!=null&&S.tracks&&a(k.data.tracks)})},[e]);const m=k=>f(S=>{const _=new Set(S);return _.has(k)?_.delete(k):_.add(k),_}),x=(k,S)=>f(_=>{const P=new Set(_);return k.forEach(O=>S?P.add(O):P.delete(O)),P}),b=k=>f(k?new Set(y):new Set),w=async()=>{u(!0);const k=await za.updateStaff(e,t.userId,{sessionIds:Array.from(d),eventRole:h});u(!1),k.error||(n(),r())};return i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.35)",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",padding:24,backdropFilter:"blur(2px)"},children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"100%",maxWidth:520,maxHeight:"88vh",display:"flex",flexDirection:"column",boxShadow:"var(--elevation-sm)"},children:[i.jsxs("div",{style:{padding:"20px 24px 16px",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:600,color:"var(--foreground)",marginBottom:2},children:"Edit access"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:[t.firstName,t.lastName].filter(Boolean).join(" ")||t.email})]}),i.jsx("button",{type:"button",onClick:r,style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",padding:2},children:i.jsx(er,{size:16})})]}),i.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"20px 24px"},children:[i.jsxs("div",{style:{marginBottom:16},children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",display:"block",marginBottom:6},children:"Event role"}),i.jsx("select",{value:h,onChange:k=>p(k.target.value),style:{width:"100%",maxWidth:200,height:36,padding:"0 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",fontSize:"var(--text-sm)"},children:w8.map(k=>i.jsx("option",{value:k,children:k},k))})]}),s?i.jsx("p",{style:{color:"var(--muted)"},children:"Loading sessions…"}):i.jsx(S8,{tracks:o,selected:d,onToggle:m,onSelectGroup:x,onSelectAll:b})]}),i.jsxs("div",{style:{padding:"14px 24px",borderTop:"1px solid var(--border)",display:"flex",justifyContent:"flex-end",gap:8},children:[i.jsx("button",{type:"button",onClick:r,style:{padding:"8px 18px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",cursor:"pointer"},children:"Cancel"}),i.jsx("button",{type:"button",onClick:w,disabled:c,style:{padding:"8px 18px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",fontSize:"var(--text-sm)",fontWeight:600,cursor:c?"wait":"pointer"},children:c?"Saving…":"Save"})]})]})})}function t6e(){const{selectedEventId:e}=eo(),[t,r]=j.useState(null),[n,o]=j.useState([]),[a,s]=j.useState([]),[l,c]=j.useState(!0),[u,d]=j.useState(!1),[f,h]=j.useState(""),[p,y]=j.useState(null),[m,x]=j.useState(!1),[b,w]=j.useState(!1),[k,S]=j.useState(!1),[_,P]=j.useState(null),O=async()=>{var z;if(!e){c(!1),o([]),s([]),r(null);return}c(!0),d(!1);const[F,L]=await Promise.all([zr.get(e),za.listStaff(e)]);if(c(!1),(z=F.data)!=null&&z.name&&r(F.data.name),L.error){L.status===403&&d(!0);return}L.data&&(o(L.data.members??[]),s(L.data.invites??[]))};j.useEffect(()=>{O()},[e]);const T=j.useMemo(()=>{if(!f.trim())return n;const F=f.toLowerCase();return n.filter(L=>L.email.toLowerCase().includes(F)||[L.firstName,L.lastName].filter(Boolean).join(" ").toLowerCase().includes(F))},[n,f]),R=j.useMemo(()=>f.trim()?a.filter(F=>F.email.toLowerCase().includes(f.toLowerCase())):a,[a,f]),I=async F=>{if(!e||!confirm("Remove this user from the event?"))return;(await za.removeStaff(e,F)).error||O()},E=async F=>{e&&(await za.resendInvite(e,F),O())},A=async F=>{if(!e||!confirm("Cancel this invitation?"))return;(await za.cancelInvite(e,F)).error||O()};return e?u?i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:24,alignItems:"center",justifyContent:"center",minHeight:280},children:[i.jsx(id,{size:40,style:{color:"var(--destructive)"}}),i.jsx("p",{style:{fontSize:"var(--text-base)",color:"var(--muted)"},children:"You don’t have permission to manage this event’s team."})]}):i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:24},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:4},children:t??"Event"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:600,color:"var(--foreground)",lineHeight:1.2,marginBottom:6},children:"Users & Permissions"}),i.jsxs("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)"},children:[n.length," member",n.length!==1?"s":""," · ",a.length," pending invite",a.length!==1?"s":""]})]}),i.jsxs("div",{style:{display:"flex",gap:8},children:[i.jsxs("button",{type:"button",onClick:()=>w(!0),style:{display:"flex",alignItems:"center",gap:6,padding:"8px 16px",borderRadius:"var(--radius-button)",border:"1px solid var(--primary)",background:"transparent",color:"var(--primary)",fontSize:"var(--text-sm)",fontWeight:600,cursor:"pointer"},children:[i.jsx(vi,{size:14})," Add users"]}),i.jsxs("button",{type:"button",onClick:()=>S(!0),style:{display:"flex",alignItems:"center",gap:6,padding:"8px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontWeight:600},children:[i.jsx(z6,{size:14})," Invite by email"]})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,height:38,padding:"0 12px",background:"var(--card)",border:`1px solid ${m?"var(--ring)":"var(--border)"}`,borderRadius:"var(--radius-button)",maxWidth:380},children:[i.jsx(Pi,{size:14,style:{color:"var(--muted)",flexShrink:0}}),i.jsx("input",{value:f,onChange:F=>h(F.target.value),placeholder:"Search by name or email…",onFocus:()=>x(!0),onBlur:()=>x(!1),style:{flex:1,background:"transparent",border:"none",outline:"none",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)"}}),f&&i.jsx("button",{type:"button",onClick:()=>h(""),style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",padding:0},children:i.jsx(er,{size:12})})]}),i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:[i.jsx("div",{style:{display:"grid",gridTemplateColumns:"minmax(160px,1fr) minmax(200px,1.5fr) 110px 160px",padding:"9px 20px",background:"var(--secondary)",borderBottom:"1px solid var(--border)"},children:["User","Email","Access",""].map(F=>i.jsx("span",{style:{fontSize:11,fontFamily:"var(--font-noto-sans)",fontWeight:600,color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:F},F))}),l?i.jsx("div",{style:{padding:48,textAlign:"center",color:"var(--muted)"},children:"Loading…"}):T.length===0&&R.length===0?i.jsxs("div",{style:{padding:"48px 20px",textAlign:"center"},children:[i.jsx(id,{size:28,style:{color:"var(--border)",margin:"0 auto 10px"}}),i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)"},children:"No users or invites match your search."})]}):i.jsxs(i.Fragment,{children:[T.map(F=>i.jsxs("div",{onMouseEnter:()=>y(F.userId),onMouseLeave:()=>y(null),style:{display:"grid",gridTemplateColumns:"minmax(160px,1fr) minmax(200px,1.5fr) 110px 160px",alignItems:"center",padding:"13px 20px",borderBottom:"1px solid var(--border)",background:p===F.userId?"var(--secondary)":"var(--card)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i.jsx(o6,{initials:vQ(F.firstName,F.lastName,F.email),color:i6(F.email)}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500,color:"var(--foreground)"},children:[F.firstName,F.lastName].filter(Boolean).join(" ")||F.email})]}),i.jsx("span",{style:{fontSize:"var(--text-sm)",color:"var(--muted)"},children:F.email}),i.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:999,width:"fit-content",background:"#e0e7ff",color:"#3730a3",fontSize:11,fontWeight:600},children:F.eventRole||"Viewer"}),i.jsxs("div",{style:{display:"flex",gap:6,opacity:p===F.userId?1:0},children:[i.jsxs("button",{type:"button",onClick:()=>P(F),style:{display:"flex",alignItems:"center",gap:4,padding:"5px 11px",borderRadius:"var(--radius-button)",background:"var(--card)",border:"1px solid var(--border)",color:"var(--card-foreground)",fontSize:"var(--text-xs)",cursor:"pointer"},children:[i.jsx(Ii,{size:12})," Edit"]}),i.jsx("button",{type:"button",onClick:()=>I(F.userId),style:{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"var(--radius-button)",background:"var(--card)",border:"1px solid var(--border)",color:"var(--muted)",cursor:"pointer"},children:i.jsx(gn,{size:12})})]})]},F.userId)),R.map(F=>i.jsxs("div",{onMouseEnter:()=>y(`inv-${F.id}`),onMouseLeave:()=>y(null),style:{display:"grid",gridTemplateColumns:"minmax(160px,1fr) minmax(200px,1.5fr) 110px 160px",alignItems:"center",padding:"13px 20px",borderBottom:"1px solid var(--border)",background:p===`inv-${F.id}`?"var(--secondary)":"var(--card)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i.jsx(o6,{initials:F.email.slice(0,2).toUpperCase(),color:i6(F.email)}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500,color:"var(--foreground)"},children:F.email})]}),i.jsx("span",{style:{fontSize:"var(--text-sm)",color:"var(--muted)"},children:"Pending invite"}),i.jsx("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:999,width:"fit-content",background:"#fef9c3",color:"#92400e",fontSize:11,fontWeight:600},children:F.eventRole}),i.jsxs("div",{style:{display:"flex",gap:6,opacity:p===`inv-${F.id}`?1:0},children:[i.jsxs("button",{type:"button",onClick:()=>E(F.id),style:{display:"flex",alignItems:"center",gap:4,padding:"5px 11px",borderRadius:"var(--radius-button)",background:"var(--card)",border:"1px solid var(--border)",color:"var(--card-foreground)",fontSize:"var(--text-xs)",cursor:"pointer"},children:[i.jsx(kq,{size:12})," Resend"]}),i.jsx("button",{type:"button",onClick:()=>A(F.id),style:{display:"flex",alignItems:"center",justifyContent:"center",width:28,height:28,borderRadius:"var(--radius-button)",background:"var(--card)",border:"1px solid var(--border)",color:"var(--muted)",cursor:"pointer"},children:i.jsx(gn,{size:12})})]})]},F.id))]})]}),b&&e&&i.jsx(ZAe,{eventId:e,onClose:()=>w(!1),onSuccess:O}),k&&e&&i.jsx(JAe,{eventId:e,onClose:()=>S(!1),onSuccess:O}),_&&e&&i.jsx(e6e,{eventId:e,member:_,onClose:()=>P(null),onSuccess:O})]}):i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:24,alignItems:"center",justifyContent:"center",minHeight:280},children:[i.jsx(id,{size:40,style:{color:"var(--border)"}}),i.jsx("p",{style:{fontSize:"var(--text-base)",color:"var(--muted)"},children:"Select an event to manage users and permissions."})]})}const e3=[{key:"registrationComplete",label:"Registration complete",hint:"Awarded once when someone joins the event"},{key:"questionAsk",label:"Ask a question",hint:"Per question (signed-in attendee)"},{key:"questionUpvote",label:"Upvote a question",hint:"Per upvote state change"},{key:"questionDownvote",label:"Downvote a question",hint:"Per downvote state change"},{key:"quizPollSubmitted",label:"Quiz submitted",hint:"When a visitor completes a quiz"},{key:"quizCorrectPerQuestion",label:"Correct quiz answer",hint:"Loyalty per correct objective question"},{key:"pollParticipation",label:"Poll / survey participation",hint:"When a visitor submits a poll or survey"},{key:"feedbackFormSubmitted",label:"Feedback form (reserved)",hint:"Wire when visitor feedback API exists"},{key:"ratingSubmitted",label:"Rating (reserved)",hint:"Wire when visitor rating API exists"}];function oh(e){const t=[e.firstName,e.lastName].filter(Boolean).join(" ").trim();return t||(e.email?e.email:"Participant")}function r6e(e,t){return{name:e.name,type:e.type,status:e.status,startDate:e.startDate,endDate:e.endDate,subtitle:e.subtitle??null,description:e.description??null,category:e.category??null,location:e.location??null,locationType:e.locationType??void 0,virtualLink:e.virtualLink??null,tags:e.tags,image:e.image??null,bannerImage:e.bannerImage??null,settings:e.settings,metadata:e.metadata,rewardRules:t}}function n6e({top3:e}){const[t,r,n]=[e[0],e[1],e[2]],o=[r,t,n],a=[72,100,56],s=["🥈","🥇","🥉"],l=["#475569","#92400e","#c2410c"],c=["#f1f5f9","#fef3c7","#ffedd5"];return!t&&!r&&!n?i.jsx("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"24px 20px",color:"var(--muted)",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)"},children:"No leaderboard entries yet. Configure point rules and let attendees earn points."}):i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"24px 20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"24px"},children:[i.jsx(od,{size:15,style:{color:"#d97706"}}),i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:"Top performers"})]}),i.jsx("div",{style:{display:"flex",alignItems:"flex-end",justifyContent:"center",gap:"8px",height:"200px"},children:o.map((u,d)=>u?i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",flex:1,maxWidth:"180px"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginBottom:"10px",flex:1,justifyContent:"flex-end"},children:[i.jsx("span",{style:{fontSize:"20px",marginBottom:"4px"},children:s[d]}),i.jsx("div",{style:{width:"36px",height:"36px",borderRadius:"50%",background:d===1?"var(--primary)":"var(--secondary)",display:"flex",alignItems:"center",justifyContent:"center",border:"2px solid var(--border)",marginBottom:"5px"},children:i.jsx("span",{style:{fontSize:"11px",fontFamily:"var(--font-inter)",fontWeight:"600",color:d===1?"#fff":"var(--foreground)"},children:oh(u).slice(0,2).toUpperCase()})}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-xs)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",textAlign:"center",lineHeight:"1.3",maxWidth:"120px"},children:oh(u)}),i.jsxs("p",{style:{display:"inline-flex",marginTop:"4px",padding:"2px 8px",borderRadius:"999px",background:c[d],color:l[d],fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600"},children:[u.total," pts"]})]}),i.jsx("div",{style:{width:"100%",height:a[d],background:d===1?"var(--accent)":"var(--secondary)",borderRadius:"4px 4px 0 0",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--border)",borderBottom:"none"},children:i.jsxs("span",{style:{fontSize:"var(--text-base)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:d===1?"var(--primary)":"var(--muted)"},children:["#",d===0?2:d===1?1:3]})})]},u.participantId+d):i.jsx("div",{style:{flex:1,maxWidth:"180px"}},`empty-${d}`))}),i.jsx("div",{style:{height:"4px",background:"var(--border)",borderRadius:"0 0 4px 4px"}})]})}function i6e({initialRules:e,onClose:t,onSave:r,saving:n}){const[o,a]=j.useState(()=>{const c={};for(const{key:u}of e3){const d=e[u];c[u]=d!=null&&d!==""?String(d):""}return c}),s=(c,u)=>a(d=>({...d,[c]:u})),l=()=>{const c={};for(const{key:u}of e3){const d=String(o[u]??"").trim();if(d==="")continue;const f=Number(d);Number.isFinite(f)&&f>=0&&(c[u]=f)}r(c)};return i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(15,48,114,0.25)",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",backdropFilter:"blur(2px)"},children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"100%",maxWidth:"520px",boxShadow:"var(--elevation-sm)",display:"flex",flexDirection:"column",maxHeight:"90vh"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 22px",borderBottom:"1px solid var(--border)"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"2px"},children:"Reward rules"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Set to 0 or leave blank to disable. Session and quiz settings can override later."})]}),i.jsx("button",{type:"button",onClick:t,style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",marginLeft:"12px"},children:i.jsx(er,{size:16})})]}),i.jsx("div",{style:{padding:"20px 22px",display:"flex",flexDirection:"column",gap:"12px",overflowY:"auto"},children:e3.map(c=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[i.jsxs("div",{style:{flex:1},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)",marginBottom:"1px"},children:c.label}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:c.hint})]}),i.jsxs("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0},children:[i.jsx("input",{type:"number",min:0,max:1e4,value:o[c.key]??"",onChange:u=>s(c.key,u.target.value),style:{width:"68px",height:"34px",padding:"0 8px",borderRadius:"var(--radius-button) 0 0 var(--radius-button)",border:"1px solid var(--border)",borderRight:"none",background:"var(--card)",fontFamily:"var(--font-inter)",fontSize:"var(--text-sm)",color:"var(--foreground)",outline:"none",textAlign:"center"}}),i.jsx("div",{style:{padding:"0 10px",height:"34px",display:"flex",alignItems:"center",background:"var(--secondary)",border:"1px solid var(--border)",borderRadius:"0 var(--radius-button) var(--radius-button) 0"},children:i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",whiteSpace:"nowrap"},children:"pts"})})]})]},c.key))}),i.jsxs("div",{style:{padding:"14px 22px",borderTop:"1px solid var(--border)",display:"flex",justifyContent:"flex-end",gap:"8px"},children:[i.jsx("button",{type:"button",onClick:t,style:{padding:"8px 16px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:"Cancel"}),i.jsxs("button",{type:"button",disabled:n,onClick:l,style:{display:"flex",alignItems:"center",gap:"5px",padding:"8px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:n?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",opacity:n?.75:1},children:[i.jsx(Nw,{size:13})," Save"]})]})]})})}function o6e({row:e,onClose:t,onSubmit:r,loading:n}){const[o,a]=j.useState(5),[s,l]=j.useState("");return i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(15,48,114,0.25)",zIndex:100,display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",backdropFilter:"blur(2px)"},children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"100%",maxWidth:"380px",boxShadow:"var(--elevation-sm)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid var(--border)"},children:[i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:"Add points"}),i.jsx("button",{type:"button",onClick:t,style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex"},children:i.jsx(er,{size:15})})]}),i.jsxs("div",{style:{padding:"18px 20px",display:"flex",flexDirection:"column",gap:"14px"},children:[i.jsxs("div",{style:{background:"var(--secondary)",borderRadius:"var(--radius-button)",padding:"10px 14px",display:"flex",alignItems:"center",gap:"10px"},children:[i.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx("span",{style:{color:"#fff",fontSize:"10px",fontFamily:"var(--font-inter)",fontWeight:"600"},children:oh(e).slice(0,2).toUpperCase()})}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:oh(e)}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:["Net ",e.total," pts"]})]})]}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",marginBottom:"5px"},children:"Points to add"}),i.jsx("input",{type:"number",min:1,value:o,onChange:c=>a(Number(c.target.value)),style:{width:"100%",height:"36px",padding:"0 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--foreground)",outline:"none",boxSizing:"border-box"}})]}),i.jsxs("div",{children:[i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",marginBottom:"5px"},children:["Reason ",i.jsx("span",{style:{color:"var(--muted)"},children:"(optional)"})]}),i.jsx("input",{type:"text",value:s,onChange:c=>l(c.target.value),placeholder:"e.g. Best question award",style:{width:"100%",height:"36px",padding:"0 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--foreground)",outline:"none",boxSizing:"border-box"}})]})]}),i.jsxs("div",{style:{padding:"12px 20px",borderTop:"1px solid var(--border)",display:"flex",justifyContent:"flex-end",gap:"8px"},children:[i.jsx("button",{type:"button",onClick:t,style:{padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:"Cancel"}),i.jsxs("button",{type:"button",disabled:n,onClick:()=>r(o,s.trim()),style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:n?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:13})," Add ",o," pts"]})]})]})})}function a6e({eventId:e}){var L;const[t,r]=j.useState(!1),[n,o]=j.useState(null),[a,s]=j.useState(null),[l,c]=j.useState([]),[u,d]=j.useState(null),[f,h]=j.useState(!1),[p,y]=j.useState(!1),[m,x]=j.useState(!1),[b,w]=j.useState(""),[k,S]=j.useState(!1),[_,P]=j.useState(null),O=j.useCallback(async()=>{var z;if(!e){s(null),c([]);return}h(!0),d(null);try{const[V,Q]=await Promise.all([zr.get(e),ZO.leaderboard(e,200)]);if(V.error){d(V.error),s(null),c([]);return}s(V.data??null);const U=((z=Q.data)==null?void 0:z.leaderboard)??[];if(Q.error){d(Q.error),c([]);return}c(U)}finally{h(!1)}},[e]);j.useEffect(()=>{O()},[O]);const T=j.useMemo(()=>{const z=b.trim().toLowerCase();return z?l.filter(V=>{const Q=oh(V).toLowerCase(),U=(V.email||"").toLowerCase();return Q.includes(z)||U.includes(z)}):l},[l,b]),R=T.slice(0,3),I=Math.max(((L=T[0])==null?void 0:L.total)??1,1),E=()=>{const z=[["rank","name","email","net_points"].join(",")];T.forEach((ee,H)=>{const B=oh(ee).replace(/"/g,'""'),M=(ee.email||"").replace(/"/g,'""');z.push(`${H+1},"${B}","${M}",${ee.total}`)});const V=new Blob([z.join(`
|
||
`)],{type:"text/csv"}),Q=URL.createObjectURL(V),U=document.createElement("a");U.href=Q,U.download=`reward-leaderboard-${e||"event"}.csv`,U.click(),URL.revokeObjectURL(Q)},A=async z=>{if(!(!e||!a)){y(!0);try{const V=r6e(a,z);(await zr.update(e,V)).error||(r(!1),await O())}finally{y(!1)}}},F=async(z,V)=>{if(!(!e||!n)){x(!0);try{await ZO.create(e,{participant:n.participantId,points:Math.max(1,Math.floor(z)),type:"earned",source:"manual",description:V||void 0}),o(null),await O()}finally{x(!1)}}};return e?i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:f?"Loading…":(a==null?void 0:a.name)??"Event"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"6px"},children:"Reward points"}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:u?i.jsx("span",{style:{color:"var(--destructive)"},children:u}):`${l.length} on leaderboard · Net score (earned − redeemed)`})]}),i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[i.jsxs("button",{type:"button",onClick:E,disabled:!T.length,style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",background:"var(--secondary)",color:"var(--card-foreground)",border:"1px solid var(--border)",cursor:T.length?"pointer":"not-allowed",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",opacity:T.length?1:.5},children:[i.jsx(Al,{size:13})," Export CSV"]}),i.jsx("button",{type:"button",onClick:()=>r(!0),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"34px",height:"34px",borderRadius:"var(--radius-button)",background:"var(--secondary)",color:"var(--muted)",border:"1px solid var(--border)",cursor:"pointer"},children:i.jsx(Pl,{size:14})})]})]}),i.jsx(n6e,{top3:R}),i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"10px 16px",borderBottom:"1px solid var(--border)",background:"var(--secondary)"},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Rankings"}),i.jsx("div",{style:{flex:1}}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",height:"28px",padding:"0 10px",background:"var(--card)",border:`1px solid ${k?"var(--ring)":"var(--border)"}`,borderRadius:"var(--radius-button)",width:"200px"},children:[i.jsx(Pi,{size:11,style:{color:"var(--muted)",flexShrink:0}}),i.jsx("input",{value:b,onChange:z=>w(z.target.value),placeholder:"Search…",onFocus:()=>S(!0),onBlur:()=>S(!1),style:{flex:1,background:"transparent",border:"none",outline:"none",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)"}}),b&&i.jsx("button",{type:"button",onClick:()=>w(""),style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",padding:0},children:i.jsx(er,{size:10})})]})]}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"56px 1fr 1.6fr 80px 120px",padding:"8px 16px",background:"var(--card)",borderBottom:"1px solid var(--border)"},children:["Rank","Name","Email","Points",""].map(z=>i.jsx("span",{style:{fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.04em"},children:z},z))}),!T.length&&!f?i.jsx("div",{style:{padding:"24px",textAlign:"center",color:"var(--muted)",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)"},children:"No participants with positive net points yet."}):T.map((z,V)=>{const Q=V+1,U=Q<=3,ee=z.total/I;return i.jsxs("div",{onMouseEnter:()=>P(V),onMouseLeave:()=>P(null),style:{display:"grid",gridTemplateColumns:"56px 1fr 1.6fr 80px 120px",alignItems:"center",padding:"10px 16px",borderBottom:"1px solid var(--border)",background:_===V?"var(--secondary)":"var(--card)",transition:"background 0.12s"},children:[i.jsx("div",{children:Q===1?i.jsx("span",{style:{fontSize:"16px"},children:"🥇"}):Q===2?i.jsx("span",{style:{fontSize:"16px"},children:"🥈"}):Q===3?i.jsx("span",{style:{fontSize:"16px"},children:"🥉"}):i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:["#",Q]})}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:U?"var(--font-weight-medium)":"var(--font-weight-normal)",color:"var(--foreground)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:oh(z)}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:z.email??"—"}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:z.total}),i.jsx("div",{style:{flex:1,height:"3px",background:"var(--border)",borderRadius:"999px",overflow:"hidden"},children:i.jsx("div",{style:{width:`${Math.round(ee*100)}%`,height:"100%",background:"var(--primary)",opacity:.5,borderRadius:"999px"}})})]}),i.jsx("div",{style:{opacity:_===V?1:0,transition:"opacity 0.15s"},children:i.jsxs("button",{type:"button",onClick:()=>o(z),style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"var(--radius-button)",background:"var(--card)",border:"1px solid var(--border)",color:"var(--muted)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"pointer",whiteSpace:"nowrap"},children:[i.jsx(wr,{size:11})," Add points"]})})]},z.participantId)})]}),t&&a&&i.jsx(i6e,{initialRules:a.rewardRules||{},onClose:()=>r(!1),onSave:A,saving:p}),n&&i.jsx(o6e,{row:n,onClose:()=>o(null),onSubmit:F,loading:m})]}):i.jsx("div",{style:{padding:"24px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Select an event to manage reward points and the leaderboard."})}function yQ(e){const t=e.cu??"INR",r=e.pa.trim(),n=e.pn.trim().slice(0,99),o=e.am.trim();return!r||!n||!o?"":`upi://pay?pa=${encodeURIComponent(r)}&pn=${encodeURIComponent(n)}&am=${encodeURIComponent(o)}&cu=${encodeURIComponent(t)}`}const Go={fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",fontWeight:"var(--font-weight-medium)",textTransform:"uppercase",letterSpacing:"0.06em"};function s6e(e,t){return`${t} ${(e/100).toFixed(2)}`}const YB="__eb_payment_cancelled__";function l6e(){var De,tt;const{user:e}=Ur(),{selectedEventId:t}=eo(),r=zn(e),[n,o]=j.useState([]),[a,s]=j.useState(!0),[l,c]=j.useState(null),[u,d]=j.useState([]),[f,h]=j.useState([]),[p,y]=j.useState(!1),[m,x]=j.useState(null),[b,w]=j.useState(!1),[k,S]=j.useState(""),[_,P]=j.useState(""),[O,T]=j.useState([""]),[R,I]=j.useState(""),[E,A]=j.useState("INR"),[F,L]=j.useState(0),[z,V]=j.useState(""),[Q,U]=j.useState(""),[ee,H]=j.useState(""),[B,M]=j.useState([]),[$,q]=j.useState(null),[Y,K]=j.useState(!1),[G,re]=j.useState(null),[J,ae]=j.useState(!1),[le,me]=j.useState(!1),[Oe,we]=j.useState(""),[ie,Me]=j.useState("upload"),[ke,se]=j.useState(""),[fe,Ie]=j.useState(""),[ce,je]=j.useState(""),[qe,Ne]=j.useState(""),[Je,vt]=j.useState(""),[Ge,Ot]=j.useState([]),[nt,Ae]=j.useState(!1),[Te,wt]=j.useState(!1),ft=(e==null?void 0:e.role)==="super_admin"||(e==null?void 0:e.role)==="admin",Pt=typeof window<"u"&&t?`${window.location.origin}/event/${t}/tickets`:"",At=j.useCallback(async()=>{var Le;if(!t||!r){o([]),s(!1);return}s(!0),c(null);try{const[Ke,Fe,Ve]=await Promise.all([m1.list(t),Fa.list({organization:r}),Ma.listForEvent(t)]);if(o(Ke),Fe.error)throw new Error(Fe.error);d((((Le=Fe.data)==null?void 0:Le.lists)??[]).filter(xt=>xt.type==="fixed")),h(Ve)}catch(Ke){c(Ke instanceof Error?Ke.message:"Failed to load"),o([])}finally{s(!1)}},[t,r]);j.useEffect(()=>{At()},[At]);const Ht=j.useCallback(async()=>{var Le,Ke;if(!t){q(null);return}K(!0),re(null);try{const[Fe,Ve]=await Promise.all([Pj.get(t),zr.get(t)]);we(((Ke=(Le=Ve.data)==null?void 0:Le.name)==null?void 0:Ke.trim())||""),q(Fe),me(Fe.enabled),Me(Fe.manualQrMode==="dynamic"?"dynamic":"upload"),Ie(Fe.upiQrImageUrl||""),je(Fe.upiId||""),Ne(Fe.payeeName||""),vt(Fe.instructions||"");const xt=await v1.list(t,"pending_review");Ot(xt)}catch(Fe){re(Fe instanceof Error?Fe.message:"Failed to load UPI settings"),q(null)}finally{K(!1)}},[t]);j.useEffect(()=>{Ht()},[Ht]),j.useEffect(()=>{var Tt,Mt;if(ie!=="dynamic"||!ce.trim()||!Oe.trim()){se("");return}const Ke=`${((Tt=n[0])==null?void 0:Tt.name)||"Sample ticket"} · ${Oe}`.slice(0,99),Ve=((((Mt=n[0])==null?void 0:Mt.basePriceMinor)??1e4)/100).toFixed(2),xt=yQ({pa:ce.trim(),pn:Ke,am:Ve});if(!xt){se("");return}let dt=!1;return Mw.toDataURL(xt,{margin:1,width:220,errorCorrectionLevel:"M"}).then(fr=>{dt||se(fr)}),()=>{dt=!0}},[ie,ce,Oe,n]);const Se=async()=>{if(t){Ae(!0);try{Ot(await v1.list(t,"pending_review"))}catch{}finally{Ae(!1)}}},ct=async()=>{if(t){ae(!0);try{const Le={enabled:le,manualQrMode:ie,upiQrImageUrl:fe.trim(),upiId:ce.trim(),payeeName:qe.trim(),instructions:Je,platformFeeInr:null},Ke=await Pj.patch(t,Le);q(Ke),me(Ke.enabled),Me(Ke.manualQrMode==="dynamic"?"dynamic":"upload"),Ie(Ke.upiQrImageUrl||""),await Se()}catch(Le){window.alert(Le instanceof Error?Le.message:"Save failed")}finally{ae(!1)}}},gt=async()=>{if(!(!t||!ft)){wt(!0);try{await P6();const Le=await Pj.checkoutEnablementOrder(t),Ke=window.Razorpay;await new Promise((Fe,Ve)=>{let xt=!1;const dt=new Ke({key:Le.keyId,amount:Le.amount,currency:Le.currency,order_id:Le.orderId,name:"EventBuzz",description:"Manual UPI ticketing — enablement fee",handler:Tt=>{xt=!0,Ku.checkoutVerify({orderId:Tt.razorpay_order_id,paymentId:Tt.razorpay_payment_id,signature:Tt.razorpay_signature}).then(()=>Fe()).catch(Mt=>Ve(Mt instanceof Error?Mt:new Error("Verification failed")))},modal:{ondismiss:()=>{xt||Ve(new Error(YB))}},theme:{color:"#0B4DD1"},prefill:e!=null&&e.email?{email:e.email}:void 0});dt.on("payment.failed",Tt=>{var Mt;Ve(new Error(((Mt=Tt.error)==null?void 0:Mt.description)||"Payment failed"))}),dt.open()}),await Ht()}catch(Le){const Ke=Le instanceof Error?Le.message:"Payment failed";Ke!==YB&&window.alert(Ke)}finally{wt(!1)}}},We=async Le=>{var Ke;if(!(!Le||!t||!r))try{const Ve=(Ke=(await Ys(Le,{eventId:t,module:"ticketing-upi-qr"})).url)==null?void 0:Ke.trim();Ve&&Ie(Ve)}catch(Fe){window.alert(Fe instanceof Error?Fe.message:"Upload failed")}},Pe=()=>{var Le;x(null),S(""),P(""),T([""]),I(""),A("INR"),L(0),V(""),U(((Le=u[0])==null?void 0:Le._id)||""),H(""),M([]),y(!0)},rt=Le=>{var Ke,Fe;x(Le),S(Le.name),P(Le.description||""),T((Ke=Le.keyPoints)!=null&&Ke.length?Le.keyPoints:[""]),I(String((Le.basePriceMinor||0)/100)),A(Le.currency||"INR"),L(Le.sortOrder??0),V(Le.maxPerOrder!=null?String(Le.maxPerOrder):""),U(Le.participantList),H(Le.registrationForm||""),M((Fe=Le.taxItems)!=null&&Fe.length?[...Le.taxItems]:[]),y(!0)},Ze=async()=>{if(!t||!Q)return;const Le=parseFloat(R);if(!Number.isFinite(Le)||Le<0){window.alert("Enter a valid price.");return}const Ke=Math.round(Le*100),Fe={name:k.trim(),description:_.trim(),keyPoints:O.map(Ve=>Ve.trim()).filter(Boolean),basePriceMinor:Ke,currency:E,sortOrder:F,maxPerOrder:z.trim()?parseInt(z,10):null,taxItems:B,participantList:Q,registrationForm:ee.trim()||null,isActive:!0};w(!0);try{m?await m1.update(t,m._id,Fe):await m1.create(t,Fe),y(!1),await At()}catch(Ve){window.alert(Ve instanceof Error?Ve.message:"Save failed")}finally{w(!1)}},pe=async Le=>{if(t&&window.confirm(`Deactivate “${Le.name}”? It will no longer appear on the public checkout page.`))try{await m1.remove(t,Le._id),await At()}catch(Ke){window.alert(Ke instanceof Error?Ke.message:"Failed")}},xe=()=>{Pt&&navigator.clipboard.writeText(Pt).then(()=>window.alert("Checkout link copied."),()=>window.alert(Pt))};return t?r?i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"12px",flexWrap:"wrap"},children:[i.jsxs("div",{children:[i.jsx("p",{style:Go,children:"Event"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:"Ticketing"}),i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",marginTop:"6px",maxWidth:"560px"},children:"Sell tickets on the public checkout page. Buyers are added to the participant list you choose. Online card/UPI uses your Razorpay (or platform) gateway when configured; if not, you can enable per-event UPI QR and review payment screenshots below."})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px",alignItems:"flex-end"},children:[i.jsxs("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:[i.jsxs("button",{type:"button",onClick:xe,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(iu,{size:14})," Copy checkout link"]}),i.jsxs("a",{href:Pt||"#",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",color:"var(--primary)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",textDecoration:"none"},children:[i.jsx(av,{size:14})," Open checkout"]}),i.jsxs("button",{type:"button",onClick:Pe,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:14})," Add ticket"]})]}),Pt&&i.jsx("code",{style:{fontSize:"11px",color:"var(--muted)",maxWidth:"420px",wordBreak:"break-all",textAlign:"right"},children:Pt})]})]}),l&&i.jsx("p",{style:{color:"var(--destructive)",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)"},children:l}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 360px), 1fr))",gap:"24px",alignItems:"start"},children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px",minWidth:0},children:[a&&i.jsx("p",{style:{color:"var(--muted)"},children:"Loading…"}),!a&&n.length===0&&!l&&i.jsx("div",{style:{padding:"40px",border:"2px dashed var(--border)",borderRadius:"var(--radius-card)",textAlign:"center",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"No tickets yet. Add a ticket to publish it on the public checkout page."}),i.jsx("div",{style:{display:"grid",gap:"12px"},children:n.map(Le=>{var Ke;return i.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"16px",background:"var(--card)",display:"flex",justifyContent:"space-between",gap:"12px",flexWrap:"wrap",opacity:Le.isActive?1:.65},children:[i.jsxs("div",{children:[i.jsxs("p",{style:{fontWeight:"var(--font-weight-medium)",fontFamily:"var(--font-inter)",marginBottom:"4px"},children:[Le.name," ",!Le.isActive&&i.jsx("span",{style:{fontSize:"11px",color:"var(--muted)"},children:"(inactive)"})]}),i.jsxs("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",marginBottom:"8px"},children:[s6e(Le.basePriceMinor,Le.currency),(Ke=Le.taxItems)!=null&&Ke.length?` · ${Le.taxItems.length} tax row(s)`:""]}),Le.description&&i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",maxWidth:"640px"},children:Le.description})]}),i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start"},children:[i.jsxs("button",{type:"button",onClick:()=>rt(Le),style:{padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"var(--text-xs)"},children:[i.jsx(Ii,{size:14})," Edit"]}),Le.isActive&&i.jsxs("button",{type:"button",onClick:()=>void pe(Le),style:{padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--destructive)",color:"var(--destructive)",background:"transparent",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"var(--text-xs)"},children:[i.jsx(gn,{size:14})," Deactivate"]})]})]},Le._id)})})]}),i.jsx("aside",{style:{minWidth:0},children:i.jsxs("section",{style:{border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"16px",background:"var(--card)",position:"sticky",top:16},children:[i.jsx("h2",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",margin:"0 0 8px"},children:"UPI / manual checkout"}),i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",margin:"0 0 12px"},children:"For events without an online payment gateway. Buyers pay you directly, then upload proof for you to approve."}),G&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-sm)"},children:G}),Y&&i.jsx("p",{style:{color:"var(--muted)"},children:"Loading UPI settings…"}),!Y&&$&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[$.enablementPaid?i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:0},children:["Enablement fee paid",$.enablementPaidAt?` · ${new Date($.enablementPaidAt).toLocaleString()}`:"",". You can configure and enable manual checkout below."]}):i.jsxs("div",{style:{padding:"12px",borderRadius:"8px",border:"1px solid var(--border)",background:"var(--muted-background, rgba(0,0,0,0.04))"},children:[i.jsxs("p",{style:{fontSize:"var(--text-sm)",margin:"0 0 10px",color:"var(--foreground)"},children:["Pay a one-time ",i.jsxs("strong",{children:["INR ",((tt=(De=$.enablementFeeInr)==null?void 0:De.toFixed)==null?void 0:tt.call(De,0))??$.enablementFeeInr]})," ","enablement fee per event to turn on manual UPI checkout. The receipt is listed under"," ",i.jsx("strong",{children:"Settings → Billing"})," with your other invoices."]}),ft?i.jsx("button",{type:"button",disabled:Te,onClick:()=>void gt(),style:{padding:"8px 16px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",cursor:Te?"wait":"pointer",fontSize:"var(--text-sm)"},children:Te?"Processing…":"Pay enablement fee"}):i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:0},children:"Only organisation administrators can complete this payment."})]}),i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"var(--text-sm)"},children:[i.jsx("input",{type:"checkbox",checked:le,disabled:!$.enablementPaid&&!le,onChange:Le=>me(Le.target.checked)}),"Enable UPI / manual checkout for this event"]}),!$.enablementPaid&&!le?i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:0},children:"Complete payment above before you can enable this option."}):null,le&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{background:"#fffbeb",border:"1px solid #fcd34d",borderRadius:"8px",padding:"12px",fontSize:"var(--text-sm)",color:"#92400e",lineHeight:1.45},children:[i.jsx("strong",{children:"Manual verification required."})," EventBuzz does not confirm money movement on UPI. You must check each payment in your bank or UPI app, match it to the buyer’s screenshot, then approve or reject the ticket in the queue below. Unmatched or fraudulent payments should be rejected."]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[i.jsx("span",{style:Go,children:"QR code"}),i.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"8px",fontSize:"var(--text-sm)"},children:[i.jsx("input",{type:"radio",name:"eb-manual-qr-mode",checked:ie==="upload",onChange:()=>Me("upload"),style:{marginTop:3}}),i.jsx("span",{children:"Upload a static QR image (or image URL)"})]}),i.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"8px",fontSize:"var(--text-sm)"},children:[i.jsx("input",{type:"radio",name:"eb-manual-qr-mode",checked:ie==="dynamic",onChange:()=>Me("dynamic"),style:{marginTop:3}}),i.jsxs("span",{children:["Generate QR from UPI ID: payee name is ",i.jsx("em",{children:"ticket name · event name"}),"; amount is the buyer’s order total at checkout."]})]})]}),ie==="upload"?i.jsxs(i.Fragment,{children:[i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:Go,children:"UPI QR image"}),i.jsx("input",{type:"file",accept:"image/*",onChange:Le=>{var Ke;return void We(((Ke=Le.target.files)==null?void 0:Ke[0])??null)}}),fe?i.jsx("img",{src:fe,alt:"QR",style:{maxWidth:200,borderRadius:8,border:"1px solid var(--border)"}}):null,i.jsx("input",{value:fe,onChange:Le=>Ie(Le.target.value),placeholder:"Or paste image URL",style:{padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--border)"}})]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:Go,children:"UPI ID (optional, shown to buyers)"}),i.jsx("input",{value:ce,onChange:Le=>je(Le.target.value),style:{padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--border)"}})]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:Go,children:"Payee name (optional)"}),i.jsx("input",{value:qe,onChange:Le=>Ne(Le.target.value),style:{padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--border)"}})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:Go,children:"UPI ID (VPA) — required"}),i.jsx("input",{value:ce,onChange:Le=>je(Le.target.value),placeholder:"e.g. merchant@paytm",style:{padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--border)"}})]}),i.jsx("p",{style:{fontSize:"11px",color:"var(--muted)",margin:0},children:"Preview uses your first ticket’s base price only. On the public page the QR updates with the exact total (ticket + tax, no Eventbuzz add-on)."}),ke?i.jsx("img",{src:ke,alt:"Sample UPI QR",style:{maxWidth:220,borderRadius:8,border:"1px solid var(--border)"}}):null]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:Go,children:"Instructions for buyers"}),i.jsx("textarea",{value:Je,onChange:Le=>vt(Le.target.value),rows:3,style:{padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--border)",fontFamily:"inherit"}})]}),i.jsx("p",{style:{fontSize:"11px",color:"var(--muted)",margin:0,lineHeight:1.45},children:"Buyers pay ticket price plus tax only on this path. Eventbuzz is covered by the one-time manual UPI enablement fee you pay per event (Billing)."}),i.jsx("button",{type:"button",disabled:J,onClick:()=>void ct(),style:{alignSelf:"flex-start",padding:"8px 16px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",cursor:"pointer"},children:J?"Saving…":"Save UPI settings"})]})]}),i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",marginTop:"24px",marginBottom:"8px"},children:"Pending UPI proofs"}),nt?i.jsx("p",{style:{color:"var(--muted)"},children:"Refreshing…"}):Ge.length===0?i.jsx("p",{style:{color:"var(--muted)",fontSize:"var(--text-sm)"},children:"No pending reviews."}):i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:Ge.map(Le=>{var Ke;return i.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:"8px",padding:"12px",display:"grid",gap:"8px",gridTemplateColumns:"1fr auto",alignItems:"start"},children:[i.jsxs("div",{children:[i.jsxs("p",{style:{fontWeight:"var(--font-weight-medium)",margin:"0 0 4px"},children:[((Ke=Le.ticket)==null?void 0:Ke.name)||"Ticket"," · ",Le.purchaserEmail]}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:0},children:[Le.quote&&typeof Le.quote.totalMinor=="number"?`${Le.quote.totalMinor/100} ${Le.currency}`:"—"," ","· ",Le.createdAt?new Date(Le.createdAt).toLocaleString():""]}),Le.buyerNote?i.jsx("p",{style:{fontSize:"var(--text-sm)",margin:"8px 0 0"},children:Le.buyerNote}):null,Le.screenshotUrl?i.jsx("a",{href:Le.screenshotUrl,target:"_blank",rel:"noopener noreferrer",style:{fontSize:"var(--text-sm)"},children:"View screenshot"}):null]}),i.jsxs("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:[i.jsx("button",{type:"button",onClick:()=>{(async()=>{if(t&&window.confirm("Approve this payment and register attendees?"))try{await v1.approve(t,Le._id),await Se(),await At()}catch(Fe){window.alert(Fe instanceof Error?Fe.message:"Approve failed")}})()},style:{padding:"6px 12px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",cursor:"pointer",fontSize:"var(--text-xs)"},children:"Approve"}),i.jsx("button",{type:"button",onClick:()=>{(async()=>{if(!t)return;const Fe=window.prompt("Reject reason (optional)")??"";try{await v1.reject(t,Le._id,Fe),await Se()}catch(Ve){window.alert(Ve instanceof Error?Ve.message:"Reject failed")}})()},style:{padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--destructive)",color:"var(--destructive)",background:"transparent",cursor:"pointer",fontSize:"var(--text-xs)"},children:"Reject"})]})]},Le._id)})})]})})]}),p&&i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.35)",zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center",padding:"16px"},onClick:()=>!b&&y(!1),children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",maxWidth:"560px",width:"100%",maxHeight:"90vh",overflow:"auto",padding:"20px",border:"1px solid var(--border)"},onClick:Le=>Le.stopPropagation(),children:[i.jsx("h2",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",marginBottom:"16px"},children:m?"Edit ticket":"New ticket"}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:Go,children:"Name"}),i.jsx("input",{value:k,onChange:Le=>S(Le.target.value),style:{padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--border)"}})]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:Go,children:"Description"}),i.jsx("textarea",{value:_,onChange:Le=>P(Le.target.value),rows:3,style:{padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--border)",fontFamily:"inherit"}})]}),i.jsxs("div",{children:[i.jsx("span",{style:Go,children:"Key points"}),O.map((Le,Ke)=>i.jsxs("div",{style:{display:"flex",gap:"8px",marginTop:"6px"},children:[i.jsx("input",{value:Le,onChange:Fe=>{const Ve=[...O];Ve[Ke]=Fe.target.value,T(Ve)},placeholder:"Bullet point",style:{flex:1,padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--border)"}}),i.jsx("button",{type:"button",onClick:()=>T(O.filter((Fe,Ve)=>Ve!==Ke)),style:{padding:"8px 12px",border:"1px solid var(--border)",borderRadius:"8px",background:"var(--background)"},children:"−"})]},Ke)),i.jsx("button",{type:"button",onClick:()=>T([...O,""]),style:{marginTop:"8px",padding:"6px 12px",borderRadius:"8px",border:"1px dashed var(--border)",background:"transparent",cursor:"pointer"},children:"+ Add point"})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},children:[i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsxs("span",{style:Go,children:["Price (",E,")"]}),i.jsx("input",{value:R,onChange:Le=>I(Le.target.value),placeholder:"0.00",style:{padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--border)"}})]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:Go,children:"Currency"}),i.jsx("input",{value:E,onChange:Le=>A(Le.target.value.toUpperCase()),maxLength:3,style:{padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--border)"}})]})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},children:[i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:Go,children:"Sort order"}),i.jsx("input",{type:"number",value:F,onChange:Le=>L(parseInt(Le.target.value,10)||0),style:{padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--border)"}})]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:Go,children:"Max per order (optional)"}),i.jsx("input",{value:z,onChange:Le=>V(Le.target.value),placeholder:"Unlimited",style:{padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--border)"}})]})]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:Go,children:"Participant list (fixed)"}),i.jsxs("select",{value:Q,onChange:Le=>U(Le.target.value),style:{padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--border)"},children:[i.jsx("option",{value:"",children:"Select list…"}),u.map(Le=>i.jsx("option",{value:Le._id,children:Le.name},Le._id))]})]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsx("span",{style:Go,children:"Registration form (optional)"}),i.jsxs("select",{value:ee,onChange:Le=>H(Le.target.value),style:{padding:"8px 10px",borderRadius:"8px",border:"1px solid var(--border)"},children:[i.jsx("option",{value:"",children:"None"}),f.map(Le=>i.jsxs("option",{value:Le._id,children:[Le.name," (",Le.type,")"]},Le._id))]})]}),i.jsxs("div",{children:[i.jsx("span",{style:Go,children:"Tax items"}),i.jsx("p",{style:{fontSize:"11px",color:"var(--muted)",margin:"4px 0 8px"},children:"Rate as percent (e.g. 18 for 18%). Leave states empty to apply everywhere; otherwise enter comma-separated codes (e.g. KA,MH)."}),B.map((Le,Ke)=>i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 80px 1fr auto",gap:"8px",marginBottom:"8px"},children:[i.jsx("input",{placeholder:"Label (e.g. GST)",value:Le.label,onChange:Fe=>{const Ve=[...B];Ve[Ke]={...Ve[Ke],label:Fe.target.value},M(Ve)},style:{padding:"8px",borderRadius:"8px",border:"1px solid var(--border)"}}),i.jsx("input",{type:"number",placeholder:"%",value:Le.rateBps/100,onChange:Fe=>{const Ve=parseFloat(Fe.target.value)||0,xt=[...B];xt[Ke]={...xt[Ke],rateBps:Math.round(Ve*100)},M(xt)},style:{padding:"8px",borderRadius:"8px",border:"1px solid var(--border)"}}),i.jsx("input",{placeholder:"States or empty = all",value:Le.appliesToStates.join(","),onChange:Fe=>{const Ve=[...B];Ve[Ke]={...Ve[Ke],appliesToStates:Fe.target.value.split(",").map(xt=>xt.trim().toUpperCase()).filter(Boolean)},M(Ve)},style:{padding:"8px",borderRadius:"8px",border:"1px solid var(--border)"}}),i.jsx("button",{type:"button",onClick:()=>M(B.filter((Fe,Ve)=>Ve!==Ke)),style:{padding:"8px",border:"1px solid var(--border)",borderRadius:"8px"},children:"×"})]},Ke)),i.jsx("button",{type:"button",onClick:()=>M([...B,{label:"",rateBps:0,appliesToStates:[]}]),style:{padding:"6px 12px",borderRadius:"8px",border:"1px dashed var(--border)",background:"transparent"},children:"+ Tax row"})]})]}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"20px"},children:[i.jsx("button",{type:"button",disabled:b,onClick:()=>y(!1),style:{padding:"8px 16px",borderRadius:"8px",border:"1px solid var(--border)",background:"var(--background)"},children:"Cancel"}),i.jsx("button",{type:"button",disabled:b||!k.trim()||!Q,onClick:()=>void Ze(),style:{padding:"8px 16px",borderRadius:"8px",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",opacity:b?.7:1},children:b?"Saving…":"Save"})]})]})})]}):i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Your account needs an organisation to use ticketing."}):i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Select an event to manage tickets."})}function c6e({...e}){return i.jsx(s$,{"data-slot":"sheet",...e})}function u6e({...e}){return i.jsx(l$,{"data-slot":"sheet-portal",...e})}const xQ=j.forwardRef(({className:e,...t},r)=>i.jsx(c$,{ref:r,"data-slot":"sheet-overlay",className:Xo("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t}));xQ.displayName="SheetOverlay";function d6e({className:e,children:t,side:r="right",...n}){return i.jsxs(u6e,{children:[i.jsx(xQ,{}),i.jsxs(u$,{"data-slot":"sheet-content",className:Xo("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...n,children:[t,i.jsxs(f$,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[i.jsx(er,{className:"size-4"}),i.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function f6e({className:e,...t}){return i.jsx("div",{"data-slot":"sheet-header",className:Xo("flex flex-col gap-1.5 p-4",e),...t})}function p6e({className:e,...t}){return i.jsx(d$,{"data-slot":"sheet-title",className:Xo("text-foreground font-semibold",e),...t})}function h6e(e){const t=j.useRef({value:e,previous:e});return j.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var j8="Switch",[g6e]=Rw(j8),[m6e,v6e]=g6e(j8),bQ=j.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:o,defaultChecked:a,required:s,disabled:l,value:c="on",onCheckedChange:u,form:d,...f}=e,[h,p]=j.useState(null),y=Nl(t,k=>p(k)),m=j.useRef(!1),x=h?d||!!h.closest("form"):!0,[b=!1,w]=W6({prop:o,defaultProp:a,onChange:u});return i.jsxs(m6e,{scope:r,checked:b,disabled:l,children:[i.jsx(ya.button,{type:"button",role:"switch","aria-checked":b,"aria-required":s,"data-state":jQ(b),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:y,onClick:ps(e.onClick,k=>{w(S=>!S),x&&(m.current=k.isPropagationStopped(),m.current||k.stopPropagation())})}),x&&i.jsx(y6e,{control:h,bubbles:!m.current,name:n,value:c,checked:b,required:s,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});bQ.displayName=j8;var wQ="SwitchThumb",SQ=j.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,o=v6e(wQ,r);return i.jsx(ya.span,{"data-state":jQ(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});SQ.displayName=wQ;var y6e=e=>{const{control:t,checked:r,bubbles:n=!0,...o}=e,a=j.useRef(null),s=h6e(r),l=iG(t);return j.useEffect(()=>{const c=a.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(s!==r&&f){const h=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(h)}},[s,r,n]),i.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...o,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function jQ(e){return e?"checked":"unchecked"}var x6e=bQ,b6e=SQ;function w6e({className:e,...t}){return i.jsx(x6e,{"data-slot":"switch",className:Xo("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-background focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:i.jsx(b6e,{"data-slot":"switch-thumb",className:Xo("bg-card dark:data-[state=unchecked]:bg-card-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}const $t={width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",outline:"none",boxSizing:"border-box"},Nr={...$t,cursor:"pointer",appearance:"none",paddingRight:"32px"};({...$t});const kt=e=>{e.currentTarget.style.borderColor="var(--primary)",e.currentTarget.style.boxShadow="0 0 0 2px rgba(11,77,209,0.10)"},_t=e=>{e.currentTarget.style.borderColor="var(--border)",e.currentTarget.style.boxShadow="none"};function pt({text:e,required:t}){return i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)",marginBottom:"5px"},children:[t&&i.jsx("span",{style:{color:"var(--destructive)",marginRight:"3px"},children:"*"}),e]})}function Qt({text:e}){return i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"4px 0 0",display:"flex",alignItems:"center",gap:"4px"},children:[i.jsx("span",{style:{fontSize:"10px"},children:"ℹ"})," ",e]})}function lt({children:e,span2:t,error:r}){return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gridColumn:t?"1 / -1":void 0},children:[e,r&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--destructive)",margin:"4px 0 0"},children:r})]})}function Zi({children:e,cols:t=2}){return i.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t}, 1fr)`,gap:"12px"},children:e})}function an({children:e}){return i.jsxs("div",{style:{position:"relative"},children:[e,i.jsx(po,{size:13,style:{position:"absolute",right:10,top:"50%",transform:"translateY(-50%)",color:"var(--muted)",pointerEvents:"none"}})]})}function go({name:e,value:t,onChange:r,options:n}){return i.jsx("div",{style:{display:"flex",gap:"20px",alignItems:"center",paddingTop:"2px"},children:n.map(o=>i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",fontWeight:"var(--font-weight-normal)"},children:[i.jsx("input",{type:"radio",name:e,value:o.value,checked:t===o.value,onChange:()=>r(o.value),style:{accentColor:"var(--primary)",width:"16px",height:"16px",cursor:"pointer"}}),o.label]},o.value))})}function gw({text:e,onRemove:t}){return i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"3px 8px",borderRadius:"var(--radius-button)",background:"var(--accent)",border:"1px solid var(--accent-foreground)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--accent-foreground)"},children:[e,t&&i.jsx("button",{onClick:t,style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",padding:0,lineHeight:1},children:i.jsx(er,{size:10})})]})}function S6e(){return i.jsx("div",{style:{height:"1px",background:"var(--border)",margin:"4px 0"}})}function ev({text:e}){return i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:"8px",marginTop:"4px"},children:e})}function j6e({n:e,state:t}){return i.jsx("div",{style:{width:28,height:28,borderRadius:"50%",background:t==="todo"?"var(--muted)":"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t==="done"?i.jsx(Oi,{size:13,style:{color:"#fff"}}):i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-inter)",color:"#fff",fontWeight:"var(--font-weight-medium)"},children:e})})}function $r({n:e,title:t,subtitle:r,open:n,completed:o,onToggle:a,children:s,onSave:l,nextLabel:c,nextDisabled:u,sectionError:d}){const f=n?"active":o?"done":"todo";return i.jsxs("div",{style:{borderBottom:"1px solid var(--border)"},children:[i.jsxs("button",{onClick:a,style:{width:"100%",display:"flex",alignItems:"center",gap:"12px",padding:"14px 20px",background:"none",border:"none",cursor:"pointer",textAlign:"left"},children:[i.jsx(j6e,{n:e,state:f}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:n?"var(--primary)":"var(--card-foreground)",margin:0},children:t}),!n&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:r})]}),n?i.jsx($f,{size:18,style:{color:"var(--muted)",flexShrink:0}}):i.jsx(po,{size:18,style:{color:"var(--muted)",flexShrink:0}})]}),n&&i.jsxs("div",{style:{padding:"0 20px 16px"},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"0 0 16px 40px"},children:r}),d&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--destructive)",margin:"0 0 12px 40px"},children:d}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:s}),i.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"12px",marginTop:"20px",paddingTop:"14px",borderTop:"1px solid var(--border)"},children:i.jsx("button",{type:"button",disabled:u,onClick:l,style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 18px",borderRadius:"var(--radius-button)",background:u?"var(--secondary)":"var(--primary)",color:u?"var(--muted)":"var(--primary-foreground)",border:"none",cursor:u?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:c})})]})]})}function Zo({children:e,onClose:t,title:r,breadcrumb:n,description:o,completedCount:a,totalSections:s,ctaLabel:l,ctaDisabled:c,onCtaClick:u,showProgress:d=!0,hidePrimaryCta:f=!1,panelWidth:h}){const p=s>0?Math.round(a/s*100):0,y=u?!c:!c&&a>=s;return i.jsxs(i.Fragment,{children:[i.jsx("style",{children:"@keyframes __panelIn { from { transform:translateX(100%); opacity:.6 } to { transform:translateX(0); opacity:1 } }"}),i.jsx("div",{role:"presentation",onClick:t,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.50)",zIndex:200}}),i.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"__panel-shell-title",onClick:m=>m.stopPropagation(),style:{position:"fixed",top:0,right:0,height:"100%",width:h??"min(560px,100vw)",maxWidth:"100vw",background:"var(--card)",zIndex:201,display:"flex",flexDirection:"column",boxShadow:"-4px 0 40px rgba(0,0,0,0.20)",animation:"__panelIn .25s cubic-bezier(.4,0,.2,1)"},children:[i.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)",flexShrink:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",marginBottom:d?"14px":"0"},children:[i.jsxs("div",{style:{flex:1,minWidth:0},children:[n&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"0 0 3px"},children:n}),i.jsx("h3",{id:"__panel-shell-title",style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:r}),o&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"5px 0 0"},children:o})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:[i.jsx("button",{type:"button",onClick:t,title:"Close",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",color:"var(--muted)"},onMouseEnter:m=>{m.currentTarget.style.borderColor="var(--destructive)",m.currentTarget.style.color="var(--destructive)"},onMouseLeave:m=>{m.currentTarget.style.borderColor="var(--border)",m.currentTarget.style.color="var(--muted)"},children:i.jsx(er,{size:14})}),!f&&i.jsx("button",{type:"button",disabled:!y,onClick:()=>y&&(u==null?void 0:u()),style:{padding:"6px 16px",borderRadius:"var(--radius-button)",background:y?"var(--primary)":"var(--secondary)",color:y?"var(--primary-foreground)":"var(--muted)",border:"none",cursor:y?"pointer":"not-allowed",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",transition:"background .2s"},children:l})]})]}),d&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"6px"},children:[i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[a," of ",s," sections complete"]}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--primary)",fontWeight:"var(--font-weight-medium)"},children:[p,"%"]})]}),i.jsx("div",{style:{height:"6px",borderRadius:"99px",background:"var(--border)",overflow:"hidden"},children:i.jsx("div",{style:{height:"100%",width:`${p}%`,background:p===100?"#22c55e":"var(--primary)",borderRadius:"99px",transition:"width .35s ease"}})})]})]}),i.jsx("div",{style:{flex:1,overflowY:"auto"},children:e})]})]})}function mc(e){const[t,r]=j.useState(1),[n,o]=j.useState(new Set);return{open:t,done:n,advance:l=>{o(c=>new Set([...c,l])),l<e&&r(l+1)},toggle:l=>r(c=>c===l?0:l)}}const k6e="https://api.eventbuzz.live/api".replace(/\/api\/?$/,"")||(typeof window<"u"?window.location.origin:"");function jy(e){return e?e.startsWith("http")?e:`${k6e}${e.startsWith("/")?"":"/"}${e}`:""}const _6e=3;function C6e({eventId:e,open:t,onOpenChange:r}){const[n,o]=j.useState({}),[a,s]=j.useState(!1),[l,c]=j.useState(null),[u,d]=j.useState("idle"),[f,h]=j.useState(null),[p,y]=j.useState([]),[m,x]=j.useState(!1),b=j.useRef(null),w=mc(_6e),k=j.useCallback(async()=>{if(e){s(!0);try{const I=await Uc.get(e);o(I.data||{})}catch{o({})}finally{s(!1)}}},[e]);j.useEffect(()=>{t&&e&&(k(),x(!0),Hs.list({type:"microsite",limit:50}).then(I=>{var E;y(((E=I.data)==null?void 0:E.templates)??[])}).catch(()=>y([])).finally(()=>x(!1)))},[t,e,k]);const S=j.useCallback(async I=>{if(e){h(null),c(I);try{await Uc.update(e,n),w.advance(I)}catch(E){h(E instanceof Error?E.message:"Failed to save")}finally{c(null)}}},[e,n,w]),_=j.useCallback(async()=>{var E;const I=(n.folder||"").trim().toLowerCase().replace(/[^a-z0-9-]/g,"");if(!I){d("idle");return}if(e){d("checking");try{const A=await Uc.checkFolder(e,I);d((E=A.data)!=null&&E.available?"available":"taken")}catch{d("idle")}}},[e,n.folder]);j.useEffect(()=>{if(b.current&&clearTimeout(b.current),!(n.folder||"").trim()){d("idle");return}return b.current=setTimeout(()=>_(),500),()=>{b.current&&clearTimeout(b.current)}},[n.folder,_]);const P=async I=>{var A;const E=(A=I.target.files)==null?void 0:A[0];if(!(!E||!e)){try{const F=await Ys(E,{eventId:e,module:"website/logo"});o(L=>({...L,logo:F.url}))}catch{}I.target.value=""}},O=async I=>{var A;const E=(A=I.target.files)==null?void 0:A[0];if(!(!E||!e)){try{const F=await Ys(E,{eventId:e,module:"website/banner"});o(L=>({...L,banners:[...L.banners||[],F.url]}))}catch{}I.target.value=""}},T=I=>{o(E=>({...E,banners:(E.banners||[]).filter((A,F)=>F!==I)}))},R=async I=>{var A;const E=(A=I.target.files)==null?void 0:A[0];if(!(!E||!e)){try{const F=await Ys(E,{eventId:e,module:"website/favicon"});o(L=>({...L,favicon:F.url}))}catch{}I.target.value=""}};return i.jsx(c6e,{open:t,onOpenChange:r,children:i.jsxs(d6e,{side:"right",className:"sm:max-w-2xl flex flex-col p-0",children:[i.jsx(f6e,{className:"px-4 pt-4 pb-2 border-b border-border",children:i.jsxs(p6e,{className:"flex items-center gap-2",children:[i.jsx(Pl,{size:18})," Website Settings"]})}),i.jsx("div",{className:"flex-1 overflow-y-auto",children:a?i.jsx("div",{className:"flex items-center justify-center py-12",children:i.jsx(ix,{className:"size-6 animate-spin text-muted-foreground"})}):i.jsxs(i.Fragment,{children:[i.jsxs($r,{n:1,title:"Basic configuration",subtitle:"Enable website, folder, title, description and keywords",open:w.open===1,completed:w.done.has(1),onToggle:()=>w.toggle(1),onSave:()=>S(1),nextLabel:l===1?"Saving…":"Save",nextDisabled:l!==null,sectionError:f||(u==="taken"?"Another event uses this website folder.":void 0),children:[i.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[i.jsx(w6e,{checked:!!n.enabled,onCheckedChange:I=>o(E=>({...E,enabled:I}))}),i.jsx("span",{className:"text-sm text-foreground font-medium",children:"Enable website"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:"Website folder"}),i.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[i.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"http://web.eventbuzz.live/"}),i.jsx("input",{type:"text",value:n.folder||"",onChange:I=>o(E=>({...E,folder:I.target.value})),placeholder:"e.g. napcon-2026",style:{flex:"1 1 120px",minWidth:0,padding:"6px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",color:"var(--foreground)",fontSize:"var(--text-sm)"}})]}),u==="checking"&&i.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Checking…"}),u==="available"&&i.jsx("p",{className:"text-xs text-green-600 mt-1",children:"Available"}),u==="taken"&&i.jsx("p",{className:"text-xs text-destructive mt-1",children:"Another event uses this folder"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:"Website title"}),i.jsx("input",{type:"text",value:n.title||"",onChange:I=>o(E=>({...E,title:I.target.value})),placeholder:"Event website title",style:{width:"100%",padding:"6px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",color:"var(--foreground)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:"Description"}),i.jsx("textarea",{value:n.description||"",onChange:I=>o(E=>({...E,description:I.target.value})),placeholder:"Meta description",rows:2,style:{width:"100%",padding:"6px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",color:"var(--foreground)",fontSize:"var(--text-sm)",resize:"none"}})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:"Keywords (comma-separated)"}),i.jsx("input",{type:"text",value:Array.isArray(n.keywords)?n.keywords.join(", "):n.keywords||"",onChange:I=>o(E=>({...E,keywords:I.target.value.split(",").map(A=>A.trim()).filter(Boolean)})),placeholder:"event, conference, 2026",style:{width:"100%",padding:"6px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",color:"var(--foreground)",fontSize:"var(--text-sm)"}})]})]}),i.jsxs($r,{n:2,title:"Template",subtitle:"Choose a microsite template",open:w.open===2,completed:w.done.has(2),onToggle:()=>w.toggle(2),onSave:()=>S(2),nextLabel:l===2?"Saving…":"Save",nextDisabled:l!==null,children:[m?i.jsx("div",{className:"flex items-center justify-center py-6",children:i.jsx(ix,{className:"size-5 animate-spin text-muted-foreground"})}):i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"12px"},children:p.map(I=>i.jsxs("div",{style:{background:"var(--card)",border:n.templateId===I._id?"2px solid var(--primary)":"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:[i.jsx("div",{style:{height:"100px",background:"var(--secondary)",display:"flex",alignItems:"center",justifyContent:"center",borderBottom:"1px solid var(--border)"},children:I.thumbnail?i.jsx("img",{src:jy(I.thumbnail),alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}):i.jsx(_q,{size:28,style:{color:"var(--muted)"}})}),i.jsxs("div",{style:{padding:"8px 10px"},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:I.name}),i.jsxs("div",{style:{display:"flex",gap:"6px",marginTop:"6px",flexWrap:"wrap"},children:[i.jsxs("button",{type:"button",onClick:()=>o(E=>({...E,templateId:I._id})),style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"4px 8px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:n.templateId===I._id?"var(--primary)":"var(--secondary)",color:n.templateId===I._id?"var(--primary-foreground)":"var(--foreground)",cursor:"pointer",fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"500"},children:[n.templateId===I._id?i.jsx(Oi,{size:10}):null," Select"]}),i.jsxs("button",{type:"button",onClick:()=>I.thumbnail?window.open(jy(I.thumbnail),"_blank"):null,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"4px 8px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",color:"var(--foreground)",cursor:"pointer",fontSize:"11px",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(Ah,{size:10})," Preview"]})]})]})]},I._id))}),!m&&p.length===0&&i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"No microsite templates found. Create templates under Design → Microsite Templates."})]}),i.jsxs($r,{n:3,title:"Logo & Banners",subtitle:"Upload logo, favicon and banner images",open:w.open===3,completed:w.done.has(3),onToggle:()=>w.toggle(3),onSave:()=>S(3),nextLabel:l===3?"Saving…":"Save",nextDisabled:l!==null,children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:"Logo"}),n.logo?i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("img",{src:jy(n.logo),alt:"Logo",style:{height:40,objectFit:"contain",border:"1px solid var(--border)",borderRadius:4}}),i.jsx("button",{type:"button",onClick:()=>o(I=>({...I,logo:void 0})),style:{fontSize:"var(--text-xs)",color:"var(--destructive)",background:"none",border:"none",cursor:"pointer"},children:"Remove"})]}):null,i.jsx("input",{type:"file",accept:"image/*",onChange:P,className:"text-sm text-muted-foreground file:mr-2 file:py-1 file:px-2 file:rounded file:border file:text-xs"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:"Favicon"}),n.favicon?i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("img",{src:jy(n.favicon),alt:"Favicon",style:{width:24,height:24,objectFit:"contain"}}),i.jsx("button",{type:"button",onClick:()=>o(I=>({...I,favicon:void 0})),style:{fontSize:"var(--text-xs)",color:"var(--destructive)",background:"none",border:"none",cursor:"pointer"},children:"Remove"})]}):null,i.jsx("input",{type:"file",accept:"image/*,.ico",onChange:R,className:"text-sm text-muted-foreground file:mr-2 file:py-1 file:px-2 file:rounded file:border file:text-xs"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs text-muted-foreground mb-1",children:"Banner images (multiple)"}),i.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:(n.banners||[]).map((I,E)=>i.jsxs("div",{style:{position:"relative"},children:[i.jsx("img",{src:jy(I),alt:"",style:{height:64,width:96,objectFit:"cover",borderRadius:4,border:"1px solid var(--border)"}}),i.jsx("button",{type:"button",onClick:()=>T(E),style:{position:"absolute",top:-4,right:-4,width:20,height:20,borderRadius:"50%",background:"var(--destructive)",color:"var(--destructive-foreground)",border:"none",cursor:"pointer",fontSize:12,display:"flex",alignItems:"center",justifyContent:"center"},children:"×"})]},E))}),i.jsx("input",{type:"file",accept:"image/*",onChange:O,className:"text-sm text-muted-foreground file:mr-2 file:py-1 file:px-2 file:rounded file:border file:text-xs"})]})]})]})})]})})}function E6e(e){return e.replace(/\/+$/,"")}function A6e(){return E6e("https://builder.eventbuzz.live")}function kQ(){try{return new URL(A6e()).origin}catch{return"*"}}const T6e="EB_EXPORT_HTML",P6e="EB_EXPORT_HTML_RESULT";function mw(e,t=2e4){return new Promise((r,n)=>{const o=e==null?void 0:e.contentWindow;if(!o){n(new Error("Editor is not ready."));return}const a=`${Date.now()}-${Math.random().toString(36).slice(2)}`,s=kQ(),l=u=>{var d;u.source===o&&(((d=u.data)==null?void 0:d.type)!==P6e||u.data.requestId!==a||(window.removeEventListener("message",l),window.clearTimeout(c),u.data.error?n(new Error(String(u.data.error))):r(String(u.data.html??""))))};window.addEventListener("message",l);const c=window.setTimeout(()=>{window.removeEventListener("message",l),n(new Error("Timed out waiting for editor HTML."))},t);o.postMessage({type:T6e,requestId:a},s==="*"?"*":s)})}function _Q(e){return e.replace(/\/+$/,"")}function O6e(){return _Q("https://builder.eventbuzz.live")}function I6e(){return _Q("https://api.eventbuzz.live/api")}function N6e(...e){return t=>{e.forEach(r=>{r&&(typeof r=="function"?r(t):r.current=t)})}}const R6e="EB_BUILDER_READY",CQ=j.forwardRef(function({pageId:t,eventId:r,micrositeId:n=null,variant:o="default",mountNonce:a=0},s){const l=j.useRef(null),c=kQ(),u=j.useCallback(()=>{var w;const y=(w=l.current)==null?void 0:w.contentWindow;if(!y)return;const m=MJ(),x=I6e(),b={type:"SET_AUTH_TOKEN",token:m,pageId:t,eventId:r,apiBaseUrl:x};n&&String(n).trim()&&(b.micrositeId=String(n).trim()),y.postMessage(b,c==="*"?"*":c)},[t,r,n,c]),d=j.useCallback(()=>{u(),window.setTimeout(u,0),window.setTimeout(u,50),window.setTimeout(u,200)},[u]);j.useEffect(()=>{const y=m=>{var x,b;m.source===((x=l.current)==null?void 0:x.contentWindow)&&((b=m.data)==null?void 0:b.type)===R6e&&d()};return window.addEventListener("message",y),()=>window.removeEventListener("message",y)},[d]);const f=j.useCallback(()=>{d()},[d]),h=O6e(),p=o==="fullscreen";return i.jsx("div",{style:{width:"100%",height:p?"100%":"calc(100vh - 220px)",minHeight:p?0:"min(70vh, 900px)",maxHeight:p?"none":"1200px",flex:p?1:void 0,display:"flex",flexDirection:"column",border:p?"none":"1px solid var(--border)",borderRadius:p?0:"var(--radius-card)",overflow:"hidden",background:p?"var(--background)":"var(--card)"},children:i.jsx("iframe",{ref:N6e(l,s),src:h,onLoad:f,title:"Microsite visual editor",style:{width:"100%",flex:1,minHeight:0,border:"none"}},`${t}-${a}-${n??"legacy"}`)})}),GB={header:"Header",banner:"Banner",contact_form:"Contact form",agenda:"Agenda / schedule",register_links:"Register links",speakers:"Speakers",footer:"Footer",sponsors:"Sponsors",cta:"CTA",custom_html:"Custom HTML",countdown:"Countdown strip",gallery:"Gallery",about:"About",venue:"Venue",faq:"FAQ",tickets:"Tickets / pricing"};function KB(e){switch(e){case"header":return{logoText:"",menuItems:[]};case"banner":return{headline:"",subtext:"",ctaText:"",ctaUrl:"#",secondaryCtaText:"View schedule",secondaryCtaUrl:"#schedule",backgroundClass:"bg-primary"};case"contact_form":return{title:"Contact Us",submitLabel:"Send"};case"agenda":return{title:"Schedule"};case"register_links":return{title:"Register",primaryLabel:"Register Now",primaryUrl:"#",secondaryLabel:"",secondaryUrl:"#"};case"speakers":return{title:"Speakers",limit:12};case"footer":return{copyrightText:"",links:[]};case"sponsors":return{title:"Sponsors & partners",sponsors:[],partnerCtaLabel:"",partnerCtaUrl:"#"};case"cta":return{headline:"Join us",subtext:"",buttonLabel:"Register",buttonUrl:"#"};case"custom_html":return{html:""};case"countdown":return{headingLine:""};case"gallery":return{title:"Gallery",images:[]};case"about":return{title:"About",lead:"",bulletsTitle:"Why attend",bullets:[],ctaLabel:"",ctaUrl:"#register"};case"venue":return{title:"Venue",venueName:"",intro:"",mapEmbedUrl:"",transportCards:[]};case"faq":return{title:"FAQ",items:[],contactEmail:""};case"tickets":return{title:"Tickets",intro:"",tiers:[],includedTitle:"",includedBullets:[]};default:return{}}}function L6e(){var At,Ht;const{selectedEventId:e,pendingMicrositeBuilder:t,setPendingMicrositeBuilder:r}=eo(),[n,o]=j.useState([]),[a,s]=j.useState(!1),[l,c]=j.useState(!1),[u,d]=j.useState(""),[f,h]=j.useState("home"),[p,y]=j.useState(""),[m,x]=j.useState(!1),[b,w]=j.useState(null),[k,S]=j.useState(null),[_,P]=j.useState(!1),[O,T]=j.useState(!1),[R,I]=j.useState(!1),E=j.useRef(null),[A,F]=j.useState(null),[L,z]=j.useState({}),[V,Q]=j.useState(""),[U,ee]=j.useState(!1),[H,B]=j.useState(!1),[M,$]=j.useState(null),[q,Y]=j.useState(""),[K,G]=j.useState(!1),[re,J]=j.useState("sections"),[ae,le]=j.useState(""),[me,Oe]=j.useState(null),we=j.useRef(null),[ie,Me]=j.useState(!1),[ke,se]=j.useState(null),fe=j.useCallback(async()=>{var Se;if(e){s(!0);try{const ct=await Wc.list(e);o(((Se=ct.data)==null?void 0:Se.pages)??[])}catch{o([])}finally{s(!1)}}},[e]);j.useEffect(()=>{fe()},[fe]),j.useEffect(()=>{if(!e){le(""),Oe(null);return}(async()=>{var We;const Se=await ua.list(e);if(Se.data&&Se.data.length>0){const Pe=Se.data[0];Oe(Pe._id),le(Pe.publishFolder!=null?String(Pe.publishFolder).trim():"");return}Oe(null);const ct=await Uc.get(e),gt=((We=ct.data)==null?void 0:We.folder)!=null?String(ct.data.folder).trim():"";le(gt)})().catch(()=>{Oe(null),le("")})},[e]),j.useEffect(()=>{const Se=t;!Se||!e||Se.eventId!==e||(r(null),(async()=>{var gt;let ct=Se.pageId;if(!ct)try{const Pe=((gt=(await Wc.list(e)).data)==null?void 0:gt.pages)??[],rt=Pe.find(Ze=>Ze.type==="home")??Pe[0];ct=(rt==null?void 0:rt._id)??null}catch{ct=null}ct&&(w(ct),J(Se.mode))})())},[t,e,r]);const Ie=j.useCallback(async()=>{if(se(null),!e||!ae.trim()){se("Set a microsite URL slug in Configure event microsite first.");return}Me(!0);try{const Se=await mw(we.current);if(me){const ct=await ua.update(e,me,{micrositeHtml:Se});if(ct.error)throw new Error(ct.error);const gt=await ua.publish(e,me,{targets:"draft"});if(gt.error)throw new Error(gt.error)}else{const ct=await Uc.update(e,{micrositeHtml:Se});if(ct.error)throw new Error(ct.error);const gt=await Uc.publishMicrosite(e,{targets:"draft"});if(gt.error)throw new Error(gt.error)}}catch(Se){se(Se instanceof Error?Se.message:"Save failed")}finally{Me(!1)}},[e,ae,me]),ce=j.useCallback(async()=>{if(se(null),!e||!ae.trim()){se("Set a microsite URL slug in Configure event microsite first.");return}Me(!0);try{const Se=await mw(we.current);if(me){const ct=await ua.update(e,me,{micrositeHtml:Se});if(ct.error)throw new Error(ct.error);const gt=await ua.publish(e,me,{targets:"both"});if(gt.error)throw new Error(gt.error)}else{const ct=await Uc.update(e,{micrositeHtml:Se});if(ct.error)throw new Error(ct.error);const gt=await Uc.publishMicrosite(e,{targets:"both"});if(gt.error)throw new Error(gt.error)}}catch(Se){se(Se instanceof Error?Se.message:"Publish failed")}finally{Me(!1)}},[e,ae,me]),je=j.useCallback(async Se=>{P(!0);try{const ct=await Wc.get(Se);S(ct.data??null)}catch{S(null)}finally{P(!1)}},[]);j.useEffect(()=>{b?je(b):S(null)},[b,je]),j.useEffect(()=>{const Se=ct=>{E.current&&!E.current.contains(ct.target)&&T(!1)};return document.addEventListener("mousedown",Se),()=>document.removeEventListener("mousedown",Se)},[]);const qe=async Se=>{if(!b)return;const ct=await Wc.update(b,{sections:Se});ct.data&&S(ct.data)},Ne=(Se,ct)=>{if(!(k!=null&&k.sections))return;const We=[...[...k.sections].sort((Ze,pe)=>(Ze.order??0)-(pe.order??0))],Pe=ct==="up"?Se-1:Se+1;if(Pe<0||Pe>=We.length)return;[We[Se],We[Pe]]=[We[Pe],We[Se]];const rt=We.map((Ze,pe)=>({...Ze,order:pe}));qe(rt)},Je=Se=>{if(!(k!=null&&k.sections))return;const gt=[...k.sections].sort((We,Pe)=>(We.order??0)-(Pe.order??0)).filter((We,Pe)=>Pe!==Se).map((We,Pe)=>({...We,order:Pe}));qe(gt)},vt=async Se=>{if(!b||!k)return;T(!1),I(!0);const ct=k.sections??[],gt=ct.length,We={id:crypto.randomUUID(),type:Se,order:gt,config:KB(Se)},Pe=[...ct,We];try{const rt=await Wc.update(b,{sections:Pe});rt.data&&S(rt.data)}finally{I(!1)}},Ge=Se=>{F(Se.id),Q(Se.type),z({...Se.config||KB(Se.type)})},Ot=async()=>{if(!b||!k||!A)return;ee(!0);const Se=(k.sections??[]).map(ct=>ct.id===A?{...ct,config:{...L}}:ct);try{const ct=await Wc.update(b,{sections:Se});ct.data&&(S(ct.data),F(null))}finally{ee(!1)}},nt=(Se,ct)=>{z(gt=>({...gt,[Se]:ct}))},Ae=(Se,ct,gt,We)=>{z(Pe=>{const Ze=[...Pe[Se]??[]];return Ze[ct]?(Ze[ct]={...Ze[ct],[gt]:We},{...Pe,[Se]:Ze}):Pe})},Te=(Se,ct)=>{z(gt=>{const We=gt[Se]??[];return{...gt,[Se]:[...We,ct]}})},wt=(Se,ct)=>{z(gt=>{const We=gt[Se]??[];return{...gt,[Se]:We.filter((Pe,rt)=>rt!==ct)}})},ft=async Se=>{var ct;if(b){$(null),B(!0);try{const gt=await Wc.exportHtml(b,q.trim()||void 0);if(gt.error){$(gt.error);return}const We=(ct=gt.data)==null?void 0:ct.html;if(!We){$("No HTML returned");return}if(Se){const Pe=window.open("","_blank");Pe?(Pe.document.write(We),Pe.document.close()):$("Popup blocked. Allow popups to preview.")}else{const Pe=new Blob([We],{type:"text/html"}),rt=URL.createObjectURL(Pe),Ze=document.createElement("a");Ze.href=rt,Ze.download=((k==null?void 0:k.slug)||"page")+".html",Ze.click(),URL.revokeObjectURL(rt)}}catch(gt){$(gt instanceof Error?gt.message:"Export failed")}finally{B(!1)}}},Pt=async Se=>{if(Se.preventDefault(),!(!e||!u.trim())){x(!0);try{(await Wc.create(e,{title:u.trim(),type:f,slug:p.trim()||void 0})).data&&(c(!1),d(""),h("home"),y(""),fe())}finally{x(!1)}}};return e?i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:"Event Website"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.2"},children:"Event Website"}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--muted)",marginTop:"4px"},children:"Pages"})]}),b?i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"},children:[i.jsxs("button",{type:"button",onClick:()=>{w(null),S(null),$(null),J("sections")},style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",borderRadius:"var(--radius-button)",background:"var(--secondary)",border:"1px solid var(--border)",color:"var(--foreground)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(wq,{size:14})," Back to pages"]}),i.jsx("span",{style:{flex:1,minWidth:"120px",fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:(k==null?void 0:k.title)??((At=n.find(Se=>Se._id===b))==null?void 0:At.title)??"Page"}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[i.jsxs("button",{type:"button",onClick:()=>J("visual"),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",boxShadow:re==="visual"?"0 0 0 2px var(--ring, rgba(99,102,241,0.5))":void 0},title:"Open GrapesJS visual editor (run website_builder separately)",children:[i.jsx(Z3,{size:16})," Visual builder"]}),i.jsxs("button",{type:"button",onClick:()=>G(!0),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",borderRadius:"var(--radius-button)",background:"var(--secondary)",border:"1px solid var(--border)",color:"var(--foreground)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(Pl,{size:14})," Settings"]})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",flexWrap:"wrap",padding:"4px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",width:"fit-content"},role:"tablist","aria-label":"Editor mode",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":re==="sections",onClick:()=>J("sections"),style:{padding:"8px 14px",borderRadius:"calc(var(--radius-button) - 2px)",border:"none",background:re==="sections"?"var(--card)":"transparent",color:"var(--foreground)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:re==="sections"?"600":"400",boxShadow:re==="sections"?"0 1px 2px rgba(0,0,0,0.06)":void 0},children:"Sections list"}),i.jsx("button",{type:"button",role:"tab","aria-selected":re==="visual",onClick:()=>J("visual"),style:{padding:"8px 14px",borderRadius:"calc(var(--radius-button) - 2px)",border:"none",background:re==="visual"?"var(--card)":"transparent",color:"var(--foreground)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:re==="visual"?"600":"400",boxShadow:re==="visual"?"0 1px 2px rgba(0,0,0,0.06)":void 0},children:"Visual editor (iframe)"})]}),re==="visual"?i.jsxs(i.Fragment,{children:[i.jsxs("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--muted)",margin:0},children:["Visual HTML is stored on ",me?i.jsxs(i.Fragment,{children:["the selected ",i.jsx("code",{style:{fontSize:"0.85em"},children:"EventMicrosite"})," template"]}):i.jsxs(i.Fragment,{children:[i.jsx("code",{style:{fontSize:"0.85em"},children:"Event.website.micrositeHtml"})," (legacy)"]}),". ",i.jsx("strong",{children:"Save (draft site)"})," updates the DB and publishes only ",i.jsxs("code",{style:{fontSize:"0.85em"},children:[ae||"slug","_draft"]}),". ",i.jsx("strong",{children:"Publish"})," writes both draft and live folders. Set ",i.jsx("code",{style:{fontSize:"0.85em"},children:"VITE_PARENT_ORIGIN"})," on the builder in production."]}),e&&b?i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",marginTop:"10px"},children:[i.jsxs("button",{type:"button",disabled:ie||!ae.trim(),onClick:()=>void Ie(),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",color:"var(--foreground)",cursor:ie||!ae.trim()?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(Nw,{size:16,"aria-hidden":!0})," ",ie?"Working…":"Save (draft site)"]}),i.jsxs("button",{type:"button",disabled:ie||!ae.trim(),onClick:()=>void ce(),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 14px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",cursor:ie||!ae.trim()?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(Aq,{size:16,"aria-hidden":!0})," Publish"]})]}),ke?i.jsx("p",{style:{margin:"8px 0 0",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--destructive)"},children:ke}):null,i.jsx(CQ,{ref:we,pageId:b,eventId:e,micrositeId:me??void 0})]}):i.jsx("div",{style:{padding:"24px",color:"var(--muted)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"Select an event and page to open the visual editor."})]}):k?i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",flexWrap:"wrap"},children:[i.jsx("input",{type:"text",placeholder:"Registration URL (optional)",value:q,onChange:Se=>Y(Se.target.value),style:{maxWidth:"280px",padding:"6px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",color:"var(--foreground)",fontSize:"var(--text-sm)"}}),i.jsxs("button",{type:"button",onClick:()=>ft(!0),disabled:H,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",borderRadius:"var(--radius-button)",background:"var(--secondary)",border:"1px solid var(--border)",color:"var(--foreground)",cursor:H?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(av,{size:14})," ",H?"Loading…":"Preview HTML"]}),i.jsxs("button",{type:"button",onClick:()=>ft(!1),disabled:H,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:H?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(Al,{size:14})," Download HTML"]})]}),M&&i.jsx("div",{style:{padding:"8px 12px",borderRadius:"var(--radius-button)",background:"#fef2f2",color:"#b91c1c",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:M}),i.jsxs("div",{style:{marginBottom:"12px",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"8px"},children:[i.jsx("span",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--muted)"},children:"Add a section to this page"}),i.jsxs("div",{ref:E,style:{position:"relative"},children:[i.jsxs("button",{type:"button",disabled:R,onClick:()=>T(Se=>!Se),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:R?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:14})," Add section"]}),O&&i.jsx("div",{style:{position:"absolute",right:0,top:"100%",marginTop:"4px",background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",boxShadow:"var(--shadow-md)",zIndex:50,minWidth:"180px",overflow:"hidden"},children:BJ.map(Se=>i.jsx("button",{type:"button",onClick:()=>vt(Se),style:{display:"block",width:"100%",padding:"10px 14px",textAlign:"left",background:"none",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)"},children:GB[Se]??Se},Se))})]})]}),i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:[i.jsx("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border)",fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:"Sections"}),_?i.jsx("div",{style:{padding:"24px",color:"var(--muted)",fontSize:"var(--text-sm)"},children:"Loading…"}):(Ht=k.sections)!=null&&Ht.length?i.jsx("div",{style:{display:"flex",flexDirection:"column"},children:[...k.sections??[]].sort((Se,ct)=>(Se.order??0)-(ct.order??0)).map((Se,ct)=>{var gt,We,Pe;return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"10px 16px",borderBottom:"1px solid var(--border)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx("span",{style:{display:"inline-flex",padding:"2px 8px",borderRadius:"4px",background:"var(--secondary)",color:"var(--foreground)",fontSize:"var(--text-xs)",fontWeight:"500",minWidth:"100px"},children:Se.type.replace(/_/g," ")}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:["Order: ",ct+1]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",marginLeft:"auto"},children:[i.jsx("button",{type:"button",onClick:()=>Ge(Se),title:"Edit section",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",cursor:"pointer"},children:i.jsx(Ii,{size:14})}),i.jsx("button",{type:"button",onClick:()=>Ne(ct,"up"),disabled:ct===0,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",cursor:ct===0?"not-allowed":"pointer",opacity:ct===0?.5:1},children:i.jsx($f,{size:14})}),i.jsx("button",{type:"button",onClick:()=>Ne(ct,"down"),disabled:ct===(((gt=k.sections)==null?void 0:gt.length)??0)-1,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",cursor:ct===(((We=k.sections)==null?void 0:We.length)??0)-1?"not-allowed":"pointer",opacity:ct===(((Pe=k.sections)==null?void 0:Pe.length)??0)-1?.5:1},children:i.jsx(po,{size:14})}),i.jsx("button",{type:"button",onClick:()=>Je(ct),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--destructive)",cursor:"pointer"},children:i.jsx(gn,{size:14})})]})]},Se.id)})}):i.jsx("div",{style:{padding:"24px",color:"var(--muted)",fontSize:"var(--text-sm)"},children:"No sections yet. Add one below."})]})]}):i.jsx("div",{style:{padding:"24px",color:"var(--muted)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:_?"Loading page…":"Could not load this page."})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"},children:[i.jsx("div",{style:{flex:1,minWidth:0}}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsxs("button",{type:"button",onClick:()=>G(!0),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 16px",borderRadius:"var(--radius-button)",background:"var(--secondary)",border:"1px solid var(--border)",color:"var(--foreground)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(Pl,{size:14})," Settings"]}),i.jsxs("button",{type:"button",onClick:()=>c(!0),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:14})," Add page"]})]})]}),l&&i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16px"},children:[i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:"Add page"}),i.jsx("button",{type:"button",onClick:()=>{c(!1),d(""),y("")},style:{background:"none",border:"none",cursor:"pointer",padding:"4px",color:"var(--muted)"},children:i.jsx(er,{size:18})})]}),i.jsxs("form",{onSubmit:Pt,style:{display:"flex",flexDirection:"column",gap:"12px",maxWidth:"400px"},children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:"Title *"}),i.jsx("input",{type:"text",value:u,onChange:Se=>d(Se.target.value),required:!0,placeholder:"e.g. Home",style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",color:"var(--foreground)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:"Type"}),i.jsx("select",{value:f,onChange:Se=>h(Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",color:"var(--foreground)",fontSize:"var(--text-sm)"},children:zJ.map(Se=>i.jsx("option",{value:Se,children:Se},Se))})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:"Slug (optional)"}),i.jsx("input",{type:"text",value:p,onChange:Se=>y(Se.target.value),placeholder:"e.g. home",style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",color:"var(--foreground)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{style:{display:"flex",gap:"8px"},children:[i.jsx("button",{type:"submit",disabled:m||!u.trim(),style:{padding:"8px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:m?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:m?"Saving…":"Create"}),i.jsx("button",{type:"button",onClick:()=>{c(!1),d(""),y("")},style:{padding:"8px 16px",borderRadius:"var(--radius-button)",background:"var(--secondary)",color:"var(--foreground)",border:"1px solid var(--border)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"Cancel"})]})]})]}),i.jsx("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:a?i.jsx("div",{style:{padding:"24px",color:"var(--muted)",fontSize:"var(--text-sm)"},children:"Loading pages…"}):n.length===0?i.jsx("div",{style:{padding:"32px"},children:i.jsx(SI,{icon:i.jsx(ud,{size:24}),title:"No pages yet",description:"Add one to get started."})}):i.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[i.jsxs("div",{style:{padding:"12px 16px",borderBottom:"1px solid var(--border)",background:"var(--secondary)",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--muted)"},children:["Click a page to edit sections, or use ",i.jsx("strong",{style:{color:"var(--foreground)"},children:"Visual builder"})," to open the GrapesJS editor in an iframe (run ",i.jsx("code",{style:{fontSize:"0.85em"},children:"website_builder"})," locally)."]}),n.map(Se=>{var ct;return i.jsxs("div",{role:"button",tabIndex:0,onClick:()=>{w(Se._id),J("sections")},onKeyDown:gt=>{(gt.key==="Enter"||gt.key===" ")&&(gt.preventDefault(),w(Se._id),J("sections"))},style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px 16px",borderBottom:"1px solid var(--border)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:[i.jsx("span",{style:{flex:1,fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:Se.title}),i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:Se.slug}),i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",textTransform:"capitalize"},children:Se.type}),((ct=Se.settings)==null?void 0:ct.isPublished)&&i.jsx("span",{style:{display:"inline-flex",padding:"2px 8px",borderRadius:"999px",background:"#dcfce7",color:"#15803d",fontSize:"10px",fontWeight:"600"},children:"Published"}),i.jsxs("button",{type:"button",onClick:gt=>{gt.stopPropagation(),w(Se._id),J("visual")},style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",flexShrink:0},children:[i.jsx(Z3,{size:14})," Visual builder"]})]},Se._id)})]})})]}),i.jsx(C6e,{eventId:e,open:K,onOpenChange:G}),i.jsx(bie,{open:!!A,onOpenChange:Se=>{Se||F(null)},title:`Edit section: ${GB[V]??V}`,children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px",maxHeight:"70vh",overflowY:"auto"},children:[V==="header"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:"Logo text"}),i.jsx("input",{type:"text",value:String(L.logoText??""),onChange:Se=>nt("logoText",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",color:"var(--foreground)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:"Menu items (label, url)"}),(L.menuItems??[]).map((Se,ct)=>i.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"6px"},children:[i.jsx("input",{type:"text",placeholder:"Label",value:(Se==null?void 0:Se.label)??"",onChange:gt=>Ae("menuItems",ct,"label",gt.target.value),style:{flex:1,padding:"6px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}}),i.jsx("input",{type:"text",placeholder:"URL",value:(Se==null?void 0:Se.url)??"",onChange:gt=>Ae("menuItems",ct,"url",gt.target.value),style:{flex:1,padding:"6px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}}),i.jsx("button",{type:"button",onClick:()=>wt("menuItems",ct),style:{padding:"6px 10px",color:"var(--destructive)",background:"none",border:"none",cursor:"pointer"},children:i.jsx(gn,{size:14})})]},ct)),i.jsx("button",{type:"button",onClick:()=>Te("menuItems",{label:"",url:"#"}),style:{padding:"6px 12px",fontSize:"var(--text-xs)",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",cursor:"pointer"},children:"+ Add item"})]})]}),V==="banner"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Headline"}),i.jsx("input",{type:"text",value:String(L.headline??""),onChange:Se=>nt("headline",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Subtext"}),i.jsx("input",{type:"text",value:String(L.subtext??""),onChange:Se=>nt("subtext",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"CTA text"}),i.jsx("input",{type:"text",value:String(L.ctaText??""),onChange:Se=>nt("ctaText",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"CTA URL"}),i.jsx("input",{type:"text",value:String(L.ctaUrl??""),onChange:Se=>nt("ctaUrl",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Secondary CTA text"}),i.jsx("input",{type:"text",value:String(L.secondaryCtaText??""),onChange:Se=>nt("secondaryCtaText",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Secondary CTA URL"}),i.jsx("input",{type:"text",value:String(L.secondaryCtaUrl??""),onChange:Se=>nt("secondaryCtaUrl",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Background class (e.g. bg-primary)"}),i.jsx("input",{type:"text",value:String(L.backgroundClass??""),onChange:Se=>nt("backgroundClass",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]})]}),V==="contact_form"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Title"}),i.jsx("input",{type:"text",value:String(L.title??""),onChange:Se=>nt("title",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Submit button label"}),i.jsx("input",{type:"text",value:String(L.submitLabel??""),onChange:Se=>nt("submitLabel",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]})]}),V==="agenda"&&i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Title"}),i.jsx("input",{type:"text",value:String(L.title??""),onChange:Se=>nt("title",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),V==="register_links"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Title"}),i.jsx("input",{type:"text",value:String(L.title??""),onChange:Se=>nt("title",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Primary button label"}),i.jsx("input",{type:"text",value:String(L.primaryLabel??""),onChange:Se=>nt("primaryLabel",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Primary URL"}),i.jsx("input",{type:"text",value:String(L.primaryUrl??""),onChange:Se=>nt("primaryUrl",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Secondary button label"}),i.jsx("input",{type:"text",value:String(L.secondaryLabel??""),onChange:Se=>nt("secondaryLabel",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Secondary URL"}),i.jsx("input",{type:"text",value:String(L.secondaryUrl??""),onChange:Se=>nt("secondaryUrl",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]})]}),V==="speakers"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Title"}),i.jsx("input",{type:"text",value:String(L.title??""),onChange:Se=>nt("title",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Limit (number)"}),i.jsx("input",{type:"number",value:Number(L.limit??12),onChange:Se=>nt("limit",Se.target.value===""?12:parseInt(Se.target.value,10)||12),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]})]}),V==="footer"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Copyright text"}),i.jsx("input",{type:"text",value:String(L.copyrightText??""),onChange:Se=>nt("copyrightText",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Links (label, url)"}),(L.links??[]).map((Se,ct)=>i.jsxs("div",{style:{display:"flex",gap:"8px",marginBottom:"6px"},children:[i.jsx("input",{type:"text",placeholder:"Label",value:(Se==null?void 0:Se.label)??"",onChange:gt=>Ae("links",ct,"label",gt.target.value),style:{flex:1,padding:"6px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}}),i.jsx("input",{type:"text",placeholder:"URL",value:(Se==null?void 0:Se.url)??"",onChange:gt=>Ae("links",ct,"url",gt.target.value),style:{flex:1,padding:"6px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}}),i.jsx("button",{type:"button",onClick:()=>wt("links",ct),style:{padding:"6px 10px",color:"var(--destructive)",background:"none",border:"none",cursor:"pointer"},children:i.jsx(gn,{size:14})})]},ct)),i.jsx("button",{type:"button",onClick:()=>Te("links",{label:"",url:"#"}),style:{padding:"6px 12px",fontSize:"var(--text-xs)",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",cursor:"pointer"},children:"+ Add link"})]})]}),V==="sponsors"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Title"}),i.jsx("input",{type:"text",value:String(L.title??""),onChange:Se=>nt("title",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Sponsors (name, logoUrl, url)"}),(L.sponsors??[]).map((Se,ct)=>i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px",marginBottom:"6px"},children:[i.jsx("input",{type:"text",placeholder:"Name",value:(Se==null?void 0:Se.name)??"",onChange:gt=>Ae("sponsors",ct,"name",gt.target.value),style:{flex:"1 1 120px",minWidth:"80px",padding:"6px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}}),i.jsx("input",{type:"text",placeholder:"Logo URL",value:(Se==null?void 0:Se.logoUrl)??"",onChange:gt=>Ae("sponsors",ct,"logoUrl",gt.target.value),style:{flex:"1 1 120px",minWidth:"80px",padding:"6px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}}),i.jsx("input",{type:"text",placeholder:"URL",value:(Se==null?void 0:Se.url)??"",onChange:gt=>Ae("sponsors",ct,"url",gt.target.value),style:{flex:"1 1 100px",minWidth:"80px",padding:"6px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}}),i.jsx("button",{type:"button",onClick:()=>wt("sponsors",ct),style:{padding:"6px 10px",color:"var(--destructive)",background:"none",border:"none",cursor:"pointer"},children:i.jsx(gn,{size:14})})]},ct)),i.jsx("button",{type:"button",onClick:()=>Te("sponsors",{name:"",logoUrl:"",url:"#"}),style:{padding:"6px 12px",fontSize:"var(--text-xs)",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",cursor:"pointer"},children:"+ Add sponsor"})]})]}),V==="cta"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Headline"}),i.jsx("input",{type:"text",value:String(L.headline??""),onChange:Se=>nt("headline",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Subtext"}),i.jsx("input",{type:"text",value:String(L.subtext??""),onChange:Se=>nt("subtext",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Button label"}),i.jsx("input",{type:"text",value:String(L.buttonLabel??""),onChange:Se=>nt("buttonLabel",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Button URL"}),i.jsx("input",{type:"text",value:String(L.buttonUrl??""),onChange:Se=>nt("buttonUrl",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]})]}),V==="custom_html"&&i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"HTML"}),i.jsx("textarea",{value:String(L.html??""),onChange:Se=>nt("html",Se.target.value),rows:8,style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",color:"var(--foreground)",fontSize:"var(--text-sm)",fontFamily:"monospace"}})]}),V==="countdown"&&i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Countdown heading line"}),i.jsx("input",{type:"text",value:String(L.headingLine??""),onChange:Se=>nt("headingLine",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),V==="gallery"&&i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Title"}),i.jsx("input",{type:"text",value:String(L.title??""),onChange:Se=>nt("title",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),V==="about"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Title"}),i.jsx("input",{type:"text",value:String(L.title??""),onChange:Se=>nt("title",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Lead paragraph"}),i.jsx("textarea",{value:String(L.lead??""),onChange:Se=>nt("lead",Se.target.value),rows:3,style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Bullets title"}),i.jsx("input",{type:"text",value:String(L.bulletsTitle??""),onChange:Se=>nt("bulletsTitle",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"CTA label"}),i.jsx("input",{type:"text",value:String(L.ctaLabel??""),onChange:Se=>nt("ctaLabel",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"CTA URL"}),i.jsx("input",{type:"text",value:String(L.ctaUrl??""),onChange:Se=>nt("ctaUrl",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]})]}),V==="venue"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Title"}),i.jsx("input",{type:"text",value:String(L.title??""),onChange:Se=>nt("title",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Venue name"}),i.jsx("input",{type:"text",value:String(L.venueName??""),onChange:Se=>nt("venueName",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Intro"}),i.jsx("textarea",{value:String(L.intro??""),onChange:Se=>nt("intro",Se.target.value),rows:3,style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Map embed URL"}),i.jsx("input",{type:"text",value:String(L.mapEmbedUrl??""),onChange:Se=>nt("mapEmbedUrl",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]})]}),V==="faq"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Title"}),i.jsx("input",{type:"text",value:String(L.title??""),onChange:Se=>nt("title",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Contact email"}),i.jsx("input",{type:"text",value:String(L.contactEmail??""),onChange:Se=>nt("contactEmail",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]})]}),V==="tickets"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Title"}),i.jsx("input",{type:"text",value:String(L.title??""),onChange:Se=>nt("title",Se.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{display:"block",fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Intro"}),i.jsx("textarea",{value:String(L.intro??""),onChange:Se=>nt("intro",Se.target.value),rows:2,style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)"}})]})]}),i.jsxs("div",{style:{display:"flex",gap:"8px",marginTop:"8px"},children:[i.jsx("button",{type:"button",onClick:Ot,disabled:U,style:{padding:"8px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:U?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:U?"Saving…":"Save"}),i.jsx("button",{type:"button",onClick:()=>F(null),style:{padding:"8px 16px",borderRadius:"var(--radius-button)",background:"var(--secondary)",color:"var(--foreground)",border:"1px solid var(--border)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"Cancel"})]})]})})]}):i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:"Event Website"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.2"},children:"Event Website"})]}),i.jsx("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"32px"},children:i.jsx(SI,{icon:i.jsx(ud,{size:24}),title:"Select an event",description:"Choose an event from the sidebar to build and manage its website pages."})})]})}const Zl={width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",outline:"none",boxSizing:"border-box"},QB={...Zl,cursor:"pointer",appearance:"none",paddingRight:"32px"},wl=e=>{e.currentTarget.style.borderColor="var(--primary)",e.currentTarget.style.boxShadow="0 0 0 2px rgba(11,77,209,0.12)"},Sl=e=>{e.currentTarget.style.borderColor="var(--border)",e.currentTarget.style.boxShadow="none"};function Po({text:e,required:t}){return i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)",marginBottom:"5px"},children:[t&&i.jsx("span",{style:{color:"var(--destructive)",marginRight:"3px"},children:"*"}),e]})}function ky({text:e}){return i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"4px 0 0",display:"flex",alignItems:"center",gap:"4px"},children:[i.jsx("span",{style:{fontSize:"10px"},children:"ℹ"})," ",e]})}function Ko({children:e,span2:t,error:r}){return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gridColumn:t?"1 / -1":void 0},children:[e,r?i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--destructive)",margin:"5px 0 0",lineHeight:1.35},children:r}):null]})}function t3({children:e,cols:t=2}){return i.jsx("div",{style:{display:"grid",gridTemplateColumns:`repeat(${t}, 1fr)`,gap:"12px"},children:e})}function XB({children:e}){return i.jsxs("div",{style:{position:"relative"},children:[e,i.jsx(po,{size:13,style:{position:"absolute",right:10,top:"50%",transform:"translateY(-50%)",color:"var(--muted)",pointerEvents:"none"}})]})}function _y({name:e,value:t,onChange:r,options:n}){return i.jsx("div",{style:{display:"flex",gap:"20px",alignItems:"center",paddingTop:"2px"},children:n.map(o=>i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",fontWeight:"var(--font-weight-normal)"},children:[i.jsx("input",{type:"radio",name:e,value:o.value,checked:t===o.value,onChange:()=>r(o.value),style:{accentColor:"var(--primary)",width:"16px",height:"16px",cursor:"pointer"}}),o.label]},o.value))})}const F6e=2*1024*1024,EQ="image/jpeg,image/png,image/webp,image/gif";function M6e(e){return e.type&&EQ.split(",").includes(e.type)?!0:/\.(jpe?g|png|webp|gif)$/i.test(e.name)}function D6e({preview:e,onChange:t,eventId:r}){const n=j.useRef(null),[o,a]=j.useState(!1),[s,l]=j.useState(null),c=async d=>{if(l(null),!M6e(d)){l("Use a JPG, PNG, WEBP, or GIF image.");return}if(d.size>F6e){l("Image must be 2 MB or smaller.");return}a(!0);try{const f=await Ys(d,{...r!=null&&r.trim()?{eventId:r.trim()}:{},module:"speakers/photo"});if(f!=null&&f.url)t(f.url);else throw new Error("Upload did not return a URL")}catch(f){l(f instanceof Error?f.message:"Upload failed")}finally{a(!1)}},u=d=>{d&&c(d)};return i.jsxs("div",{onClick:()=>{var d;o||(d=n.current)==null||d.click()},onDragOver:d=>d.preventDefault(),onDrop:d=>{if(d.preventDefault(),o)return;const f=d.dataTransfer.files[0];u(f)},style:{border:"1.5px dashed var(--primary)",borderRadius:"var(--radius-button)",background:"var(--secondary)",padding:"20px 12px",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",cursor:o?"wait":"pointer",transition:"background 0.15s",opacity:o?.85:1},onMouseEnter:d=>{o||(d.currentTarget.style.background="var(--accent)")},onMouseLeave:d=>{d.currentTarget.style.background="var(--secondary)"},children:[i.jsx("input",{ref:n,type:"file",accept:EQ,style:{display:"none"},disabled:o,onChange:d=>{var h;const f=(h=d.target.files)==null?void 0:h[0];d.target.value="",u(f)}}),e?i.jsx("img",{src:e,alt:"Speaker photo",style:{width:64,height:64,borderRadius:"50%",objectFit:"cover",border:"2px solid var(--primary)"}}):i.jsx("div",{style:{width:56,height:56,borderRadius:"50%",background:"var(--border)",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx(ou,{size:22,style:{color:"var(--primary)"}})}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",textAlign:"center",margin:0},children:o?"Uploading…":i.jsxs(i.Fragment,{children:["Drag and drop or"," ",i.jsx("span",{style:{color:"var(--primary)",textDecoration:"underline"},children:"choose a file"}),". Files are stored on S3 and served via CDN."]})}),e&&!o&&i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--primary)"},children:"Click to change photo"}),s?i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--destructive)",margin:0,textAlign:"center"},children:s}):null]})}function r3({icon:e,placeholder:t,value:r,onChange:n}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"var(--muted)"},children:e}),i.jsx("input",{style:{...Zl,flex:1,width:"auto"},placeholder:t,value:r,onChange:o=>n(o.target.value),onFocus:wl,onBlur:Sl})]})}function z6e({n:e,state:t}){return i.jsx("div",{style:{width:28,height:28,borderRadius:"50%",background:t==="todo"?"var(--muted)":"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t==="done"?i.jsx(Oi,{size:13,style:{color:"#fff"}}):i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-inter)",color:"#fff",fontWeight:"var(--font-weight-medium)"},children:e})})}function n3({n:e,title:t,subtitle:r,open:n,completed:o,onToggle:a,children:s,onSave:l,nextLabel:c,isLast:u,nextDisabled:d}){const f=n?"active":o?"done":"todo";return i.jsxs("div",{style:{borderBottom:"1px solid var(--border)"},children:[i.jsxs("button",{onClick:a,style:{width:"100%",display:"flex",alignItems:"center",gap:"12px",padding:"14px 20px",background:"none",border:"none",cursor:"pointer",textAlign:"left"},children:[i.jsx(z6e,{n:e,state:f}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:n?"var(--primary)":"var(--card-foreground)",margin:0},children:t}),!n&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:r})]}),n?i.jsx($f,{size:18,style:{color:"var(--muted)",flexShrink:0}}):i.jsx(po,{size:18,style:{color:"var(--muted)",flexShrink:0}})]}),n&&i.jsxs("div",{style:{padding:"0 20px 16px"},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"0 0 12px 40px"},children:r}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:s}),i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"12px",marginTop:"20px",paddingTop:"14px",borderTop:"1px solid var(--border)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--primary)"},children:[i.jsx(Oi,{size:12})," Saved"]}),i.jsx("button",{type:"button",disabled:d,onClick:l,style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 18px",borderRadius:"var(--radius-button)",background:d?"var(--secondary)":"var(--primary)",color:d?"var(--muted)":"var(--primary-foreground)",border:"none",cursor:d?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:c})]})]})]})}const B6e={fullName:"",title:"",specialisation:"",organisation:"",email:"",phone:"",photo:null,bio:"",website:"",linkedin:"",twitter:"",role:"Speaker",visibility:"Public",featured:"No",honorarium:"No",honorariumAmount:"",travelRequired:"No",accommodation:"No",dietaryRequirements:"",notes:""};function W6e(e){const t=e.trim().split(/\s+/);return t.length===0?{firstName:"",lastName:""}:t.length===1?{firstName:t[0],lastName:""}:{firstName:t[0],lastName:t.slice(1).join(" ")}}const Cy=["fullName","title","specialisation","organisation","email","role"];function ZB(e){const t={};return e.fullName.trim()||(t.fullName="Full name is required."),e.title||(t.title="Please select a title."),e.specialisation.trim()||(t.specialisation="Specialisation is required."),e.organisation.trim()||(t.organisation="Organisation / Institution is required."),e.email.trim()?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.email.trim())||(t.email="Enter a valid email address."):t.email="Email is required.",e.role||(t.role="Please select a speaker role."),t}function JB(e){const t={};return e.bio.trim()||(t.bio="Bio is required."),t}function Ey(e,t){const r={...e};return t.forEach(n=>{delete r[n]}),r}function q6e({onClose:e,speakerId:t,onSuccess:r,eventId:n}){const{user:o}=Ur(),a=o!=null&&o.organization&&typeof o.organization=="object"&&"_id"in o.organization?String(o.organization._id):o!=null&&o.organization?String(o.organization):void 0,s=!!t,[l,c]=j.useState(1),[u,d]=j.useState(new Set),[f,h]=j.useState(B6e),[p,y]=j.useState(!1),[m,x]=j.useState({}),[b,w]=j.useState(!1),[k,S]=j.useState(!1);j.useEffect(()=>{t&&Ef.get(t).then(z=>{var V,Q,U,ee,H;if(z.data){const B=z.data,M=B.logistics;h({fullName:`${B.firstName} ${B.lastName}`.trim(),title:B.title??"",specialisation:((V=B.expertise)==null?void 0:V[0])??"",organisation:B.organizationName??"",email:B.email,phone:B.phone??"",photo:B.photo??null,bio:B.bio??"",website:((Q=B.socialLinks)==null?void 0:Q.website)??"",linkedin:((U=B.socialLinks)==null?void 0:U.linkedin)??"",twitter:((ee=B.socialLinks)==null?void 0:ee.twitter)??"",role:((H=B.speakerRole)==null?void 0:H.trim())||"Speaker",visibility:B.profileVisibility==="private"?"Private":"Public",featured:B.isFeatured?"Yes":"No",honorarium:M!=null&&M.honorarium?"Yes":"No",honorariumAmount:(M==null?void 0:M.honorariumAmount)!=null?String(M.honorariumAmount):"",travelRequired:M!=null&&M.travelRequired?"Yes":"No",accommodation:M!=null&&M.accommodation?"Yes":"No",dietaryRequirements:(M==null?void 0:M.dietaryRequirements)??"",notes:(M==null?void 0:M.internalNotes)??""}),d(new Set([1,2,3]))}})},[t]),j.useEffect(()=>{if(!b)return;const z=ZB(f);Object.keys(z).length===0?x(V=>Ey(V,Cy)):x(V=>({...Ey(V,Cy),...z}))},[f.fullName,f.email,f.title,f.specialisation,f.organisation,f.role,b]),j.useEffect(()=>{if(!k)return;const z=JB(f);Object.keys(z).length===0?x(V=>{const Q={...V};return delete Q.bio,Q}):x(V=>({...V,bio:z.bio}))},[f.bio,k]);const _=3,P=u.size,O=Math.round(P/_*100),T=(z,V)=>h(Q=>({...Q,[z]:V})),R=z=>{d(V=>new Set([...V,z])),z===1&&x(V=>Ey(V,Cy)),z===2&&x(V=>{const Q={...V};return delete Q.bio,Q}),z<_&&c(z+1)},I=z=>{if(z===1){const V=ZB(f);if(Object.keys(V).length){w(!0),x(U=>({...Ey(U,Cy),...V}));return}w(!1),x(U=>Ey(U,Cy)),R(1);return}if(z===2){const V=JB(f);if(Object.keys(V).length){S(!0),x(Q=>({...Q,...V}));return}S(!1),x(Q=>{const U={...Q};return delete U.bio,U}),R(2)}},E=()=>{x(z=>{const V={...z};return delete V._submit,V}),R(3),L()},A=z=>c(V=>V===z?0:z),F=!p&&!!f.fullName.trim()&&!!f.email.trim(),L=async()=>{const{firstName:z,lastName:V}=W6e(f.fullName);if(!z.trim()||!f.email.trim())return;y(!0);const Q={firstName:z,lastName:V,email:f.email.trim(),phone:f.phone||void 0,title:f.title||void 0,organizationName:f.organisation||void 0,bio:f.bio||void 0,photo:f.photo||void 0,socialLinks:f.website||f.linkedin||f.twitter?{website:f.website||void 0,linkedin:f.linkedin||void 0,twitter:f.twitter||void 0}:void 0,expertise:f.specialisation?[f.specialisation]:void 0,isFeatured:f.featured==="Yes",speakerRole:f.role.trim()||void 0,profileVisibility:f.visibility==="Private"?"private":"public",logistics:{honorarium:f.honorarium==="Yes",honorariumAmount:f.honorariumAmount.trim()||"",travelRequired:f.travelRequired==="Yes",accommodation:f.accommodation==="Yes",dietaryRequirements:f.dietaryRequirements.trim()||"",internalNotes:f.notes.trim()||""}};(o==null?void 0:o.role)==="super_admin"&&a&&(Q.organization=a);const U=s&&t?await Ef.update(t,Q):await Ef.create(Q);y(!1),U.error?(x(ee=>({...ee,_submit:U.error||"Could not save. Please try again."})),c(3)):(r==null||r(),e())};return i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:e,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.50)",zIndex:200}}),i.jsxs("div",{style:{position:"fixed",top:0,right:0,height:"100%",width:"min(560px, 100vw)",background:"var(--card)",zIndex:201,display:"flex",flexDirection:"column",boxShadow:"-4px 0 40px rgba(0,0,0,0.20)",animation:"spSlideIn 0.25s cubic-bezier(0.4,0,0.2,1)"},children:[i.jsx("style",{children:`
|
||
@keyframes spSlideIn {
|
||
from { transform: translateX(100%); opacity: 0.6; }
|
||
to { transform: translateX(0); opacity: 1; }
|
||
}
|
||
`}),i.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)",flexShrink:0,background:"var(--card)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",marginBottom:"14px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"0 0 3px"},children:"Faculty & Speakers"}),i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:s?"Edit Speaker":"Add Speaker"}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"5px 0 0"},children:["Add a speaker's details and manage logistics. Fields marked with ",i.jsx("span",{style:{color:"var(--destructive)"},children:"*"})," are required."]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexShrink:0},children:[i.jsx("button",{onClick:e,title:"Close",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",color:"var(--muted)"},onMouseEnter:z=>{z.currentTarget.style.borderColor="var(--destructive)",z.currentTarget.style.color="var(--destructive)"},onMouseLeave:z=>{z.currentTarget.style.borderColor="var(--border)",z.currentTarget.style.color="var(--muted)"},children:i.jsx(er,{size:14})}),i.jsx("button",{type:"button",disabled:!F,onClick:L,style:{padding:"6px 16px",borderRadius:"var(--radius-button)",background:F?"var(--primary)":"var(--secondary)",color:F?"var(--primary-foreground)":"var(--muted)",border:"none",cursor:F?"pointer":"not-allowed",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",transition:"background 0.2s"},children:p?"Saving…":s?"Save changes":"Save Speaker"})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"6px"},children:[i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[P," of ",_," sections complete"]}),i.jsxs("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--primary)",fontWeight:"var(--font-weight-medium)"},children:[O,"%"]})]}),i.jsx("div",{style:{height:"6px",borderRadius:"99px",background:"var(--border)",overflow:"hidden"},children:i.jsx("div",{style:{height:"100%",width:`${O}%`,background:O===100?"#22c55e":"var(--primary)",borderRadius:"99px",transition:"width 0.35s ease"}})})]}),i.jsxs("div",{style:{flex:1,overflowY:"auto"},children:[i.jsx(n3,{n:1,title:"Personal Information",subtitle:"Name, contact, role on programme, and profile visibility",open:l===1,completed:u.has(1),onToggle:()=>A(1),onSave:()=>I(1),nextLabel:"Profile & Media",children:i.jsxs(t3,{cols:2,children:[i.jsxs(Ko,{error:m.fullName,children:[i.jsx(Po,{text:"Full Name",required:!0}),i.jsx("input",{style:{...Zl,...m.fullName?{borderColor:"var(--destructive)"}:{}},placeholder:"e.g. Dr. Rajesh Sharma",value:f.fullName,onChange:z=>T("fullName",z.target.value),onFocus:wl,onBlur:Sl})]}),i.jsxs(Ko,{error:m.title,children:[i.jsx(Po,{text:"Title / Designation",required:!0}),i.jsx(XB,{children:i.jsxs("select",{style:{...QB,...m.title?{borderColor:"var(--destructive)"}:{}},value:f.title,onChange:z=>T("title",z.target.value),onFocus:wl,onBlur:Sl,children:[i.jsx("option",{value:"",children:"Select Title"}),i.jsx("option",{children:"Dr."}),i.jsx("option",{children:"Prof."}),i.jsx("option",{children:"Mr."}),i.jsx("option",{children:"Ms."}),i.jsx("option",{children:"Mrs."})]})})]}),i.jsxs(Ko,{error:m.specialisation,children:[i.jsx(Po,{text:"Specialisation",required:!0}),i.jsx("input",{style:{...Zl,...m.specialisation?{borderColor:"var(--destructive)"}:{}},placeholder:"e.g. Pulmonologist",value:f.specialisation,onChange:z=>T("specialisation",z.target.value),onFocus:wl,onBlur:Sl})]}),i.jsxs(Ko,{error:m.organisation,children:[i.jsx(Po,{text:"Organisation / Institution",required:!0}),i.jsx("input",{style:{...Zl,...m.organisation?{borderColor:"var(--destructive)"}:{}},placeholder:"e.g. AIIMS Delhi",value:f.organisation,onChange:z=>T("organisation",z.target.value),onFocus:wl,onBlur:Sl})]}),i.jsxs(Ko,{error:m.email,children:[i.jsx(Po,{text:"Email Address",required:!0}),i.jsx("input",{type:"email",style:{...Zl,...m.email?{borderColor:"var(--destructive)"}:{}},placeholder:"name@institution.org",value:f.email,onChange:z=>T("email",z.target.value),onFocus:wl,onBlur:Sl})]}),i.jsxs(Ko,{children:[i.jsx(Po,{text:"Phone Number"}),i.jsx("input",{type:"tel",style:Zl,placeholder:"+91 98765 43210",value:f.phone,onChange:z=>T("phone",z.target.value),onFocus:wl,onBlur:Sl})]}),i.jsxs(Ko,{error:m.role,children:[i.jsx(Po,{text:"Speaker Role",required:!0}),i.jsx(XB,{children:i.jsxs("select",{style:{...QB,...m.role?{borderColor:"var(--destructive)"}:{}},value:f.role,onChange:z=>T("role",z.target.value),onFocus:wl,onBlur:Sl,children:[i.jsx("option",{value:"",children:"Select Role"}),i.jsx("option",{children:"Speaker"}),i.jsx("option",{children:"Keynote Speaker"}),i.jsx("option",{children:"Moderator"}),i.jsx("option",{children:"Panelist"}),i.jsx("option",{children:"Chair"}),i.jsx("option",{children:"Co-Chair"}),i.jsx("option",{children:"Workshop Leader"})]})})]}),i.jsxs(Ko,{children:[i.jsx(Po,{text:"Profile Visibility",required:!0}),i.jsx(_y,{name:"visibility",value:f.visibility,onChange:z=>T("visibility",z),options:[{label:"Public",value:"Public"},{label:"Private",value:"Private"}]}),i.jsx(ky,{text:"Public speakers appear on the event website."})]}),i.jsxs(Ko,{span2:!0,children:[i.jsx(Po,{text:"Featured Speaker"}),i.jsx(_y,{name:"featured",value:f.featured,onChange:z=>T("featured",z),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]}),i.jsx(ky,{text:"Featured speakers appear on the event homepage."})]})]})}),i.jsxs(n3,{n:2,title:"Profile & Media",subtitle:"Upload a photo, write a bio, and add social links",open:l===2,completed:u.has(2),onToggle:()=>A(2),onSave:()=>I(2),nextLabel:"Logistics",children:[i.jsxs(t3,{cols:2,children:[i.jsxs(Ko,{children:[i.jsx(Po,{text:"Profile Photo"}),i.jsx(D6e,{preview:f.photo,onChange:z=>T("photo",z),eventId:n??void 0}),i.jsx(ky,{text:"JPG, PNG, WEBP or GIF · Max 2 MB · Square crop recommended · Uploaded via media API (S3 / CDN)"})]}),i.jsxs(Ko,{error:m.bio,children:[i.jsx(Po,{text:"Bio",required:!0}),i.jsxs("div",{style:{position:"relative"},children:[i.jsx("textarea",{style:{...Zl,resize:"vertical",minHeight:"112px",paddingBottom:"22px",...m.bio?{borderColor:"var(--destructive)"}:{}},placeholder:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",value:f.bio,maxLength:400,onChange:z=>T("bio",z.target.value),onFocus:wl,onBlur:Sl}),i.jsxs("span",{style:{position:"absolute",bottom:"7px",right:"10px",fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:f.bio.length>360?"var(--destructive)":"var(--muted)"},children:[f.bio.length,"/400"]})]}),i.jsx(ky,{text:"A short professional bio visible to attendees."})]})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[i.jsx(Po,{text:"Social & Web Links"}),i.jsx(r3,{icon:i.jsx(ud,{size:14}),placeholder:"https://personal-website.com",value:f.website,onChange:z=>T("website",z)}),i.jsx(r3,{icon:i.jsx(rte,{size:14}),placeholder:"linkedin.com/in/username",value:f.linkedin,onChange:z=>T("linkedin",z)}),i.jsx(r3,{icon:i.jsx(ere,{size:14}),placeholder:"twitter.com/handle",value:f.twitter,onChange:z=>T("twitter",z)})]})]}),i.jsx(n3,{n:3,title:"Logistics",subtitle:"Manage honorarium, travel, and special requirements",open:l===3,completed:u.has(3),onToggle:()=>A(3),onSave:E,nextLabel:"Save Speaker",nextDisabled:!F,isLast:!0,children:i.jsxs(t3,{cols:2,children:[i.jsxs(Ko,{children:[i.jsx(Po,{text:"Honorarium",required:!0}),i.jsx(_y,{name:"honorarium",value:f.honorarium,onChange:z=>T("honorarium",z),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]})]}),f.honorarium==="Yes"&&i.jsxs(Ko,{children:[i.jsx(Po,{text:"Amount (₹)"}),i.jsx("input",{type:"number",style:Zl,placeholder:"0.00",value:f.honorariumAmount,onChange:z=>T("honorariumAmount",z.target.value),onFocus:wl,onBlur:Sl})]}),i.jsxs(Ko,{children:[i.jsx(Po,{text:"Travel Required",required:!0}),i.jsx(_y,{name:"travel",value:f.travelRequired,onChange:z=>T("travelRequired",z),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]})]}),i.jsxs(Ko,{children:[i.jsx(Po,{text:"Accommodation",required:!0}),i.jsx(_y,{name:"accommodation",value:f.accommodation,onChange:z=>T("accommodation",z),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]})]}),i.jsxs(Ko,{span2:!0,children:[i.jsx(Po,{text:"Dietary / Special Requirements"}),i.jsx("input",{style:Zl,placeholder:"e.g. Vegetarian, Gluten-free, Wheelchair access…",value:f.dietaryRequirements,onChange:z=>T("dietaryRequirements",z.target.value),onFocus:wl,onBlur:Sl})]}),i.jsxs(Ko,{span2:!0,children:[i.jsx(Po,{text:"Internal Notes"}),i.jsxs("div",{style:{position:"relative"},children:[i.jsx("textarea",{style:{...Zl,resize:"vertical",minHeight:"72px",paddingBottom:"22px"},placeholder:"Internal notes visible only to organisers…",value:f.notes,maxLength:300,onChange:z=>T("notes",z.target.value),onFocus:wl,onBlur:Sl}),i.jsxs("span",{style:{position:"absolute",bottom:"7px",right:"10px",fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[f.notes.length,"/300"]})]}),i.jsx(ky,{text:"Not visible to attendees or the speaker."})]}),m._submit&&i.jsx("div",{style:{gridColumn:"1 / -1"},children:i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--destructive)",margin:"4px 0 0",lineHeight:1.35},children:m._submit})})]})})]})]})]})}const AQ=["Status","Tag","Event"],$6e=["is","is not"],TQ=[{label:"Pending",value:"pending"},{label:"Confirmed",value:"confirmed"},{label:"Checked In",value:"checked_in"},{label:"Cancelled",value:"cancelled"}],e9=()=>({listName:"",description:"",rules:[{id:`r-${Math.random().toString(36).slice(2)}`,field:"Status",operator:"is",value:"pending"}],conjunction:"AND",visibility:"Private",autoUpdate:"Yes"});function PQ(e){return`rule-${e}-${Math.random().toString(36).slice(2,10)}`}function U6e(e,t){const r=String(e.field??"Status"),n=AQ.includes(r)?r:"Status",a=String(e.operator??"is").trim().toLowerCase()==="is not"?"is not":"is";let s=String(e.value??"");return n==="Status"&&(TQ.some(c=>c.value===s)||(s="pending")),{id:PQ(t),field:n,operator:a,value:s}}function i3(e){const t=e.rules,r=Array.isArray(t==null?void 0:t.rules)?t.rules:[],n=r.length?r.map((o,a)=>U6e(o,a)):[{id:PQ(0),field:"Status",operator:"is",value:"pending"}];return{listName:e.name,description:e.description??"",rules:n,conjunction:(t==null?void 0:t.conjunction)==="OR"?"OR":"AND",visibility:e.visibility==="shared"?"Shared":"Private",autoUpdate:e.autoUpdate!==!1?"Yes":"No"}}function OQ({onClose:e,onCreated:t,onSaved:r,editList:n=null}){const{user:o}=Ur(),a=zn(o),s=3,l=mc(s),c=(n==null?void 0:n.type)==="rule_based",[u,d]=j.useState(()=>c&&n?i3(n):e9()),f=(F,L)=>d(z=>({...z,[F]:L})),[h,p]=j.useState([]),[y,m]=j.useState([]),[x,b]=j.useState(!0),[w,k]=j.useState(!1),[S,_]=j.useState(null);j.useEffect(()=>{let F=!1;if(!a){b(!1);return}return b(!0),Promise.all([Ei.listDistinctTags({organization:a}),zr.list({limit:400,organization:a})]).then(([L,z])=>{var V,Q;F||((V=L.data)!=null&&V.tags&&p(L.data.tags),(Q=z.data)!=null&&Q.events&&m(z.data.events),b(!1))}).catch(()=>{F||b(!1)}),()=>{F=!0}},[a]),j.useEffect(()=>{if(!n||n.type!=="rule_based"){d(e9());return}d(i3(n));let F=!1;return Fa.get(n._id).then(L=>{if(F||L.error||!L.data)return;const z=L.data;z.type==="rule_based"&&d(i3(z))}),()=>{F=!0}},[n==null?void 0:n._id]),j.useEffect(()=>{h.length&&d(F=>({...F,rules:F.rules.map(L=>L.field!=="Tag"||L.value&&h.includes(L.value)?L:{...L,value:h[0]})}))},[h]),j.useEffect(()=>{y.length&&d(F=>({...F,rules:F.rules.map(L=>L.field!=="Event"||L.value&&y.some(z=>z._id===L.value)?L:{...L,value:y[0]._id})}))},[y]);const P=()=>d(F=>({...F,rules:[...F.rules,{id:Math.random().toString(36).slice(2),field:"Status",operator:"is",value:"pending"}]})),O=F=>d(L=>({...L,rules:L.rules.filter(z=>z.id!==F)})),T=(F,L,z)=>d(V=>({...V,rules:V.rules.map(Q=>Q.id===F?{...Q,[L]:z}:Q)})),R=(F,L)=>{let z="";L==="Status"?z="pending":L==="Tag"&&h[0]?z=h[0]:L==="Event"&&y[0]&&(z=y[0]._id),d(V=>({...V,rules:V.rules.map(Q=>Q.id===F?{...Q,field:L,operator:"is",value:z}:Q)}))},I=F=>{if(F.field==="Status")return i.jsx("select",{style:Nr,value:F.value||"pending",onChange:L=>T(F.id,"value",L.target.value),onFocus:kt,onBlur:_t,children:TQ.map(L=>i.jsx("option",{value:L.value,children:L.label},L.value))});if(F.field==="Tag"){if(x)return i.jsx("span",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"Loading tags…"});if(h.length===0)return i.jsx("span",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"No tags yet. Add tags to participants first."});const L=F.value&&h.includes(F.value)?F.value:h[0];return i.jsx("select",{style:Nr,value:L,onChange:z=>T(F.id,"value",z.target.value),onFocus:kt,onBlur:_t,children:h.map(z=>i.jsx("option",{value:z,children:z},z))})}if(F.field==="Event"){if(x)return i.jsx("span",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"Loading events…"});if(y.length===0)return i.jsx("span",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"No events available."});const L=F.value&&y.some(z=>z._id===F.value)?F.value:y[0]._id;return i.jsx("select",{style:Nr,value:L,onChange:z=>T(F.id,"value",z.target.value),onFocus:kt,onBlur:_t,children:y.map(z=>i.jsx("option",{value:z._id,children:z.name},z._id))})}return null},E=async()=>{if(_(null),!u.listName.trim()){_("List name is required.");return}if(u.rules.some(L=>L.field==="Tag"&&!h.length||L.field==="Event"&&!y.length)){_("Each rule needs a valid value. Add tags or events, or adjust rules.");return}k(!0);try{const L={rules:u.rules.map(({field:z,operator:V,value:Q})=>({field:z,operator:V,value:Q})),conjunction:u.conjunction};if(c&&n){const z=await Fa.update(n._id,{name:u.listName.trim(),description:u.description.trim(),visibility:u.visibility==="Shared"?"shared":"private",type:"rule_based",autoUpdate:u.autoUpdate==="Yes",rules:L});if(z.error){_(z.error||"Could not update list."),k(!1);return}z.data&&(r==null||r(z.data)),e()}else{const z=await Fa.create({name:u.listName.trim(),description:u.description.trim(),visibility:u.visibility==="Shared"?"shared":"private",type:"rule_based",autoUpdate:u.autoUpdate==="Yes",rules:L});if(z.error){_(z.error||"Could not create list."),k(!1);return}t==null||t(),e()}}catch{_(c?"Could not update list.":"Could not create list.")}k(!1)},A=c?"Save changes":"Create List";return i.jsxs(Zo,{onClose:e,title:c?"Edit Custom List":"Create Custom List",breadcrumb:"Participants · Custom Lists",description:c?"Update name, rules, and settings for this list. Fields marked * are required.":"Build a smart filtered list from your participant database. Fields marked * are required.",completedCount:l.done.size,totalSections:s,ctaLabel:w?"Saving…":A,ctaDisabled:w,onCtaClick:E,children:[S&&i.jsx("p",{style:{margin:"0 20px 12px",fontSize:"var(--text-sm)",color:"var(--destructive)",fontFamily:"var(--font-noto-sans)"},children:S}),i.jsxs($r,{n:1,title:"List Details",subtitle:"Name and describe your custom list",open:l.open===1,completed:l.done.has(1),onToggle:()=>l.toggle(1),onSave:()=>l.advance(1),nextLabel:"Filter Rules",children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"List Name",required:!0}),i.jsx("input",{style:$t,placeholder:"e.g. VIP Delegates — NAPCON 2026",value:u.listName,onChange:F=>f("listName",F.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Description"}),i.jsx("textarea",{style:{...$t,resize:"vertical",minHeight:"72px"},placeholder:"Briefly describe who this list is for…",value:u.description,onChange:F=>f("description",F.target.value),onFocus:kt,onBlur:_t})]})]}),i.jsxs($r,{n:2,title:"Filter Rules",subtitle:"Define conditions to automatically populate this list",open:l.open===2,completed:l.done.has(2),onToggle:()=>l.toggle(2),onSave:()=>l.advance(2),nextLabel:"Settings",children:[u.rules.length>1&&i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center",marginBottom:"4px"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Match"}),["AND","OR"].map(F=>i.jsx("button",{type:"button",onClick:()=>f("conjunction",F),style:{padding:"4px 12px",borderRadius:"var(--radius-button)",border:`1px solid ${u.conjunction===F?"var(--primary)":"var(--border)"}`,background:u.conjunction===F?"var(--accent)":"transparent",color:u.conjunction===F?"var(--primary)":"var(--muted)",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:F},F)),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"of the following rules"})]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:u.rules.map((F,L)=>i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr auto",gap:"8px",alignItems:"center",padding:"10px 12px",background:"var(--secondary)",borderRadius:"var(--radius-button)",border:"1px solid var(--border)"},children:[L>0&&i.jsx("span",{style:{gridColumn:"1/-1",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",fontWeight:"var(--font-weight-medium)"},children:u.conjunction}),i.jsx("div",{style:{position:"relative"},children:i.jsx("select",{style:Nr,value:F.field,onChange:z=>R(F.id,z.target.value),onFocus:kt,onBlur:_t,children:AQ.map(z=>i.jsx("option",{value:z,children:z},z))})}),i.jsx("div",{style:{position:"relative"},children:i.jsx("select",{style:Nr,value:F.operator,onChange:z=>T(F.id,"operator",z.target.value),onFocus:kt,onBlur:_t,children:$6e.map(z=>i.jsx("option",{value:z,children:z},z))})}),i.jsx("div",{style:{position:"relative",minWidth:0},children:I(F)}),i.jsx("button",{type:"button",onClick:()=>O(F.id),disabled:u.rules.length===1,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:u.rules.length===1?"var(--muted-foreground)":"var(--destructive)",cursor:u.rules.length===1?"not-allowed":"pointer"},children:i.jsx(gn,{size:13})})]},F.id))}),i.jsxs("button",{type:"button",onClick:P,style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px dashed var(--primary)",background:"transparent",color:"var(--primary)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:13})," Add Rule"]}),i.jsx(Qt,{text:"Status, Tag, and Event use lists from your organization. Tag options come from participant tags; Event from your events."})]}),i.jsx($r,{n:3,title:"Settings",subtitle:"Configure visibility and update behaviour",open:l.open===3,completed:l.done.has(3),onToggle:()=>l.toggle(3),onSave:()=>void E(),nextLabel:A,nextDisabled:w,children:i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Visibility",required:!0}),i.jsx(go,{name:"clVisibility",value:u.visibility,onChange:F=>f("visibility",F),options:[{label:"Private",value:"Private"},{label:"Shared",value:"Shared"}]}),i.jsx(Qt,{text:"Shared lists are visible to all admins."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Auto Update",required:!0}),i.jsx(go,{name:"clAutoUpdate",value:u.autoUpdate,onChange:F=>f("autoUpdate",F),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]}),i.jsx(Qt,{text:"Recompute rule-based members when you open the list."})]})]})})]})}function H6e({onClose:e,onSuccess:t}){var E;const{user:r}=Ur(),n=zn(r),[o,a]=j.useState(""),[s,l]=j.useState(null),[c,u]=j.useState([]),[d,f]=j.useState(new Set),[h,p]=j.useState(!1),[y,m]=j.useState(""),[x,b]=j.useState(""),[w,k]=j.useState(!1),[S,_]=j.useState(null),P=!!((E=r==null?void 0:r.organization)!=null&&E._id||r!=null&&r.organization);j.useEffect(()=>{n&&zr.list({limit:400,organization:n}).then(A=>{var F;(F=A.data)!=null&&F.events&&u(A.data.events)})},[n]);const O=A=>{f(F=>{const L=new Set(F);return L.has(A)?L.delete(A):L.add(A),L})},T=A=>{var L;const F=(L=A.target.files)==null?void 0:L[0];F&&(_(null),F.text().then(z=>{a(z),l(F.name)}).catch(()=>_("Could not read file.")),A.target.value="")},R=j.useCallback(async()=>{if(_(null),!P){_("Your account must belong to an organization.");return}if(!o.trim()){_("Choose a CSV file first.");return}if(h&&!y.trim()){_("Enter a list name for the custom list.");return}k(!0);const A=await Ei.importGlobal({csv:o,eventIds:[...d],createCustomList:h,listName:h?y.trim():void 0,listDescription:h?x.trim():void 0});if(k(!1),A.error){_(A.error);return}const F=A.data,L=[(F==null?void 0:F.participantsCreated)!=null?`${F.participantsCreated} new participant(s)`:null,F!=null&&F.membershipsAdded?`${F.membershipsAdded} event membership(s) added`:null,F!=null&&F.profilesUpdated?`${F.profilesUpdated} profile(s) updated`:null].filter(Boolean);let z=L.length?L.join(" · "):"Import finished.";F!=null&&F.skippedDuplicate&&(z+=` · Skipped duplicate membership(s): ${F.skippedDuplicate}.`),F!=null&&F.failed&&(z+=` · Failed rows: ${F.failed}.`),h&&(F!=null&&F.listId)&&(z+=` Custom list created (${F.listRows??0} rows, ${F.listLinked??0} linked).`),t(z),e()},[o,d,h,y,x,P,e,t]),I=w||!o.trim()||!P||h&&!y.trim();return i.jsx(Zo,{onClose:e,title:"Import participants",breadcrumb:"Participants · Import",description:"Upload a CSV (same columns as event import). Everyone is added under your organization. Optionally attach rows to events and/or save a fixed custom list from this file.",completedCount:o.trim()?1:0,totalSections:1,ctaLabel:w?"Importing…":"Import",ctaDisabled:I,onCtaClick:R,children:i.jsxs("div",{style:{padding:"0 20px 24px",display:"flex",flexDirection:"column",gap:"16px"},children:[S&&i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--destructive)",margin:0,fontFamily:"var(--font-noto-sans)"},children:S}),!P&&i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--destructive)",margin:0,fontFamily:"var(--font-noto-sans)"},children:"Your account is not linked to an organization; imports cannot be scoped."}),i.jsxs(lt,{children:[i.jsx(pt,{text:"CSV file",required:!0}),i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"10px 14px",borderRadius:"var(--radius-button)",border:"1px dashed var(--primary)",color:"var(--primary)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(ou,{size:16}),s||"Choose file…",i.jsx("input",{type:"file",accept:".csv,text/csv",style:{display:"none"},onChange:T})]}),i.jsx(Qt,{text:"Required: email, first name, last name per row."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Attach to events (optional)"}),i.jsx("div",{style:{maxHeight:"200px",overflowY:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",padding:"8px 10px"},children:c.length===0?i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"No events loaded."}):c.map(A=>i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 4px",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx("input",{type:"checkbox",checked:d.has(A._id),onChange:()=>O(A._id)}),i.jsx("span",{children:A.name})]},A._id))}),i.jsx(Qt,{text:"Selected events get a pending membership for each imported person. Leave empty to only add/update people in your org pool."})]}),i.jsx(lt,{children:i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx("input",{type:"checkbox",checked:h,onChange:A=>p(A.target.checked)}),"Also create a custom list from this import"]})}),h&&i.jsxs(i.Fragment,{children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"List name",required:!0}),i.jsx("input",{style:$t,value:y,onChange:A=>m(A.target.value),onFocus:kt,onBlur:_t,placeholder:"e.g. January invitees"})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Description"}),i.jsx("textarea",{style:{...$t,resize:"vertical",minHeight:"72px"},value:x,onChange:A=>b(A.target.value),onFocus:kt,onBlur:_t,placeholder:"Optional notes for admins"})]})]})]})})}function V6e(e){return e.split(/[,;\n]+/).map(t=>t.trim()).filter(Boolean)}function Y6e({participantId:e,onClose:t,onSaved:r}){const[n,o]=j.useState(""),[a,s]=j.useState(""),[l,c]=j.useState(""),[u,d]=j.useState(""),[f,h]=j.useState(""),[p,y]=j.useState(""),[m,x]=j.useState(""),[b,w]=j.useState(""),[k,S]=j.useState(!0),[_,P]=j.useState(!1),[O,T]=j.useState(null);j.useEffect(()=>{S(!0),T(null),Ei.get(e).then(I=>{if(S(!1),I.error||!I.data){T(I.error||"Could not load participant");return}const E=I.data;o(E.email??""),s(E.firstName??""),c(E.lastName??""),d(E.phone??""),h(E.organization??""),y(E.designation??""),x(E.notes??"");const A=E.tags;w(Array.isArray(A)?A.join(", "):"")}).catch(()=>{S(!1),T("Could not load participant")})},[e]);const R=j.useCallback(async()=>{if(T(null),!n.trim()){T("Email is required");return}P(!0);const I=V6e(b),E=await Ei.update(e,{email:n.trim(),firstName:a.trim(),lastName:l.trim(),phone:u.trim()||void 0,organization:f.trim()||void 0,designation:p.trim()||void 0,notes:m.trim()||void 0,tags:I});if(P(!1),E.error){T(E.error);return}r(),t()},[e,n,a,l,u,f,p,m,b,t,r]);return i.jsx(Zo,{onClose:t,title:"Edit participant",breadcrumb:"Participants · Edit",description:"Update profile and tags for this person in your organization.",completedCount:k?0:1,totalSections:1,ctaLabel:_?"Saving…":"Save",ctaDisabled:_||k,onCtaClick:R,children:i.jsxs("div",{style:{padding:"0 20px 24px",display:"flex",flexDirection:"column",gap:"14px"},children:[O&&i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--destructive)",margin:0,fontFamily:"var(--font-noto-sans)"},children:O}),k?i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"Loading…"}):i.jsxs(i.Fragment,{children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Email",required:!0}),i.jsx("input",{style:$t,value:n,onChange:I=>o(I.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"First name",required:!0}),i.jsx("input",{style:$t,value:a,onChange:I=>s(I.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Last name",required:!0}),i.jsx("input",{style:$t,value:l,onChange:I=>c(I.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Phone"}),i.jsx("input",{style:$t,value:u,onChange:I=>d(I.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Organization"}),i.jsx("input",{style:$t,value:f,onChange:I=>h(I.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Designation"}),i.jsx("input",{style:$t,value:p,onChange:I=>y(I.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Tags"}),i.jsx("input",{style:$t,value:b,onChange:I=>w(I.target.value),onFocus:kt,onBlur:_t,placeholder:"e.g. VIP, Speaker"}),i.jsx(Qt,{text:"Comma or semicolon separated."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Notes"}),i.jsx("textarea",{style:{...$t,resize:"vertical",minHeight:"72px"},value:m,onChange:I=>x(I.target.value),onFocus:kt,onBlur:_t})]})]})]})})}function G6e(e){return e?typeof e=="string"?e:String(e._id??""):""}const IQ=["Star Rating","NPS (0–10)","Multiple Choice","Radio","Short Text","Long Text","Checkboxes","Yes / No"],NQ=["Text","Email","Phone","Dropdown","Radio","Checkboxes","Yes / No","Date","File Upload"],K6e=[...new Set([...IQ,...NQ])],Wf=new Set(["Multiple Choice","Dropdown","Radio","Checkboxes"]),t9={Text:"text",Email:"email",Phone:"phone",Dropdown:"select",Radio:"radio",Checkboxes:"checkboxes","Yes / No":"checkbox",Date:"text","File Upload":"file"},Q6e=[{value:"",label:"Don't map (submission only)"},{value:"phone",label:"Phone"},{value:"organization",label:"Organization"},{value:"designation",label:"Designation"},{value:"notes",label:"Notes"},{value:"displayName",label:"Display name"},{value:"custom",label:"Custom field (key below)"}];function RQ(e){return(e.options??[]).map(t=>String(t).trim()).filter(Boolean)}function r9(e){return Wf.has(e.type)?RQ(e).length>=2:!0}function k8(){return["Option 1","Option 2"]}function LQ({options:e,onChange:t}){const r=e.length?e:["",""],n=(s,l)=>{const c=[...r];c[s]=l,t(c)},o=()=>t([...r,""]),a=s=>{r.length<=1||t(r.filter((l,c)=>c!==s))};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",paddingTop:"4px"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",fontWeight:600,fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Choices"}),r.map((s,l)=>i.jsxs("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[i.jsx("input",{style:{...$t,flex:1},placeholder:`Choice ${l+1}`,value:s,onChange:c=>n(l,c.target.value),onFocus:kt,onBlur:_t}),i.jsx("button",{type:"button",onClick:()=>a(l),disabled:r.length<=1,title:"Remove choice",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--destructive)",cursor:r.length<=1?"not-allowed":"pointer",opacity:r.length<=1?.45:1,flexShrink:0},children:i.jsx(gn,{size:13})})]},l)),i.jsxs("button",{type:"button",onClick:o,style:{alignSelf:"flex-start",display:"flex",alignItems:"center",gap:"6px",padding:"5px 10px",borderRadius:"var(--radius-button)",border:"1px dashed var(--border)",background:"transparent",color:"var(--primary)",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(wr,{size:12})," Add choice"]}),i.jsx(Qt,{text:"At least two non-empty choices are required."})]})}function a6(){return[{id:"reg-core-fn",label:"First name",type:"Text",required:"Yes",mapsTo:"firstName",fixed:!0},{id:"reg-core-ln",label:"Last name",type:"Text",required:"Yes",mapsTo:"lastName",fixed:!0},{id:"reg-core-em",label:"Email",type:"Email",required:"Yes",mapsTo:"email",fixed:!0}]}function X6e({q:e,types:t,onPatch:r,onRemove:n,idx:o,canRemove:a}){const s=Wf.has(e.type);return i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start",padding:"10px 12px",background:"var(--secondary)",borderRadius:"var(--radius-button)",border:"1px solid var(--border)"},children:[i.jsx("div",{style:{color:"var(--muted)",paddingTop:"6px",flexShrink:0},children:i.jsx(sv,{size:14})}),i.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"8px"},children:[i.jsxs("div",{style:{display:"grid",gridTemplateColumns:a?"1fr auto auto auto":"1fr auto auto",gap:"8px",alignItems:"center"},children:[i.jsx("input",{style:$t,placeholder:`Question ${o+1}`,value:e.label,onChange:l=>r({label:l.target.value}),onFocus:kt,onBlur:_t}),i.jsx("div",{style:{position:"relative"},children:i.jsx("select",{style:{...Nr,width:"auto",minWidth:"130px"},value:e.type,onChange:l=>{var d;const c=l.target.value,u={type:c};Wf.has(c)?u.options=(d=e.options)!=null&&d.length?e.options:k8():u.options=[],r(u)},onFocus:kt,onBlur:_t,children:t.map(l=>i.jsx("option",{children:l},l))})}),a&&i.jsx("button",{onClick:n,type:"button",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--destructive)",cursor:"pointer",flexShrink:0},children:i.jsx(gn,{size:13})})]}),s&&i.jsx(LQ,{options:e.options??[],onChange:l=>r({options:l})}),i.jsx("div",{style:{display:"flex",alignItems:"center",gap:"16px"},children:i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:[i.jsx("input",{type:"checkbox",checked:e.required==="Yes",onChange:l=>r({required:l.target.checked?"Yes":"No"}),style:{accentColor:"var(--primary)",width:"13px",height:"13px"}}),"Required field"]})})]})]})}function Z6e({q:e,idx:t,onPatch:r}){return i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start",padding:"10px 12px",background:"var(--accent)",borderRadius:"var(--radius-button)",border:"1px solid var(--border)"},children:[i.jsx("div",{style:{color:"var(--muted)",paddingTop:"6px",flexShrink:0},children:i.jsx(sv,{size:14})}),i.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"8px"},children:[i.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:i.jsxs("span",{style:{fontSize:"10px",fontWeight:600,fontFamily:"var(--font-noto-sans)",color:"var(--primary)",textTransform:"uppercase"},children:["Core · maps to ",e.mapsTo]})}),i.jsx("input",{style:$t,placeholder:e.mapsTo==="email"?"Email address":"Label shown to registrants",value:e.label,onChange:n=>r({label:n.target.value}),onFocus:kt,onBlur:_t})]})]})}function J6e({q:e,types:t,onPatch:r,onRemove:n,idx:o}){const a=Wf.has(e.type);return i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",padding:"10px 12px",background:"var(--secondary)",borderRadius:"var(--radius-button)",border:"1px solid var(--border)"},children:i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"flex-start"},children:[i.jsx("div",{style:{color:"var(--muted)",paddingTop:"6px"},children:i.jsx(sv,{size:14})}),i.jsxs("div",{style:{flex:1,display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px",alignItems:"start"},children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Field label"}),i.jsx("input",{style:$t,placeholder:`Field ${o+1}`,value:e.label,onChange:s=>r({label:s.target.value}),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Field type"}),i.jsx("div",{style:{position:"relative"},children:i.jsx("select",{style:Nr,value:e.type,onChange:s=>{var u;const l=s.target.value,c={type:l};Wf.has(l)?c.options=(u=e.options)!=null&&u.length?e.options:k8():c.options=[],r(c)},onFocus:kt,onBlur:_t,children:t.map(s=>i.jsx("option",{children:s},s))})})]}),a&&i.jsx(lt,{span2:!0,children:i.jsx(LQ,{options:e.options??[],onChange:s=>r({options:s})})}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Map to participant"}),i.jsx("div",{style:{position:"relative"},children:i.jsx("select",{style:Nr,value:e.mapsTo??"",onChange:s=>r({mapsTo:s.target.value}),onFocus:kt,onBlur:_t,children:Q6e.map(s=>i.jsx("option",{value:s.value,children:s.label},s.value||"—"))})})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Required"}),i.jsx(go,{name:`req-${e.id}`,value:e.required,onChange:s=>r({required:s}),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]})]}),e.mapsTo==="custom"&&i.jsxs(lt,{span2:!0,children:[i.jsx(pt,{text:"Custom field key",required:!0}),i.jsx("input",{style:$t,placeholder:"e.g. dietaryPreference",value:e.customMapsKey??"",onChange:s=>r({customMapsKey:s.target.value}),onFocus:kt,onBlur:_t}),i.jsx(Qt,{text:"Stored under Participant.customFields[key]."})]})]}),i.jsx("button",{onClick:n,type:"button",title:"Remove field",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--destructive)",cursor:"pointer",flexShrink:0},children:i.jsx(gn,{size:13})})]})})}const vw=e=>{const t=e[0];return{id:Math.random().toString(36).slice(2),label:"",type:t,required:"No",options:Wf.has(t)?k8():[],mapsTo:"",customMapsKey:"",fixed:!1}},eTe=(e,t)=>({name:"",description:"",questions:[vw(e)],showThankYou:"Yes",thankYouMsg:"Thank you for your feedback!",collectEmail:"No",anonymous:t?"Yes":"No",publish:"Draft",paymentEnabled:"No",amount:"",confirmationEmail:"Yes",onSubmitTags:"",onSubmitListId:""});function FQ(e,t,r){if(e==="stars"||e==="select"&&(t==null?void 0:t.length)===5&&t.every((n,o)=>n===String(o+1)))return"Star Rating";if(e==="select"&&(t==null?void 0:t.length)===11)return"NPS (0–10)";if(e==="radio")return"Radio";if(e==="checkboxes")return"Checkboxes";if(e==="select"){const n=(r==null?void 0:r.indexOf("Multiple Choice"))??-1,o=(r==null?void 0:r.indexOf("Dropdown"))??-1;return o>=0&&(n<0||o<n)?"Dropdown":(n>=0,"Multiple Choice")}return e==="checkbox"?r!=null&&r.includes("Yes / No")?"Yes / No":"Checkboxes":e==="text"?r!=null&&r.includes("Short Text")?"Short Text":"Text":e==="email"?"Email":e==="phone"?"Phone":e==="file"?"File Upload":(r==null?void 0:r[0])??"Short Text"}function MQ(e){return Array.isArray(e.options)?e.options.map(t=>String(t)):[]}function DQ(e,t){var s;const r=((s=e.label)==null?void 0:s.trim())||"Untitled",n=e.required==="Yes",o=RQ(e);if(t){if(e.type==="Star Rating")return{label:r,type:"stars",required:n,options:["1","2","3","4","5"]};if(e.type==="NPS (0–10)")return{label:r,type:"select",required:n,options:Array.from({length:11},(c,u)=>String(u))};if(e.type==="Multiple Choice")return{label:r,type:"select",required:n,options:o};if(e.type==="Radio")return{label:r,type:"radio",required:n,options:o};if(e.type==="Checkboxes")return{label:r,type:"checkboxes",required:n,options:o};if(e.type==="Short Text"||e.type==="Long Text")return{label:r,type:"text",required:n};if(e.type==="Yes / No")return{label:r,type:"checkbox",required:n};const l=t9[e.type];return l?l==="select"||l==="radio"||l==="checkboxes"?{label:r,type:l,required:n,options:o}:{label:r,type:l,required:n}:{label:r,type:"text",required:n}}const a=t9[e.type]??"text";return a==="select"||a==="radio"||a==="checkboxes"?{label:r,type:a,required:n,options:o}:{label:r,type:a,required:n}}function zQ(e){return e==="firstName"||e==="lastName"||e==="email"}function tTe(e){var n;const t=DQ(e,!1),r=e.fixed===!0||zQ(e.mapsTo)?!0:t.required;return{...t,required:r,mapsTo:e.mapsTo||void 0,customMapsKey:e.mapsTo==="custom"&&((n=e.customMapsKey)!=null&&n.trim())?e.customMapsKey.trim():void 0,isFixed:e.fixed===!0}}function rTe(e){return e.isFixed===!0||zQ(e.mapsTo)||e.required?"Yes":"No"}function nTe(e,t){return e!=null&&e.length?e.map((r,n)=>{const o=FQ(r.type??"text",r.options,t);return{id:Math.random().toString(36).slice(2)+String(n),label:r.label??"",type:o,required:r.required?"Yes":"No",options:Wf.has(o)?MQ(r):[],mapsTo:r.mapsTo,customMapsKey:r.customMapsKey,fixed:r.isFixed}}):[vw(t)]}function iTe(e,t,r){const n=FQ(e.type??"text",e.options,r);return{id:`imp-${t}-${Math.random().toString(36).slice(2)}`,label:e.label??"",type:n,required:rTe(e),options:Wf.has(n)?MQ(e):[],mapsTo:e.mapsTo,customMapsKey:e.customMapsKey,fixed:e.isFixed===!0}}function oTe(e,t){const r=a6();if(!(e!=null&&e.length))return r;const n=e.map((o,a)=>iTe(o,a,t));return n.some(o=>o.mapsTo==="firstName")?n:[...r,...n]}function o3({eventId:e,formId:t,mode:r,onClose:n,onSuccess:o}){const{user:a}=Ur(),s=zn(a),l=r==="feedback",c=r==="registration",u=r==="other",d=c?5:3,f=c?NQ:u?K6e:IQ,h=l||u,p=mc(d),[y,m]=j.useState(()=>{const q=eTe(f,h);return c?{...q,questions:a6()}:q}),[x,b]=j.useState([]),[w,k]=j.useState({}),[S,_]=j.useState(!1),[P,O]=j.useState(!!t),[T,R]=j.useState([]),[I,E]=j.useState("");j.useEffect(()=>{if(!s){R([]);return}let q=!1;return zr.list({organization:s,recordKind:"event",limit:500}).then(Y=>{var G;if(q)return;const K=((G=Y.data)==null?void 0:G.events)??[];R(K.map(re=>{var J;return{_id:re._id,name:(J=re.name)!=null&&J.trim()?re.name:"Untitled"}}))}).catch(()=>{q||R([])}),()=>{q=!0}},[s]),j.useEffect(()=>{!t&&e&&E(e)},[t,e]),j.useEffect(()=>{if(c){if(!s){b([]);return}Fa.list({organization:s}).then(q=>{var Y;(Y=q.data)!=null&&Y.lists&&b(q.data.lists.filter(K=>K.type==="fixed"))}).catch(()=>b([]))}},[c,s]),j.useEffect(()=>{if(!t)return;let q=!1;return(async()=>{var Y;try{const K=await Ma.get(t);if(q)return;const G=K.type==="registration"?oTe(K.fields,f):nTe(K.fields,f),re=K.settings??{},J=Array.isArray(re.onSubmitAddTags)?re.onSubmitAddTags.join(", "):"";m({name:K.name??"",description:K.description??"",questions:G.length?G:K.type==="registration"?a6():[vw(f)],showThankYou:re.showThankYou===!1?"No":"Yes",thankYouMsg:(Y=re.thankYouMessage)!=null&&Y.trim()?re.thankYouMessage:"Thank you for your feedback!",collectEmail:re.collectEmail?"Yes":"No",anonymous:re.allowAnonymous||h?"Yes":"No",publish:re.isActive!==!1?"Published":"Draft",paymentEnabled:re.paymentEnabled?"Yes":"No",amount:re.paymentAmount!=null&&re.paymentAmount!==""?String(re.paymentAmount):"",confirmationEmail:re.sendConfirmationEmail===!1?"No":"Yes",onSubmitTags:J,onSubmitListId:re.onSubmitParticipantListId??""}),E(G6e(K.event))}catch{q||O(!1)}finally{q||O(!1)}})(),()=>{q=!0}},[t,f.join(","),h]);const A=(q,Y)=>m(K=>({...K,[q]:Y})),F=()=>m(q=>({...q,questions:[...q.questions,vw(f)]})),L=q=>m(Y=>({...Y,questions:Y.questions.filter(K=>!K.fixed&&K.id!==q)})),z=(q,Y)=>m(K=>({...K,questions:K.questions.map(G=>G.id===q?{...G,...Y}:G)})),V=j.useCallback((q,Y)=>{if(Y===1)return q.name.trim().length>0&&I.trim().length>0;if(Y===2){if(c){const re=q.questions.filter(le=>le.fixed).every(le=>le.label.trim().length>0),ae=q.questions.filter(le=>!le.fixed).every(le=>{var me;return!(!le.label.trim()||le.mapsTo==="custom"&&!((me=le.customMapsKey)!=null&&me.trim())||!r9(le))});return re&&ae}const K=q.questions.some(re=>re.label.trim().length>0),G=q.questions.every(re=>!re.label.trim()||r9(re));return K&&G}return!0},[c,I]),Q=j.useCallback(q=>{const Y=V(y,q);k(K=>({...K,[q]:Y?"":"Please complete required fields before continuing."})),Y&&p.advance(q)},[y,V,p]),U=j.useCallback(()=>{const q=c?"registration":u?"other":"feedback",Y=c?y.questions.filter(re=>re.label.trim()).map(re=>tTe(re)):y.questions.filter(re=>re.label.trim()).map(re=>DQ(re,h)),K=y.publish==="Published",G=y.onSubmitTags.split(/[,;\n]+/).map(re=>re.trim()).filter(Boolean);return{name:y.name.trim(),description:y.description.trim(),type:q,fields:Y,settings:{isActive:K,thankYouMessage:y.thankYouMsg.trim(),showThankYou:y.showThankYou==="Yes",collectEmail:y.collectEmail==="Yes",allowAnonymous:y.anonymous==="Yes",paymentEnabled:y.paymentEnabled==="Yes",paymentAmount:y.paymentEnabled==="Yes"&&y.amount.trim()?y.amount.trim():"",sendConfirmationEmail:y.confirmationEmail==="Yes",...c?{onSubmitAddTags:G,onSubmitParticipantListId:y.onSubmitListId.trim()||null}:{}}}},[y,c,u,h]),ee=j.useCallback(async()=>{if(!y.name.trim()||!I.trim()){I.trim()||k(q=>({...q,1:"Select an event for this form."}));return}_(!0),k({});try{const q=U();t?await Ma.update(t,{...q,event:I}):await Ma.create({...q,event:I}),o(),n()}catch{k(q=>({...q,1:"Failed to save. Please try again."}))}finally{_(!1)}},[y.name,t,I,U,o,n]),H=j.useCallback(()=>{const q=c?5:3;if(!V(y,q)){k(Y=>({...Y,[q]:"Please complete required fields."}));return}k(Y=>({...Y,[q]:""})),ee()},[y,c,V,ee]),B=l?"Forms & Workflow · Feedback":c?"Forms & Workflow · Registration":"Forms & Workflow · Other Forms",M=t?l?"Edit Feedback Form":c?"Edit Registration Form":"Edit Form":l?"Create Feedback Form":c?"Create Registration Form":"Create Other Form",$=l?"Design a feedback form to collect responses from your attendees.":c?"Build a registration form; each submission creates or updates a participant.":"Build custom forms (other / general-purpose) for your event.";return P?i.jsx(Zo,{onClose:n,title:M,breadcrumb:B,description:$,completedCount:0,totalSections:d,ctaLabel:"Save",ctaDisabled:!0,children:i.jsx("div",{style:{padding:"20px",color:"var(--muted)"},children:"Loading form…"})}):i.jsxs(Zo,{onClose:n,title:M,breadcrumb:B,description:$,completedCount:p.done.size,totalSections:d,ctaLabel:"Save",ctaDisabled:!y.name.trim()||!I.trim()||S||!t&&T.length===0,onCtaClick:ee,children:[i.jsxs($r,{n:1,title:"Form Details",subtitle:"Name and describe your form",open:p.open===1,completed:p.done.has(1),onToggle:()=>p.toggle(1),onSave:()=>Q(1),nextLabel:h?"Questions":"Fields",sectionError:w[1],children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Form Name",required:!0}),i.jsx("input",{style:$t,placeholder:h?"e.g. Post-Event Feedback 2026":"e.g. Conference Registration 2026",value:y.name,onChange:q=>A("name",q.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Event",required:!0}),i.jsx("div",{style:{position:"relative"},children:i.jsxs("select",{style:Nr,value:I,onChange:q=>E(q.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"Select an event…"}),I&&!T.some(q=>q._id===I)?i.jsx("option",{value:I,children:"Current linked event"}):null,T.map(q=>i.jsx("option",{value:q._id,children:q.name},q._id))]})}),s&&T.length===0?i.jsx(Qt,{text:"No events in this organization. Create an event under Portfolio (All Events) first."}):null]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Description"}),i.jsx("textarea",{style:{...$t,resize:"vertical",minHeight:"72px"},placeholder:"Briefly describe this form…",value:y.description,onChange:q=>A("description",q.target.value),onFocus:kt,onBlur:_t})]}),h&&i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Anonymous Responses",required:!0}),i.jsx(go,{name:"anon",value:y.anonymous,onChange:q=>A("anonymous",q),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]}),i.jsx(Qt,{text:"Anonymous forms don't record the respondent's identity."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Collect Email"}),i.jsx(go,{name:"collectEmail",value:y.collectEmail,onChange:q=>A("collectEmail",q),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]})]})]})]}),i.jsxs($r,{n:2,title:h?"Questions":"Form Fields",subtitle:c?"Core fields (first name, last name, email) plus optional mapped fields":h?"Add and order your feedback questions":"Add and arrange fields",open:p.open===2,completed:p.done.has(2),onToggle:()=>p.toggle(2),onSave:()=>Q(2),nextLabel:c?"Participant actions":"Settings",sectionError:w[2],children:[i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:c?i.jsxs(i.Fragment,{children:[y.questions.filter(q=>q.fixed).map((q,Y)=>i.jsx(Z6e,{q,idx:Y,onPatch:K=>z(q.id,K)},q.id)),y.questions.filter(q=>!q.fixed).map((q,Y)=>i.jsx(J6e,{q,types:f,idx:Y,onPatch:K=>z(q.id,K),onRemove:()=>L(q.id)},q.id))]}):y.questions.map((q,Y)=>i.jsx(X6e,{q,types:f,idx:Y,onPatch:K=>z(q.id,K),onRemove:()=>L(q.id),canRemove:y.questions.length>1},q.id))}),c?i.jsxs("button",{type:"button",onClick:F,style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px dashed var(--primary)",background:"transparent",color:"var(--primary)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:13})," Add field"]}):i.jsxs("button",{type:"button",onClick:F,style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px dashed var(--primary)",background:"transparent",color:"var(--primary)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:13})," Add ",h?"Question":"Field"]}),i.jsx(Qt,{text:c?"Submissions must include the email field. Map extra fields to participant columns or customFields.":"Drag the grip icon to reorder questions."})]}),c&&i.jsxs($r,{n:3,title:"Participant actions",subtitle:"Tags and lists applied when someone submits",open:p.open===3,completed:p.done.has(3),onToggle:()=>p.toggle(3),onSave:()=>Q(3),nextLabel:"Payment",sectionError:w[3],children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Add tags on submit"}),i.jsx("input",{style:$t,placeholder:"e.g. VIP, Registered — comma separated",value:y.onSubmitTags,onChange:q=>A("onSubmitTags",q.target.value),onFocus:kt,onBlur:_t}),i.jsx(Qt,{text:"Merged onto the participant record (deduplicated)."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Add to fixed participant list"}),i.jsx("div",{style:{position:"relative"},children:i.jsxs("select",{style:Nr,value:y.onSubmitListId,onChange:q=>A("onSubmitListId",q.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"— None —"}),x.map(q=>i.jsx("option",{value:q._id,children:q.name},q._id))]})}),i.jsx(Qt,{text:"Only fixed (manual) lists in your organization are shown."})]})]}),c&&i.jsx($r,{n:4,title:"Payment",subtitle:"Configure payment settings for paid registrations",open:p.open===4,completed:p.done.has(4),onToggle:()=>p.toggle(4),onSave:()=>Q(4),nextLabel:"Publish Settings",sectionError:w[4],children:i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Enable Payment",required:!0}),i.jsx(go,{name:"regPayment",value:y.paymentEnabled,onChange:q=>A("paymentEnabled",q),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]})]}),y.paymentEnabled==="Yes"&&i.jsxs(lt,{children:[i.jsx(pt,{text:"Registration Fee (₹)",required:!0}),i.jsx("input",{type:"number",style:$t,placeholder:"0.00",value:y.amount,onChange:q=>A("amount",q.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Confirmation Email",required:!0}),i.jsx(go,{name:"confEmail",value:y.confirmationEmail,onChange:q=>A("confirmationEmail",q),options:[{label:"Yes",value:"Yes"},{label:"No",value:"No"}]}),i.jsx(Qt,{text:"Send a confirmation email after registration."})]})]})}),i.jsx($r,{n:c?5:3,title:"Publish Settings",subtitle:"Set the form status and thank-you message",open:p.open===(c?5:3),completed:p.done.has(c?5:3),onToggle:()=>p.toggle(c?5:3),onSave:H,nextLabel:"Save",sectionError:w[c?5:3],children:i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Status",required:!0}),i.jsx("div",{style:{position:"relative"},children:i.jsxs("select",{style:Nr,value:y.publish,onChange:q=>A("publish",q.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{children:"Draft"}),i.jsx("option",{children:"Published"})]})})]}),i.jsxs(lt,{span2:!0,children:[i.jsx(pt,{text:"Thank You Message"}),i.jsx("input",{style:$t,placeholder:"Thank you for your response!",value:y.thankYouMsg,onChange:q=>A("thankYouMsg",q.target.value),onFocus:kt,onBlur:_t}),i.jsx(Qt,{text:"Shown to respondents after they submit the form."})]})]})})]})}function aTe(e){return!e||typeof e!="object"?{}:e}function sTe(e){if(!e)return"—";try{return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}catch{return"—"}}function lTe(e){var t;return!e||typeof e=="string"?"—":((t=e.email)==null?void 0:t.trim())||"—"}const n9=20,i9=4;function cTe({formId:e,formName:t,onClose:r}){const[n,o]=j.useState(null),[a,s]=j.useState(""),[l,c]=j.useState(""),[u,d]=j.useState(""),[f,h]=j.useState(""),[p,y]=j.useState(""),[m,x]=j.useState(""),[b,w]=j.useState(1),[k,S]=j.useState([]),[_,P]=j.useState(0),[O,T]=j.useState(!0),[R,I]=j.useState(null),[E,A]=j.useState(!1),F=((n==null?void 0:n.fields)||[]).map(B=>{var M;return(M=B.label)==null?void 0:M.trim()}).filter(Boolean),L=F.slice(0,i9),z=Math.max(0,F.length-L.length),V=j.useCallback(async()=>{try{const B=await Ma.get(e);o(B)}catch{o(null)}},[e]),Q=j.useCallback(async()=>{T(!0),I(null);try{const B=await Ma.listSubmissions(e,{q:l||void 0,dateFrom:p||void 0,dateTo:m||void 0,page:b,limit:n9});S(B.submissions),P(B.total)}catch(B){I(B instanceof Error?B.message:"Failed to load submissions."),S([]),P(0)}finally{T(!1)}},[e,l,p,m,b]);j.useEffect(()=>{V()},[V]),j.useEffect(()=>{Q()},[Q]);const U=()=>{c(a.trim()),y(u),x(f),w(1)},ee=async()=>{A(!0);try{const B=await Ma.exportSubmissionsCsv(e,{q:l||void 0,dateFrom:p||void 0,dateTo:m||void 0}),M=URL.createObjectURL(B),$=document.createElement("a");$.href=M,$.download=`form-${e}-submissions.csv`,$.click(),URL.revokeObjectURL(M)}catch(B){I(B instanceof Error?B.message:"Export failed.")}finally{A(!1)}},H=Math.max(1,Math.ceil(_/n9));return i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:r,role:"presentation",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:200}}),i.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"form-submissions-title",style:{position:"fixed",top:0,right:0,height:"100%",width:"min(720px, 100vw)",background:"var(--card)",zIndex:201,display:"flex",flexDirection:"column",boxShadow:"-4px 0 40px rgba(0,0,0,0.2)",animation:"formSubmissionsSlideIn 0.2s ease"},children:[i.jsx("style",{children:"@keyframes formSubmissionsSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }"}),i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:12,padding:"16px 18px",borderBottom:"1px solid var(--border)",flexShrink:0},children:[i.jsxs("div",{style:{minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"0 0 4px"},children:"Submissions"}),i.jsx("h2",{id:"form-submissions-title",style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0,lineHeight:1.3,wordBreak:"break-word"},children:t})]}),i.jsx("button",{type:"button",onClick:r,"aria-label":"Close",style:{flexShrink:0,width:36,height:36,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",cursor:"pointer"},children:i.jsx(er,{size:18})})]}),i.jsxs("div",{style:{padding:"12px 18px",borderBottom:"1px solid var(--border)",display:"flex",flexDirection:"column",gap:10,flexShrink:0},children:[i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"flex-end"},children:[i.jsxs("div",{style:{flex:"1 1 160px",minWidth:0},children:[i.jsx("label",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:600,color:"var(--muted)",textTransform:"uppercase",display:"block",marginBottom:4},children:"Search (* wildcards)"}),i.jsx("input",{value:a,onChange:B=>s(B.target.value),onKeyDown:B=>B.key==="Enter"&&U(),placeholder:"e.g. john*@*",style:{width:"100%",padding:"8px 10px",fontSize:"var(--text-sm)",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",color:"var(--foreground)",boxSizing:"border-box"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:600,color:"var(--muted)",textTransform:"uppercase",display:"block",marginBottom:4},children:"From"}),i.jsx("input",{type:"date",value:u,onChange:B=>d(B.target.value),style:{padding:"8px 10px",fontSize:"var(--text-sm)",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",color:"var(--foreground)"}})]}),i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:600,color:"var(--muted)",textTransform:"uppercase",display:"block",marginBottom:4},children:"To"}),i.jsx("input",{type:"date",value:f,onChange:B=>h(B.target.value),style:{padding:"8px 10px",fontSize:"var(--text-sm)",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",color:"var(--foreground)"}})]}),i.jsx("button",{type:"button",onClick:U,style:{padding:"8px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",color:"var(--foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:600,cursor:"pointer"},children:"Apply"}),i.jsxs("button",{type:"button",onClick:()=>void ee(),disabled:E||_===0,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"8px 14px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:600,cursor:E||_===0?"not-allowed":"pointer",opacity:E||_===0?.6:1},children:[i.jsx(Al,{size:14}),E?"Exporting…":"Export CSV"]})]}),i.jsxs("p",{style:{margin:0,fontSize:"var(--text-xs)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:["Showing ",_.toLocaleString()," match",_===1?"":"es",". List view is paged; export includes all matches and"," ",i.jsx("strong",{style:{color:"var(--foreground)"},children:"all form fields"})," as columns.",z>0?` The table only shows the first ${i9} response fields (${z} more in the file only).`:null]})]}),i.jsxs("div",{style:{flex:1,overflow:"auto",padding:"0 0 16px"},children:[R?i.jsx("p",{style:{padding:"16px 18px",margin:0,color:"var(--destructive)",fontSize:"var(--text-sm)"},children:R}):null,O?i.jsx("p",{style:{padding:"24px 18px",margin:0,color:"var(--muted)"},children:"Loading…"}):k.length===0?i.jsx("p",{style:{padding:"24px 18px",margin:0,color:"var(--muted)"},children:"No submissions for this filter."}):i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{background:"var(--secondary)",borderBottom:"1px solid var(--border)"},children:[i.jsx("th",{style:{textAlign:"left",padding:"10px 12px",whiteSpace:"nowrap"},children:"Submitted"}),i.jsx("th",{style:{textAlign:"left",padding:"10px 12px",whiteSpace:"nowrap"},children:"Email"}),L.map(B=>i.jsx("th",{style:{textAlign:"left",padding:"10px 12px",maxWidth:180},children:B},B)),z>0?i.jsxs("th",{style:{textAlign:"left",padding:"10px 12px",color:"var(--muted)",fontWeight:600,whiteSpace:"nowrap"},children:["+",z," more…"]},"__more__"):null]})}),i.jsx("tbody",{children:k.map(B=>{const M=aTe(B.data);return i.jsxs("tr",{style:{borderBottom:"1px solid var(--border)",verticalAlign:"top"},children:[i.jsx("td",{style:{padding:"10px 12px",whiteSpace:"nowrap",color:"var(--foreground)"},children:sTe(B.submittedAt)}),i.jsx("td",{style:{padding:"10px 12px",wordBreak:"break-all"},children:lTe(B.participant)}),L.map($=>i.jsx("td",{style:{padding:"10px 12px",wordBreak:"break-word",maxWidth:220},children:uTe(M[$])},$)),z>0?i.jsx("td",{style:{padding:"10px 12px",color:"var(--muted)",fontSize:"10px",fontStyle:"italic"},children:"Export for full data"},"__more__"):null]},B._id)})})]})})]}),i.jsxs("div",{style:{padding:"12px 18px",borderTop:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,flexShrink:0},children:[i.jsxs("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:["Page ",b," of ",H]}),i.jsxs("div",{style:{display:"flex",gap:8},children:[i.jsxs("button",{type:"button",disabled:b<=1||O,onClick:()=>w(B=>Math.max(1,B-1)),style:{display:"inline-flex",alignItems:"center",gap:4,padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:b<=1||O?"not-allowed":"pointer",opacity:b<=1||O?.5:1},children:[i.jsx(Nf,{size:16})," Prev"]}),i.jsxs("button",{type:"button",disabled:b>=H||O,onClick:()=>w(B=>B+1),style:{display:"inline-flex",alignItems:"center",gap:4,padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:b>=H||O?"not-allowed":"pointer",opacity:b>=H||O?.5:1},children:["Next ",i.jsx(va,{size:16})]})]})]})]})]})}function uTe(e){if(e==null)return"—";if(typeof e=="boolean")return e?"Yes":"No";if(Array.isArray(e))return e.join(", ");const t=String(e);return t.length>500?`${t.slice(0,500)}…`:t}function dTe(e){return e<1024?e+" B":e<1048576?(e/1024).toFixed(1)+" KB":(e/1048576).toFixed(1)+" MB"}function fTe({onClose:e,onSuccess:t}){const{user:r}=Ur(),n=zn(r),o=3,a=mc(o),s=j.useRef(null),[l,c]=j.useState([]),[u,d]=j.useState(!1),[f,h]=j.useState({collection:"",description:"",visibility:"Private",tags:""}),[p,y]=j.useState([]),[m,x]=j.useState(""),[b,w]=j.useState({}),[k,S]=j.useState({}),[_,P]=j.useState(!1),O=(z,V)=>{h(Q=>({...Q,[z]:V})),S(Q=>({...Q,[z]:void 0}))};j.useEffect(()=>{if(!n){y([]),x("Organisation required to load collections.");return}I0.list({organization:n}).then(y).catch(()=>{y([]),x("Could not load collections.")})},[n]);const T=z=>{const V=Array.from(z).map(Q=>({id:Math.random().toString(36).slice(2),file:Q}));c(Q=>[...Q,...V]),S(Q=>({...Q,files:void 0}))},R=j.useCallback(z=>z===1?l.length===0?(S(V=>({...V,files:"Add at least one file to upload."})),!1):(S(V=>({...V,files:void 0})),!0):z===2?f.collection&&!p.some(Q=>Q._id===f.collection)?(S(Q=>({...Q,collection:"Select a valid collection or choose None."})),!1):(S(V=>({...V,collection:void 0})),!0):z===3?f.visibility!=="Private"&&f.visibility!=="Public"?(S(V=>({...V,visibility:"Select a visibility option."})),!1):(S(V=>({...V,visibility:void 0})),!0):!0,[l.length,f.collection,f.visibility,p]),I=z=>{const V=R(z);w(Q=>({...Q,[z]:V?"":"Fix the errors below before continuing."})),V&&a.advance(z)},E=j.useCallback(()=>{const z=R(1),V=R(2),Q=R(3);return w(U=>({...U,99:"",1:z?"":U[1]||"Fix the errors below before continuing.",2:V?"":U[2]||"Fix the errors below before continuing.",3:Q?"":U[3]||"Fix the errors below before continuing."})),!z||!V||!Q?(w(U=>({...U,99:"Complete and fix all sections before uploading."})),!1):!0},[R]),A=z=>{c(V=>V.filter(Q=>Q.id!==z))},F=async()=>{if(!E())return;P(!0),c(H=>H.map(B=>({...B,error:void 0,uploading:!0,done:!1})));const z=f.visibility==="Public"?"public":"private",V=f.tags.trim(),Q=f.description.trim(),U=f.collection.trim()||void 0;let ee=!1;for(let H=0;H<l.length;H++){const B=l[H],M=B.id;try{await Ys(B.file,{eventId:"portfolio",module:"content-library",description:Q,visibility:z,tags:V||void 0,contentCollectionId:U}),c($=>$.map(q=>q.id===M?{...q,uploading:!1,done:!0}:q))}catch($){ee=!0;const q=$ instanceof Error?$.message:"Upload failed";c(Y=>Y.map(K=>K.id===M?{...K,uploading:!1,done:!1,error:q}:K))}}P(!1),ee||(t==null||t(),e())},L=()=>{F()};return i.jsxs(Zo,{onClose:e,title:"Upload Files",breadcrumb:"Content · Library",description:"Upload files to your content library. You can attach them to a collection after uploading.",completedCount:a.done.size,totalSections:o,ctaLabel:"Save Files",ctaDisabled:_||a.done.size<o,onCtaClick:F,children:[b[99]&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",padding:"0 20px",margin:0},children:b[99]}),i.jsxs($r,{n:1,title:"Upload Files",subtitle:"Drag and drop or select files to upload",open:a.open===1,completed:a.done.has(1),onToggle:()=>a.toggle(1),onSave:()=>I(1),nextLabel:"File Details",nextDisabled:_,sectionError:b[1],children:[i.jsx(lt,{error:k.files,children:i.jsxs("div",{onClick:()=>{var z;return(z=s.current)==null?void 0:z.click()},onDragOver:z=>{z.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:z=>{z.preventDefault(),d(!1),T(z.dataTransfer.files)},style:{border:`2px dashed ${u?"var(--primary)":k.files?"var(--destructive)":"var(--border)"}`,borderRadius:"var(--radius-card)",background:u?"var(--accent)":"var(--secondary)",padding:"32px 20px",display:"flex",flexDirection:"column",alignItems:"center",gap:"10px",cursor:"pointer",transition:"all .15s"},children:[i.jsx("input",{ref:s,type:"file",multiple:!0,style:{display:"none"},onChange:z=>z.target.files&&T(z.target.files)}),i.jsx("div",{style:{width:48,height:48,borderRadius:"50%",background:"var(--card)",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx(ou,{size:22,style:{color:"var(--primary)"}})}),i.jsxs("div",{style:{textAlign:"center"},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)",margin:"0 0 4px"},children:"Drag and drop files here"}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:["or ",i.jsx("span",{style:{color:"var(--primary)",textDecoration:"underline"},children:"select files"})," to upload · Max 50 MB per file"]})]})]})}),l.length>0&&i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:l.map(z=>{const V=z.file.type.startsWith("image")?"var(--chart-1)":z.file.type==="application/pdf"?"var(--destructive)":"var(--muted)";return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 12px",background:"var(--secondary)",borderRadius:"var(--radius-button)",border:`1px solid ${z.error?"var(--destructive)":"var(--border)"}`},children:[i.jsx(L6,{size:18,style:{color:V,flexShrink:0}}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:z.file.name}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"2px 0 0"},children:dTe(z.file.size)}),z.error&&i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",margin:"4px 0 0",display:"flex",alignItems:"center",gap:"4px"},children:[i.jsx(nv,{size:12})," ",z.error]})]}),z.uploading&&i.jsx("span",{style:{fontSize:"10px",color:"var(--muted)"},children:"Uploading…"}),z.done&&!z.error&&i.jsx(iv,{size:14,style:{color:"#22c55e",flexShrink:0}}),i.jsx("button",{type:"button",onClick:()=>A(z.id),disabled:_,style:{background:"none",border:"none",cursor:_?"not-allowed":"pointer",color:"var(--muted)",display:"flex",flexShrink:0},children:i.jsx(er,{size:14})})]},z.id)})}),i.jsx(Qt,{text:"Supported: PDF, JPG, PNG, MP4, ZIP, PPTX, DOCX."})]}),i.jsxs($r,{n:2,title:"File Details",subtitle:"Add metadata and organise your files",open:a.open===2,completed:a.done.has(2),onToggle:()=>a.toggle(2),onSave:()=>I(2),nextLabel:"Visibility",nextDisabled:_,sectionError:b[2],children:[m&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",margin:0},children:m}),i.jsxs(lt,{error:k.collection,children:[i.jsx(pt,{text:"Add to Collection"}),i.jsx("div",{style:{position:"relative"},children:i.jsxs("select",{style:{...Nr,...k.collection?{borderColor:"var(--destructive)"}:{}},value:f.collection,onChange:z=>O("collection",z.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"None (Library only)"}),p.map(z=>i.jsx("option",{value:z._id,children:z.name},z._id))]})}),i.jsx(Qt,{text:"Optional. New files are appended to the collection after upload."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Description / Notes"}),i.jsx("textarea",{style:{...$t,resize:"vertical",minHeight:"72px"},placeholder:"Optional notes about these files…",value:f.description,onChange:z=>O("description",z.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Tags"}),i.jsx("input",{style:$t,placeholder:"e.g. keynote, day1, sponsor",value:f.tags,onChange:z=>O("tags",z.target.value),onFocus:kt,onBlur:_t}),i.jsx(Qt,{text:"Separate tags with commas."})]})]}),i.jsx($r,{n:3,title:"Visibility",subtitle:"Control who can access these files",open:a.open===3,completed:a.done.has(3),onToggle:()=>a.toggle(3),onSave:L,nextLabel:"Save Files",nextDisabled:_,sectionError:b[3],children:i.jsxs(lt,{error:k.visibility,children:[i.jsx(pt,{text:"File Visibility",required:!0}),i.jsx(go,{name:"fileVis",value:f.visibility,onChange:z=>O("visibility",z),options:[{label:"Private (team only)",value:"Private"},{label:"Public (attendees can view)",value:"Public"}]}),i.jsx(Qt,{text:"Public files may be linked from the event website."})]})})]})}function o9(e){const t=e.type;return t==="image"?"Image":t==="pdf"?"PDF":t==="video"?"Video":"Other"}function pTe(e){return e==null||Number.isNaN(e)?"—":e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function r0(e){return[e.firstName,e.lastName].filter(Boolean).join(" ").trim()||e.email}const a9={Image:"var(--chart-1)",PDF:"var(--destructive)",Video:"var(--chart-5)",Other:"var(--muted)"},hTe={Image:i.jsx(Ree,{size:14}),PDF:i.jsx(lh,{size:14}),Video:i.jsx(Dee,{size:14}),Other:i.jsx(L6,{size:14})},gTe=["Media Kit","Presentations","Speaker Resources","Recordings","Marketing Assets","Attendee Resources","Other"],mTe=["📁","🗂️","📸","🎥","📄","🎤","🏆","⭐","🎨","📊","🔖","💼"],vTe=["All","Image","PDF","Video","Other"];function yTe(e){return e!=null&&e.length?e.map(t=>typeof t=="string"?t:t._id):[]}function xTe(e){const t=e.visibility,r=t==="shared"?"Shared":t==="public"?"Public":"Private";let n="";if(e.expiryDate){const o=new Date(e.expiryDate);Number.isNaN(o.getTime())||(n=o.toISOString().slice(0,10))}return{name:e.name??"",description:e.description??"",collectionType:e.collectionType??"",coverIcon:e.coverIcon||"📁",tags:e.tags??[],selectedFiles:[...e.contentIds??[]],visibility:r,sharedWith:yTe(e.sharedWith),passwordProtected:!!e.passwordProtected,password:"",expiryEnabled:!!e.expiryEnabled,expiryDate:n,notifyOnAdd:e.notifyOnAdd!==!1,notifyOnShare:e.notifyOnShare!==!1}}function bTe({onClose:e,onSuccess:t,editing:r=null}){const{user:n}=Ur(),o=zn(n),a=4,s=mc(a),[l,c]=j.useState({name:"",description:"",collectionType:"",coverIcon:"📁",tags:[],selectedFiles:[],visibility:"Private",sharedWith:[],passwordProtected:!1,password:"",expiryEnabled:!1,expiryDate:"",notifyOnAdd:!0,notifyOnShare:!0}),[u,d]=j.useState([]),[f,h]=j.useState([]),[p,y]=j.useState(""),[m,x]=j.useState({}),[b,w]=j.useState({}),[k,S]=j.useState(!1),_=(J,ae)=>{c(Oe=>({...Oe,[J]:ae}));const me={name:["name"],collectionType:["collectionType"],visibility:["visibility","sharedWith","password","expiryDate"],sharedWith:["sharedWith"],passwordProtected:["password"],password:["password"],expiryEnabled:["expiryDate"],expiryDate:["expiryDate"],selectedFiles:["files"]}[J];me!=null&&me.length&&w(Oe=>{const we={...Oe};for(const ie of me)delete we[ie];return we})};j.useEffect(()=>{let J=!1;if(!o){d([]),y("Organisation required to load library.");return}return(async()=>{try{const{media:ae}=await vq({limit:400,organization:o});J||(d(ae),y(""))}catch{J||(d([]),y("Could not load library."))}})(),()=>{J=!0}},[o]),j.useEffect(()=>{let J=!1;return(async()=>{var me;const ae=await nx.list();if(J)return;if(ae.error||!((me=ae.data)!=null&&me.users)){h([]);return}const le=n==null?void 0:n._id;h(le?ae.data.users.filter(Oe=>Oe._id!==le):ae.data.users)})(),()=>{J=!0}},[n==null?void 0:n._id]),j.useEffect(()=>{r&&(c(xTe(r)),x({}),w({}))},[r==null?void 0:r._id]);const P=j.useCallback(J=>{if(J===1){const ae={};return l.name.trim()||(ae.name="Collection name is required."),l.collectionType.trim()||(ae.collectionType="Select a collection type."),Object.keys(ae).length>0?(w(le=>({...le,...ae})),!1):(w(le=>({...le,name:void 0,collectionType:void 0})),!0)}if(J===2){if(l.selectedFiles.length<1)return w(me=>({...me,files:"Select at least one file from your library."})),!1;const ae=new Set(u.map(me=>me._id));return l.selectedFiles.every(me=>ae.has(me))?(w(me=>({...me,files:void 0})),!0):(w(me=>({...me,files:"One or more selected files are no longer available."})),!1)}if(J===3){const ae={};if(["Private","Shared","Public"].includes(l.visibility)||(ae.visibility="Select a visibility option."),l.visibility==="Shared"&&l.sharedWith.length<1&&(ae.sharedWith="Add at least one team member to share with."),l.visibility==="Public"&&l.passwordProtected&&(!r||!r.passwordProtected&&l.passwordProtected)&&!l.password.trim()&&(ae.password="Enter a password or turn off password protection."),l.visibility==="Public"&&l.expiryEnabled)if(!l.expiryDate.trim())ae.expiryDate="Choose an expiry date.";else{const le=new Date(l.expiryDate);le.setHours(23,59,59,999),le.getTime()<=Date.now()&&(ae.expiryDate="Expiry date must be in the future.")}return w(le=>({...le,...ae})),Object.keys(ae).length?!1:(w(le=>({...le,visibility:void 0,sharedWith:void 0,password:void 0,expiryDate:void 0})),!0)}return!0},[l.name,l.collectionType,l.selectedFiles,l.visibility,l.sharedWith,l.passwordProtected,l.password,l.expiryEnabled,l.expiryDate,u,r]),O=J=>{const ae=P(J);x(le=>({...le,[J]:ae?"":"Fix the errors below before continuing."})),ae&&s.advance(J)},T=j.useCallback(()=>{const J=P(1),ae=P(2),le=P(3),me=P(4);return x(Oe=>({...Oe,99:"",1:J?"":Oe[1]||"Fix the errors below before continuing.",2:ae?"":Oe[2]||"Fix the errors below before continuing.",3:le?"":Oe[3]||"Fix the errors below before continuing.",4:me?"":Oe[4]||"Fix the errors below before continuing."})),!J||!ae||!le||!me?(x(Oe=>({...Oe,99:r?"Complete and fix all sections before saving.":"Complete and fix all sections before creating the collection."})),!1):!0},[P,r]),R=()=>{const J=l.visibility==="Private"?"private":l.visibility==="Shared"?"shared":"public";return{name:l.name.trim(),description:l.description.trim()||void 0,collectionType:l.collectionType,coverIcon:l.coverIcon,tags:l.tags,contentIds:l.selectedFiles,visibility:J,sharedWith:l.visibility==="Shared"?l.sharedWith:[],passwordProtected:l.visibility==="Public"?l.passwordProtected:!1,password:l.visibility==="Public"&&l.passwordProtected&&l.password.trim()?l.password.trim():void 0,expiryEnabled:l.visibility==="Public"?l.expiryEnabled:!1,expiryDate:l.visibility==="Public"&&l.expiryEnabled&&l.expiryDate.trim()?new Date(l.expiryDate).toISOString():void 0,notifyOnAdd:l.notifyOnAdd,notifyOnShare:l.notifyOnShare}},I=async()=>{if(!T())return;S(!0),x(ae=>({...ae,99:""}));const J=R();try{r!=null&&r._id?await I0.update(r._id,J):await I0.create(J),t==null||t(),e()}catch(ae){const le=ae instanceof Error?ae.message:r?"Could not update collection.":"Could not create collection.";x(me=>({...me,99:le}))}finally{S(!1)}},E=()=>{I()},[A,F]=j.useState(""),L=j.useRef(null),z=()=>{const J=A.trim();J&&!l.tags.includes(J)&&_("tags",[...l.tags,J]),F("")},V=J=>_("tags",l.tags.filter(ae=>ae!==J)),Q=J=>{(J.key==="Enter"||J.key===",")&&(J.preventDefault(),z()),J.key==="Backspace"&&!A&&l.tags.length&&V(l.tags[l.tags.length-1])},[U,ee]=j.useState(""),[H,B]=j.useState("All"),M=u.filter(J=>{const ae=o9(J);return(!U||J.name.toLowerCase().includes(U.toLowerCase()))&&(H==="All"||ae===H)}),$=J=>_("selectedFiles",l.selectedFiles.includes(J)?l.selectedFiles.filter(ae=>ae!==J):[...l.selectedFiles,J]),[q,Y]=j.useState(""),K=f.filter(J=>!l.sharedWith.includes(J._id)&&r0(J).toLowerCase().includes(q.toLowerCase())),G=J=>{_("sharedWith",[...l.sharedWith,J]),Y("")},re=J=>_("sharedWith",l.sharedWith.filter(ae=>ae!==J));return i.jsxs(Zo,{onClose:e,title:r?"Edit Collection":"New Collection",breadcrumb:"Content · Collections",description:r?"Update details, library files, and access for this collection.":"Group related files into a shareable, access-controlled collection.",completedCount:s.done.size,totalSections:a,ctaLabel:r?"Save changes":"Create Collection",ctaDisabled:k||s.done.size<a,onCtaClick:()=>{I()},children:[m[99]&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",padding:"0 20px",margin:0},children:m[99]}),i.jsxs($r,{n:1,title:"Collection Details",subtitle:"Name, type, icon and tags",open:s.open===1,completed:s.done.has(1),onToggle:()=>s.toggle(1),onSave:()=>O(1),nextLabel:"Add Files",nextDisabled:k,sectionError:m[1],children:[i.jsxs(lt,{error:b.name,children:[i.jsx(pt,{text:"Collection Name",required:!0}),i.jsx("input",{style:{...$t,...b.name?{borderColor:"var(--destructive)"}:{}},placeholder:"e.g. NAPCON 2026 Media Kit",value:l.name,onChange:J=>_("name",J.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Description"}),i.jsx("textarea",{style:{...$t,resize:"vertical",minHeight:"72px"},placeholder:"What does this collection contain? Who is it for?",value:l.description,onChange:J=>_("description",J.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{error:b.collectionType,children:[i.jsx(pt,{text:"Collection Type",required:!0}),i.jsx(an,{children:i.jsxs("select",{style:{...Nr,...b.collectionType?{borderColor:"var(--destructive)"}:{}},value:l.collectionType,onChange:J=>_("collectionType",J.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"Select type…"}),gTe.map(J=>i.jsx("option",{value:J,children:J},J))]})})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Cover Icon"}),i.jsx("div",{style:{display:"flex",gap:"6px",flexWrap:"wrap",paddingTop:"2px"},children:mTe.map(J=>i.jsx("button",{onClick:()=>_("coverIcon",J),title:J,style:{width:"32px",height:"32px",borderRadius:"var(--radius-button)",border:`2px solid ${l.coverIcon===J?"var(--primary)":"var(--border)"}`,background:l.coverIcon===J?"var(--accent)":"var(--secondary)",cursor:"pointer",fontSize:"15px",display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color .12s"},children:J},J))})]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Tags"}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px",padding:"7px 10px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)",cursor:"text",minHeight:"40px",alignItems:"center"},onClick:()=>{var J;return(J=L.current)==null?void 0:J.focus()},children:[l.tags.map(J=>i.jsx(gw,{text:J,onRemove:()=>V(J)},J)),i.jsx("input",{ref:L,value:A,onChange:J=>F(J.target.value),onKeyDown:Q,onBlur:z,placeholder:l.tags.length===0?"Add tags — press Enter or comma…":"",style:{border:"none",outline:"none",background:"transparent",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",flex:1,minWidth:"120px"}})]}),i.jsx(Qt,{text:"Tags help attendees and admins find this collection quickly."})]})]}),i.jsxs($r,{n:2,title:"Add Files",subtitle:"Pick files from your library to include",open:s.open===2,completed:s.done.has(2),onToggle:()=>s.toggle(2),onSave:()=>O(2),nextLabel:"Visibility & Access",nextDisabled:k,sectionError:m[2],children:[p&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",margin:"0 0 8px"},children:p}),l.selectedFiles.length>0&&i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px",padding:"8px 10px",background:"var(--accent)",borderRadius:"var(--radius-button)",border:"1px solid var(--border)"},children:l.selectedFiles.map(J=>{const ae=u.find(le=>le._id===J);return i.jsx(gw,{text:(ae==null?void 0:ae.name)??J,onRemove:()=>$(J)},J)})}),i.jsxs("div",{style:{position:"relative"},children:[i.jsx(Pi,{size:13,style:{position:"absolute",left:"10px",top:"50%",transform:"translateY(-50%)",color:"var(--muted)",pointerEvents:"none"}}),i.jsx("input",{style:{...$t,paddingLeft:"30px"},placeholder:"Search library…",value:U,onChange:J=>ee(J.target.value),onFocus:kt,onBlur:_t})]}),i.jsx("div",{style:{display:"flex",gap:"6px",flexWrap:"wrap"},children:vTe.map(J=>i.jsxs("button",{onClick:()=>B(J),style:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"99px",border:`1px solid ${H===J?"var(--primary)":"var(--border)"}`,background:H===J?"var(--accent)":"var(--card)",color:H===J?"var(--primary)":"var(--muted)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"pointer",transition:"all .12s"},children:[J!=="All"&&i.jsx("span",{style:{color:a9[J]??"var(--muted)"},children:hTe[J]}),J]},J))}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"3px",maxHeight:"260px",overflowY:"auto",paddingRight:"2px"},children:p?null:u.length===0?i.jsx("p",{style:{textAlign:"center",padding:"24px",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"No files in your library yet. Upload files from the Library tab first."}):M.length===0?i.jsx("p",{style:{textAlign:"center",padding:"24px",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"No files match your search."}):M.map(J=>{const ae=o9(J),le=l.selectedFiles.includes(J._id);return i.jsxs("button",{onClick:()=>$(J._id),style:{display:"flex",alignItems:"center",gap:"10px",padding:"9px 12px",borderRadius:"var(--radius-button)",border:`1px solid ${le?"var(--primary)":"var(--border)"}`,background:le?"var(--accent)":"var(--card)",cursor:"pointer",textAlign:"left",transition:"all .12s"},children:[i.jsx("div",{style:{width:"16px",height:"16px",borderRadius:"4px",border:`2px solid ${le?"var(--primary)":"var(--border)"}`,background:le?"var(--primary)":"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all .12s"},children:le&&i.jsx(Oi,{size:10,style:{color:"#fff"}})}),i.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",background:a9[ae]??"var(--muted)",flexShrink:0}}),i.jsx("span",{style:{flex:1,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:J.name}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",flexShrink:0},children:ae}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",flexShrink:0,minWidth:"52px",textAlign:"right"},children:pTe(J.size)})]},J._id)})}),i.jsx(lt,{error:b.files,children:i.jsx(Qt,{text:`${l.selectedFiles.length} file${l.selectedFiles.length!==1?"s":""} selected. You can add more files later.`})})]}),i.jsxs($r,{n:3,title:"Visibility & Access",subtitle:"Control who can view or manage this collection",open:s.open===3,completed:s.done.has(3),onToggle:()=>s.toggle(3),onSave:()=>O(3),nextLabel:"Notifications",nextDisabled:k,sectionError:m[3],children:[i.jsxs(lt,{error:b.visibility,children:[i.jsx(pt,{text:"Visibility",required:!0}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:["Private","Shared","Public"].map(J=>{const ae={Private:{icon:i.jsx(ate,{size:14}),desc:"Only you can see this collection."},Shared:{icon:i.jsx(rI,{size:14}),desc:"Specific admins or editors you invite."},Public:{icon:i.jsx(Q3,{size:14}),desc:"Anyone with the link can view."}},le=l.visibility===J;return i.jsxs("button",{type:"button",onClick:()=>_("visibility",J),style:{display:"flex",alignItems:"flex-start",gap:"10px",padding:"10px 12px",borderRadius:"var(--radius-button)",border:`1.5px solid ${le?"var(--primary)":"var(--border)"}`,background:le?"var(--accent)":"var(--card)",cursor:"pointer",textAlign:"left",transition:"all .12s"},children:[i.jsx("div",{style:{width:"16px",height:"16px",borderRadius:"50%",flexShrink:0,marginTop:"2px",border:`2px solid ${le?"var(--primary)":"var(--border)"}`,background:le?"var(--primary)":"transparent",display:"flex",alignItems:"center",justifyContent:"center",transition:"all .12s"},children:le&&i.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",background:"#fff"}})}),i.jsx("span",{style:{color:le?"var(--primary)":"var(--muted)",marginTop:"1px",flexShrink:0},children:ae[J].icon}),i.jsxs("div",{children:[i.jsx("p",{style:{margin:0,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:le?"var(--primary)":"var(--card-foreground)"},children:J}),i.jsx("p",{style:{margin:"2px 0 0",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:ae[J].desc})]})]},J)})})]}),l.visibility==="Shared"&&i.jsxs(lt,{error:b.sharedWith,children:[i.jsx(pt,{text:"Share With"}),l.sharedWith.length>0&&i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px",marginBottom:"8px"},children:l.sharedWith.map(J=>{const ae=f.find(me=>me._id===J),le=ae?r0(ae):J;return i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"4px 8px",borderRadius:"var(--radius-button)",background:"var(--accent)",border:"1px solid var(--border)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:[i.jsx("span",{style:{width:"18px",height:"18px",borderRadius:"50%",background:"var(--primary)",color:"var(--primary-foreground)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9px",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)"},children:le.split(/\s+/).filter(Boolean).map(me=>me[0]).join("").slice(0,2).toUpperCase()}),le,i.jsx("button",{type:"button",onClick:()=>re(J),style:{background:"none",border:"none",cursor:"pointer",display:"flex",padding:0,color:"var(--muted)"},children:i.jsx(er,{size:10})})]},J)})}),i.jsxs("div",{style:{position:"relative"},children:[i.jsx("input",{style:$t,placeholder:"Search team members…",value:q,onChange:J=>Y(J.target.value),onFocus:kt,onBlur:_t}),q&&K.length>0&&i.jsx("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",zIndex:10,boxShadow:"0 4px 12px rgba(0,0,0,0.10)",overflow:"hidden"},children:K.map(J=>i.jsxs("button",{type:"button",onMouseDown:()=>G(J._id),style:{width:"100%",display:"flex",alignItems:"center",gap:"8px",padding:"9px 12px",background:"none",border:"none",cursor:"pointer",textAlign:"left",borderBottom:"1px solid var(--border)"},onMouseEnter:ae=>{ae.currentTarget.style.background="var(--secondary)"},onMouseLeave:ae=>{ae.currentTarget.style.background="none"},children:[i.jsx("span",{style:{width:"24px",height:"24px",borderRadius:"50%",background:"var(--primary)",color:"var(--primary-foreground)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"10px",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",flexShrink:0},children:r0(J).split(/\s+/).filter(Boolean).map(ae=>ae[0]).join("").slice(0,2).toUpperCase()}),i.jsxs("div",{children:[i.jsx("p",{style:{margin:0,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:r0(J)}),i.jsx("p",{style:{margin:0,fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:J.role})]})]},J._id))})]}),i.jsx(Qt,{text:"Team members will receive an email notification when added."})]}),l.visibility==="Public"&&i.jsxs(i.Fragment,{children:[i.jsxs(lt,{error:b.password,children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{margin:0,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)"},children:"Password Protection"}),i.jsx("p",{style:{margin:"2px 0 0",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Require a password to access this collection"})]}),i.jsx(s6,{value:l.passwordProtected,onChange:J=>_("passwordProtected",J)})]}),l.passwordProtected&&i.jsxs(i.Fragment,{children:[i.jsx("input",{style:{...$t,marginTop:"8px",...b.password?{borderColor:"var(--destructive)"}:{}},type:"password",placeholder:"Set access password…",value:l.password,onChange:J=>_("password",J.target.value),onFocus:kt,onBlur:_t}),(r==null?void 0:r.passwordProtected)&&i.jsx(Qt,{text:"Leave blank to keep the current password. Enter a new value to replace it."})]})]}),i.jsxs(lt,{error:b.expiryDate,children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{margin:0,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)"},children:"Link Expiry"}),i.jsx("p",{style:{margin:"2px 0 0",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Automatically revoke access after a date"})]}),i.jsx(s6,{value:l.expiryEnabled,onChange:J=>_("expiryEnabled",J)})]}),l.expiryEnabled&&i.jsx("input",{style:{...$t,marginTop:"8px",...b.expiryDate?{borderColor:"var(--destructive)"}:{}},type:"date",value:l.expiryDate,onChange:J=>_("expiryDate",J.target.value),onFocus:kt,onBlur:_t})]})]})]}),i.jsxs($r,{n:4,title:"Notifications",subtitle:"Choose when to receive alerts for this collection",open:s.open===4,completed:s.done.has(4),onToggle:()=>s.toggle(4),onSave:E,nextLabel:r?"Save changes":"Create Collection",nextDisabled:k,sectionError:m[4],children:[i.jsx(ev,{text:"Notify me when…"}),i.jsx(s9,{icon:i.jsx(rI,{size:14}),label:"Files are added or removed",description:"Get notified whenever a file is uploaded or deleted.",value:l.notifyOnAdd,onChange:J=>_("notifyOnAdd",J)}),i.jsx(s9,{icon:i.jsx(Q3,{size:14}),label:"Collection is shared",description:"Alert me when someone shares or accesses this collection.",value:l.notifyOnShare,onChange:J=>_("notifyOnShare",J)}),i.jsx(Qt,{text:"Notifications are sent to your account email. You can change preferences in Settings."})]})]})}function s6({value:e,onChange:t}){return i.jsx("button",{onClick:()=>t(!e),"aria-pressed":e,style:{width:"36px",height:"20px",borderRadius:"99px",border:"none",cursor:"pointer",flexShrink:0,background:e?"var(--primary)":"var(--border)",position:"relative",transition:"background .2s"},children:i.jsx("span",{style:{position:"absolute",top:"3px",left:e?"19px":"3px",width:"14px",height:"14px",borderRadius:"50%",background:"#fff",transition:"left .2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}})})}function s9({icon:e,label:t,description:r,value:n,onChange:o}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:"10px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"10px",flex:1},children:[i.jsx("span",{style:{color:n?"var(--primary)":"var(--muted)",marginTop:"2px",flexShrink:0},children:n?i.jsx(I6,{size:14}):i.jsx(iee,{size:14})}),i.jsxs("div",{children:[i.jsx("p",{style:{margin:0,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)"},children:t}),i.jsx("p",{style:{margin:"2px 0 0",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:r})]})]}),i.jsx(s6,{value:n,onChange:o})]})}var w0={exports:{}};/*!
|
||
* Quill Editor v1.3.7
|
||
* https://quilljs.com/
|
||
* Copyright (c) 2014, Jason Chen
|
||
* Copyright (c) 2013, salesforce.com
|
||
*/var wTe=w0.exports,l9;function STe(){return l9||(l9=1,(function(e,t){(function(n,o){e.exports=o()})(typeof self<"u"?self:wTe,function(){return(function(r){var n={};function o(a){if(n[a])return n[a].exports;var s=n[a]={i:a,l:!1,exports:{}};return r[a].call(s.exports,s,s.exports,o),s.l=!0,s.exports}return o.m=r,o.c=n,o.d=function(a,s,l){o.o(a,s)||Object.defineProperty(a,s,{configurable:!1,enumerable:!0,get:l})},o.n=function(a){var s=a&&a.__esModule?function(){return a.default}:function(){return a};return o.d(s,"a",s),s},o.o=function(a,s){return Object.prototype.hasOwnProperty.call(a,s)},o.p="",o(o.s=109)})([(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=o(17),s=o(18),l=o(19),c=o(45),u=o(46),d=o(47),f=o(48),h=o(49),p=o(12),y=o(32),m=o(33),x=o(31),b=o(1),w={Scope:b.Scope,create:b.create,find:b.find,query:b.query,register:b.register,Container:a.default,Format:s.default,Leaf:l.default,Embed:f.default,Scroll:c.default,Block:d.default,Inline:u.default,Text:h.default,Attributor:{Attribute:p.default,Class:y.default,Style:m.default,Store:x.default}};n.default=w}),(function(r,n,o){var a=this&&this.__extends||(function(){var x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,w){b.__proto__=w}||function(b,w){for(var k in w)w.hasOwnProperty(k)&&(b[k]=w[k])};return function(b,w){x(b,w);function k(){this.constructor=b}b.prototype=w===null?Object.create(w):(k.prototype=w.prototype,new k)}})();Object.defineProperty(n,"__esModule",{value:!0});var s=(function(x){a(b,x);function b(w){var k=this;return w="[Parchment] "+w,k=x.call(this,w)||this,k.message=w,k.name=k.constructor.name,k}return b})(Error);n.ParchmentError=s;var l={},c={},u={},d={};n.DATA_KEY="__blot";var f;(function(x){x[x.TYPE=3]="TYPE",x[x.LEVEL=12]="LEVEL",x[x.ATTRIBUTE=13]="ATTRIBUTE",x[x.BLOT=14]="BLOT",x[x.INLINE=7]="INLINE",x[x.BLOCK=11]="BLOCK",x[x.BLOCK_BLOT=10]="BLOCK_BLOT",x[x.INLINE_BLOT=6]="INLINE_BLOT",x[x.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",x[x.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",x[x.ANY=15]="ANY"})(f=n.Scope||(n.Scope={}));function h(x,b){var w=y(x);if(w==null)throw new s("Unable to create "+x+" blot");var k=w,S=x instanceof Node||x.nodeType===Node.TEXT_NODE?x:k.create(b);return new k(S,b)}n.create=h;function p(x,b){return b===void 0&&(b=!1),x==null?null:x[n.DATA_KEY]!=null?x[n.DATA_KEY].blot:b?p(x.parentNode,b):null}n.find=p;function y(x,b){b===void 0&&(b=f.ANY);var w;if(typeof x=="string")w=d[x]||l[x];else if(x instanceof Text||x.nodeType===Node.TEXT_NODE)w=d.text;else if(typeof x=="number")x&f.LEVEL&f.BLOCK?w=d.block:x&f.LEVEL&f.INLINE&&(w=d.inline);else if(x instanceof HTMLElement){var k=(x.getAttribute("class")||"").split(/\s+/);for(var S in k)if(w=c[k[S]],w)break;w=w||u[x.tagName]}return w==null?null:b&f.LEVEL&w.scope&&b&f.TYPE&w.scope?w:null}n.query=y;function m(){for(var x=[],b=0;b<arguments.length;b++)x[b]=arguments[b];if(x.length>1)return x.map(function(S){return m(S)});var w=x[0];if(typeof w.blotName!="string"&&typeof w.attrName!="string")throw new s("Invalid definition");if(w.blotName==="abstract")throw new s("Cannot register abstract class");if(d[w.blotName||w.attrName]=w,typeof w.keyName=="string")l[w.keyName]=w;else if(w.className!=null&&(c[w.className]=w),w.tagName!=null){Array.isArray(w.tagName)?w.tagName=w.tagName.map(function(S){return S.toUpperCase()}):w.tagName=w.tagName.toUpperCase();var k=Array.isArray(w.tagName)?w.tagName:[w.tagName];k.forEach(function(S){(u[S]==null||w.className==null)&&(u[S]=w)})}return w}n.register=m}),(function(r,n,o){var a=o(51),s=o(11),l=o(3),c=o(20),u="\0",d=function(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]};d.prototype.insert=function(f,h){var p={};return f.length===0?this:(p.insert=f,h!=null&&typeof h=="object"&&Object.keys(h).length>0&&(p.attributes=h),this.push(p))},d.prototype.delete=function(f){return f<=0?this:this.push({delete:f})},d.prototype.retain=function(f,h){if(f<=0)return this;var p={retain:f};return h!=null&&typeof h=="object"&&Object.keys(h).length>0&&(p.attributes=h),this.push(p)},d.prototype.push=function(f){var h=this.ops.length,p=this.ops[h-1];if(f=l(!0,{},f),typeof p=="object"){if(typeof f.delete=="number"&&typeof p.delete=="number")return this.ops[h-1]={delete:p.delete+f.delete},this;if(typeof p.delete=="number"&&f.insert!=null&&(h-=1,p=this.ops[h-1],typeof p!="object"))return this.ops.unshift(f),this;if(s(f.attributes,p.attributes)){if(typeof f.insert=="string"&&typeof p.insert=="string")return this.ops[h-1]={insert:p.insert+f.insert},typeof f.attributes=="object"&&(this.ops[h-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof p.retain=="number")return this.ops[h-1]={retain:p.retain+f.retain},typeof f.attributes=="object"&&(this.ops[h-1].attributes=f.attributes),this}}return h===this.ops.length?this.ops.push(f):this.ops.splice(h,0,f),this},d.prototype.chop=function(){var f=this.ops[this.ops.length-1];return f&&f.retain&&!f.attributes&&this.ops.pop(),this},d.prototype.filter=function(f){return this.ops.filter(f)},d.prototype.forEach=function(f){this.ops.forEach(f)},d.prototype.map=function(f){return this.ops.map(f)},d.prototype.partition=function(f){var h=[],p=[];return this.forEach(function(y){var m=f(y)?h:p;m.push(y)}),[h,p]},d.prototype.reduce=function(f,h){return this.ops.reduce(f,h)},d.prototype.changeLength=function(){return this.reduce(function(f,h){return h.insert?f+c.length(h):h.delete?f-h.delete:f},0)},d.prototype.length=function(){return this.reduce(function(f,h){return f+c.length(h)},0)},d.prototype.slice=function(f,h){f=f||0,typeof h!="number"&&(h=1/0);for(var p=[],y=c.iterator(this.ops),m=0;m<h&&y.hasNext();){var x;m<f?x=y.next(f-m):(x=y.next(h-m),p.push(x)),m+=c.length(x)}return new d(p)},d.prototype.compose=function(f){var h=c.iterator(this.ops),p=c.iterator(f.ops),y=[],m=p.peek();if(m!=null&&typeof m.retain=="number"&&m.attributes==null){for(var x=m.retain;h.peekType()==="insert"&&h.peekLength()<=x;)x-=h.peekLength(),y.push(h.next());m.retain-x>0&&p.next(m.retain-x)}for(var b=new d(y);h.hasNext()||p.hasNext();)if(p.peekType()==="insert")b.push(p.next());else if(h.peekType()==="delete")b.push(h.next());else{var w=Math.min(h.peekLength(),p.peekLength()),k=h.next(w),S=p.next(w);if(typeof S.retain=="number"){var _={};typeof k.retain=="number"?_.retain=w:_.insert=k.insert;var P=c.attributes.compose(k.attributes,S.attributes,typeof k.retain=="number");if(P&&(_.attributes=P),b.push(_),!p.hasNext()&&s(b.ops[b.ops.length-1],_)){var O=new d(h.rest());return b.concat(O).chop()}}else typeof S.delete=="number"&&typeof k.retain=="number"&&b.push(S)}return b.chop()},d.prototype.concat=function(f){var h=new d(this.ops.slice());return f.ops.length>0&&(h.push(f.ops[0]),h.ops=h.ops.concat(f.ops.slice(1))),h},d.prototype.diff=function(f,h){if(this.ops===f.ops)return new d;var p=[this,f].map(function(w){return w.map(function(k){if(k.insert!=null)return typeof k.insert=="string"?k.insert:u;var S=w===f?"on":"with";throw new Error("diff() called "+S+" non-document")}).join("")}),y=new d,m=a(p[0],p[1],h),x=c.iterator(this.ops),b=c.iterator(f.ops);return m.forEach(function(w){for(var k=w[1].length;k>0;){var S=0;switch(w[0]){case a.INSERT:S=Math.min(b.peekLength(),k),y.push(b.next(S));break;case a.DELETE:S=Math.min(k,x.peekLength()),x.next(S),y.delete(S);break;case a.EQUAL:S=Math.min(x.peekLength(),b.peekLength(),k);var _=x.next(S),P=b.next(S);s(_.insert,P.insert)?y.retain(S,c.attributes.diff(_.attributes,P.attributes)):y.push(P).delete(S);break}k-=S}}),y.chop()},d.prototype.eachLine=function(f,h){h=h||`
|
||
`;for(var p=c.iterator(this.ops),y=new d,m=0;p.hasNext();){if(p.peekType()!=="insert")return;var x=p.peek(),b=c.length(x)-p.peekLength(),w=typeof x.insert=="string"?x.insert.indexOf(h,b)-b:-1;if(w<0)y.push(p.next());else if(w>0)y.push(p.next(w));else{if(f(y,p.next(1).attributes||{},m)===!1)return;m+=1,y=new d}}y.length()>0&&f(y,{},m)},d.prototype.transform=function(f,h){if(h=!!h,typeof f=="number")return this.transformPosition(f,h);for(var p=c.iterator(this.ops),y=c.iterator(f.ops),m=new d;p.hasNext()||y.hasNext();)if(p.peekType()==="insert"&&(h||y.peekType()!=="insert"))m.retain(c.length(p.next()));else if(y.peekType()==="insert")m.push(y.next());else{var x=Math.min(p.peekLength(),y.peekLength()),b=p.next(x),w=y.next(x);if(b.delete)continue;w.delete?m.push(w):m.retain(x,c.attributes.transform(b.attributes,w.attributes,h))}return m.chop()},d.prototype.transformPosition=function(f,h){h=!!h;for(var p=c.iterator(this.ops),y=0;p.hasNext()&&y<=f;){var m=p.peekLength(),x=p.peekType();if(p.next(),x==="delete"){f-=Math.min(m,f-y);continue}else x==="insert"&&(y<f||!h)&&(f+=m);y+=m}return f},r.exports=d}),(function(r,n){var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=function(p){return typeof Array.isArray=="function"?Array.isArray(p):a.call(p)==="[object Array]"},u=function(p){if(!p||a.call(p)!=="[object Object]")return!1;var y=o.call(p,"constructor"),m=p.constructor&&p.constructor.prototype&&o.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!y&&!m)return!1;var x;for(x in p);return typeof x>"u"||o.call(p,x)},d=function(p,y){s&&y.name==="__proto__"?s(p,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):p[y.name]=y.newValue},f=function(p,y){if(y==="__proto__")if(o.call(p,y)){if(l)return l(p,y).value}else return;return p[y]};r.exports=function h(){var p,y,m,x,b,w,k=arguments[0],S=1,_=arguments.length,P=!1;for(typeof k=="boolean"&&(P=k,k=arguments[1]||{},S=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});S<_;++S)if(p=arguments[S],p!=null)for(y in p)m=f(k,y),x=f(p,y),k!==x&&(P&&x&&(u(x)||(b=c(x)))?(b?(b=!1,w=m&&c(m)?m:[]):w=m&&u(m)?m:{},d(k,{name:y,newValue:h(P,w,x)})):typeof x<"u"&&d(k,{name:y,newValue:x}));return k}}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BlockEmbed=n.bubbleFormats=void 0;var a=(function(){function E(A,F){for(var L=0;L<F.length;L++){var z=F[L];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(A,z.key,z)}}return function(A,F,L){return F&&E(A.prototype,F),L&&E(A,L),A}})(),s=function E(A,F,L){A===null&&(A=Function.prototype);var z=Object.getOwnPropertyDescriptor(A,F);if(z===void 0){var V=Object.getPrototypeOf(A);return V===null?void 0:E(V,F,L)}else{if("value"in z)return z.value;var Q=z.get;return Q===void 0?void 0:Q.call(L)}},l=o(3),c=k(l),u=o(2),d=k(u),f=o(0),h=k(f),p=o(16),y=k(p),m=o(6),x=k(m),b=o(7),w=k(b);function k(E){return E&&E.__esModule?E:{default:E}}function S(E,A){if(!(E instanceof A))throw new TypeError("Cannot call a class as a function")}function _(E,A){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:E}function P(E,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);E.prototype=Object.create(A&&A.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(E,A):E.__proto__=A)}var O=1,T=(function(E){P(A,E);function A(){return S(this,A),_(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}return a(A,[{key:"attach",value:function(){s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"attach",this).call(this),this.attributes=new h.default.Attributor.Store(this.domNode)}},{key:"delta",value:function(){return new d.default().insert(this.value(),(0,c.default)(this.formats(),this.attributes.values()))}},{key:"format",value:function(L,z){var V=h.default.query(L,h.default.Scope.BLOCK_ATTRIBUTE);V!=null&&this.attributes.attribute(V,z)}},{key:"formatAt",value:function(L,z,V,Q){this.format(V,Q)}},{key:"insertAt",value:function(L,z,V){if(typeof z=="string"&&z.endsWith(`
|
||
`)){var Q=h.default.create(R.blotName);this.parent.insertBefore(Q,L===0?this:this.next),Q.insertAt(0,z.slice(0,-1))}else s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertAt",this).call(this,L,z,V)}}]),A})(h.default.Embed);T.scope=h.default.Scope.BLOCK_BLOT;var R=(function(E){P(A,E);function A(F){S(this,A);var L=_(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,F));return L.cache={},L}return a(A,[{key:"delta",value:function(){return this.cache.delta==null&&(this.cache.delta=this.descendants(h.default.Leaf).reduce(function(L,z){return z.length()===0?L:L.insert(z.value(),I(z))},new d.default).insert(`
|
||
`,I(this))),this.cache.delta}},{key:"deleteAt",value:function(L,z){s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"deleteAt",this).call(this,L,z),this.cache={}}},{key:"formatAt",value:function(L,z,V,Q){z<=0||(h.default.query(V,h.default.Scope.BLOCK)?L+z===this.length()&&this.format(V,Q):s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"formatAt",this).call(this,L,Math.min(z,this.length()-L-1),V,Q),this.cache={})}},{key:"insertAt",value:function(L,z,V){if(V!=null)return s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertAt",this).call(this,L,z,V);if(z.length!==0){var Q=z.split(`
|
||
`),U=Q.shift();U.length>0&&(L<this.length()-1||this.children.tail==null?s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertAt",this).call(this,Math.min(L,this.length()-1),U):this.children.tail.insertAt(this.children.tail.length(),U),this.cache={});var ee=this;Q.reduce(function(H,B){return ee=ee.split(H,!0),ee.insertAt(0,B),B.length},L+U.length)}}},{key:"insertBefore",value:function(L,z){var V=this.children.head;s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"insertBefore",this).call(this,L,z),V instanceof y.default&&V.remove(),this.cache={}}},{key:"length",value:function(){return this.cache.length==null&&(this.cache.length=s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"length",this).call(this)+O),this.cache.length}},{key:"moveChildren",value:function(L,z){s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"moveChildren",this).call(this,L,z),this.cache={}}},{key:"optimize",value:function(L){s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"optimize",this).call(this,L),this.cache={}}},{key:"path",value:function(L){return s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"path",this).call(this,L,!0)}},{key:"removeChild",value:function(L){s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"removeChild",this).call(this,L),this.cache={}}},{key:"split",value:function(L){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(z&&(L===0||L>=this.length()-O)){var V=this.clone();return L===0?(this.parent.insertBefore(V,this),this):(this.parent.insertBefore(V,this.next),V)}else{var Q=s(A.prototype.__proto__||Object.getPrototypeOf(A.prototype),"split",this).call(this,L,z);return this.cache={},Q}}}]),A})(h.default.Block);R.blotName="block",R.tagName="P",R.defaultChild="break",R.allowedChildren=[x.default,h.default.Embed,w.default];function I(E){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E==null||(typeof E.formats=="function"&&(A=(0,c.default)(A,E.formats())),E.parent==null||E.parent.blotName=="scroll"||E.parent.statics.scope!==E.statics.scope)?A:I(E.parent,A)}n.bubbleFormats=I,n.BlockEmbed=T,n.default=R}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.overload=n.expandConfig=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ee){return typeof ee}:function(ee){return ee&&typeof Symbol=="function"&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},s=(function(){function ee(H,B){var M=[],$=!0,q=!1,Y=void 0;try{for(var K=H[Symbol.iterator](),G;!($=(G=K.next()).done)&&(M.push(G.value),!(B&&M.length===B));$=!0);}catch(re){q=!0,Y=re}finally{try{!$&&K.return&&K.return()}finally{if(q)throw Y}}return M}return function(H,B){if(Array.isArray(H))return H;if(Symbol.iterator in Object(H))return ee(H,B);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),l=(function(){function ee(H,B){for(var M=0;M<B.length;M++){var $=B[M];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(H,$.key,$)}}return function(H,B,M){return B&&ee(H.prototype,B),M&&ee(H,M),H}})();o(50);var c=o(2),u=I(c),d=o(14),f=I(d),h=o(8),p=I(h),y=o(9),m=I(y),x=o(0),b=I(x),w=o(15),k=I(w),S=o(3),_=I(S),P=o(10),O=I(P),T=o(34),R=I(T);function I(ee){return ee&&ee.__esModule?ee:{default:ee}}function E(ee,H,B){return H in ee?Object.defineProperty(ee,H,{value:B,enumerable:!0,configurable:!0,writable:!0}):ee[H]=B,ee}function A(ee,H){if(!(ee instanceof H))throw new TypeError("Cannot call a class as a function")}var F=(0,O.default)("quill"),L=(function(){l(ee,null,[{key:"debug",value:function(B){B===!0&&(B="log"),O.default.level(B)}},{key:"find",value:function(B){return B.__quill||b.default.find(B)}},{key:"import",value:function(B){return this.imports[B]==null&&F.error("Cannot import "+B+". Are you sure it was registered?"),this.imports[B]}},{key:"register",value:function(B,M){var $=this,q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof B!="string"){var Y=B.attrName||B.blotName;typeof Y=="string"?this.register("formats/"+Y,B,M):Object.keys(B).forEach(function(K){$.register(K,B[K],M)})}else this.imports[B]!=null&&!q&&F.warn("Overwriting "+B+" with",M),this.imports[B]=M,(B.startsWith("blots/")||B.startsWith("formats/"))&&M.blotName!=="abstract"?b.default.register(M):B.startsWith("modules")&&typeof M.register=="function"&&M.register()}}]);function ee(H){var B=this,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(A(this,ee),this.options=z(H,M),this.container=this.options.container,this.container==null)return F.error("Invalid Quill container",H);this.options.debug&&ee.debug(this.options.debug);var $=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new p.default,this.scroll=b.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new f.default(this.scroll),this.selection=new k.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(p.default.events.EDITOR_CHANGE,function(Y){Y===p.default.events.TEXT_CHANGE&&B.root.classList.toggle("ql-blank",B.editor.isBlank())}),this.emitter.on(p.default.events.SCROLL_UPDATE,function(Y,K){var G=B.selection.lastRange,re=G&&G.length===0?G.index:void 0;V.call(B,function(){return B.editor.update(null,K,re)},Y)});var q=this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">`+$+"<p><br></p></div>");this.setContents(q),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return l(ee,[{key:"addContainer",value:function(B){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof B=="string"){var $=B;B=document.createElement("div"),B.classList.add($)}return this.container.insertBefore(B,M),B}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(B,M,$){var q=this,Y=Q(B,M,$),K=s(Y,4);return B=K[0],M=K[1],$=K[3],V.call(this,function(){return q.editor.deleteText(B,M)},$,B,-1*M)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(B),this.container.classList.toggle("ql-disabled",!B)}},{key:"focus",value:function(){var B=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=B,this.scrollIntoView()}},{key:"format",value:function(B,M){var $=this,q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p.default.sources.API;return V.call(this,function(){var Y=$.getSelection(!0),K=new u.default;if(Y==null)return K;if(b.default.query(B,b.default.Scope.BLOCK))K=$.editor.formatLine(Y.index,Y.length,E({},B,M));else{if(Y.length===0)return $.selection.format(B,M),K;K=$.editor.formatText(Y.index,Y.length,E({},B,M))}return $.setSelection(Y,p.default.sources.SILENT),K},q)}},{key:"formatLine",value:function(B,M,$,q,Y){var K=this,G=void 0,re=Q(B,M,$,q,Y),J=s(re,4);return B=J[0],M=J[1],G=J[2],Y=J[3],V.call(this,function(){return K.editor.formatLine(B,M,G)},Y,B,0)}},{key:"formatText",value:function(B,M,$,q,Y){var K=this,G=void 0,re=Q(B,M,$,q,Y),J=s(re,4);return B=J[0],M=J[1],G=J[2],Y=J[3],V.call(this,function(){return K.editor.formatText(B,M,G)},Y,B,0)}},{key:"getBounds",value:function(B){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,$=void 0;typeof B=="number"?$=this.selection.getBounds(B,M):$=this.selection.getBounds(B.index,B.length);var q=this.container.getBoundingClientRect();return{bottom:$.bottom-q.top,height:$.height,left:$.left-q.left,right:$.right-q.left,top:$.top-q.top,width:$.width}}},{key:"getContents",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-B,$=Q(B,M),q=s($,2);return B=q[0],M=q[1],this.editor.getContents(B,M)}},{key:"getFormat",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof B=="number"?this.editor.getFormat(B,M):this.editor.getFormat(B.index,B.length)}},{key:"getIndex",value:function(B){return B.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(B){return this.scroll.leaf(B)}},{key:"getLine",value:function(B){return this.scroll.line(B)}},{key:"getLines",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof B!="number"?this.scroll.lines(B.index,B.length):this.scroll.lines(B,M)}},{key:"getModule",value:function(B){return this.theme.modules[B]}},{key:"getSelection",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return B&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-B,$=Q(B,M),q=s($,2);return B=q[0],M=q[1],this.editor.getText(B,M)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(B,M,$){var q=this,Y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ee.sources.API;return V.call(this,function(){return q.editor.insertEmbed(B,M,$)},Y,B)}},{key:"insertText",value:function(B,M,$,q,Y){var K=this,G=void 0,re=Q(B,0,$,q,Y),J=s(re,4);return B=J[0],G=J[2],Y=J[3],V.call(this,function(){return K.editor.insertText(B,M,G)},Y,B,M.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(B,M,$){this.clipboard.dangerouslyPasteHTML(B,M,$)}},{key:"removeFormat",value:function(B,M,$){var q=this,Y=Q(B,M,$),K=s(Y,4);return B=K[0],M=K[1],$=K[3],V.call(this,function(){return q.editor.removeFormat(B,M)},$,B)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(B){var M=this,$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return V.call(this,function(){B=new u.default(B);var q=M.getLength(),Y=M.editor.deleteText(0,q),K=M.editor.applyDelta(B),G=K.ops[K.ops.length-1];G!=null&&typeof G.insert=="string"&&G.insert[G.insert.length-1]===`
|
||
`&&(M.editor.deleteText(M.getLength()-1,1),K.delete(1));var re=Y.compose(K);return re},$)}},{key:"setSelection",value:function(B,M,$){if(B==null)this.selection.setRange(null,M||ee.sources.API);else{var q=Q(B,M,$),Y=s(q,4);B=Y[0],M=Y[1],$=Y[3],this.selection.setRange(new w.Range(B,M),$),$!==p.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(B){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API,$=new u.default().insert(B);return this.setContents($,M)}},{key:"update",value:function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p.default.sources.USER,M=this.scroll.update(B);return this.selection.update(B),M}},{key:"updateContents",value:function(B){var M=this,$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p.default.sources.API;return V.call(this,function(){return B=new u.default(B),M.editor.applyDelta(B,$)},$,!0)}}]),ee})();L.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},L.events=p.default.events,L.sources=p.default.sources,L.version="1.3.7",L.imports={delta:u.default,parchment:b.default,"core/module":m.default,"core/theme":R.default};function z(ee,H){if(H=(0,_.default)(!0,{container:ee,modules:{clipboard:!0,keyboard:!0,history:!0}},H),!H.theme||H.theme===L.DEFAULTS.theme)H.theme=R.default;else if(H.theme=L.import("themes/"+H.theme),H.theme==null)throw new Error("Invalid theme "+H.theme+". Did you register it?");var B=(0,_.default)(!0,{},H.theme.DEFAULTS);[B,H].forEach(function(q){q.modules=q.modules||{},Object.keys(q.modules).forEach(function(Y){q.modules[Y]===!0&&(q.modules[Y]={})})});var M=Object.keys(B.modules).concat(Object.keys(H.modules)),$=M.reduce(function(q,Y){var K=L.import("modules/"+Y);return K==null?F.error("Cannot load "+Y+" module. Are you sure you registered it?"):q[Y]=K.DEFAULTS||{},q},{});return H.modules!=null&&H.modules.toolbar&&H.modules.toolbar.constructor!==Object&&(H.modules.toolbar={container:H.modules.toolbar}),H=(0,_.default)(!0,{},L.DEFAULTS,{modules:$},B,H),["bounds","container","scrollingContainer"].forEach(function(q){typeof H[q]=="string"&&(H[q]=document.querySelector(H[q]))}),H.modules=Object.keys(H.modules).reduce(function(q,Y){return H.modules[Y]&&(q[Y]=H.modules[Y]),q},{}),H}function V(ee,H,B,M){if(this.options.strict&&!this.isEnabled()&&H===p.default.sources.USER)return new u.default;var $=B==null?null:this.getSelection(),q=this.editor.delta,Y=ee();if($!=null&&(B===!0&&(B=$.index),M==null?$=U($,Y,H):M!==0&&($=U($,B,M,H)),this.setSelection($,p.default.sources.SILENT)),Y.length()>0){var K,G=[p.default.events.TEXT_CHANGE,Y,q,H];if((K=this.emitter).emit.apply(K,[p.default.events.EDITOR_CHANGE].concat(G)),H!==p.default.sources.SILENT){var re;(re=this.emitter).emit.apply(re,G)}}return Y}function Q(ee,H,B,M,$){var q={};return typeof ee.index=="number"&&typeof ee.length=="number"?typeof H!="number"?($=M,M=B,B=H,H=ee.length,ee=ee.index):(H=ee.length,ee=ee.index):typeof H!="number"&&($=M,M=B,B=H,H=0),(typeof B>"u"?"undefined":a(B))==="object"?(q=B,$=M):typeof B=="string"&&(M!=null?q[B]=M:$=B),$=$||p.default.sources.API,[ee,H,q,$]}function U(ee,H,B,M){if(ee==null)return null;var $=void 0,q=void 0;if(H instanceof u.default){var Y=[ee.index,ee.index+ee.length].map(function(J){return H.transformPosition(J,M!==p.default.sources.USER)}),K=s(Y,2);$=K[0],q=K[1]}else{var G=[ee.index,ee.index+ee.length].map(function(J){return J<H||J===H&&M===p.default.sources.USER?J:B>=0?J+B:Math.max(H,J+B)}),re=s(G,2);$=re[0],q=re[1]}return new w.Range($,q-$)}n.expandConfig=z,n.overload=Q,n.default=L}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function x(b,w){for(var k=0;k<w.length;k++){var S=w[k];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,w,k){return w&&x(b.prototype,w),k&&x(b,k),b}})(),s=function x(b,w,k){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,w);if(S===void 0){var _=Object.getPrototypeOf(b);return _===null?void 0:x(_,w,k)}else{if("value"in S)return S.value;var P=S.get;return P===void 0?void 0:P.call(k)}},l=o(7),c=f(l),u=o(0),d=f(u);function f(x){return x&&x.__esModule?x:{default:x}}function h(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function p(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function y(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var m=(function(x){y(b,x);function b(){return h(this,b),p(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"formatAt",value:function(k,S,_,P){if(b.compare(this.statics.blotName,_)<0&&d.default.query(_,d.default.Scope.BLOT)){var O=this.isolate(k,S);P&&O.wrap(_,P)}else s(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"formatAt",this).call(this,k,S,_,P)}},{key:"optimize",value:function(k){if(s(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"optimize",this).call(this,k),this.parent instanceof b&&b.compare(this.statics.blotName,this.parent.statics.blotName)>0){var S=this.parent.isolate(this.offset(),this.length());this.moveChildren(S),S.wrap(this)}}}],[{key:"compare",value:function(k,S){var _=b.order.indexOf(k),P=b.order.indexOf(S);return _>=0||P>=0?_-P:k===S?0:k<S?-1:1}}]),b})(d.default.Inline);m.allowedChildren=[m,d.default.Embed,c.default],m.order=["cursor","inline","underline","strike","italic","bold","script","link","code"],n.default=m}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=o(0),s=l(a);function l(h){return h&&h.__esModule?h:{default:h}}function c(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function u(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function d(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var f=(function(h){d(p,h);function p(){return c(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(s.default.Text);n.default=f}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function w(k,S){for(var _=0;_<S.length;_++){var P=S[_];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(k,P.key,P)}}return function(k,S,_){return S&&w(k.prototype,S),_&&w(k,_),k}})(),s=function w(k,S,_){k===null&&(k=Function.prototype);var P=Object.getOwnPropertyDescriptor(k,S);if(P===void 0){var O=Object.getPrototypeOf(k);return O===null?void 0:w(O,S,_)}else{if("value"in P)return P.value;var T=P.get;return T===void 0?void 0:T.call(_)}},l=o(54),c=f(l),u=o(10),d=f(u);function f(w){return w&&w.__esModule?w:{default:w}}function h(w,k){if(!(w instanceof k))throw new TypeError("Cannot call a class as a function")}function p(w,k){if(!w)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:w}function y(w,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);w.prototype=Object.create(k&&k.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(w,k):w.__proto__=k)}var m=(0,d.default)("quill:events"),x=["selectionchange","mousedown","mouseup","click"];x.forEach(function(w){document.addEventListener(w,function(){for(var k=arguments.length,S=Array(k),_=0;_<k;_++)S[_]=arguments[_];[].slice.call(document.querySelectorAll(".ql-container")).forEach(function(P){if(P.__quill&&P.__quill.emitter){var O;(O=P.__quill.emitter).handleDOM.apply(O,S)}})})});var b=(function(w){y(k,w);function k(){h(this,k);var S=p(this,(k.__proto__||Object.getPrototypeOf(k)).call(this));return S.listeners={},S.on("error",m.error),S}return a(k,[{key:"emit",value:function(){m.log.apply(m,arguments),s(k.prototype.__proto__||Object.getPrototypeOf(k.prototype),"emit",this).apply(this,arguments)}},{key:"handleDOM",value:function(_){for(var P=arguments.length,O=Array(P>1?P-1:0),T=1;T<P;T++)O[T-1]=arguments[T];(this.listeners[_.type]||[]).forEach(function(R){var I=R.node,E=R.handler;(_.target===I||I.contains(_.target))&&E.apply(void 0,[_].concat(O))})}},{key:"listenDOM",value:function(_,P,O){this.listeners[_]||(this.listeners[_]=[]),this.listeners[_].push({node:P,handler:O})}}]),k})(c.default);b.events={EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change"},b.sources={API:"api",SILENT:"silent",USER:"user"},n.default=b}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});function a(l,c){if(!(l instanceof c))throw new TypeError("Cannot call a class as a function")}var s=function l(c){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};a(this,l),this.quill=c,this.options=u};s.DEFAULTS={},n.default=s}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=["error","warn","log","info"],s="warn";function l(u){if(a.indexOf(u)<=a.indexOf(s)){for(var d,f=arguments.length,h=Array(f>1?f-1:0),p=1;p<f;p++)h[p-1]=arguments[p];(d=console)[u].apply(d,h)}}function c(u){return a.reduce(function(d,f){return d[f]=l.bind(console,f,u),d},{})}l.level=c.level=function(u){s=u},n.default=c}),(function(r,n,o){var a=Array.prototype.slice,s=o(52),l=o(53),c=r.exports=function(h,p,y){return y||(y={}),h===p?!0:h instanceof Date&&p instanceof Date?h.getTime()===p.getTime():!h||!p||typeof h!="object"&&typeof p!="object"?y.strict?h===p:h==p:f(h,p,y)};function u(h){return h==null}function d(h){return!(!h||typeof h!="object"||typeof h.length!="number"||typeof h.copy!="function"||typeof h.slice!="function"||h.length>0&&typeof h[0]!="number")}function f(h,p,y){var m,x;if(u(h)||u(p)||h.prototype!==p.prototype)return!1;if(l(h))return l(p)?(h=a.call(h),p=a.call(p),c(h,p,y)):!1;if(d(h)){if(!d(p)||h.length!==p.length)return!1;for(m=0;m<h.length;m++)if(h[m]!==p[m])return!1;return!0}try{var b=s(h),w=s(p)}catch{return!1}if(b.length!=w.length)return!1;for(b.sort(),w.sort(),m=b.length-1;m>=0;m--)if(b[m]!=w[m])return!1;for(m=b.length-1;m>=0;m--)if(x=b[m],!c(h[x],p[x],y))return!1;return typeof h==typeof p}}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=o(1),s=(function(){function l(c,u,d){d===void 0&&(d={}),this.attrName=c,this.keyName=u;var f=a.Scope.TYPE&a.Scope.ATTRIBUTE;d.scope!=null?this.scope=d.scope&a.Scope.LEVEL|f:this.scope=a.Scope.ATTRIBUTE,d.whitelist!=null&&(this.whitelist=d.whitelist)}return l.keys=function(c){return[].map.call(c.attributes,function(u){return u.name})},l.prototype.add=function(c,u){return this.canAdd(c,u)?(c.setAttribute(this.keyName,u),!0):!1},l.prototype.canAdd=function(c,u){var d=a.query(c,a.Scope.BLOT&(this.scope|a.Scope.TYPE));return d==null?!1:this.whitelist==null?!0:typeof u=="string"?this.whitelist.indexOf(u.replace(/["']/g,""))>-1:this.whitelist.indexOf(u)>-1},l.prototype.remove=function(c){c.removeAttribute(this.keyName)},l.prototype.value=function(c){var u=c.getAttribute(this.keyName);return this.canAdd(c,u)&&u?u:""},l})();n.default=s}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Code=void 0;var a=(function(){function T(R,I){var E=[],A=!0,F=!1,L=void 0;try{for(var z=R[Symbol.iterator](),V;!(A=(V=z.next()).done)&&(E.push(V.value),!(I&&E.length===I));A=!0);}catch(Q){F=!0,L=Q}finally{try{!A&&z.return&&z.return()}finally{if(F)throw L}}return E}return function(R,I){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return T(R,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),s=(function(){function T(R,I){for(var E=0;E<I.length;E++){var A=I[E];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(R,A.key,A)}}return function(R,I,E){return I&&T(R.prototype,I),E&&T(R,E),R}})(),l=function T(R,I,E){R===null&&(R=Function.prototype);var A=Object.getOwnPropertyDescriptor(R,I);if(A===void 0){var F=Object.getPrototypeOf(R);return F===null?void 0:T(F,I,E)}else{if("value"in A)return A.value;var L=A.get;return L===void 0?void 0:L.call(E)}},c=o(2),u=w(c),d=o(0),f=w(d),h=o(4),p=w(h),y=o(6),m=w(y),x=o(7),b=w(x);function w(T){return T&&T.__esModule?T:{default:T}}function k(T,R){if(!(T instanceof R))throw new TypeError("Cannot call a class as a function")}function S(T,R){if(!T)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R&&(typeof R=="object"||typeof R=="function")?R:T}function _(T,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof R);T.prototype=Object.create(R&&R.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),R&&(Object.setPrototypeOf?Object.setPrototypeOf(T,R):T.__proto__=R)}var P=(function(T){_(R,T);function R(){return k(this,R),S(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return R})(m.default);P.blotName="code",P.tagName="CODE";var O=(function(T){_(R,T);function R(){return k(this,R),S(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}return s(R,[{key:"delta",value:function(){var E=this,A=this.domNode.textContent;return A.endsWith(`
|
||
`)&&(A=A.slice(0,-1)),A.split(`
|
||
`).reduce(function(F,L){return F.insert(L).insert(`
|
||
`,E.formats())},new u.default)}},{key:"format",value:function(E,A){if(!(E===this.statics.blotName&&A)){var F=this.descendant(b.default,this.length()-1),L=a(F,1),z=L[0];z!=null&&z.deleteAt(z.length()-1,1),l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"format",this).call(this,E,A)}}},{key:"formatAt",value:function(E,A,F,L){if(A!==0&&!(f.default.query(F,f.default.Scope.BLOCK)==null||F===this.statics.blotName&&L===this.statics.formats(this.domNode))){var z=this.newlineIndex(E);if(!(z<0||z>=E+A)){var V=this.newlineIndex(E,!0)+1,Q=z-V+1,U=this.isolate(V,Q),ee=U.next;U.format(F,L),ee instanceof R&&ee.formatAt(0,E-V+A-Q,F,L)}}}},{key:"insertAt",value:function(E,A,F){if(F==null){var L=this.descendant(b.default,E),z=a(L,2),V=z[0],Q=z[1];V.insertAt(Q,A)}}},{key:"length",value:function(){var E=this.domNode.textContent.length;return this.domNode.textContent.endsWith(`
|
||
`)?E:E+1}},{key:"newlineIndex",value:function(E){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(A)return this.domNode.textContent.slice(0,E).lastIndexOf(`
|
||
`);var F=this.domNode.textContent.slice(E).indexOf(`
|
||
`);return F>-1?E+F:-1}},{key:"optimize",value:function(E){this.domNode.textContent.endsWith(`
|
||
`)||this.appendChild(f.default.create("text",`
|
||
`)),l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"optimize",this).call(this,E);var A=this.next;A!=null&&A.prev===this&&A.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===A.statics.formats(A.domNode)&&(A.optimize(E),A.moveChildren(this),A.remove())}},{key:"replace",value:function(E){l(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"replace",this).call(this,E),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(A){var F=f.default.find(A);F==null?A.parentNode.removeChild(A):F instanceof f.default.Embed?F.remove():F.unwrap()})}}],[{key:"create",value:function(E){var A=l(R.__proto__||Object.getPrototypeOf(R),"create",this).call(this,E);return A.setAttribute("spellcheck",!1),A}},{key:"formats",value:function(){return!0}}]),R})(p.default);O.blotName="code-block",O.tagName="PRE",O.TAB=" ",n.Code=P,n.default=O}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ee){return typeof ee}:function(ee){return ee&&typeof Symbol=="function"&&ee.constructor===Symbol&&ee!==Symbol.prototype?"symbol":typeof ee},s=(function(){function ee(H,B){var M=[],$=!0,q=!1,Y=void 0;try{for(var K=H[Symbol.iterator](),G;!($=(G=K.next()).done)&&(M.push(G.value),!(B&&M.length===B));$=!0);}catch(re){q=!0,Y=re}finally{try{!$&&K.return&&K.return()}finally{if(q)throw Y}}return M}return function(H,B){if(Array.isArray(H))return H;if(Symbol.iterator in Object(H))return ee(H,B);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),l=(function(){function ee(H,B){for(var M=0;M<B.length;M++){var $=B[M];$.enumerable=$.enumerable||!1,$.configurable=!0,"value"in $&&($.writable=!0),Object.defineProperty(H,$.key,$)}}return function(H,B,M){return B&&ee(H.prototype,B),M&&ee(H,M),H}})(),c=o(2),u=A(c),d=o(20),f=A(d),h=o(0),p=A(h),y=o(13),m=A(y),x=o(24),b=A(x),w=o(4),k=A(w),S=o(16),_=A(S),P=o(21),O=A(P),T=o(11),R=A(T),I=o(3),E=A(I);function A(ee){return ee&&ee.__esModule?ee:{default:ee}}function F(ee,H,B){return H in ee?Object.defineProperty(ee,H,{value:B,enumerable:!0,configurable:!0,writable:!0}):ee[H]=B,ee}function L(ee,H){if(!(ee instanceof H))throw new TypeError("Cannot call a class as a function")}var z=/^[ -~]*$/,V=(function(){function ee(H){L(this,ee),this.scroll=H,this.delta=this.getDelta()}return l(ee,[{key:"applyDelta",value:function(B){var M=this,$=!1;this.scroll.update();var q=this.scroll.length();return this.scroll.batchStart(),B=U(B),B.reduce(function(Y,K){var G=K.retain||K.delete||K.insert.length||1,re=K.attributes||{};if(K.insert!=null){if(typeof K.insert=="string"){var J=K.insert;J.endsWith(`
|
||
`)&&$&&($=!1,J=J.slice(0,-1)),Y>=q&&!J.endsWith(`
|
||
`)&&($=!0),M.scroll.insertAt(Y,J);var ae=M.scroll.line(Y),le=s(ae,2),me=le[0],Oe=le[1],we=(0,E.default)({},(0,w.bubbleFormats)(me));if(me instanceof k.default){var ie=me.descendant(p.default.Leaf,Oe),Me=s(ie,1),ke=Me[0];we=(0,E.default)(we,(0,w.bubbleFormats)(ke))}re=f.default.attributes.diff(we,re)||{}}else if(a(K.insert)==="object"){var se=Object.keys(K.insert)[0];if(se==null)return Y;M.scroll.insertAt(Y,se,K.insert[se])}q+=G}return Object.keys(re).forEach(function(fe){M.scroll.formatAt(Y,G,fe,re[fe])}),Y+G},0),B.reduce(function(Y,K){return typeof K.delete=="number"?(M.scroll.deleteAt(Y,K.delete),Y):Y+(K.retain||K.insert.length||1)},0),this.scroll.batchEnd(),this.update(B)}},{key:"deleteText",value:function(B,M){return this.scroll.deleteAt(B,M),this.update(new u.default().retain(B).delete(M))}},{key:"formatLine",value:function(B,M){var $=this,q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.scroll.update(),Object.keys(q).forEach(function(Y){if(!($.scroll.whitelist!=null&&!$.scroll.whitelist[Y])){var K=$.scroll.lines(B,Math.max(M,1)),G=M;K.forEach(function(re){var J=re.length();if(!(re instanceof m.default))re.format(Y,q[Y]);else{var ae=B-re.offset($.scroll),le=re.newlineIndex(ae+G)-ae+1;re.formatAt(ae,le,Y,q[Y])}G-=J})}}),this.scroll.optimize(),this.update(new u.default().retain(B).retain(M,(0,O.default)(q)))}},{key:"formatText",value:function(B,M){var $=this,q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Object.keys(q).forEach(function(Y){$.scroll.formatAt(B,M,Y,q[Y])}),this.update(new u.default().retain(B).retain(M,(0,O.default)(q)))}},{key:"getContents",value:function(B,M){return this.delta.slice(B,B+M)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(B,M){return B.concat(M.delta())},new u.default)}},{key:"getFormat",value:function(B){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,$=[],q=[];M===0?this.scroll.path(B).forEach(function(K){var G=s(K,1),re=G[0];re instanceof k.default?$.push(re):re instanceof p.default.Leaf&&q.push(re)}):($=this.scroll.lines(B,M),q=this.scroll.descendants(p.default.Leaf,B,M));var Y=[$,q].map(function(K){if(K.length===0)return{};for(var G=(0,w.bubbleFormats)(K.shift());Object.keys(G).length>0;){var re=K.shift();if(re==null)return G;G=Q((0,w.bubbleFormats)(re),G)}return G});return E.default.apply(E.default,Y)}},{key:"getText",value:function(B,M){return this.getContents(B,M).filter(function($){return typeof $.insert=="string"}).map(function($){return $.insert}).join("")}},{key:"insertEmbed",value:function(B,M,$){return this.scroll.insertAt(B,M,$),this.update(new u.default().retain(B).insert(F({},M,$)))}},{key:"insertText",value:function(B,M){var $=this,q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return M=M.replace(/\r\n/g,`
|
||
`).replace(/\r/g,`
|
||
`),this.scroll.insertAt(B,M),Object.keys(q).forEach(function(Y){$.scroll.formatAt(B,M.length,Y,q[Y])}),this.update(new u.default().retain(B).insert(M,(0,O.default)(q)))}},{key:"isBlank",value:function(){if(this.scroll.children.length==0)return!0;if(this.scroll.children.length>1)return!1;var B=this.scroll.children.head;return B.statics.blotName!==k.default.blotName||B.children.length>1?!1:B.children.head instanceof _.default}},{key:"removeFormat",value:function(B,M){var $=this.getText(B,M),q=this.scroll.line(B+M),Y=s(q,2),K=Y[0],G=Y[1],re=0,J=new u.default;K!=null&&(K instanceof m.default?re=K.newlineIndex(G)-G+1:re=K.length()-G,J=K.delta().slice(G,G+re-1).insert(`
|
||
`));var ae=this.getContents(B,M+re),le=ae.diff(new u.default().insert($).concat(J)),me=new u.default().retain(B).concat(le);return this.applyDelta(me)}},{key:"update",value:function(B){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],$=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,q=this.delta;if(M.length===1&&M[0].type==="characterData"&&M[0].target.data.match(z)&&p.default.find(M[0].target)){var Y=p.default.find(M[0].target),K=(0,w.bubbleFormats)(Y),G=Y.offset(this.scroll),re=M[0].oldValue.replace(b.default.CONTENTS,""),J=new u.default().insert(re),ae=new u.default().insert(Y.value()),le=new u.default().retain(G).concat(J.diff(ae,$));B=le.reduce(function(me,Oe){return Oe.insert?me.insert(Oe.insert,K):me.push(Oe)},new u.default),this.delta=q.compose(B)}else this.delta=this.getDelta(),(!B||!(0,R.default)(q.compose(B),this.delta))&&(B=q.diff(this.delta,$));return B}}]),ee})();function Q(ee,H){return Object.keys(H).reduce(function(B,M){return ee[M]==null||(H[M]===ee[M]?B[M]=H[M]:Array.isArray(H[M])?H[M].indexOf(ee[M])<0&&(B[M]=H[M].concat([ee[M]])):B[M]=[H[M],ee[M]]),B},{})}function U(ee){return ee.reduce(function(H,B){if(B.insert===1){var M=(0,O.default)(B.attributes);return delete M.image,H.insert({image:B.attributes.image},M)}if(B.attributes!=null&&(B.attributes.list===!0||B.attributes.bullet===!0)&&(B=(0,O.default)(B),B.attributes.list?B.attributes.list="ordered":(B.attributes.list="bullet",delete B.attributes.bullet)),typeof B.insert=="string"){var $=B.insert.replace(/\r\n/g,`
|
||
`).replace(/\r/g,`
|
||
`);return H.insert($,B.attributes)}return H.push(B)},new u.default)}n.default=V}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.Range=void 0;var a=(function(){function T(R,I){var E=[],A=!0,F=!1,L=void 0;try{for(var z=R[Symbol.iterator](),V;!(A=(V=z.next()).done)&&(E.push(V.value),!(I&&E.length===I));A=!0);}catch(Q){F=!0,L=Q}finally{try{!A&&z.return&&z.return()}finally{if(F)throw L}}return E}return function(R,I){if(Array.isArray(R))return R;if(Symbol.iterator in Object(R))return T(R,I);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),s=(function(){function T(R,I){for(var E=0;E<I.length;E++){var A=I[E];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(R,A.key,A)}}return function(R,I,E){return I&&T(R.prototype,I),E&&T(R,E),R}})(),l=o(0),c=b(l),u=o(21),d=b(u),f=o(11),h=b(f),p=o(8),y=b(p),m=o(10),x=b(m);function b(T){return T&&T.__esModule?T:{default:T}}function w(T){if(Array.isArray(T)){for(var R=0,I=Array(T.length);R<T.length;R++)I[R]=T[R];return I}else return Array.from(T)}function k(T,R){if(!(T instanceof R))throw new TypeError("Cannot call a class as a function")}var S=(0,x.default)("quill:selection"),_=function T(R){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;k(this,T),this.index=R,this.length=I},P=(function(){function T(R,I){var E=this;k(this,T),this.emitter=I,this.scroll=R,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=c.default.create("cursor",this),this.lastRange=this.savedRange=new _(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){E.mouseDown||setTimeout(E.update.bind(E,y.default.sources.USER),1)}),this.emitter.on(y.default.events.EDITOR_CHANGE,function(A,F){A===y.default.events.TEXT_CHANGE&&F.length()>0&&E.update(y.default.sources.SILENT)}),this.emitter.on(y.default.events.SCROLL_BEFORE_UPDATE,function(){if(E.hasFocus()){var A=E.getNativeRange();A!=null&&A.start.node!==E.cursor.textNode&&E.emitter.once(y.default.events.SCROLL_UPDATE,function(){try{E.setNativeRange(A.start.node,A.start.offset,A.end.node,A.end.offset)}catch{}})}}),this.emitter.on(y.default.events.SCROLL_OPTIMIZE,function(A,F){if(F.range){var L=F.range,z=L.startNode,V=L.startOffset,Q=L.endNode,U=L.endOffset;E.setNativeRange(z,V,Q,U)}}),this.update(y.default.sources.SILENT)}return s(T,[{key:"handleComposition",value:function(){var I=this;this.root.addEventListener("compositionstart",function(){I.composing=!0}),this.root.addEventListener("compositionend",function(){if(I.composing=!1,I.cursor.parent){var E=I.cursor.restore();if(!E)return;setTimeout(function(){I.setNativeRange(E.startNode,E.startOffset,E.endNode,E.endOffset)},1)}})}},{key:"handleDragging",value:function(){var I=this;this.emitter.listenDOM("mousedown",document.body,function(){I.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){I.mouseDown=!1,I.update(y.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(I,E){if(!(this.scroll.whitelist!=null&&!this.scroll.whitelist[I])){this.scroll.update();var A=this.getNativeRange();if(!(A==null||!A.native.collapsed||c.default.query(I,c.default.Scope.BLOCK))){if(A.start.node!==this.cursor.textNode){var F=c.default.find(A.start.node,!1);if(F==null)return;if(F instanceof c.default.Leaf){var L=F.split(A.start.offset);F.parent.insertBefore(this.cursor,L)}else F.insertBefore(this.cursor,A.start.node);this.cursor.attach()}this.cursor.format(I,E),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(I){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,A=this.scroll.length();I=Math.min(I,A-1),E=Math.min(I+E,A-1)-I;var F=void 0,L=this.scroll.leaf(I),z=a(L,2),V=z[0],Q=z[1];if(V==null)return null;var U=V.position(Q,!0),ee=a(U,2);F=ee[0],Q=ee[1];var H=document.createRange();if(E>0){H.setStart(F,Q);var B=this.scroll.leaf(I+E),M=a(B,2);if(V=M[0],Q=M[1],V==null)return null;var $=V.position(Q,!0),q=a($,2);return F=q[0],Q=q[1],H.setEnd(F,Q),H.getBoundingClientRect()}else{var Y="left",K=void 0;return F instanceof Text?(Q<F.data.length?(H.setStart(F,Q),H.setEnd(F,Q+1)):(H.setStart(F,Q-1),H.setEnd(F,Q),Y="right"),K=H.getBoundingClientRect()):(K=V.domNode.getBoundingClientRect(),Q>0&&(Y="right")),{bottom:K.top+K.height,height:K.height,left:K[Y],right:K[Y],top:K.top,width:0}}}},{key:"getNativeRange",value:function(){var I=document.getSelection();if(I==null||I.rangeCount<=0)return null;var E=I.getRangeAt(0);if(E==null)return null;var A=this.normalizeNative(E);return S.info("getNativeRange",A),A}},{key:"getRange",value:function(){var I=this.getNativeRange();if(I==null)return[null,null];var E=this.normalizedToRange(I);return[E,I]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(I){var E=this,A=[[I.start.node,I.start.offset]];I.native.collapsed||A.push([I.end.node,I.end.offset]);var F=A.map(function(V){var Q=a(V,2),U=Q[0],ee=Q[1],H=c.default.find(U,!0),B=H.offset(E.scroll);return ee===0?B:H instanceof c.default.Container?B+H.length():B+H.index(U,ee)}),L=Math.min(Math.max.apply(Math,w(F)),this.scroll.length()-1),z=Math.min.apply(Math,[L].concat(w(F)));return new _(z,L-z)}},{key:"normalizeNative",value:function(I){if(!O(this.root,I.startContainer)||!I.collapsed&&!O(this.root,I.endContainer))return null;var E={start:{node:I.startContainer,offset:I.startOffset},end:{node:I.endContainer,offset:I.endOffset},native:I};return[E.start,E.end].forEach(function(A){for(var F=A.node,L=A.offset;!(F instanceof Text)&&F.childNodes.length>0;)if(F.childNodes.length>L)F=F.childNodes[L],L=0;else if(F.childNodes.length===L)F=F.lastChild,L=F instanceof Text?F.data.length:F.childNodes.length+1;else break;A.node=F,A.offset=L}),E}},{key:"rangeToNative",value:function(I){var E=this,A=I.collapsed?[I.index]:[I.index,I.index+I.length],F=[],L=this.scroll.length();return A.forEach(function(z,V){z=Math.min(L-1,z);var Q=void 0,U=E.scroll.leaf(z),ee=a(U,2),H=ee[0],B=ee[1],M=H.position(B,V!==0),$=a(M,2);Q=$[0],B=$[1],F.push(Q,B)}),F.length<2&&(F=F.concat(F)),F}},{key:"scrollIntoView",value:function(I){var E=this.lastRange;if(E!=null){var A=this.getBounds(E.index,E.length);if(A!=null){var F=this.scroll.length()-1,L=this.scroll.line(Math.min(E.index,F)),z=a(L,1),V=z[0],Q=V;if(E.length>0){var U=this.scroll.line(Math.min(E.index+E.length,F)),ee=a(U,1);Q=ee[0]}if(!(V==null||Q==null)){var H=I.getBoundingClientRect();A.top<H.top?I.scrollTop-=H.top-A.top:A.bottom>H.bottom&&(I.scrollTop+=A.bottom-H.bottom)}}}}},{key:"setNativeRange",value:function(I,E){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:I,F=arguments.length>3&&arguments[3]!==void 0?arguments[3]:E,L=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(S.info("setNativeRange",I,E,A,F),!(I!=null&&(this.root.parentNode==null||I.parentNode==null||A.parentNode==null))){var z=document.getSelection();if(z!=null)if(I!=null){this.hasFocus()||this.root.focus();var V=(this.getNativeRange()||{}).native;if(V==null||L||I!==V.startContainer||E!==V.startOffset||A!==V.endContainer||F!==V.endOffset){I.tagName=="BR"&&(E=[].indexOf.call(I.parentNode.childNodes,I),I=I.parentNode),A.tagName=="BR"&&(F=[].indexOf.call(A.parentNode.childNodes,A),A=A.parentNode);var Q=document.createRange();Q.setStart(I,E),Q.setEnd(A,F),z.removeAllRanges(),z.addRange(Q)}}else z.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(I){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.default.sources.API;if(typeof E=="string"&&(A=E,E=!1),S.info("setRange",I),I!=null){var F=this.rangeToNative(I);this.setNativeRange.apply(this,w(F).concat([E]))}else this.setNativeRange(null);this.update(A)}},{key:"update",value:function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:y.default.sources.USER,E=this.lastRange,A=this.getRange(),F=a(A,2),L=F[0],z=F[1];if(this.lastRange=L,this.lastRange!=null&&(this.savedRange=this.lastRange),!(0,h.default)(E,this.lastRange)){var V;!this.composing&&z!=null&&z.native.collapsed&&z.start.node!==this.cursor.textNode&&this.cursor.restore();var Q=[y.default.events.SELECTION_CHANGE,(0,d.default)(this.lastRange),(0,d.default)(E),I];if((V=this.emitter).emit.apply(V,[y.default.events.EDITOR_CHANGE].concat(Q)),I!==y.default.sources.SILENT){var U;(U=this.emitter).emit.apply(U,Q)}}}}]),T})();function O(T,R){try{R.parentNode}catch{return!1}return R instanceof Text&&(R=R.parentNode),T.contains(R)}n.Range=_,n.default=P}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function y(m,x){for(var b=0;b<x.length;b++){var w=x[b];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,x,b){return x&&y(m.prototype,x),b&&y(m,b),m}})(),s=function y(m,x,b){m===null&&(m=Function.prototype);var w=Object.getOwnPropertyDescriptor(m,x);if(w===void 0){var k=Object.getPrototypeOf(m);return k===null?void 0:y(k,x,b)}else{if("value"in w)return w.value;var S=w.get;return S===void 0?void 0:S.call(b)}},l=o(0),c=u(l);function u(y){return y&&y.__esModule?y:{default:y}}function d(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")}function f(y,m){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:y}function h(y,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);y.prototype=Object.create(m&&m.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(y,m):y.__proto__=m)}var p=(function(y){h(m,y);function m(){return d(this,m),f(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"insertInto",value:function(b,w){b.children.length===0?s(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"insertInto",this).call(this,b,w):this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}],[{key:"value",value:function(){}}]),m})(c.default.Embed);p.blotName="break",p.tagName="BR",n.default=p}),(function(r,n,o){var a=this&&this.__extends||(function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var y in p)p.hasOwnProperty(y)&&(h[y]=p[y])};return function(h,p){f(h,p);function y(){this.constructor=h}h.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}})();Object.defineProperty(n,"__esModule",{value:!0});var s=o(44),l=o(30),c=o(1),u=(function(f){a(h,f);function h(p){var y=f.call(this,p)||this;return y.build(),y}return h.prototype.appendChild=function(p){this.insertBefore(p)},h.prototype.attach=function(){f.prototype.attach.call(this),this.children.forEach(function(p){p.attach()})},h.prototype.build=function(){var p=this;this.children=new s.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(y){try{var m=d(y);p.insertBefore(m,p.children.head||void 0)}catch(x){if(x instanceof c.ParchmentError)return;throw x}})},h.prototype.deleteAt=function(p,y){if(p===0&&y===this.length())return this.remove();this.children.forEachAt(p,y,function(m,x,b){m.deleteAt(x,b)})},h.prototype.descendant=function(p,y){var m=this.children.find(y),x=m[0],b=m[1];return p.blotName==null&&p(x)||p.blotName!=null&&x instanceof p?[x,b]:x instanceof h?x.descendant(p,b):[null,-1]},h.prototype.descendants=function(p,y,m){y===void 0&&(y=0),m===void 0&&(m=Number.MAX_VALUE);var x=[],b=m;return this.children.forEachAt(y,m,function(w,k,S){(p.blotName==null&&p(w)||p.blotName!=null&&w instanceof p)&&x.push(w),w instanceof h&&(x=x.concat(w.descendants(p,k,b))),b-=S}),x},h.prototype.detach=function(){this.children.forEach(function(p){p.detach()}),f.prototype.detach.call(this)},h.prototype.formatAt=function(p,y,m,x){this.children.forEachAt(p,y,function(b,w,k){b.formatAt(w,k,m,x)})},h.prototype.insertAt=function(p,y,m){var x=this.children.find(p),b=x[0],w=x[1];if(b)b.insertAt(w,y,m);else{var k=m==null?c.create("text",y):c.create(y,m);this.appendChild(k)}},h.prototype.insertBefore=function(p,y){if(this.statics.allowedChildren!=null&&!this.statics.allowedChildren.some(function(m){return p instanceof m}))throw new c.ParchmentError("Cannot insert "+p.statics.blotName+" into "+this.statics.blotName);p.insertInto(this,y)},h.prototype.length=function(){return this.children.reduce(function(p,y){return p+y.length()},0)},h.prototype.moveChildren=function(p,y){this.children.forEach(function(m){p.insertBefore(m,y)})},h.prototype.optimize=function(p){if(f.prototype.optimize.call(this,p),this.children.length===0)if(this.statics.defaultChild!=null){var y=c.create(this.statics.defaultChild);this.appendChild(y),y.optimize(p)}else this.remove()},h.prototype.path=function(p,y){y===void 0&&(y=!1);var m=this.children.find(p,y),x=m[0],b=m[1],w=[[this,p]];return x instanceof h?w.concat(x.path(b,y)):(x!=null&&w.push([x,b]),w)},h.prototype.removeChild=function(p){this.children.remove(p)},h.prototype.replace=function(p){p instanceof h&&p.moveChildren(this),f.prototype.replace.call(this,p)},h.prototype.split=function(p,y){if(y===void 0&&(y=!1),!y){if(p===0)return this;if(p===this.length())return this.next}var m=this.clone();return this.parent.insertBefore(m,this.next),this.children.forEachAt(p,this.length(),function(x,b,w){x=x.split(b,y),m.appendChild(x)}),m},h.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},h.prototype.update=function(p,y){var m=this,x=[],b=[];p.forEach(function(w){w.target===m.domNode&&w.type==="childList"&&(x.push.apply(x,w.addedNodes),b.push.apply(b,w.removedNodes))}),b.forEach(function(w){if(!(w.parentNode!=null&&w.tagName!=="IFRAME"&&document.body.compareDocumentPosition(w)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var k=c.find(w);k!=null&&(k.domNode.parentNode==null||k.domNode.parentNode===m.domNode)&&k.detach()}}),x.filter(function(w){return w.parentNode==m.domNode}).sort(function(w,k){return w===k?0:w.compareDocumentPosition(k)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(w){var k=null;w.nextSibling!=null&&(k=c.find(w.nextSibling));var S=d(w);(S.next!=k||S.next==null)&&(S.parent!=null&&S.parent.removeChild(m),m.insertBefore(S,k||void 0))})},h})(l.default);function d(f){var h=c.find(f);if(h==null)try{h=c.create(f)}catch{h=c.create(c.Scope.INLINE),[].slice.call(f.childNodes).forEach(function(y){h.domNode.appendChild(y)}),f.parentNode&&f.parentNode.replaceChild(h.domNode,f),h.attach()}return h}n.default=u}),(function(r,n,o){var a=this&&this.__extends||(function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var y in p)p.hasOwnProperty(y)&&(h[y]=p[y])};return function(h,p){f(h,p);function y(){this.constructor=h}h.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}})();Object.defineProperty(n,"__esModule",{value:!0});var s=o(12),l=o(31),c=o(17),u=o(1),d=(function(f){a(h,f);function h(p){var y=f.call(this,p)||this;return y.attributes=new l.default(y.domNode),y}return h.formats=function(p){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return p.tagName.toLowerCase()},h.prototype.format=function(p,y){var m=u.query(p);m instanceof s.default?this.attributes.attribute(m,y):y&&m!=null&&(p!==this.statics.blotName||this.formats()[p]!==y)&&this.replaceWith(p,y)},h.prototype.formats=function(){var p=this.attributes.values(),y=this.statics.formats(this.domNode);return y!=null&&(p[this.statics.blotName]=y),p},h.prototype.replaceWith=function(p,y){var m=f.prototype.replaceWith.call(this,p,y);return this.attributes.copy(m),m},h.prototype.update=function(p,y){var m=this;f.prototype.update.call(this,p,y),p.some(function(x){return x.target===m.domNode&&x.type==="attributes"})&&this.attributes.build()},h.prototype.wrap=function(p,y){var m=f.prototype.wrap.call(this,p,y);return m instanceof h&&m.statics.scope===this.statics.scope&&this.attributes.move(m),m},h})(c.default);n.default=d}),(function(r,n,o){var a=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var h in f)f.hasOwnProperty(h)&&(d[h]=f[h])};return function(d,f){u(d,f);function h(){this.constructor=d}d.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)}})();Object.defineProperty(n,"__esModule",{value:!0});var s=o(30),l=o(1),c=(function(u){a(d,u);function d(){return u!==null&&u.apply(this,arguments)||this}return d.value=function(f){return!0},d.prototype.index=function(f,h){return this.domNode===f||this.domNode.compareDocumentPosition(f)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(h,1):-1},d.prototype.position=function(f,h){var p=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return f>0&&(p+=1),[this.parent.domNode,p]},d.prototype.value=function(){var f;return f={},f[this.statics.blotName]=this.statics.value(this.domNode)||!0,f},d.scope=l.Scope.INLINE_BLOT,d})(s.default);n.default=c}),(function(r,n,o){var a=o(11),s=o(3),l={attributes:{compose:function(u,d,f){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});var h=s(!0,{},d);f||(h=Object.keys(h).reduce(function(y,m){return h[m]!=null&&(y[m]=h[m]),y},{}));for(var p in u)u[p]!==void 0&&d[p]===void 0&&(h[p]=u[p]);return Object.keys(h).length>0?h:void 0},diff:function(u,d){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});var f=Object.keys(u).concat(Object.keys(d)).reduce(function(h,p){return a(u[p],d[p])||(h[p]=d[p]===void 0?null:d[p]),h},{});return Object.keys(f).length>0?f:void 0},transform:function(u,d,f){if(typeof u!="object")return d;if(typeof d=="object"){if(!f)return d;var h=Object.keys(d).reduce(function(p,y){return u[y]===void 0&&(p[y]=d[y]),p},{});return Object.keys(h).length>0?h:void 0}}},iterator:function(u){return new c(u)},length:function(u){return typeof u.delete=="number"?u.delete:typeof u.retain=="number"?u.retain:typeof u.insert=="string"?u.insert.length:1}};function c(u){this.ops=u,this.index=0,this.offset=0}c.prototype.hasNext=function(){return this.peekLength()<1/0},c.prototype.next=function(u){u||(u=1/0);var d=this.ops[this.index];if(d){var f=this.offset,h=l.length(d);if(u>=h-f?(u=h-f,this.index+=1,this.offset=0):this.offset+=u,typeof d.delete=="number")return{delete:u};var p={};return d.attributes&&(p.attributes=d.attributes),typeof d.retain=="number"?p.retain=u:typeof d.insert=="string"?p.insert=d.insert.substr(f,u):p.insert=d.insert,p}else return{retain:1/0}},c.prototype.peek=function(){return this.ops[this.index]},c.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},c.prototype.peekType=function(){return this.ops[this.index]?typeof this.ops[this.index].delete=="number"?"delete":typeof this.ops[this.index].retain=="number"?"retain":"insert":"retain"},c.prototype.rest=function(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);var u=this.offset,d=this.index,f=this.next(),h=this.ops.slice(this.index);return this.offset=u,this.index=d,[f].concat(h)}else return[]},r.exports=l}),(function(r,n){var o=(function(){function a(m,x){return x!=null&&m instanceof x}var s;try{s=Map}catch{s=function(){}}var l;try{l=Set}catch{l=function(){}}var c;try{c=Promise}catch{c=function(){}}function u(m,x,b,w,k){typeof x=="object"&&(b=x.depth,w=x.prototype,k=x.includeNonEnumerable,x=x.circular);var S=[],_=[],P=typeof Buffer<"u";typeof x>"u"&&(x=!0),typeof b>"u"&&(b=1/0);function O(T,R){if(T===null)return null;if(R===0)return T;var I,E;if(typeof T!="object")return T;if(a(T,s))I=new s;else if(a(T,l))I=new l;else if(a(T,c))I=new c(function(H,B){T.then(function(M){H(O(M,R-1))},function(M){B(O(M,R-1))})});else if(u.__isArray(T))I=[];else if(u.__isRegExp(T))I=new RegExp(T.source,y(T)),T.lastIndex&&(I.lastIndex=T.lastIndex);else if(u.__isDate(T))I=new Date(T.getTime());else{if(P&&Buffer.isBuffer(T))return Buffer.allocUnsafe?I=Buffer.allocUnsafe(T.length):I=new Buffer(T.length),T.copy(I),I;a(T,Error)?I=Object.create(T):typeof w>"u"?(E=Object.getPrototypeOf(T),I=Object.create(E)):(I=Object.create(w),E=w)}if(x){var A=S.indexOf(T);if(A!=-1)return _[A];S.push(T),_.push(I)}a(T,s)&&T.forEach(function(H,B){var M=O(B,R-1),$=O(H,R-1);I.set(M,$)}),a(T,l)&&T.forEach(function(H){var B=O(H,R-1);I.add(B)});for(var F in T){var L;E&&(L=Object.getOwnPropertyDescriptor(E,F)),!(L&&L.set==null)&&(I[F]=O(T[F],R-1))}if(Object.getOwnPropertySymbols)for(var z=Object.getOwnPropertySymbols(T),F=0;F<z.length;F++){var V=z[F],Q=Object.getOwnPropertyDescriptor(T,V);Q&&!Q.enumerable&&!k||(I[V]=O(T[V],R-1),Q.enumerable||Object.defineProperty(I,V,{enumerable:!1}))}if(k)for(var U=Object.getOwnPropertyNames(T),F=0;F<U.length;F++){var ee=U[F],Q=Object.getOwnPropertyDescriptor(T,ee);Q&&Q.enumerable||(I[ee]=O(T[ee],R-1),Object.defineProperty(I,ee,{enumerable:!1}))}return I}return O(m,b)}u.clonePrototype=function(x){if(x===null)return null;var b=function(){};return b.prototype=x,new b};function d(m){return Object.prototype.toString.call(m)}u.__objToStr=d;function f(m){return typeof m=="object"&&d(m)==="[object Date]"}u.__isDate=f;function h(m){return typeof m=="object"&&d(m)==="[object Array]"}u.__isArray=h;function p(m){return typeof m=="object"&&d(m)==="[object RegExp]"}u.__isRegExp=p;function y(m){var x="";return m.global&&(x+="g"),m.ignoreCase&&(x+="i"),m.multiline&&(x+="m"),x}return u.__getRegExpFlags=y,u})();typeof r=="object"&&r.exports&&(r.exports=o)}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function I(E,A){var F=[],L=!0,z=!1,V=void 0;try{for(var Q=E[Symbol.iterator](),U;!(L=(U=Q.next()).done)&&(F.push(U.value),!(A&&F.length===A));L=!0);}catch(ee){z=!0,V=ee}finally{try{!L&&Q.return&&Q.return()}finally{if(z)throw V}}return F}return function(E,A){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return I(E,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),s=(function(){function I(E,A){for(var F=0;F<A.length;F++){var L=A[F];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(E,L.key,L)}}return function(E,A,F){return A&&I(E.prototype,A),F&&I(E,F),E}})(),l=function I(E,A,F){E===null&&(E=Function.prototype);var L=Object.getOwnPropertyDescriptor(E,A);if(L===void 0){var z=Object.getPrototypeOf(E);return z===null?void 0:I(z,A,F)}else{if("value"in L)return L.value;var V=L.get;return V===void 0?void 0:V.call(F)}},c=o(0),u=S(c),d=o(8),f=S(d),h=o(4),p=S(h),y=o(16),m=S(y),x=o(13),b=S(x),w=o(25),k=S(w);function S(I){return I&&I.__esModule?I:{default:I}}function _(I,E){if(!(I instanceof E))throw new TypeError("Cannot call a class as a function")}function P(I,E){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:I}function O(I,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);I.prototype=Object.create(E&&E.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(I,E):I.__proto__=E)}function T(I){return I instanceof p.default||I instanceof h.BlockEmbed}var R=(function(I){O(E,I);function E(A,F){_(this,E);var L=P(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,A));return L.emitter=F.emitter,Array.isArray(F.whitelist)&&(L.whitelist=F.whitelist.reduce(function(z,V){return z[V]=!0,z},{})),L.domNode.addEventListener("DOMNodeInserted",function(){}),L.optimize(),L.enable(),L}return s(E,[{key:"batchStart",value:function(){this.batch=!0}},{key:"batchEnd",value:function(){this.batch=!1,this.optimize()}},{key:"deleteAt",value:function(F,L){var z=this.line(F),V=a(z,2),Q=V[0],U=V[1],ee=this.line(F+L),H=a(ee,1),B=H[0];if(l(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"deleteAt",this).call(this,F,L),B!=null&&Q!==B&&U>0){if(Q instanceof h.BlockEmbed||B instanceof h.BlockEmbed){this.optimize();return}if(Q instanceof b.default){var M=Q.newlineIndex(Q.length(),!0);if(M>-1&&(Q=Q.split(M+1),Q===B)){this.optimize();return}}else if(B instanceof b.default){var $=B.newlineIndex(0);$>-1&&B.split($+1)}var q=B.children.head instanceof m.default?null:B.children.head;Q.moveChildren(B,q),Q.remove()}this.optimize()}},{key:"enable",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",F)}},{key:"formatAt",value:function(F,L,z,V){this.whitelist!=null&&!this.whitelist[z]||(l(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"formatAt",this).call(this,F,L,z,V),this.optimize())}},{key:"insertAt",value:function(F,L,z){if(!(z!=null&&this.whitelist!=null&&!this.whitelist[L])){if(F>=this.length())if(z==null||u.default.query(L,u.default.Scope.BLOCK)==null){var V=u.default.create(this.statics.defaultChild);this.appendChild(V),z==null&&L.endsWith(`
|
||
`)&&(L=L.slice(0,-1)),V.insertAt(0,L,z)}else{var Q=u.default.create(L,z);this.appendChild(Q)}else l(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertAt",this).call(this,F,L,z);this.optimize()}}},{key:"insertBefore",value:function(F,L){if(F.statics.scope===u.default.Scope.INLINE_BLOT){var z=u.default.create(this.statics.defaultChild);z.appendChild(F),F=z}l(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"insertBefore",this).call(this,F,L)}},{key:"leaf",value:function(F){return this.path(F).pop()||[null,-1]}},{key:"line",value:function(F){return F===this.length()?this.line(F-1):this.descendant(T,F)}},{key:"lines",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE,z=function V(Q,U,ee){var H=[],B=ee;return Q.children.forEachAt(U,ee,function(M,$,q){T(M)?H.push(M):M instanceof u.default.Container&&(H=H.concat(V(M,$,B))),B-=q}),H};return z(this,F,L)}},{key:"optimize",value:function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch!==!0&&(l(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"optimize",this).call(this,F,L),F.length>0&&this.emitter.emit(f.default.events.SCROLL_OPTIMIZE,F,L))}},{key:"path",value:function(F){return l(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"path",this).call(this,F).slice(1)}},{key:"update",value:function(F){if(this.batch!==!0){var L=f.default.sources.USER;typeof F=="string"&&(L=F),Array.isArray(F)||(F=this.observer.takeRecords()),F.length>0&&this.emitter.emit(f.default.events.SCROLL_BEFORE_UPDATE,L,F),l(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"update",this).call(this,F.concat([])),F.length>0&&this.emitter.emit(f.default.events.SCROLL_UPDATE,L,F)}}}]),E})(u.default.Scroll);R.blotName="scroll",R.className="ql-editor",R.tagName="DIV",R.defaultChild="block",R.allowedChildren=[p.default,h.BlockEmbed,k.default],n.default=R}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.SHORTKEY=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(K){return typeof K}:function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},s=(function(){function K(G,re){var J=[],ae=!0,le=!1,me=void 0;try{for(var Oe=G[Symbol.iterator](),we;!(ae=(we=Oe.next()).done)&&(J.push(we.value),!(re&&J.length===re));ae=!0);}catch(ie){le=!0,me=ie}finally{try{!ae&&Oe.return&&Oe.return()}finally{if(le)throw me}}return J}return function(G,re){if(Array.isArray(G))return G;if(Symbol.iterator in Object(G))return K(G,re);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),l=(function(){function K(G,re){for(var J=0;J<re.length;J++){var ae=re[J];ae.enumerable=ae.enumerable||!1,ae.configurable=!0,"value"in ae&&(ae.writable=!0),Object.defineProperty(G,ae.key,ae)}}return function(G,re,J){return re&&K(G.prototype,re),J&&K(G,J),G}})(),c=o(21),u=I(c),d=o(11),f=I(d),h=o(3),p=I(h),y=o(2),m=I(y),x=o(20),b=I(x),w=o(0),k=I(w),S=o(5),_=I(S),P=o(10),O=I(P),T=o(9),R=I(T);function I(K){return K&&K.__esModule?K:{default:K}}function E(K,G,re){return G in K?Object.defineProperty(K,G,{value:re,enumerable:!0,configurable:!0,writable:!0}):K[G]=re,K}function A(K,G){if(!(K instanceof G))throw new TypeError("Cannot call a class as a function")}function F(K,G){if(!K)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return G&&(typeof G=="object"||typeof G=="function")?G:K}function L(K,G){if(typeof G!="function"&&G!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof G);K.prototype=Object.create(G&&G.prototype,{constructor:{value:K,enumerable:!1,writable:!0,configurable:!0}}),G&&(Object.setPrototypeOf?Object.setPrototypeOf(K,G):K.__proto__=G)}var z=(0,O.default)("quill:keyboard"),V=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey",Q=(function(K){L(G,K),l(G,null,[{key:"match",value:function(J,ae){return ae=Y(ae),["altKey","ctrlKey","metaKey","shiftKey"].some(function(le){return!!ae[le]!==J[le]&&ae[le]!==null})?!1:ae.key===(J.which||J.keyCode)}}]);function G(re,J){A(this,G);var ae=F(this,(G.__proto__||Object.getPrototypeOf(G)).call(this,re,J));return ae.bindings={},Object.keys(ae.options.bindings).forEach(function(le){le==="list autofill"&&re.scroll.whitelist!=null&&!re.scroll.whitelist.list||ae.options.bindings[le]&&ae.addBinding(ae.options.bindings[le])}),ae.addBinding({key:G.keys.ENTER,shiftKey:null},M),ae.addBinding({key:G.keys.ENTER,metaKey:null,ctrlKey:null,altKey:null},function(){}),/Firefox/i.test(navigator.userAgent)?(ae.addBinding({key:G.keys.BACKSPACE},{collapsed:!0},ee),ae.addBinding({key:G.keys.DELETE},{collapsed:!0},H)):(ae.addBinding({key:G.keys.BACKSPACE},{collapsed:!0,prefix:/^.?$/},ee),ae.addBinding({key:G.keys.DELETE},{collapsed:!0,suffix:/^.?$/},H)),ae.addBinding({key:G.keys.BACKSPACE},{collapsed:!1},B),ae.addBinding({key:G.keys.DELETE},{collapsed:!1},B),ae.addBinding({key:G.keys.BACKSPACE,altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},ee),ae.listen(),ae}return l(G,[{key:"addBinding",value:function(J){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},me=Y(J);if(me==null||me.key==null)return z.warn("Attempted to add invalid keyboard binding",me);typeof ae=="function"&&(ae={handler:ae}),typeof le=="function"&&(le={handler:le}),me=(0,p.default)(me,ae,le),this.bindings[me.key]=this.bindings[me.key]||[],this.bindings[me.key].push(me)}},{key:"listen",value:function(){var J=this;this.quill.root.addEventListener("keydown",function(ae){if(!ae.defaultPrevented){var le=ae.which||ae.keyCode,me=(J.bindings[le]||[]).filter(function(Ae){return G.match(ae,Ae)});if(me.length!==0){var Oe=J.quill.getSelection();if(!(Oe==null||!J.quill.hasFocus())){var we=J.quill.getLine(Oe.index),ie=s(we,2),Me=ie[0],ke=ie[1],se=J.quill.getLeaf(Oe.index),fe=s(se,2),Ie=fe[0],ce=fe[1],je=Oe.length===0?[Ie,ce]:J.quill.getLeaf(Oe.index+Oe.length),qe=s(je,2),Ne=qe[0],Je=qe[1],vt=Ie instanceof k.default.Text?Ie.value().slice(0,ce):"",Ge=Ne instanceof k.default.Text?Ne.value().slice(Je):"",Ot={collapsed:Oe.length===0,empty:Oe.length===0&&Me.length()<=1,format:J.quill.getFormat(Oe),offset:ke,prefix:vt,suffix:Ge},nt=me.some(function(Ae){if(Ae.collapsed!=null&&Ae.collapsed!==Ot.collapsed||Ae.empty!=null&&Ae.empty!==Ot.empty||Ae.offset!=null&&Ae.offset!==Ot.offset)return!1;if(Array.isArray(Ae.format)){if(Ae.format.every(function(Te){return Ot.format[Te]==null}))return!1}else if(a(Ae.format)==="object"&&!Object.keys(Ae.format).every(function(Te){return Ae.format[Te]===!0?Ot.format[Te]!=null:Ae.format[Te]===!1?Ot.format[Te]==null:(0,f.default)(Ae.format[Te],Ot.format[Te])}))return!1;return Ae.prefix!=null&&!Ae.prefix.test(Ot.prefix)||Ae.suffix!=null&&!Ae.suffix.test(Ot.suffix)?!1:Ae.handler.call(J,Oe,Ot)!==!0});nt&&ae.preventDefault()}}}})}}]),G})(R.default);Q.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},Q.DEFAULTS={bindings:{bold:q("bold"),italic:q("italic"),underline:q("underline"),indent:{key:Q.keys.TAB,format:["blockquote","indent","list"],handler:function(G,re){if(re.collapsed&&re.offset!==0)return!0;this.quill.format("indent","+1",_.default.sources.USER)}},outdent:{key:Q.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(G,re){if(re.collapsed&&re.offset!==0)return!0;this.quill.format("indent","-1",_.default.sources.USER)}},"outdent backspace":{key:Q.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(G,re){re.format.indent!=null?this.quill.format("indent","-1",_.default.sources.USER):re.format.list!=null&&this.quill.format("list",!1,_.default.sources.USER)}},"indent code-block":$(!0),"outdent code-block":$(!1),"remove tab":{key:Q.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(G){this.quill.deleteText(G.index-1,1,_.default.sources.USER)}},tab:{key:Q.keys.TAB,handler:function(G){this.quill.history.cutoff();var re=new m.default().retain(G.index).delete(G.length).insert(" ");this.quill.updateContents(re,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(G.index+1,_.default.sources.SILENT)}},"list empty enter":{key:Q.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(G,re){this.quill.format("list",!1,_.default.sources.USER),re.format.indent&&this.quill.format("indent",!1,_.default.sources.USER)}},"checklist enter":{key:Q.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(G){var re=this.quill.getLine(G.index),J=s(re,2),ae=J[0],le=J[1],me=(0,p.default)({},ae.formats(),{list:"checked"}),Oe=new m.default().retain(G.index).insert(`
|
||
`,me).retain(ae.length()-le-1).retain(1,{list:"unchecked"});this.quill.updateContents(Oe,_.default.sources.USER),this.quill.setSelection(G.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:Q.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(G,re){var J=this.quill.getLine(G.index),ae=s(J,2),le=ae[0],me=ae[1],Oe=new m.default().retain(G.index).insert(`
|
||
`,re.format).retain(le.length()-me-1).retain(1,{header:null});this.quill.updateContents(Oe,_.default.sources.USER),this.quill.setSelection(G.index+1,_.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(G,re){var J=re.prefix.length,ae=this.quill.getLine(G.index),le=s(ae,2),me=le[0],Oe=le[1];if(Oe>J)return!0;var we=void 0;switch(re.prefix.trim()){case"[]":case"[ ]":we="unchecked";break;case"[x]":we="checked";break;case"-":case"*":we="bullet";break;default:we="ordered"}this.quill.insertText(G.index," ",_.default.sources.USER),this.quill.history.cutoff();var ie=new m.default().retain(G.index-Oe).delete(J+1).retain(me.length()-2-Oe).retain(1,{list:we});this.quill.updateContents(ie,_.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(G.index-J,_.default.sources.SILENT)}},"code exit":{key:Q.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(G){var re=this.quill.getLine(G.index),J=s(re,2),ae=J[0],le=J[1],me=new m.default().retain(G.index+ae.length()-le-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(me,_.default.sources.USER)}},"embed left":U(Q.keys.LEFT,!1),"embed left shift":U(Q.keys.LEFT,!0),"embed right":U(Q.keys.RIGHT,!1),"embed right shift":U(Q.keys.RIGHT,!0)}};function U(K,G){var re,J=K===Q.keys.LEFT?"prefix":"suffix";return re={key:K,shiftKey:G,altKey:null},E(re,J,/^$/),E(re,"handler",function(le){var me=le.index;K===Q.keys.RIGHT&&(me+=le.length+1);var Oe=this.quill.getLeaf(me),we=s(Oe,1),ie=we[0];return ie instanceof k.default.Embed?(K===Q.keys.LEFT?G?this.quill.setSelection(le.index-1,le.length+1,_.default.sources.USER):this.quill.setSelection(le.index-1,_.default.sources.USER):G?this.quill.setSelection(le.index,le.length+1,_.default.sources.USER):this.quill.setSelection(le.index+le.length+1,_.default.sources.USER),!1):!0}),re}function ee(K,G){if(!(K.index===0||this.quill.getLength()<=1)){var re=this.quill.getLine(K.index),J=s(re,1),ae=J[0],le={};if(G.offset===0){var me=this.quill.getLine(K.index-1),Oe=s(me,1),we=Oe[0];if(we!=null&&we.length()>1){var ie=ae.formats(),Me=this.quill.getFormat(K.index-1,1);le=b.default.attributes.diff(ie,Me)||{}}}var ke=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(G.prefix)?2:1;this.quill.deleteText(K.index-ke,ke,_.default.sources.USER),Object.keys(le).length>0&&this.quill.formatLine(K.index-ke,ke,le,_.default.sources.USER),this.quill.focus()}}function H(K,G){var re=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(G.suffix)?2:1;if(!(K.index>=this.quill.getLength()-re)){var J={},ae=0,le=this.quill.getLine(K.index),me=s(le,1),Oe=me[0];if(G.offset>=Oe.length()-1){var we=this.quill.getLine(K.index+1),ie=s(we,1),Me=ie[0];if(Me){var ke=Oe.formats(),se=this.quill.getFormat(K.index,1);J=b.default.attributes.diff(ke,se)||{},ae=Me.length()}}this.quill.deleteText(K.index,re,_.default.sources.USER),Object.keys(J).length>0&&this.quill.formatLine(K.index+ae-1,re,J,_.default.sources.USER)}}function B(K){var G=this.quill.getLines(K),re={};if(G.length>1){var J=G[0].formats(),ae=G[G.length-1].formats();re=b.default.attributes.diff(ae,J)||{}}this.quill.deleteText(K,_.default.sources.USER),Object.keys(re).length>0&&this.quill.formatLine(K.index,1,re,_.default.sources.USER),this.quill.setSelection(K.index,_.default.sources.SILENT),this.quill.focus()}function M(K,G){var re=this;K.length>0&&this.quill.scroll.deleteAt(K.index,K.length);var J=Object.keys(G.format).reduce(function(ae,le){return k.default.query(le,k.default.Scope.BLOCK)&&!Array.isArray(G.format[le])&&(ae[le]=G.format[le]),ae},{});this.quill.insertText(K.index,`
|
||
`,J,_.default.sources.USER),this.quill.setSelection(K.index+1,_.default.sources.SILENT),this.quill.focus(),Object.keys(G.format).forEach(function(ae){J[ae]==null&&(Array.isArray(G.format[ae])||ae!=="link"&&re.quill.format(ae,G.format[ae],_.default.sources.USER))})}function $(K){return{key:Q.keys.TAB,shiftKey:!K,format:{"code-block":!0},handler:function(re){var J=k.default.query("code-block"),ae=re.index,le=re.length,me=this.quill.scroll.descendant(J,ae),Oe=s(me,2),we=Oe[0],ie=Oe[1];if(we!=null){var Me=this.quill.getIndex(we),ke=we.newlineIndex(ie,!0)+1,se=we.newlineIndex(Me+ie+le),fe=we.domNode.textContent.slice(ke,se).split(`
|
||
`);ie=0,fe.forEach(function(Ie,ce){K?(we.insertAt(ke+ie,J.TAB),ie+=J.TAB.length,ce===0?ae+=J.TAB.length:le+=J.TAB.length):Ie.startsWith(J.TAB)&&(we.deleteAt(ke+ie,J.TAB.length),ie-=J.TAB.length,ce===0?ae-=J.TAB.length:le-=J.TAB.length),ie+=Ie.length+1}),this.quill.update(_.default.sources.USER),this.quill.setSelection(ae,le,_.default.sources.SILENT)}}}}function q(K){return{key:K[0].toUpperCase(),shortKey:!0,handler:function(re,J){this.quill.format(K,!J.format[K],_.default.sources.USER)}}}function Y(K){if(typeof K=="string"||typeof K=="number")return Y({key:K});if((typeof K>"u"?"undefined":a(K))==="object"&&(K=(0,u.default)(K,!1)),typeof K.key=="string")if(Q.keys[K.key.toUpperCase()]!=null)K.key=Q.keys[K.key.toUpperCase()];else if(K.key.length===1)K.key=K.key.toUpperCase().charCodeAt(0);else return null;return K.shortKey&&(K[V]=K.shortKey,delete K.shortKey),K}n.default=Q,n.SHORTKEY=V}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function b(w,k){var S=[],_=!0,P=!1,O=void 0;try{for(var T=w[Symbol.iterator](),R;!(_=(R=T.next()).done)&&(S.push(R.value),!(k&&S.length===k));_=!0);}catch(I){P=!0,O=I}finally{try{!_&&T.return&&T.return()}finally{if(P)throw O}}return S}return function(w,k){if(Array.isArray(w))return w;if(Symbol.iterator in Object(w))return b(w,k);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),s=function b(w,k,S){w===null&&(w=Function.prototype);var _=Object.getOwnPropertyDescriptor(w,k);if(_===void 0){var P=Object.getPrototypeOf(w);return P===null?void 0:b(P,k,S)}else{if("value"in _)return _.value;var O=_.get;return O===void 0?void 0:O.call(S)}},l=(function(){function b(w,k){for(var S=0;S<k.length;S++){var _=k[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(w,_.key,_)}}return function(w,k,S){return k&&b(w.prototype,k),S&&b(w,S),w}})(),c=o(0),u=h(c),d=o(7),f=h(d);function h(b){return b&&b.__esModule?b:{default:b}}function p(b,w){if(!(b instanceof w))throw new TypeError("Cannot call a class as a function")}function y(b,w){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:b}function m(b,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);b.prototype=Object.create(w&&w.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(b,w):b.__proto__=w)}var x=(function(b){m(w,b),l(w,null,[{key:"value",value:function(){}}]);function w(k,S){p(this,w);var _=y(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,k));return _.selection=S,_.textNode=document.createTextNode(w.CONTENTS),_.domNode.appendChild(_.textNode),_._length=0,_}return l(w,[{key:"detach",value:function(){this.parent!=null&&this.parent.removeChild(this)}},{key:"format",value:function(S,_){if(this._length!==0)return s(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"format",this).call(this,S,_);for(var P=this,O=0;P!=null&&P.statics.scope!==u.default.Scope.BLOCK_BLOT;)O+=P.offset(P.parent),P=P.parent;P!=null&&(this._length=w.CONTENTS.length,P.optimize(),P.formatAt(O,w.CONTENTS.length,S,_),this._length=0)}},{key:"index",value:function(S,_){return S===this.textNode?0:s(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"index",this).call(this,S,_)}},{key:"length",value:function(){return this._length}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){s(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"remove",this).call(this),this.parent=null}},{key:"restore",value:function(){if(!(this.selection.composing||this.parent==null)){var S=this.textNode,_=this.selection.getNativeRange(),P=void 0,O=void 0,T=void 0;if(_!=null&&_.start.node===S&&_.end.node===S){var R=[S,_.start.offset,_.end.offset];P=R[0],O=R[1],T=R[2]}for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);if(this.textNode.data!==w.CONTENTS){var I=this.textNode.data.split(w.CONTENTS).join("");this.next instanceof f.default?(P=this.next.domNode,this.next.insertAt(0,I),this.textNode.data=w.CONTENTS):(this.textNode.data=I,this.parent.insertBefore(u.default.create(this.textNode),this),this.textNode=document.createTextNode(w.CONTENTS),this.domNode.appendChild(this.textNode))}if(this.remove(),O!=null){var E=[O,T].map(function(F){return Math.max(0,Math.min(P.data.length,F-1))}),A=a(E,2);return O=A[0],T=A[1],{startNode:P,startOffset:O,endNode:P,endOffset:T}}}}},{key:"update",value:function(S,_){var P=this;if(S.some(function(T){return T.type==="characterData"&&T.target===P.textNode})){var O=this.restore();O&&(_.range=O)}}},{key:"value",value:function(){return""}}]),w})(u.default.Embed);x.blotName="cursor",x.className="ql-cursor",x.tagName="span",x.CONTENTS="\uFEFF",n.default=x}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=o(0),s=u(a),l=o(4),c=u(l);function u(y){return y&&y.__esModule?y:{default:y}}function d(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")}function f(y,m){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:y}function h(y,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);y.prototype=Object.create(m&&m.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(y,m):y.__proto__=m)}var p=(function(y){h(m,y);function m(){return d(this,m),f(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return m})(s.default.Container);p.allowedChildren=[c.default,l.BlockEmbed,p],n.default=p}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.ColorStyle=n.ColorClass=n.ColorAttributor=void 0;var a=(function(){function x(b,w){for(var k=0;k<w.length;k++){var S=w[k];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,w,k){return w&&x(b.prototype,w),k&&x(b,k),b}})(),s=function x(b,w,k){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,w);if(S===void 0){var _=Object.getPrototypeOf(b);return _===null?void 0:x(_,w,k)}else{if("value"in S)return S.value;var P=S.get;return P===void 0?void 0:P.call(k)}},l=o(0),c=u(l);function u(x){return x&&x.__esModule?x:{default:x}}function d(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function f(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function h(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var p=(function(x){h(b,x);function b(){return d(this,b),f(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"value",value:function(k){var S=s(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"value",this).call(this,k);return S.startsWith("rgb(")?(S=S.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),"#"+S.split(",").map(function(_){return("00"+parseInt(_).toString(16)).slice(-2)}).join("")):S}}]),b})(c.default.Attributor.Style),y=new c.default.Attributor.Class("color","ql-color",{scope:c.default.Scope.INLINE}),m=new p("color","color",{scope:c.default.Scope.INLINE});n.ColorAttributor=p,n.ColorClass=y,n.ColorStyle=m}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.sanitize=n.default=void 0;var a=(function(){function m(x,b){for(var w=0;w<b.length;w++){var k=b[w];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(x,k.key,k)}}return function(x,b,w){return b&&m(x.prototype,b),w&&m(x,w),x}})(),s=function m(x,b,w){x===null&&(x=Function.prototype);var k=Object.getOwnPropertyDescriptor(x,b);if(k===void 0){var S=Object.getPrototypeOf(x);return S===null?void 0:m(S,b,w)}else{if("value"in k)return k.value;var _=k.get;return _===void 0?void 0:_.call(w)}},l=o(6),c=u(l);function u(m){return m&&m.__esModule?m:{default:m}}function d(m,x){if(!(m instanceof x))throw new TypeError("Cannot call a class as a function")}function f(m,x){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:m}function h(m,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);m.prototype=Object.create(x&&x.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(m,x):m.__proto__=x)}var p=(function(m){h(x,m);function x(){return d(this,x),f(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"format",value:function(w,k){if(w!==this.statics.blotName||!k)return s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"format",this).call(this,w,k);k=this.constructor.sanitize(k),this.domNode.setAttribute("href",k)}}],[{key:"create",value:function(w){var k=s(x.__proto__||Object.getPrototypeOf(x),"create",this).call(this,w);return w=this.sanitize(w),k.setAttribute("href",w),k.setAttribute("rel","noopener noreferrer"),k.setAttribute("target","_blank"),k}},{key:"formats",value:function(w){return w.getAttribute("href")}},{key:"sanitize",value:function(w){return y(w,this.PROTOCOL_WHITELIST)?w:this.SANITIZED_URL}}]),x})(c.default);p.blotName="link",p.tagName="A",p.SANITIZED_URL="about:blank",p.PROTOCOL_WHITELIST=["http","https","mailto","tel"];function y(m,x){var b=document.createElement("a");b.href=m;var w=b.href.slice(0,b.href.indexOf(":"));return x.indexOf(w)>-1}n.default=p,n.sanitize=y}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},s=(function(){function x(b,w){for(var k=0;k<w.length;k++){var S=w[k];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,w,k){return w&&x(b.prototype,w),k&&x(b,k),b}})(),l=o(23),c=f(l),u=o(107),d=f(u);function f(x){return x&&x.__esModule?x:{default:x}}function h(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}var p=0;function y(x,b){x.setAttribute(b,x.getAttribute(b)!=="true")}var m=(function(){function x(b){var w=this;h(this,x),this.select=b,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",function(){w.togglePicker()}),this.label.addEventListener("keydown",function(k){switch(k.keyCode){case c.default.keys.ENTER:w.togglePicker();break;case c.default.keys.ESCAPE:w.escape(),k.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}return s(x,[{key:"togglePicker",value:function(){this.container.classList.toggle("ql-expanded"),y(this.label,"aria-expanded"),y(this.options,"aria-hidden")}},{key:"buildItem",value:function(w){var k=this,S=document.createElement("span");return S.tabIndex="0",S.setAttribute("role","button"),S.classList.add("ql-picker-item"),w.hasAttribute("value")&&S.setAttribute("data-value",w.getAttribute("value")),w.textContent&&S.setAttribute("data-label",w.textContent),S.addEventListener("click",function(){k.selectItem(S,!0)}),S.addEventListener("keydown",function(_){switch(_.keyCode){case c.default.keys.ENTER:k.selectItem(S,!0),_.preventDefault();break;case c.default.keys.ESCAPE:k.escape(),_.preventDefault();break}}),S}},{key:"buildLabel",value:function(){var w=document.createElement("span");return w.classList.add("ql-picker-label"),w.innerHTML=d.default,w.tabIndex="0",w.setAttribute("role","button"),w.setAttribute("aria-expanded","false"),this.container.appendChild(w),w}},{key:"buildOptions",value:function(){var w=this,k=document.createElement("span");k.classList.add("ql-picker-options"),k.setAttribute("aria-hidden","true"),k.tabIndex="-1",k.id="ql-picker-options-"+p,p+=1,this.label.setAttribute("aria-controls",k.id),this.options=k,[].slice.call(this.select.options).forEach(function(S){var _=w.buildItem(S);k.appendChild(_),S.selected===!0&&w.selectItem(_)}),this.container.appendChild(k)}},{key:"buildPicker",value:function(){var w=this;[].slice.call(this.select.attributes).forEach(function(k){w.container.setAttribute(k.name,k.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}},{key:"escape",value:function(){var w=this;this.close(),setTimeout(function(){return w.label.focus()},1)}},{key:"close",value:function(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}},{key:"selectItem",value:function(w){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,S=this.container.querySelector(".ql-selected");if(w!==S&&(S!=null&&S.classList.remove("ql-selected"),w!=null&&(w.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(w.parentNode.children,w),w.hasAttribute("data-value")?this.label.setAttribute("data-value",w.getAttribute("data-value")):this.label.removeAttribute("data-value"),w.hasAttribute("data-label")?this.label.setAttribute("data-label",w.getAttribute("data-label")):this.label.removeAttribute("data-label"),k))){if(typeof Event=="function")this.select.dispatchEvent(new Event("change"));else if((typeof Event>"u"?"undefined":a(Event))==="object"){var _=document.createEvent("Event");_.initEvent("change",!0,!0),this.select.dispatchEvent(_)}this.close()}}},{key:"update",value:function(){var w=void 0;if(this.select.selectedIndex>-1){var k=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];w=this.select.options[this.select.selectedIndex],this.selectItem(k)}else this.selectItem(null);var S=w!=null&&w!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",S)}}]),x})();n.default=m}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=o(0),s=z(a),l=o(5),c=z(l),u=o(4),d=z(u),f=o(16),h=z(f),p=o(25),y=z(p),m=o(24),x=z(m),b=o(35),w=z(b),k=o(6),S=z(k),_=o(22),P=z(_),O=o(7),T=z(O),R=o(55),I=z(R),E=o(42),A=z(E),F=o(23),L=z(F);function z(V){return V&&V.__esModule?V:{default:V}}c.default.register({"blots/block":d.default,"blots/block/embed":u.BlockEmbed,"blots/break":h.default,"blots/container":y.default,"blots/cursor":x.default,"blots/embed":w.default,"blots/inline":S.default,"blots/scroll":P.default,"blots/text":T.default,"modules/clipboard":I.default,"modules/history":A.default,"modules/keyboard":L.default}),s.default.register(d.default,h.default,x.default,S.default,P.default,T.default),n.default=c.default}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=o(1),s=(function(){function l(c){this.domNode=c,this.domNode[a.DATA_KEY]={blot:this}}return Object.defineProperty(l.prototype,"statics",{get:function(){return this.constructor},enumerable:!0,configurable:!0}),l.create=function(c){if(this.tagName==null)throw new a.ParchmentError("Blot definition missing tagName");var u;return Array.isArray(this.tagName)?(typeof c=="string"&&(c=c.toUpperCase(),parseInt(c).toString()===c&&(c=parseInt(c))),typeof c=="number"?u=document.createElement(this.tagName[c-1]):this.tagName.indexOf(c)>-1?u=document.createElement(c):u=document.createElement(this.tagName[0])):u=document.createElement(this.tagName),this.className&&u.classList.add(this.className),u},l.prototype.attach=function(){this.parent!=null&&(this.scroll=this.parent.scroll)},l.prototype.clone=function(){var c=this.domNode.cloneNode(!1);return a.create(c)},l.prototype.detach=function(){this.parent!=null&&this.parent.removeChild(this),delete this.domNode[a.DATA_KEY]},l.prototype.deleteAt=function(c,u){var d=this.isolate(c,u);d.remove()},l.prototype.formatAt=function(c,u,d,f){var h=this.isolate(c,u);if(a.query(d,a.Scope.BLOT)!=null&&f)h.wrap(d,f);else if(a.query(d,a.Scope.ATTRIBUTE)!=null){var p=a.create(this.statics.scope);h.wrap(p),p.format(d,f)}},l.prototype.insertAt=function(c,u,d){var f=d==null?a.create("text",u):a.create(u,d),h=this.split(c);this.parent.insertBefore(f,h)},l.prototype.insertInto=function(c,u){u===void 0&&(u=null),this.parent!=null&&this.parent.children.remove(this);var d=null;c.children.insertBefore(this,u),u!=null&&(d=u.domNode),(this.domNode.parentNode!=c.domNode||this.domNode.nextSibling!=d)&&c.domNode.insertBefore(this.domNode,d),this.parent=c,this.attach()},l.prototype.isolate=function(c,u){var d=this.split(c);return d.split(u),d},l.prototype.length=function(){return 1},l.prototype.offset=function(c){return c===void 0&&(c=this.parent),this.parent==null||this==c?0:this.parent.children.offset(this)+this.parent.offset(c)},l.prototype.optimize=function(c){this.domNode[a.DATA_KEY]!=null&&delete this.domNode[a.DATA_KEY].mutations},l.prototype.remove=function(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},l.prototype.replace=function(c){c.parent!=null&&(c.parent.insertBefore(this,c.next),c.remove())},l.prototype.replaceWith=function(c,u){var d=typeof c=="string"?a.create(c,u):c;return d.replace(this),d},l.prototype.split=function(c,u){return c===0?this:this.next},l.prototype.update=function(c,u){},l.prototype.wrap=function(c,u){var d=typeof c=="string"?a.create(c,u):c;return this.parent!=null&&this.parent.insertBefore(d,this.next),d.appendChild(this),d},l.blotName="abstract",l})();n.default=s}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=o(12),s=o(32),l=o(33),c=o(1),u=(function(){function d(f){this.attributes={},this.domNode=f,this.build()}return d.prototype.attribute=function(f,h){h?f.add(this.domNode,h)&&(f.value(this.domNode)!=null?this.attributes[f.attrName]=f:delete this.attributes[f.attrName]):(f.remove(this.domNode),delete this.attributes[f.attrName])},d.prototype.build=function(){var f=this;this.attributes={};var h=a.default.keys(this.domNode),p=s.default.keys(this.domNode),y=l.default.keys(this.domNode);h.concat(p).concat(y).forEach(function(m){var x=c.query(m,c.Scope.ATTRIBUTE);x instanceof a.default&&(f.attributes[x.attrName]=x)})},d.prototype.copy=function(f){var h=this;Object.keys(this.attributes).forEach(function(p){var y=h.attributes[p].value(h.domNode);f.format(p,y)})},d.prototype.move=function(f){var h=this;this.copy(f),Object.keys(this.attributes).forEach(function(p){h.attributes[p].remove(h.domNode)}),this.attributes={}},d.prototype.values=function(){var f=this;return Object.keys(this.attributes).reduce(function(h,p){return h[p]=f.attributes[p].value(f.domNode),h},{})},d})();n.default=u}),(function(r,n,o){var a=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var h in f)f.hasOwnProperty(h)&&(d[h]=f[h])};return function(d,f){u(d,f);function h(){this.constructor=d}d.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)}})();Object.defineProperty(n,"__esModule",{value:!0});var s=o(12);function l(u,d){var f=u.getAttribute("class")||"";return f.split(/\s+/).filter(function(h){return h.indexOf(d+"-")===0})}var c=(function(u){a(d,u);function d(){return u!==null&&u.apply(this,arguments)||this}return d.keys=function(f){return(f.getAttribute("class")||"").split(/\s+/).map(function(h){return h.split("-").slice(0,-1).join("-")})},d.prototype.add=function(f,h){return this.canAdd(f,h)?(this.remove(f),f.classList.add(this.keyName+"-"+h),!0):!1},d.prototype.remove=function(f){var h=l(f,this.keyName);h.forEach(function(p){f.classList.remove(p)}),f.classList.length===0&&f.removeAttribute("class")},d.prototype.value=function(f){var h=l(f,this.keyName)[0]||"",p=h.slice(this.keyName.length+1);return this.canAdd(f,p)?p:""},d})(s.default);n.default=c}),(function(r,n,o){var a=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var h in f)f.hasOwnProperty(h)&&(d[h]=f[h])};return function(d,f){u(d,f);function h(){this.constructor=d}d.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)}})();Object.defineProperty(n,"__esModule",{value:!0});var s=o(12);function l(u){var d=u.split("-"),f=d.slice(1).map(function(h){return h[0].toUpperCase()+h.slice(1)}).join("");return d[0]+f}var c=(function(u){a(d,u);function d(){return u!==null&&u.apply(this,arguments)||this}return d.keys=function(f){return(f.getAttribute("style")||"").split(";").map(function(h){var p=h.split(":");return p[0].trim()})},d.prototype.add=function(f,h){return this.canAdd(f,h)?(f.style[l(this.keyName)]=h,!0):!1},d.prototype.remove=function(f){f.style[l(this.keyName)]="",f.getAttribute("style")||f.removeAttribute("style")},d.prototype.value=function(f){var h=f.style[l(this.keyName)];return this.canAdd(f,h)?h:""},d})(s.default);n.default=c}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function c(u,d){for(var f=0;f<d.length;f++){var h=d[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(u,h.key,h)}}return function(u,d,f){return d&&c(u.prototype,d),f&&c(u,f),u}})();function s(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}var l=(function(){function c(u,d){s(this,c),this.quill=u,this.options=d,this.modules={}}return a(c,[{key:"init",value:function(){var d=this;Object.keys(this.options.modules).forEach(function(f){d.modules[f]==null&&d.addModule(f)})}},{key:"addModule",value:function(d){var f=this.quill.constructor.import("modules/"+d);return this.modules[d]=new f(this.quill,this.options.modules[d]||{}),this.modules[d]}}]),c})();l.DEFAULTS={modules:{}},l.themes={default:l},n.default=l}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function b(w,k){for(var S=0;S<k.length;S++){var _=k[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(w,_.key,_)}}return function(w,k,S){return k&&b(w.prototype,k),S&&b(w,S),w}})(),s=function b(w,k,S){w===null&&(w=Function.prototype);var _=Object.getOwnPropertyDescriptor(w,k);if(_===void 0){var P=Object.getPrototypeOf(w);return P===null?void 0:b(P,k,S)}else{if("value"in _)return _.value;var O=_.get;return O===void 0?void 0:O.call(S)}},l=o(0),c=f(l),u=o(7),d=f(u);function f(b){return b&&b.__esModule?b:{default:b}}function h(b,w){if(!(b instanceof w))throw new TypeError("Cannot call a class as a function")}function p(b,w){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:b}function y(b,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);b.prototype=Object.create(w&&w.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(b,w):b.__proto__=w)}var m="\uFEFF",x=(function(b){y(w,b);function w(k){h(this,w);var S=p(this,(w.__proto__||Object.getPrototypeOf(w)).call(this,k));return S.contentNode=document.createElement("span"),S.contentNode.setAttribute("contenteditable",!1),[].slice.call(S.domNode.childNodes).forEach(function(_){S.contentNode.appendChild(_)}),S.leftGuard=document.createTextNode(m),S.rightGuard=document.createTextNode(m),S.domNode.appendChild(S.leftGuard),S.domNode.appendChild(S.contentNode),S.domNode.appendChild(S.rightGuard),S}return a(w,[{key:"index",value:function(S,_){return S===this.leftGuard?0:S===this.rightGuard?1:s(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"index",this).call(this,S,_)}},{key:"restore",value:function(S){var _=void 0,P=void 0,O=S.data.split(m).join("");if(S===this.leftGuard)if(this.prev instanceof d.default){var T=this.prev.length();this.prev.insertAt(T,O),_={startNode:this.prev.domNode,startOffset:T+O.length}}else P=document.createTextNode(O),this.parent.insertBefore(c.default.create(P),this),_={startNode:P,startOffset:O.length};else S===this.rightGuard&&(this.next instanceof d.default?(this.next.insertAt(0,O),_={startNode:this.next.domNode,startOffset:O.length}):(P=document.createTextNode(O),this.parent.insertBefore(c.default.create(P),this.next),_={startNode:P,startOffset:O.length}));return S.data=m,_}},{key:"update",value:function(S,_){var P=this;S.forEach(function(O){if(O.type==="characterData"&&(O.target===P.leftGuard||O.target===P.rightGuard)){var T=P.restore(O.target);T&&(_.range=T)}})}}]),w})(c.default.Embed);n.default=x}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.AlignStyle=n.AlignClass=n.AlignAttribute=void 0;var a=o(0),s=l(a);function l(h){return h&&h.__esModule?h:{default:h}}var c={scope:s.default.Scope.BLOCK,whitelist:["right","center","justify"]},u=new s.default.Attributor.Attribute("align","align",c),d=new s.default.Attributor.Class("align","ql-align",c),f=new s.default.Attributor.Style("align","text-align",c);n.AlignAttribute=u,n.AlignClass=d,n.AlignStyle=f}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.BackgroundStyle=n.BackgroundClass=void 0;var a=o(0),s=c(a),l=o(26);function c(f){return f&&f.__esModule?f:{default:f}}var u=new s.default.Attributor.Class("background","ql-bg",{scope:s.default.Scope.INLINE}),d=new l.ColorAttributor("background","background-color",{scope:s.default.Scope.INLINE});n.BackgroundClass=u,n.BackgroundStyle=d}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.DirectionStyle=n.DirectionClass=n.DirectionAttribute=void 0;var a=o(0),s=l(a);function l(h){return h&&h.__esModule?h:{default:h}}var c={scope:s.default.Scope.BLOCK,whitelist:["rtl"]},u=new s.default.Attributor.Attribute("direction","dir",c),d=new s.default.Attributor.Class("direction","ql-direction",c),f=new s.default.Attributor.Style("direction","direction",c);n.DirectionAttribute=u,n.DirectionClass=d,n.DirectionStyle=f}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.FontClass=n.FontStyle=void 0;var a=(function(){function b(w,k){for(var S=0;S<k.length;S++){var _=k[S];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(w,_.key,_)}}return function(w,k,S){return k&&b(w.prototype,k),S&&b(w,S),w}})(),s=function b(w,k,S){w===null&&(w=Function.prototype);var _=Object.getOwnPropertyDescriptor(w,k);if(_===void 0){var P=Object.getPrototypeOf(w);return P===null?void 0:b(P,k,S)}else{if("value"in _)return _.value;var O=_.get;return O===void 0?void 0:O.call(S)}},l=o(0),c=u(l);function u(b){return b&&b.__esModule?b:{default:b}}function d(b,w){if(!(b instanceof w))throw new TypeError("Cannot call a class as a function")}function f(b,w){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return w&&(typeof w=="object"||typeof w=="function")?w:b}function h(b,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof w);b.prototype=Object.create(w&&w.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),w&&(Object.setPrototypeOf?Object.setPrototypeOf(b,w):b.__proto__=w)}var p={scope:c.default.Scope.INLINE,whitelist:["serif","monospace"]},y=new c.default.Attributor.Class("font","ql-font",p),m=(function(b){h(w,b);function w(){return d(this,w),f(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}return a(w,[{key:"value",value:function(S){return s(w.prototype.__proto__||Object.getPrototypeOf(w.prototype),"value",this).call(this,S).replace(/["']/g,"")}}]),w})(c.default.Attributor.Style),x=new m("font","font-family",p);n.FontStyle=x,n.FontClass=y}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.SizeStyle=n.SizeClass=void 0;var a=o(0),s=l(a);function l(d){return d&&d.__esModule?d:{default:d}}var c=new s.default.Attributor.Class("size","ql-size",{scope:s.default.Scope.INLINE,whitelist:["small","large","huge"]}),u=new s.default.Attributor.Style("size","font-size",{scope:s.default.Scope.INLINE,whitelist:["10px","18px","32px"]});n.SizeClass=c,n.SizeStyle=u}),(function(r,n,o){r.exports={align:{"":o(76),center:o(77),right:o(78),justify:o(79)},background:o(80),blockquote:o(81),bold:o(82),clean:o(83),code:o(58),"code-block":o(58),color:o(84),direction:{"":o(85),rtl:o(86)},float:{center:o(87),full:o(88),left:o(89),right:o(90)},formula:o(91),header:{1:o(92),2:o(93)},italic:o(94),image:o(95),indent:{"+1":o(96),"-1":o(97)},link:o(98),list:{ordered:o(99),bullet:o(100),check:o(101)},script:{sub:o(102),super:o(103)},strike:o(104),underline:o(105),video:o(106)}}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.getLastChangeIndex=n.default=void 0;var a=(function(){function k(S,_){for(var P=0;P<_.length;P++){var O=_[P];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(S,O.key,O)}}return function(S,_,P){return _&&k(S.prototype,_),P&&k(S,P),S}})(),s=o(0),l=h(s),c=o(5),u=h(c),d=o(9),f=h(d);function h(k){return k&&k.__esModule?k:{default:k}}function p(k,S){if(!(k instanceof S))throw new TypeError("Cannot call a class as a function")}function y(k,S){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:k}function m(k,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);k.prototype=Object.create(S&&S.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(k,S):k.__proto__=S)}var x=(function(k){m(S,k);function S(_,P){p(this,S);var O=y(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,_,P));return O.lastRecorded=0,O.ignoreChange=!1,O.clear(),O.quill.on(u.default.events.EDITOR_CHANGE,function(T,R,I,E){T!==u.default.events.TEXT_CHANGE||O.ignoreChange||(!O.options.userOnly||E===u.default.sources.USER?O.record(R,I):O.transform(R))}),O.quill.keyboard.addBinding({key:"Z",shortKey:!0},O.undo.bind(O)),O.quill.keyboard.addBinding({key:"Z",shortKey:!0,shiftKey:!0},O.redo.bind(O)),/Win/i.test(navigator.platform)&&O.quill.keyboard.addBinding({key:"Y",shortKey:!0},O.redo.bind(O)),O}return a(S,[{key:"change",value:function(P,O){if(this.stack[P].length!==0){var T=this.stack[P].pop();this.stack[O].push(T),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(T[P],u.default.sources.USER),this.ignoreChange=!1;var R=w(T[P]);this.quill.setSelection(R)}}},{key:"clear",value:function(){this.stack={undo:[],redo:[]}}},{key:"cutoff",value:function(){this.lastRecorded=0}},{key:"record",value:function(P,O){if(P.ops.length!==0){this.stack.redo=[];var T=this.quill.getContents().diff(O),R=Date.now();if(this.lastRecorded+this.options.delay>R&&this.stack.undo.length>0){var I=this.stack.undo.pop();T=T.compose(I.undo),P=I.redo.compose(P)}else this.lastRecorded=R;this.stack.undo.push({redo:P,undo:T}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(P){this.stack.undo.forEach(function(O){O.undo=P.transform(O.undo,!0),O.redo=P.transform(O.redo,!0)}),this.stack.redo.forEach(function(O){O.undo=P.transform(O.undo,!0),O.redo=P.transform(O.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),S})(f.default);x.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1};function b(k){var S=k.ops[k.ops.length-1];return S==null?!1:S.insert!=null?typeof S.insert=="string"&&S.insert.endsWith(`
|
||
`):S.attributes!=null?Object.keys(S.attributes).some(function(_){return l.default.query(_,l.default.Scope.BLOCK)!=null}):!1}function w(k){var S=k.reduce(function(P,O){return P+=O.delete||0,P},0),_=k.length()-S;return b(k)&&(_-=1),_}n.default=x,n.getLastChangeIndex=w}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BaseTooltip=void 0;var a=(function(){function M($,q){for(var Y=0;Y<q.length;Y++){var K=q[Y];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty($,K.key,K)}}return function($,q,Y){return q&&M($.prototype,q),Y&&M($,Y),$}})(),s=function M($,q,Y){$===null&&($=Function.prototype);var K=Object.getOwnPropertyDescriptor($,q);if(K===void 0){var G=Object.getPrototypeOf($);return G===null?void 0:M(G,q,Y)}else{if("value"in K)return K.value;var re=K.get;return re===void 0?void 0:re.call(Y)}},l=o(3),c=R(l),u=o(2),d=R(u),f=o(8),h=R(f),p=o(23),y=R(p),m=o(34),x=R(m),b=o(59),w=R(b),k=o(60),S=R(k),_=o(28),P=R(_),O=o(61),T=R(O);function R(M){return M&&M.__esModule?M:{default:M}}function I(M,$){if(!(M instanceof $))throw new TypeError("Cannot call a class as a function")}function E(M,$){if(!M)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $&&(typeof $=="object"||typeof $=="function")?$:M}function A(M,$){if(typeof $!="function"&&$!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof $);M.prototype=Object.create($&&$.prototype,{constructor:{value:M,enumerable:!1,writable:!0,configurable:!0}}),$&&(Object.setPrototypeOf?Object.setPrototypeOf(M,$):M.__proto__=$)}var F=[!1,"center","right","justify"],L=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],z=[!1,"serif","monospace"],V=["1","2","3",!1],Q=["small",!1,"large","huge"],U=(function(M){A($,M);function $(q,Y){I(this,$);var K=E(this,($.__proto__||Object.getPrototypeOf($)).call(this,q,Y)),G=function re(J){if(!document.body.contains(q.root))return document.body.removeEventListener("click",re);K.tooltip!=null&&!K.tooltip.root.contains(J.target)&&document.activeElement!==K.tooltip.textbox&&!K.quill.hasFocus()&&K.tooltip.hide(),K.pickers!=null&&K.pickers.forEach(function(ae){ae.container.contains(J.target)||ae.close()})};return q.emitter.listenDOM("click",document.body,G),K}return a($,[{key:"addModule",value:function(Y){var K=s($.prototype.__proto__||Object.getPrototypeOf($.prototype),"addModule",this).call(this,Y);return Y==="toolbar"&&this.extendToolbar(K),K}},{key:"buildButtons",value:function(Y,K){Y.forEach(function(G){var re=G.getAttribute("class")||"";re.split(/\s+/).forEach(function(J){if(J.startsWith("ql-")&&(J=J.slice(3),K[J]!=null))if(J==="direction")G.innerHTML=K[J][""]+K[J].rtl;else if(typeof K[J]=="string")G.innerHTML=K[J];else{var ae=G.value||"";ae!=null&&K[J][ae]&&(G.innerHTML=K[J][ae])}})})}},{key:"buildPickers",value:function(Y,K){var G=this;this.pickers=Y.map(function(J){if(J.classList.contains("ql-align"))return J.querySelector("option")==null&&B(J,F),new S.default(J,K.align);if(J.classList.contains("ql-background")||J.classList.contains("ql-color")){var ae=J.classList.contains("ql-background")?"background":"color";return J.querySelector("option")==null&&B(J,L,ae==="background"?"#ffffff":"#000000"),new w.default(J,K[ae])}else return J.querySelector("option")==null&&(J.classList.contains("ql-font")?B(J,z):J.classList.contains("ql-header")?B(J,V):J.classList.contains("ql-size")&&B(J,Q)),new P.default(J)});var re=function(){G.pickers.forEach(function(ae){ae.update()})};this.quill.on(h.default.events.EDITOR_CHANGE,re)}}]),$})(x.default);U.DEFAULTS=(0,c.default)(!0,{},x.default.DEFAULTS,{modules:{toolbar:{handlers:{formula:function(){this.quill.theme.tooltip.edit("formula")},image:function(){var $=this,q=this.container.querySelector("input.ql-image[type=file]");q==null&&(q=document.createElement("input"),q.setAttribute("type","file"),q.setAttribute("accept","image/png, image/gif, image/jpeg, image/bmp, image/x-icon"),q.classList.add("ql-image"),q.addEventListener("change",function(){if(q.files!=null&&q.files[0]!=null){var Y=new FileReader;Y.onload=function(K){var G=$.quill.getSelection(!0);$.quill.updateContents(new d.default().retain(G.index).delete(G.length).insert({image:K.target.result}),h.default.sources.USER),$.quill.setSelection(G.index+1,h.default.sources.SILENT),q.value=""},Y.readAsDataURL(q.files[0])}}),this.container.appendChild(q)),q.click()},video:function(){this.quill.theme.tooltip.edit("video")}}}}});var ee=(function(M){A($,M);function $(q,Y){I(this,$);var K=E(this,($.__proto__||Object.getPrototypeOf($)).call(this,q,Y));return K.textbox=K.root.querySelector('input[type="text"]'),K.listen(),K}return a($,[{key:"listen",value:function(){var Y=this;this.textbox.addEventListener("keydown",function(K){y.default.match(K,"enter")?(Y.save(),K.preventDefault()):y.default.match(K,"escape")&&(Y.cancel(),K.preventDefault())})}},{key:"cancel",value:function(){this.hide()}},{key:"edit",value:function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),K!=null?this.textbox.value=K:Y!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+Y)||""),this.root.setAttribute("data-mode",Y)}},{key:"restoreFocus",value:function(){var Y=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=Y}},{key:"save",value:function(){var Y=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":{var K=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",Y,h.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",Y,h.default.sources.USER)),this.quill.root.scrollTop=K;break}case"video":Y=H(Y);case"formula":{if(!Y)break;var G=this.quill.getSelection(!0);if(G!=null){var re=G.index+G.length;this.quill.insertEmbed(re,this.root.getAttribute("data-mode"),Y,h.default.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(re+1," ",h.default.sources.USER),this.quill.setSelection(re+2,h.default.sources.USER)}break}}this.textbox.value="",this.hide()}}]),$})(T.default);function H(M){var $=M.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||M.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return $?($[1]||"https")+"://www.youtube.com/embed/"+$[2]+"?showinfo=0":($=M.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?($[1]||"https")+"://player.vimeo.com/video/"+$[2]+"/":M}function B(M,$){var q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;$.forEach(function(Y){var K=document.createElement("option");Y===q?K.setAttribute("selected","selected"):K.setAttribute("value",Y),M.appendChild(K)})}n.BaseTooltip=ee,n.default=U}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function s(){this.head=this.tail=null,this.length=0}return s.prototype.append=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];this.insertBefore(l[0],null),l.length>1&&this.append.apply(this,l.slice(1))},s.prototype.contains=function(l){for(var c,u=this.iterator();c=u();)if(c===l)return!0;return!1},s.prototype.insertBefore=function(l,c){l&&(l.next=c,c!=null?(l.prev=c.prev,c.prev!=null&&(c.prev.next=l),c.prev=l,c===this.head&&(this.head=l)):this.tail!=null?(this.tail.next=l,l.prev=this.tail,this.tail=l):(l.prev=null,this.head=this.tail=l),this.length+=1)},s.prototype.offset=function(l){for(var c=0,u=this.head;u!=null;){if(u===l)return c;c+=u.length(),u=u.next}return-1},s.prototype.remove=function(l){this.contains(l)&&(l.prev!=null&&(l.prev.next=l.next),l.next!=null&&(l.next.prev=l.prev),l===this.head&&(this.head=l.next),l===this.tail&&(this.tail=l.prev),this.length-=1)},s.prototype.iterator=function(l){return l===void 0&&(l=this.head),function(){var c=l;return l!=null&&(l=l.next),c}},s.prototype.find=function(l,c){c===void 0&&(c=!1);for(var u,d=this.iterator();u=d();){var f=u.length();if(l<f||c&&l===f&&(u.next==null||u.next.length()!==0))return[u,l];l-=f}return[null,0]},s.prototype.forEach=function(l){for(var c,u=this.iterator();c=u();)l(c)},s.prototype.forEachAt=function(l,c,u){if(!(c<=0))for(var d=this.find(l),f=d[0],h=d[1],p,y=l-h,m=this.iterator(f);(p=m())&&y<l+c;){var x=p.length();l>y?u(p,l-y,Math.min(c,y+x-l)):u(p,0,Math.min(x,l+c-y)),y+=x}},s.prototype.map=function(l){return this.reduce(function(c,u){return c.push(l(u)),c},[])},s.prototype.reduce=function(l,c){for(var u,d=this.iterator();u=d();)c=l(c,u);return c},s})();n.default=a}),(function(r,n,o){var a=this&&this.__extends||(function(){var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,p){h.__proto__=p}||function(h,p){for(var y in p)p.hasOwnProperty(y)&&(h[y]=p[y])};return function(h,p){f(h,p);function y(){this.constructor=h}h.prototype=p===null?Object.create(p):(y.prototype=p.prototype,new y)}})();Object.defineProperty(n,"__esModule",{value:!0});var s=o(17),l=o(1),c={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},u=100,d=(function(f){a(h,f);function h(p){var y=f.call(this,p)||this;return y.scroll=y,y.observer=new MutationObserver(function(m){y.update(m)}),y.observer.observe(y.domNode,c),y.attach(),y}return h.prototype.detach=function(){f.prototype.detach.call(this),this.observer.disconnect()},h.prototype.deleteAt=function(p,y){this.update(),p===0&&y===this.length()?this.children.forEach(function(m){m.remove()}):f.prototype.deleteAt.call(this,p,y)},h.prototype.formatAt=function(p,y,m,x){this.update(),f.prototype.formatAt.call(this,p,y,m,x)},h.prototype.insertAt=function(p,y,m){this.update(),f.prototype.insertAt.call(this,p,y,m)},h.prototype.optimize=function(p,y){var m=this;p===void 0&&(p=[]),y===void 0&&(y={}),f.prototype.optimize.call(this,y);for(var x=[].slice.call(this.observer.takeRecords());x.length>0;)p.push(x.pop());for(var b=function(_,P){P===void 0&&(P=!0),!(_==null||_===m)&&_.domNode.parentNode!=null&&(_.domNode[l.DATA_KEY].mutations==null&&(_.domNode[l.DATA_KEY].mutations=[]),P&&b(_.parent))},w=function(_){_.domNode[l.DATA_KEY]==null||_.domNode[l.DATA_KEY].mutations==null||(_ instanceof s.default&&_.children.forEach(w),_.optimize(y))},k=p,S=0;k.length>0;S+=1){if(S>=u)throw new Error("[Parchment] Maximum optimize iterations reached");for(k.forEach(function(_){var P=l.find(_.target,!0);P!=null&&(P.domNode===_.target&&(_.type==="childList"?(b(l.find(_.previousSibling,!1)),[].forEach.call(_.addedNodes,function(O){var T=l.find(O,!1);b(T,!1),T instanceof s.default&&T.children.forEach(function(R){b(R,!1)})})):_.type==="attributes"&&b(P.prev)),b(P))}),this.children.forEach(w),k=[].slice.call(this.observer.takeRecords()),x=k.slice();x.length>0;)p.push(x.pop())}},h.prototype.update=function(p,y){var m=this;y===void 0&&(y={}),p=p||this.observer.takeRecords(),p.map(function(x){var b=l.find(x.target,!0);return b==null?null:b.domNode[l.DATA_KEY].mutations==null?(b.domNode[l.DATA_KEY].mutations=[x],b):(b.domNode[l.DATA_KEY].mutations.push(x),null)}).forEach(function(x){x==null||x===m||x.domNode[l.DATA_KEY]==null||x.update(x.domNode[l.DATA_KEY].mutations||[],y)}),this.domNode[l.DATA_KEY].mutations!=null&&f.prototype.update.call(this,this.domNode[l.DATA_KEY].mutations,y),this.optimize(p,y)},h.blotName="scroll",h.defaultChild="block",h.scope=l.Scope.BLOCK_BLOT,h.tagName="DIV",h})(s.default);n.default=d}),(function(r,n,o){var a=this&&this.__extends||(function(){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var p in h)h.hasOwnProperty(p)&&(f[p]=h[p])};return function(f,h){d(f,h);function p(){this.constructor=f}f.prototype=h===null?Object.create(h):(p.prototype=h.prototype,new p)}})();Object.defineProperty(n,"__esModule",{value:!0});var s=o(18),l=o(1);function c(d,f){if(Object.keys(d).length!==Object.keys(f).length)return!1;for(var h in d)if(d[h]!==f[h])return!1;return!0}var u=(function(d){a(f,d);function f(){return d!==null&&d.apply(this,arguments)||this}return f.formats=function(h){if(h.tagName!==f.tagName)return d.formats.call(this,h)},f.prototype.format=function(h,p){var y=this;h===this.statics.blotName&&!p?(this.children.forEach(function(m){m instanceof s.default||(m=m.wrap(f.blotName,!0)),y.attributes.copy(m)}),this.unwrap()):d.prototype.format.call(this,h,p)},f.prototype.formatAt=function(h,p,y,m){if(this.formats()[y]!=null||l.query(y,l.Scope.ATTRIBUTE)){var x=this.isolate(h,p);x.format(y,m)}else d.prototype.formatAt.call(this,h,p,y,m)},f.prototype.optimize=function(h){d.prototype.optimize.call(this,h);var p=this.formats();if(Object.keys(p).length===0)return this.unwrap();var y=this.next;y instanceof f&&y.prev===this&&c(p,y.formats())&&(y.moveChildren(this),y.remove())},f.blotName="inline",f.scope=l.Scope.INLINE_BLOT,f.tagName="SPAN",f})(s.default);n.default=u}),(function(r,n,o){var a=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var h in f)f.hasOwnProperty(h)&&(d[h]=f[h])};return function(d,f){u(d,f);function h(){this.constructor=d}d.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)}})();Object.defineProperty(n,"__esModule",{value:!0});var s=o(18),l=o(1),c=(function(u){a(d,u);function d(){return u!==null&&u.apply(this,arguments)||this}return d.formats=function(f){var h=l.query(d.blotName).tagName;if(f.tagName!==h)return u.formats.call(this,f)},d.prototype.format=function(f,h){l.query(f,l.Scope.BLOCK)!=null&&(f===this.statics.blotName&&!h?this.replaceWith(d.blotName):u.prototype.format.call(this,f,h))},d.prototype.formatAt=function(f,h,p,y){l.query(p,l.Scope.BLOCK)!=null?this.format(p,y):u.prototype.formatAt.call(this,f,h,p,y)},d.prototype.insertAt=function(f,h,p){if(p==null||l.query(h,l.Scope.INLINE)!=null)u.prototype.insertAt.call(this,f,h,p);else{var y=this.split(f),m=l.create(h,p);y.parent.insertBefore(m,y)}},d.prototype.update=function(f,h){navigator.userAgent.match(/Trident/)?this.build():u.prototype.update.call(this,f,h)},d.blotName="block",d.scope=l.Scope.BLOCK_BLOT,d.tagName="P",d})(s.default);n.default=c}),(function(r,n,o){var a=this&&this.__extends||(function(){var c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,d){u.__proto__=d}||function(u,d){for(var f in d)d.hasOwnProperty(f)&&(u[f]=d[f])};return function(u,d){c(u,d);function f(){this.constructor=u}u.prototype=d===null?Object.create(d):(f.prototype=d.prototype,new f)}})();Object.defineProperty(n,"__esModule",{value:!0});var s=o(19),l=(function(c){a(u,c);function u(){return c!==null&&c.apply(this,arguments)||this}return u.formats=function(d){},u.prototype.format=function(d,f){c.prototype.formatAt.call(this,0,this.length(),d,f)},u.prototype.formatAt=function(d,f,h,p){d===0&&f===this.length()?this.format(h,p):c.prototype.formatAt.call(this,d,f,h,p)},u.prototype.formats=function(){return this.statics.formats(this.domNode)},u})(s.default);n.default=l}),(function(r,n,o){var a=this&&this.__extends||(function(){var u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,f){d.__proto__=f}||function(d,f){for(var h in f)f.hasOwnProperty(h)&&(d[h]=f[h])};return function(d,f){u(d,f);function h(){this.constructor=d}d.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)}})();Object.defineProperty(n,"__esModule",{value:!0});var s=o(19),l=o(1),c=(function(u){a(d,u);function d(f){var h=u.call(this,f)||this;return h.text=h.statics.value(h.domNode),h}return d.create=function(f){return document.createTextNode(f)},d.value=function(f){var h=f.data;return h.normalize&&(h=h.normalize()),h},d.prototype.deleteAt=function(f,h){this.domNode.data=this.text=this.text.slice(0,f)+this.text.slice(f+h)},d.prototype.index=function(f,h){return this.domNode===f?h:-1},d.prototype.insertAt=function(f,h,p){p==null?(this.text=this.text.slice(0,f)+h+this.text.slice(f),this.domNode.data=this.text):u.prototype.insertAt.call(this,f,h,p)},d.prototype.length=function(){return this.text.length},d.prototype.optimize=function(f){u.prototype.optimize.call(this,f),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof d&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},d.prototype.position=function(f,h){return[this.domNode,f]},d.prototype.split=function(f,h){if(h===void 0&&(h=!1),!h){if(f===0)return this;if(f===this.length())return this.next}var p=l.create(this.domNode.splitText(f));return this.parent.insertBefore(p,this.next),this.text=this.statics.value(this.domNode),p},d.prototype.update=function(f,h){var p=this;f.some(function(y){return y.type==="characterData"&&y.target===p.domNode})&&(this.text=this.statics.value(this.domNode))},d.prototype.value=function(){return this.text},d.blotName="text",d.scope=l.Scope.INLINE_BLOT,d})(s.default);n.default=c}),(function(r,n,o){var a=document.createElement("div");if(a.classList.toggle("test-class",!1),a.classList.contains("test-class")){var s=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(l,c){return arguments.length>1&&!this.contains(l)==!c?c:s.call(this,l)}}String.prototype.startsWith||(String.prototype.startsWith=function(l,c){return c=c||0,this.substr(c,l.length)===l}),String.prototype.endsWith||(String.prototype.endsWith=function(l,c){var u=this.toString();(typeof c!="number"||!isFinite(c)||Math.floor(c)!==c||c>u.length)&&(c=u.length),c-=l.length;var d=u.indexOf(l,c);return d!==-1&&d===c}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(c){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof c!="function")throw new TypeError("predicate must be a function");for(var u=Object(this),d=u.length>>>0,f=arguments[1],h,p=0;p<d;p++)if(h=u[p],c.call(f,h,p,u))return h}}),document.addEventListener("DOMContentLoaded",function(){document.execCommand("enableObjectResizing",!1,!1),document.execCommand("autoUrlDetect",!1,!1)})}),(function(r,n){var o=-1,a=1,s=0;function l(S,_,P){if(S==_)return S?[[s,S]]:[];(P<0||S.length<P)&&(P=null);var O=f(S,_),T=S.substring(0,O);S=S.substring(O),_=_.substring(O),O=h(S,_);var R=S.substring(S.length-O);S=S.substring(0,S.length-O),_=_.substring(0,_.length-O);var I=c(S,_);return T&&I.unshift([s,T]),R&&I.push([s,R]),y(I),P!=null&&(I=b(I,P)),I=w(I),I}function c(S,_){var P;if(!S)return[[a,_]];if(!_)return[[o,S]];var O=S.length>_.length?S:_,T=S.length>_.length?_:S,R=O.indexOf(T);if(R!=-1)return P=[[a,O.substring(0,R)],[s,T],[a,O.substring(R+T.length)]],S.length>_.length&&(P[0][0]=P[2][0]=o),P;if(T.length==1)return[[o,S],[a,_]];var I=p(S,_);if(I){var E=I[0],A=I[1],F=I[2],L=I[3],z=I[4],V=l(E,F),Q=l(A,L);return V.concat([[s,z]],Q)}return u(S,_)}function u(S,_){for(var P=S.length,O=_.length,T=Math.ceil((P+O)/2),R=T,I=2*T,E=new Array(I),A=new Array(I),F=0;F<I;F++)E[F]=-1,A[F]=-1;E[R+1]=0,A[R+1]=0;for(var L=P-O,z=L%2!=0,V=0,Q=0,U=0,ee=0,H=0;H<T;H++){for(var B=-H+V;B<=H-Q;B+=2){var M=R+B,$;B==-H||B!=H&&E[M-1]<E[M+1]?$=E[M+1]:$=E[M-1]+1;for(var q=$-B;$<P&&q<O&&S.charAt($)==_.charAt(q);)$++,q++;if(E[M]=$,$>P)Q+=2;else if(q>O)V+=2;else if(z){var Y=R+L-B;if(Y>=0&&Y<I&&A[Y]!=-1){var K=P-A[Y];if($>=K)return d(S,_,$,q)}}}for(var G=-H+U;G<=H-ee;G+=2){var Y=R+G,K;G==-H||G!=H&&A[Y-1]<A[Y+1]?K=A[Y+1]:K=A[Y-1]+1;for(var re=K-G;K<P&&re<O&&S.charAt(P-K-1)==_.charAt(O-re-1);)K++,re++;if(A[Y]=K,K>P)ee+=2;else if(re>O)U+=2;else if(!z){var M=R+L-G;if(M>=0&&M<I&&E[M]!=-1){var $=E[M],q=R+$-M;if(K=P-K,$>=K)return d(S,_,$,q)}}}}return[[o,S],[a,_]]}function d(S,_,P,O){var T=S.substring(0,P),R=_.substring(0,O),I=S.substring(P),E=_.substring(O),A=l(T,R),F=l(I,E);return A.concat(F)}function f(S,_){if(!S||!_||S.charAt(0)!=_.charAt(0))return 0;for(var P=0,O=Math.min(S.length,_.length),T=O,R=0;P<T;)S.substring(R,T)==_.substring(R,T)?(P=T,R=P):O=T,T=Math.floor((O-P)/2+P);return T}function h(S,_){if(!S||!_||S.charAt(S.length-1)!=_.charAt(_.length-1))return 0;for(var P=0,O=Math.min(S.length,_.length),T=O,R=0;P<T;)S.substring(S.length-T,S.length-R)==_.substring(_.length-T,_.length-R)?(P=T,R=P):O=T,T=Math.floor((O-P)/2+P);return T}function p(S,_){var P=S.length>_.length?S:_,O=S.length>_.length?_:S;if(P.length<4||O.length*2<P.length)return null;function T(Q,U,ee){for(var H=Q.substring(ee,ee+Math.floor(Q.length/4)),B=-1,M="",$,q,Y,K;(B=U.indexOf(H,B+1))!=-1;){var G=f(Q.substring(ee),U.substring(B)),re=h(Q.substring(0,ee),U.substring(0,B));M.length<re+G&&(M=U.substring(B-re,B)+U.substring(B,B+G),$=Q.substring(0,ee-re),q=Q.substring(ee+G),Y=U.substring(0,B-re),K=U.substring(B+G))}return M.length*2>=Q.length?[$,q,Y,K,M]:null}var R=T(P,O,Math.ceil(P.length/4)),I=T(P,O,Math.ceil(P.length/2)),E;if(!R&&!I)return null;I?R?E=R[4].length>I[4].length?R:I:E=I:E=R;var A,F,L,z;S.length>_.length?(A=E[0],F=E[1],L=E[2],z=E[3]):(L=E[0],z=E[1],A=E[2],F=E[3]);var V=E[4];return[A,F,L,z,V]}function y(S){S.push([s,""]);for(var _=0,P=0,O=0,T="",R="",I;_<S.length;)switch(S[_][0]){case a:O++,R+=S[_][1],_++;break;case o:P++,T+=S[_][1],_++;break;case s:P+O>1?(P!==0&&O!==0&&(I=f(R,T),I!==0&&(_-P-O>0&&S[_-P-O-1][0]==s?S[_-P-O-1][1]+=R.substring(0,I):(S.splice(0,0,[s,R.substring(0,I)]),_++),R=R.substring(I),T=T.substring(I)),I=h(R,T),I!==0&&(S[_][1]=R.substring(R.length-I)+S[_][1],R=R.substring(0,R.length-I),T=T.substring(0,T.length-I))),P===0?S.splice(_-O,P+O,[a,R]):O===0?S.splice(_-P,P+O,[o,T]):S.splice(_-P-O,P+O,[o,T],[a,R]),_=_-P-O+(P?1:0)+(O?1:0)+1):_!==0&&S[_-1][0]==s?(S[_-1][1]+=S[_][1],S.splice(_,1)):_++,O=0,P=0,T="",R="";break}S[S.length-1][1]===""&&S.pop();var E=!1;for(_=1;_<S.length-1;)S[_-1][0]==s&&S[_+1][0]==s&&(S[_][1].substring(S[_][1].length-S[_-1][1].length)==S[_-1][1]?(S[_][1]=S[_-1][1]+S[_][1].substring(0,S[_][1].length-S[_-1][1].length),S[_+1][1]=S[_-1][1]+S[_+1][1],S.splice(_-1,1),E=!0):S[_][1].substring(0,S[_+1][1].length)==S[_+1][1]&&(S[_-1][1]+=S[_+1][1],S[_][1]=S[_][1].substring(S[_+1][1].length)+S[_+1][1],S.splice(_+1,1),E=!0)),_++;E&&y(S)}var m=l;m.INSERT=a,m.DELETE=o,m.EQUAL=s,r.exports=m;function x(S,_){if(_===0)return[s,S];for(var P=0,O=0;O<S.length;O++){var T=S[O];if(T[0]===o||T[0]===s){var R=P+T[1].length;if(_===R)return[O+1,S];if(_<R){S=S.slice();var I=_-P,E=[T[0],T[1].slice(0,I)],A=[T[0],T[1].slice(I)];return S.splice(O,1,E,A),[O+1,S]}else P=R}}throw new Error("cursor_pos is out of bounds!")}function b(S,_){var P=x(S,_),O=P[1],T=P[0],R=O[T],I=O[T+1];if(R==null)return S;if(R[0]!==s)return S;if(I!=null&&R[1]+I[1]===I[1]+R[1])return O.splice(T,2,I,R),k(O,T,2);if(I!=null&&I[1].indexOf(R[1])===0){O.splice(T,2,[I[0],R[1]],[0,R[1]]);var E=I[1].slice(R[1].length);return E.length>0&&O.splice(T+2,0,[I[0],E]),k(O,T,3)}else return S}function w(S){for(var _=!1,P=function(I){return I.charCodeAt(0)>=56320&&I.charCodeAt(0)<=57343},O=function(I){return I.charCodeAt(I.length-1)>=55296&&I.charCodeAt(I.length-1)<=56319},T=2;T<S.length;T+=1)S[T-2][0]===s&&O(S[T-2][1])&&S[T-1][0]===o&&P(S[T-1][1])&&S[T][0]===a&&P(S[T][1])&&(_=!0,S[T-1][1]=S[T-2][1].slice(-1)+S[T-1][1],S[T][1]=S[T-2][1].slice(-1)+S[T][1],S[T-2][1]=S[T-2][1].slice(0,-1));if(!_)return S;for(var R=[],T=0;T<S.length;T+=1)S[T][1].length>0&&R.push(S[T]);return R}function k(S,_,P){for(var O=_+P-1;O>=0&&O>=_-1;O--)if(O+1<S.length){var T=S[O],R=S[O+1];T[0]===R[1]&&S.splice(O,2,[T[0],T[1]+R[1]])}return S}}),(function(r,n){n=r.exports=typeof Object.keys=="function"?Object.keys:o,n.shim=o;function o(a){var s=[];for(var l in a)s.push(l);return s}}),(function(r,n){var o=(function(){return Object.prototype.toString.call(arguments)})()=="[object Arguments]";n=r.exports=o?a:s,n.supported=a;function a(l){return Object.prototype.toString.call(l)=="[object Arguments]"}n.unsupported=s;function s(l){return l&&typeof l=="object"&&typeof l.length=="number"&&Object.prototype.hasOwnProperty.call(l,"callee")&&!Object.prototype.propertyIsEnumerable.call(l,"callee")||!1}}),(function(r,n){var o=Object.prototype.hasOwnProperty,a="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(a=!1));function l(u,d,f){this.fn=u,this.context=d,this.once=f||!1}function c(){this._events=new s,this._eventsCount=0}c.prototype.eventNames=function(){var d=[],f,h;if(this._eventsCount===0)return d;for(h in f=this._events)o.call(f,h)&&d.push(a?h.slice(1):h);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(f)):d},c.prototype.listeners=function(d,f){var h=a?a+d:d,p=this._events[h];if(f)return!!p;if(!p)return[];if(p.fn)return[p.fn];for(var y=0,m=p.length,x=new Array(m);y<m;y++)x[y]=p[y].fn;return x},c.prototype.emit=function(d,f,h,p,y,m){var x=a?a+d:d;if(!this._events[x])return!1;var b=this._events[x],w=arguments.length,k,S;if(b.fn){switch(b.once&&this.removeListener(d,b.fn,void 0,!0),w){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,f),!0;case 3:return b.fn.call(b.context,f,h),!0;case 4:return b.fn.call(b.context,f,h,p),!0;case 5:return b.fn.call(b.context,f,h,p,y),!0;case 6:return b.fn.call(b.context,f,h,p,y,m),!0}for(S=1,k=new Array(w-1);S<w;S++)k[S-1]=arguments[S];b.fn.apply(b.context,k)}else{var _=b.length,P;for(S=0;S<_;S++)switch(b[S].once&&this.removeListener(d,b[S].fn,void 0,!0),w){case 1:b[S].fn.call(b[S].context);break;case 2:b[S].fn.call(b[S].context,f);break;case 3:b[S].fn.call(b[S].context,f,h);break;case 4:b[S].fn.call(b[S].context,f,h,p);break;default:if(!k)for(P=1,k=new Array(w-1);P<w;P++)k[P-1]=arguments[P];b[S].fn.apply(b[S].context,k)}}return!0},c.prototype.on=function(d,f,h){var p=new l(f,h||this),y=a?a+d:d;return this._events[y]?this._events[y].fn?this._events[y]=[this._events[y],p]:this._events[y].push(p):(this._events[y]=p,this._eventsCount++),this},c.prototype.once=function(d,f,h){var p=new l(f,h||this,!0),y=a?a+d:d;return this._events[y]?this._events[y].fn?this._events[y]=[this._events[y],p]:this._events[y].push(p):(this._events[y]=p,this._eventsCount++),this},c.prototype.removeListener=function(d,f,h,p){var y=a?a+d:d;if(!this._events[y])return this;if(!f)return--this._eventsCount===0?this._events=new s:delete this._events[y],this;var m=this._events[y];if(m.fn)m.fn===f&&(!p||m.once)&&(!h||m.context===h)&&(--this._eventsCount===0?this._events=new s:delete this._events[y]);else{for(var x=0,b=[],w=m.length;x<w;x++)(m[x].fn!==f||p&&!m[x].once||h&&m[x].context!==h)&&b.push(m[x]);b.length?this._events[y]=b.length===1?b[0]:b:--this._eventsCount===0?this._events=new s:delete this._events[y]}return this},c.prototype.removeAllListeners=function(d){var f;return d?(f=a?a+d:d,this._events[f]&&(--this._eventsCount===0?this._events=new s:delete this._events[f])):(this._events=new s,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prototype.setMaxListeners=function(){return this},c.prefixed=a,c.EventEmitter=c,typeof r<"u"&&(r.exports=c)}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.matchText=n.matchSpacing=n.matchNewline=n.matchBlot=n.matchAttributor=n.default=void 0;var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(se){return typeof se}:function(se){return se&&typeof Symbol=="function"&&se.constructor===Symbol&&se!==Symbol.prototype?"symbol":typeof se},s=(function(){function se(fe,Ie){var ce=[],je=!0,qe=!1,Ne=void 0;try{for(var Je=fe[Symbol.iterator](),vt;!(je=(vt=Je.next()).done)&&(ce.push(vt.value),!(Ie&&ce.length===Ie));je=!0);}catch(Ge){qe=!0,Ne=Ge}finally{try{!je&&Je.return&&Je.return()}finally{if(qe)throw Ne}}return ce}return function(fe,Ie){if(Array.isArray(fe))return fe;if(Symbol.iterator in Object(fe))return se(fe,Ie);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),l=(function(){function se(fe,Ie){for(var ce=0;ce<Ie.length;ce++){var je=Ie[ce];je.enumerable=je.enumerable||!1,je.configurable=!0,"value"in je&&(je.writable=!0),Object.defineProperty(fe,je.key,je)}}return function(fe,Ie,ce){return Ie&&se(fe.prototype,Ie),ce&&se(fe,ce),fe}})(),c=o(3),u=A(c),d=o(2),f=A(d),h=o(0),p=A(h),y=o(5),m=A(y),x=o(10),b=A(x),w=o(9),k=A(w),S=o(36),_=o(37),P=o(13),O=A(P),T=o(26),R=o(38),I=o(39),E=o(40);function A(se){return se&&se.__esModule?se:{default:se}}function F(se,fe,Ie){return fe in se?Object.defineProperty(se,fe,{value:Ie,enumerable:!0,configurable:!0,writable:!0}):se[fe]=Ie,se}function L(se,fe){if(!(se instanceof fe))throw new TypeError("Cannot call a class as a function")}function z(se,fe){if(!se)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return fe&&(typeof fe=="object"||typeof fe=="function")?fe:se}function V(se,fe){if(typeof fe!="function"&&fe!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof fe);se.prototype=Object.create(fe&&fe.prototype,{constructor:{value:se,enumerable:!1,writable:!0,configurable:!0}}),fe&&(Object.setPrototypeOf?Object.setPrototypeOf(se,fe):se.__proto__=fe)}var Q=(0,b.default)("quill:clipboard"),U="__ql-matcher",ee=[[Node.TEXT_NODE,ke],[Node.TEXT_NODE,we],["br",le],[Node.ELEMENT_NODE,we],[Node.ELEMENT_NODE,ae],[Node.ELEMENT_NODE,ie],[Node.ELEMENT_NODE,J],[Node.ELEMENT_NODE,Me],["li",Oe],["b",re.bind(re,"bold")],["i",re.bind(re,"italic")],["style",me]],H=[S.AlignAttribute,R.DirectionAttribute].reduce(function(se,fe){return se[fe.keyName]=fe,se},{}),B=[S.AlignStyle,_.BackgroundStyle,T.ColorStyle,R.DirectionStyle,I.FontStyle,E.SizeStyle].reduce(function(se,fe){return se[fe.keyName]=fe,se},{}),M=(function(se){V(fe,se);function fe(Ie,ce){L(this,fe);var je=z(this,(fe.__proto__||Object.getPrototypeOf(fe)).call(this,Ie,ce));return je.quill.root.addEventListener("paste",je.onPaste.bind(je)),je.container=je.quill.addContainer("ql-clipboard"),je.container.setAttribute("contenteditable",!0),je.container.setAttribute("tabindex",-1),je.matchers=[],ee.concat(je.options.matchers).forEach(function(qe){var Ne=s(qe,2),Je=Ne[0],vt=Ne[1];!ce.matchVisual&&vt===ie||je.addMatcher(Je,vt)}),je}return l(fe,[{key:"addMatcher",value:function(ce,je){this.matchers.push([ce,je])}},{key:"convert",value:function(ce){if(typeof ce=="string")return this.container.innerHTML=ce.replace(/\>\r?\n +\</g,"><"),this.convert();var je=this.quill.getFormat(this.quill.selection.savedRange.index);if(je[O.default.blotName]){var qe=this.container.innerText;return this.container.innerHTML="",new f.default().insert(qe,F({},O.default.blotName,je[O.default.blotName]))}var Ne=this.prepareMatching(),Je=s(Ne,2),vt=Je[0],Ge=Je[1],Ot=G(this.container,vt,Ge);return Y(Ot,`
|
||
`)&&Ot.ops[Ot.ops.length-1].attributes==null&&(Ot=Ot.compose(new f.default().retain(Ot.length()-1).delete(1))),Q.log("convert",this.container.innerHTML,Ot),this.container.innerHTML="",Ot}},{key:"dangerouslyPasteHTML",value:function(ce,je){var qe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:m.default.sources.API;if(typeof ce=="string")this.quill.setContents(this.convert(ce),je),this.quill.setSelection(0,m.default.sources.SILENT);else{var Ne=this.convert(je);this.quill.updateContents(new f.default().retain(ce).concat(Ne),qe),this.quill.setSelection(ce+Ne.length(),m.default.sources.SILENT)}}},{key:"onPaste",value:function(ce){var je=this;if(!(ce.defaultPrevented||!this.quill.isEnabled())){var qe=this.quill.getSelection(),Ne=new f.default().retain(qe.index),Je=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(m.default.sources.SILENT),setTimeout(function(){Ne=Ne.concat(je.convert()).delete(qe.length),je.quill.updateContents(Ne,m.default.sources.USER),je.quill.setSelection(Ne.length()-qe.length,m.default.sources.SILENT),je.quill.scrollingContainer.scrollTop=Je,je.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var ce=this,je=[],qe=[];return this.matchers.forEach(function(Ne){var Je=s(Ne,2),vt=Je[0],Ge=Je[1];switch(vt){case Node.TEXT_NODE:qe.push(Ge);break;case Node.ELEMENT_NODE:je.push(Ge);break;default:[].forEach.call(ce.container.querySelectorAll(vt),function(Ot){Ot[U]=Ot[U]||[],Ot[U].push(Ge)});break}}),[je,qe]}}]),fe})(k.default);M.DEFAULTS={matchers:[],matchVisual:!0};function $(se,fe,Ie){return(typeof fe>"u"?"undefined":a(fe))==="object"?Object.keys(fe).reduce(function(ce,je){return $(ce,je,fe[je])},se):se.reduce(function(ce,je){return je.attributes&&je.attributes[fe]?ce.push(je):ce.insert(je.insert,(0,u.default)({},F({},fe,Ie),je.attributes))},new f.default)}function q(se){if(se.nodeType!==Node.ELEMENT_NODE)return{};var fe="__ql-computed-style";return se[fe]||(se[fe]=window.getComputedStyle(se))}function Y(se,fe){for(var Ie="",ce=se.ops.length-1;ce>=0&&Ie.length<fe.length;--ce){var je=se.ops[ce];if(typeof je.insert!="string")break;Ie=je.insert+Ie}return Ie.slice(-1*fe.length)===fe}function K(se){if(se.childNodes.length===0)return!1;var fe=q(se);return["block","list-item"].indexOf(fe.display)>-1}function G(se,fe,Ie){return se.nodeType===se.TEXT_NODE?Ie.reduce(function(ce,je){return je(se,ce)},new f.default):se.nodeType===se.ELEMENT_NODE?[].reduce.call(se.childNodes||[],function(ce,je){var qe=G(je,fe,Ie);return je.nodeType===se.ELEMENT_NODE&&(qe=fe.reduce(function(Ne,Je){return Je(je,Ne)},qe),qe=(je[U]||[]).reduce(function(Ne,Je){return Je(je,Ne)},qe)),ce.concat(qe)},new f.default):new f.default}function re(se,fe,Ie){return $(Ie,se,!0)}function J(se,fe){var Ie=p.default.Attributor.Attribute.keys(se),ce=p.default.Attributor.Class.keys(se),je=p.default.Attributor.Style.keys(se),qe={};return Ie.concat(ce).concat(je).forEach(function(Ne){var Je=p.default.query(Ne,p.default.Scope.ATTRIBUTE);Je!=null&&(qe[Je.attrName]=Je.value(se),qe[Je.attrName])||(Je=H[Ne],Je!=null&&(Je.attrName===Ne||Je.keyName===Ne)&&(qe[Je.attrName]=Je.value(se)||void 0),Je=B[Ne],Je!=null&&(Je.attrName===Ne||Je.keyName===Ne)&&(Je=B[Ne],qe[Je.attrName]=Je.value(se)||void 0))}),Object.keys(qe).length>0&&(fe=$(fe,qe)),fe}function ae(se,fe){var Ie=p.default.query(se);if(Ie==null)return fe;if(Ie.prototype instanceof p.default.Embed){var ce={},je=Ie.value(se);je!=null&&(ce[Ie.blotName]=je,fe=new f.default().insert(ce,Ie.formats(se)))}else typeof Ie.formats=="function"&&(fe=$(fe,Ie.blotName,Ie.formats(se)));return fe}function le(se,fe){return Y(fe,`
|
||
`)||fe.insert(`
|
||
`),fe}function me(){return new f.default}function Oe(se,fe){var Ie=p.default.query(se);if(Ie==null||Ie.blotName!=="list-item"||!Y(fe,`
|
||
`))return fe;for(var ce=-1,je=se.parentNode;!je.classList.contains("ql-clipboard");)(p.default.query(je)||{}).blotName==="list"&&(ce+=1),je=je.parentNode;return ce<=0?fe:fe.compose(new f.default().retain(fe.length()-1).retain(1,{indent:ce}))}function we(se,fe){return Y(fe,`
|
||
`)||(K(se)||fe.length()>0&&se.nextSibling&&K(se.nextSibling))&&fe.insert(`
|
||
`),fe}function ie(se,fe){if(K(se)&&se.nextElementSibling!=null&&!Y(fe,`
|
||
|
||
`)){var Ie=se.offsetHeight+parseFloat(q(se).marginTop)+parseFloat(q(se).marginBottom);se.nextElementSibling.offsetTop>se.offsetTop+Ie*1.5&&fe.insert(`
|
||
`)}return fe}function Me(se,fe){var Ie={},ce=se.style||{};return ce.fontStyle&&q(se).fontStyle==="italic"&&(Ie.italic=!0),ce.fontWeight&&(q(se).fontWeight.startsWith("bold")||parseInt(q(se).fontWeight)>=700)&&(Ie.bold=!0),Object.keys(Ie).length>0&&(fe=$(fe,Ie)),parseFloat(ce.textIndent||0)>0&&(fe=new f.default().insert(" ").concat(fe)),fe}function ke(se,fe){var Ie=se.data;if(se.parentNode.tagName==="O:P")return fe.insert(Ie.trim());if(Ie.trim().length===0&&se.parentNode.classList.contains("ql-clipboard"))return fe;if(!q(se.parentNode).whiteSpace.startsWith("pre")){var ce=function(qe,Ne){return Ne=Ne.replace(/[^\u00a0]/g,""),Ne.length<1&&qe?" ":Ne};Ie=Ie.replace(/\r\n/g," ").replace(/\n/g," "),Ie=Ie.replace(/\s\s+/g,ce.bind(ce,!0)),(se.previousSibling==null&&K(se.parentNode)||se.previousSibling!=null&&K(se.previousSibling))&&(Ie=Ie.replace(/^\s+/,ce.bind(ce,!1))),(se.nextSibling==null&&K(se.parentNode)||se.nextSibling!=null&&K(se.nextSibling))&&(Ie=Ie.replace(/\s+$/,ce.bind(ce,!1)))}return fe.insert(Ie)}n.default=M,n.matchAttributor=J,n.matchBlot=ae,n.matchNewline=we,n.matchSpacing=ie,n.matchText=ke}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function y(m,x){for(var b=0;b<x.length;b++){var w=x[b];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,x,b){return x&&y(m.prototype,x),b&&y(m,b),m}})(),s=function y(m,x,b){m===null&&(m=Function.prototype);var w=Object.getOwnPropertyDescriptor(m,x);if(w===void 0){var k=Object.getPrototypeOf(m);return k===null?void 0:y(k,x,b)}else{if("value"in w)return w.value;var S=w.get;return S===void 0?void 0:S.call(b)}},l=o(6),c=u(l);function u(y){return y&&y.__esModule?y:{default:y}}function d(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")}function f(y,m){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:y}function h(y,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);y.prototype=Object.create(m&&m.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(y,m):y.__proto__=m)}var p=(function(y){h(m,y);function m(){return d(this,m),f(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,[{key:"optimize",value:function(b){s(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"optimize",this).call(this,b),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}],[{key:"create",value:function(){return s(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this)}},{key:"formats",value:function(){return!0}}]),m})(c.default);p.blotName="bold",p.tagName=["STRONG","B"],n.default=p}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.addControls=n.default=void 0;var a=(function(){function E(A,F){var L=[],z=!0,V=!1,Q=void 0;try{for(var U=A[Symbol.iterator](),ee;!(z=(ee=U.next()).done)&&(L.push(ee.value),!(F&&L.length===F));z=!0);}catch(H){V=!0,Q=H}finally{try{!z&&U.return&&U.return()}finally{if(V)throw Q}}return L}return function(A,F){if(Array.isArray(A))return A;if(Symbol.iterator in Object(A))return E(A,F);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),s=(function(){function E(A,F){for(var L=0;L<F.length;L++){var z=F[L];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(A,z.key,z)}}return function(A,F,L){return F&&E(A.prototype,F),L&&E(A,L),A}})(),l=o(2),c=b(l),u=o(0),d=b(u),f=o(5),h=b(f),p=o(10),y=b(p),m=o(9),x=b(m);function b(E){return E&&E.__esModule?E:{default:E}}function w(E,A,F){return A in E?Object.defineProperty(E,A,{value:F,enumerable:!0,configurable:!0,writable:!0}):E[A]=F,E}function k(E,A){if(!(E instanceof A))throw new TypeError("Cannot call a class as a function")}function S(E,A){if(!E)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A&&(typeof A=="object"||typeof A=="function")?A:E}function _(E,A){if(typeof A!="function"&&A!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof A);E.prototype=Object.create(A&&A.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),A&&(Object.setPrototypeOf?Object.setPrototypeOf(E,A):E.__proto__=A)}var P=(0,y.default)("quill:toolbar"),O=(function(E){_(A,E);function A(F,L){k(this,A);var z=S(this,(A.__proto__||Object.getPrototypeOf(A)).call(this,F,L));if(Array.isArray(z.options.container)){var V=document.createElement("div");R(V,z.options.container),F.container.parentNode.insertBefore(V,F.container),z.container=V}else typeof z.options.container=="string"?z.container=document.querySelector(z.options.container):z.container=z.options.container;if(!(z.container instanceof HTMLElement)){var Q;return Q=P.error("Container required for toolbar",z.options),S(z,Q)}return z.container.classList.add("ql-toolbar"),z.controls=[],z.handlers={},Object.keys(z.options.handlers).forEach(function(U){z.addHandler(U,z.options.handlers[U])}),[].forEach.call(z.container.querySelectorAll("button, select"),function(U){z.attach(U)}),z.quill.on(h.default.events.EDITOR_CHANGE,function(U,ee){U===h.default.events.SELECTION_CHANGE&&z.update(ee)}),z.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){var U=z.quill.selection.getRange(),ee=a(U,1),H=ee[0];z.update(H)}),z}return s(A,[{key:"addHandler",value:function(L,z){this.handlers[L]=z}},{key:"attach",value:function(L){var z=this,V=[].find.call(L.classList,function(U){return U.indexOf("ql-")===0});if(V){if(V=V.slice(3),L.tagName==="BUTTON"&&L.setAttribute("type","button"),this.handlers[V]==null){if(this.quill.scroll.whitelist!=null&&this.quill.scroll.whitelist[V]==null){P.warn("ignoring attaching to disabled format",V,L);return}if(d.default.query(V)==null){P.warn("ignoring attaching to nonexistent format",V,L);return}}var Q=L.tagName==="SELECT"?"change":"click";L.addEventListener(Q,function(U){var ee=void 0;if(L.tagName==="SELECT"){if(L.selectedIndex<0)return;var H=L.options[L.selectedIndex];H.hasAttribute("selected")?ee=!1:ee=H.value||!1}else L.classList.contains("ql-active")?ee=!1:ee=L.value||!L.hasAttribute("value"),U.preventDefault();z.quill.focus();var B=z.quill.selection.getRange(),M=a(B,1),$=M[0];if(z.handlers[V]!=null)z.handlers[V].call(z,ee);else if(d.default.query(V).prototype instanceof d.default.Embed){if(ee=prompt("Enter "+V),!ee)return;z.quill.updateContents(new c.default().retain($.index).delete($.length).insert(w({},V,ee)),h.default.sources.USER)}else z.quill.format(V,ee,h.default.sources.USER);z.update($)}),this.controls.push([V,L])}}},{key:"update",value:function(L){var z=L==null?{}:this.quill.getFormat(L);this.controls.forEach(function(V){var Q=a(V,2),U=Q[0],ee=Q[1];if(ee.tagName==="SELECT"){var H=void 0;if(L==null)H=null;else if(z[U]==null)H=ee.querySelector("option[selected]");else if(!Array.isArray(z[U])){var B=z[U];typeof B=="string"&&(B=B.replace(/\"/g,'\\"')),H=ee.querySelector('option[value="'+B+'"]')}H==null?(ee.value="",ee.selectedIndex=-1):H.selected=!0}else if(L==null)ee.classList.remove("ql-active");else if(ee.hasAttribute("value")){var M=z[U]===ee.getAttribute("value")||z[U]!=null&&z[U].toString()===ee.getAttribute("value")||z[U]==null&&!ee.getAttribute("value");ee.classList.toggle("ql-active",M)}else ee.classList.toggle("ql-active",z[U]!=null)})}}]),A})(x.default);O.DEFAULTS={};function T(E,A,F){var L=document.createElement("button");L.setAttribute("type","button"),L.classList.add("ql-"+A),F!=null&&(L.value=F),E.appendChild(L)}function R(E,A){Array.isArray(A[0])||(A=[A]),A.forEach(function(F){var L=document.createElement("span");L.classList.add("ql-formats"),F.forEach(function(z){if(typeof z=="string")T(L,z);else{var V=Object.keys(z)[0],Q=z[V];Array.isArray(Q)?I(L,V,Q):T(L,V,Q)}}),E.appendChild(L)})}function I(E,A,F){var L=document.createElement("select");L.classList.add("ql-"+A),F.forEach(function(z){var V=document.createElement("option");z!==!1?V.setAttribute("value",z):V.setAttribute("selected","selected"),L.appendChild(V)}),E.appendChild(L)}O.DEFAULTS={container:null,handlers:{clean:function(){var A=this,F=this.quill.getSelection();if(F!=null)if(F.length==0){var L=this.quill.getFormat();Object.keys(L).forEach(function(z){d.default.query(z,d.default.Scope.INLINE)!=null&&A.quill.format(z,!1)})}else this.quill.removeFormat(F,h.default.sources.USER)},direction:function(A){var F=this.quill.getFormat().align;A==="rtl"&&F==null?this.quill.format("align","right",h.default.sources.USER):!A&&F==="right"&&this.quill.format("align",!1,h.default.sources.USER),this.quill.format("direction",A,h.default.sources.USER)},indent:function(A){var F=this.quill.getSelection(),L=this.quill.getFormat(F),z=parseInt(L.indent||0);if(A==="+1"||A==="-1"){var V=A==="+1"?1:-1;L.direction==="rtl"&&(V*=-1),this.quill.format("indent",z+V,h.default.sources.USER)}},link:function(A){A===!0&&(A=prompt("Enter link URL:")),this.quill.format("link",A,h.default.sources.USER)},list:function(A){var F=this.quill.getSelection(),L=this.quill.getFormat(F);A==="check"?L.list==="checked"||L.list==="unchecked"?this.quill.format("list",!1,h.default.sources.USER):this.quill.format("list","unchecked",h.default.sources.USER):this.quill.format("list",A,h.default.sources.USER)}}},n.default=O,n.addControls=R}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>'}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function y(m,x){for(var b=0;b<x.length;b++){var w=x[b];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,x,b){return x&&y(m.prototype,x),b&&y(m,b),m}})(),s=function y(m,x,b){m===null&&(m=Function.prototype);var w=Object.getOwnPropertyDescriptor(m,x);if(w===void 0){var k=Object.getPrototypeOf(m);return k===null?void 0:y(k,x,b)}else{if("value"in w)return w.value;var S=w.get;return S===void 0?void 0:S.call(b)}},l=o(28),c=u(l);function u(y){return y&&y.__esModule?y:{default:y}}function d(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")}function f(y,m){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:y}function h(y,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);y.prototype=Object.create(m&&m.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(y,m):y.__proto__=m)}var p=(function(y){h(m,y);function m(x,b){d(this,m);var w=f(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,x));return w.label.innerHTML=b,w.container.classList.add("ql-color-picker"),[].slice.call(w.container.querySelectorAll(".ql-picker-item"),0,7).forEach(function(k){k.classList.add("ql-primary")}),w}return a(m,[{key:"buildItem",value:function(b){var w=s(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"buildItem",this).call(this,b);return w.style.backgroundColor=b.getAttribute("value")||"",w}},{key:"selectItem",value:function(b,w){s(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"selectItem",this).call(this,b,w);var k=this.label.querySelector(".ql-color-label"),S=b&&b.getAttribute("data-value")||"";k&&(k.tagName==="line"?k.style.stroke=S:k.style.fill=S)}}]),m})(c.default);n.default=p}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function y(m,x){for(var b=0;b<x.length;b++){var w=x[b];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,x,b){return x&&y(m.prototype,x),b&&y(m,b),m}})(),s=function y(m,x,b){m===null&&(m=Function.prototype);var w=Object.getOwnPropertyDescriptor(m,x);if(w===void 0){var k=Object.getPrototypeOf(m);return k===null?void 0:y(k,x,b)}else{if("value"in w)return w.value;var S=w.get;return S===void 0?void 0:S.call(b)}},l=o(28),c=u(l);function u(y){return y&&y.__esModule?y:{default:y}}function d(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")}function f(y,m){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:y}function h(y,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);y.prototype=Object.create(m&&m.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(y,m):y.__proto__=m)}var p=(function(y){h(m,y);function m(x,b){d(this,m);var w=f(this,(m.__proto__||Object.getPrototypeOf(m)).call(this,x));return w.container.classList.add("ql-icon-picker"),[].forEach.call(w.container.querySelectorAll(".ql-picker-item"),function(k){k.innerHTML=b[k.getAttribute("data-value")||""]}),w.defaultItem=w.container.querySelector(".ql-selected"),w.selectItem(w.defaultItem),w}return a(m,[{key:"selectItem",value:function(b,w){s(m.prototype.__proto__||Object.getPrototypeOf(m.prototype),"selectItem",this).call(this,b,w),b=b||this.defaultItem,this.label.innerHTML=b.innerHTML}}]),m})(c.default);n.default=p}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function c(u,d){for(var f=0;f<d.length;f++){var h=d[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(u,h.key,h)}}return function(u,d,f){return d&&c(u.prototype,d),f&&c(u,f),u}})();function s(c,u){if(!(c instanceof u))throw new TypeError("Cannot call a class as a function")}var l=(function(){function c(u,d){var f=this;s(this,c),this.quill=u,this.boundsContainer=d||document.body,this.root=u.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,this.quill.root===this.quill.scrollingContainer&&this.quill.root.addEventListener("scroll",function(){f.root.style.marginTop=-1*f.quill.root.scrollTop+"px"}),this.hide()}return a(c,[{key:"hide",value:function(){this.root.classList.add("ql-hidden")}},{key:"position",value:function(d){var f=d.left+d.width/2-this.root.offsetWidth/2,h=d.bottom+this.quill.root.scrollTop;this.root.style.left=f+"px",this.root.style.top=h+"px",this.root.classList.remove("ql-flip");var p=this.boundsContainer.getBoundingClientRect(),y=this.root.getBoundingClientRect(),m=0;if(y.right>p.right&&(m=p.right-y.right,this.root.style.left=f+m+"px"),y.left<p.left&&(m=p.left-y.left,this.root.style.left=f+m+"px"),y.bottom>p.bottom){var x=y.bottom-y.top,b=d.bottom-d.top+x;this.root.style.top=h-b+"px",this.root.classList.add("ql-flip")}return m}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),c})();n.default=l}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function I(E,A){var F=[],L=!0,z=!1,V=void 0;try{for(var Q=E[Symbol.iterator](),U;!(L=(U=Q.next()).done)&&(F.push(U.value),!(A&&F.length===A));L=!0);}catch(ee){z=!0,V=ee}finally{try{!L&&Q.return&&Q.return()}finally{if(z)throw V}}return F}return function(E,A){if(Array.isArray(E))return E;if(Symbol.iterator in Object(E))return I(E,A);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),s=function I(E,A,F){E===null&&(E=Function.prototype);var L=Object.getOwnPropertyDescriptor(E,A);if(L===void 0){var z=Object.getPrototypeOf(E);return z===null?void 0:I(z,A,F)}else{if("value"in L)return L.value;var V=L.get;return V===void 0?void 0:V.call(F)}},l=(function(){function I(E,A){for(var F=0;F<A.length;F++){var L=A[F];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(E,L.key,L)}}return function(E,A,F){return A&&I(E.prototype,A),F&&I(E,F),E}})(),c=o(3),u=k(c),d=o(8),f=k(d),h=o(43),p=k(h),y=o(27),m=k(y),x=o(15),b=o(41),w=k(b);function k(I){return I&&I.__esModule?I:{default:I}}function S(I,E){if(!(I instanceof E))throw new TypeError("Cannot call a class as a function")}function _(I,E){if(!I)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E&&(typeof E=="object"||typeof E=="function")?E:I}function P(I,E){if(typeof E!="function"&&E!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof E);I.prototype=Object.create(E&&E.prototype,{constructor:{value:I,enumerable:!1,writable:!0,configurable:!0}}),E&&(Object.setPrototypeOf?Object.setPrototypeOf(I,E):I.__proto__=E)}var O=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]],T=(function(I){P(E,I);function E(A,F){S(this,E),F.modules.toolbar!=null&&F.modules.toolbar.container==null&&(F.modules.toolbar.container=O);var L=_(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,A,F));return L.quill.container.classList.add("ql-snow"),L}return l(E,[{key:"extendToolbar",value:function(F){F.container.classList.add("ql-snow"),this.buildButtons([].slice.call(F.container.querySelectorAll("button")),w.default),this.buildPickers([].slice.call(F.container.querySelectorAll("select")),w.default),this.tooltip=new R(this.quill,this.options.bounds),F.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"K",shortKey:!0},function(L,z){F.handlers.link.call(F,!z.format.link)})}}]),E})(p.default);T.DEFAULTS=(0,u.default)(!0,{},p.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(E){if(E){var A=this.quill.getSelection();if(A==null||A.length==0)return;var F=this.quill.getText(A);/^\S+@\S+\.\S+$/.test(F)&&F.indexOf("mailto:")!==0&&(F="mailto:"+F);var L=this.quill.theme.tooltip;L.edit("link",F)}else this.quill.format("link",!1)}}}}});var R=(function(I){P(E,I);function E(A,F){S(this,E);var L=_(this,(E.__proto__||Object.getPrototypeOf(E)).call(this,A,F));return L.preview=L.root.querySelector("a.ql-preview"),L}return l(E,[{key:"listen",value:function(){var F=this;s(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"listen",this).call(this),this.root.querySelector("a.ql-action").addEventListener("click",function(L){F.root.classList.contains("ql-editing")?F.save():F.edit("link",F.preview.textContent),L.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",function(L){if(F.linkRange!=null){var z=F.linkRange;F.restoreFocus(),F.quill.formatText(z,"link",!1,f.default.sources.USER),delete F.linkRange}L.preventDefault(),F.hide()}),this.quill.on(f.default.events.SELECTION_CHANGE,function(L,z,V){if(L!=null){if(L.length===0&&V===f.default.sources.USER){var Q=F.quill.scroll.descendant(m.default,L.index),U=a(Q,2),ee=U[0],H=U[1];if(ee!=null){F.linkRange=new x.Range(L.index-H,ee.length());var B=m.default.formats(ee.domNode);F.preview.textContent=B,F.preview.setAttribute("href",B),F.show(),F.position(F.quill.getBounds(F.linkRange));return}}else delete F.linkRange;F.hide()}})}},{key:"show",value:function(){s(E.prototype.__proto__||Object.getPrototypeOf(E.prototype),"show",this).call(this),this.root.removeAttribute("data-mode")}}]),E})(h.BaseTooltip);R.TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""),n.default=T}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=o(29),s=je(a),l=o(36),c=o(38),u=o(64),d=o(65),f=je(d),h=o(66),p=je(h),y=o(67),m=je(y),x=o(37),b=o(26),w=o(39),k=o(40),S=o(56),_=je(S),P=o(68),O=je(P),T=o(27),R=je(T),I=o(69),E=je(I),A=o(70),F=je(A),L=o(71),z=je(L),V=o(72),Q=je(V),U=o(73),ee=je(U),H=o(13),B=je(H),M=o(74),$=je(M),q=o(75),Y=je(q),K=o(57),G=je(K),re=o(41),J=je(re),ae=o(28),le=je(ae),me=o(59),Oe=je(me),we=o(60),ie=je(we),Me=o(61),ke=je(Me),se=o(108),fe=je(se),Ie=o(62),ce=je(Ie);function je(qe){return qe&&qe.__esModule?qe:{default:qe}}s.default.register({"attributors/attribute/direction":c.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":x.BackgroundClass,"attributors/class/color":b.ColorClass,"attributors/class/direction":c.DirectionClass,"attributors/class/font":w.FontClass,"attributors/class/size":k.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":x.BackgroundStyle,"attributors/style/color":b.ColorStyle,"attributors/style/direction":c.DirectionStyle,"attributors/style/font":w.FontStyle,"attributors/style/size":k.SizeStyle},!0),s.default.register({"formats/align":l.AlignClass,"formats/direction":c.DirectionClass,"formats/indent":u.IndentClass,"formats/background":x.BackgroundStyle,"formats/color":b.ColorStyle,"formats/font":w.FontClass,"formats/size":k.SizeClass,"formats/blockquote":f.default,"formats/code-block":B.default,"formats/header":p.default,"formats/list":m.default,"formats/bold":_.default,"formats/code":H.Code,"formats/italic":O.default,"formats/link":R.default,"formats/script":E.default,"formats/strike":F.default,"formats/underline":z.default,"formats/image":Q.default,"formats/video":ee.default,"formats/list/item":y.ListItem,"modules/formula":$.default,"modules/syntax":Y.default,"modules/toolbar":G.default,"themes/bubble":fe.default,"themes/snow":ce.default,"ui/icons":J.default,"ui/picker":le.default,"ui/icon-picker":ie.default,"ui/color-picker":Oe.default,"ui/tooltip":ke.default},!0),n.default=s.default}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.IndentClass=void 0;var a=(function(){function m(x,b){for(var w=0;w<b.length;w++){var k=b[w];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(x,k.key,k)}}return function(x,b,w){return b&&m(x.prototype,b),w&&m(x,w),x}})(),s=function m(x,b,w){x===null&&(x=Function.prototype);var k=Object.getOwnPropertyDescriptor(x,b);if(k===void 0){var S=Object.getPrototypeOf(x);return S===null?void 0:m(S,b,w)}else{if("value"in k)return k.value;var _=k.get;return _===void 0?void 0:_.call(w)}},l=o(0),c=u(l);function u(m){return m&&m.__esModule?m:{default:m}}function d(m,x){if(!(m instanceof x))throw new TypeError("Cannot call a class as a function")}function f(m,x){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x&&(typeof x=="object"||typeof x=="function")?x:m}function h(m,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof x);m.prototype=Object.create(x&&x.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),x&&(Object.setPrototypeOf?Object.setPrototypeOf(m,x):m.__proto__=x)}var p=(function(m){h(x,m);function x(){return d(this,x),f(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}return a(x,[{key:"add",value:function(w,k){if(k==="+1"||k==="-1"){var S=this.value(w)||0;k=k==="+1"?S+1:S-1}return k===0?(this.remove(w),!0):s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"add",this).call(this,w,k)}},{key:"canAdd",value:function(w,k){return s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"canAdd",this).call(this,w,k)||s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"canAdd",this).call(this,w,parseInt(k))}},{key:"value",value:function(w){return parseInt(s(x.prototype.__proto__||Object.getPrototypeOf(x.prototype),"value",this).call(this,w))||void 0}}]),x})(c.default.Attributor.Class),y=new p("indent","ql-indent",{scope:c.default.Scope.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});n.IndentClass=y}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=o(4),s=l(a);function l(h){return h&&h.__esModule?h:{default:h}}function c(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function u(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function d(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var f=(function(h){d(p,h);function p(){return c(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(s.default);f.blotName="blockquote",f.tagName="blockquote",n.default=f}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function p(y,m){for(var x=0;x<m.length;x++){var b=m[x];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(y,b.key,b)}}return function(y,m,x){return m&&p(y.prototype,m),x&&p(y,x),y}})(),s=o(4),l=c(s);function c(p){return p&&p.__esModule?p:{default:p}}function u(p,y){if(!(p instanceof y))throw new TypeError("Cannot call a class as a function")}function d(p,y){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y&&(typeof y=="object"||typeof y=="function")?y:p}function f(p,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof y);p.prototype=Object.create(y&&y.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),y&&(Object.setPrototypeOf?Object.setPrototypeOf(p,y):p.__proto__=y)}var h=(function(p){f(y,p);function y(){return u(this,y),d(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}return a(y,null,[{key:"formats",value:function(x){return this.tagName.indexOf(x.tagName)+1}}]),y})(l.default);h.blotName="header",h.tagName=["H1","H2","H3","H4","H5","H6"],n.default=h}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ListItem=void 0;var a=(function(){function S(_,P){for(var O=0;O<P.length;O++){var T=P[O];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(_,T.key,T)}}return function(_,P,O){return P&&S(_.prototype,P),O&&S(_,O),_}})(),s=function S(_,P,O){_===null&&(_=Function.prototype);var T=Object.getOwnPropertyDescriptor(_,P);if(T===void 0){var R=Object.getPrototypeOf(_);return R===null?void 0:S(R,P,O)}else{if("value"in T)return T.value;var I=T.get;return I===void 0?void 0:I.call(O)}},l=o(0),c=p(l),u=o(4),d=p(u),f=o(25),h=p(f);function p(S){return S&&S.__esModule?S:{default:S}}function y(S,_,P){return _ in S?Object.defineProperty(S,_,{value:P,enumerable:!0,configurable:!0,writable:!0}):S[_]=P,S}function m(S,_){if(!(S instanceof _))throw new TypeError("Cannot call a class as a function")}function x(S,_){if(!S)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _&&(typeof _=="object"||typeof _=="function")?_:S}function b(S,_){if(typeof _!="function"&&_!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof _);S.prototype=Object.create(_&&_.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),_&&(Object.setPrototypeOf?Object.setPrototypeOf(S,_):S.__proto__=_)}var w=(function(S){b(_,S);function _(){return m(this,_),x(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}return a(_,[{key:"format",value:function(O,T){O===k.blotName&&!T?this.replaceWith(c.default.create(this.statics.scope)):s(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"format",this).call(this,O,T)}},{key:"remove",value:function(){this.prev==null&&this.next==null?this.parent.remove():s(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"remove",this).call(this)}},{key:"replaceWith",value:function(O,T){return this.parent.isolate(this.offset(this.parent),this.length()),O===this.parent.statics.blotName?(this.parent.replaceWith(O,T),this):(this.parent.unwrap(),s(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replaceWith",this).call(this,O,T))}}],[{key:"formats",value:function(O){return O.tagName===this.tagName?void 0:s(_.__proto__||Object.getPrototypeOf(_),"formats",this).call(this,O)}}]),_})(d.default);w.blotName="list-item",w.tagName="LI";var k=(function(S){b(_,S),a(_,null,[{key:"create",value:function(O){var T=O==="ordered"?"OL":"UL",R=s(_.__proto__||Object.getPrototypeOf(_),"create",this).call(this,T);return(O==="checked"||O==="unchecked")&&R.setAttribute("data-checked",O==="checked"),R}},{key:"formats",value:function(O){if(O.tagName==="OL")return"ordered";if(O.tagName==="UL")return O.hasAttribute("data-checked")?O.getAttribute("data-checked")==="true"?"checked":"unchecked":"bullet"}}]);function _(P){m(this,_);var O=x(this,(_.__proto__||Object.getPrototypeOf(_)).call(this,P)),T=function(I){if(I.target.parentNode===P){var E=O.statics.formats(P),A=c.default.find(I.target);E==="checked"?A.format("list","unchecked"):E==="unchecked"&&A.format("list","checked")}};return P.addEventListener("touchstart",T),P.addEventListener("mousedown",T),O}return a(_,[{key:"format",value:function(O,T){this.children.length>0&&this.children.tail.format(O,T)}},{key:"formats",value:function(){return y({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(O,T){if(O instanceof w)s(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"insertBefore",this).call(this,O,T);else{var R=T==null?this.length():T.offset(this),I=this.split(R);I.parent.insertBefore(O,I)}}},{key:"optimize",value:function(O){s(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"optimize",this).call(this,O);var T=this.next;T!=null&&T.prev===this&&T.statics.blotName===this.statics.blotName&&T.domNode.tagName===this.domNode.tagName&&T.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(T.moveChildren(this),T.remove())}},{key:"replace",value:function(O){if(O.statics.blotName!==this.statics.blotName){var T=c.default.create(this.statics.defaultChild);O.moveChildren(T),this.appendChild(T)}s(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"replace",this).call(this,O)}}]),_})(h.default);k.blotName="list",k.scope=c.default.Scope.BLOCK_BLOT,k.tagName=["OL","UL"],k.defaultChild="list-item",k.allowedChildren=[w],n.ListItem=w,n.default=k}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=o(56),s=l(a);function l(h){return h&&h.__esModule?h:{default:h}}function c(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function u(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function d(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var f=(function(h){d(p,h);function p(){return c(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(s.default);f.blotName="italic",f.tagName=["EM","I"],n.default=f}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function y(m,x){for(var b=0;b<x.length;b++){var w=x[b];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(m,w.key,w)}}return function(m,x,b){return x&&y(m.prototype,x),b&&y(m,b),m}})(),s=function y(m,x,b){m===null&&(m=Function.prototype);var w=Object.getOwnPropertyDescriptor(m,x);if(w===void 0){var k=Object.getPrototypeOf(m);return k===null?void 0:y(k,x,b)}else{if("value"in w)return w.value;var S=w.get;return S===void 0?void 0:S.call(b)}},l=o(6),c=u(l);function u(y){return y&&y.__esModule?y:{default:y}}function d(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")}function f(y,m){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m&&(typeof m=="object"||typeof m=="function")?m:y}function h(y,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof m);y.prototype=Object.create(m&&m.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),m&&(Object.setPrototypeOf?Object.setPrototypeOf(y,m):y.__proto__=m)}var p=(function(y){h(m,y);function m(){return d(this,m),f(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}return a(m,null,[{key:"create",value:function(b){return b==="super"?document.createElement("sup"):b==="sub"?document.createElement("sub"):s(m.__proto__||Object.getPrototypeOf(m),"create",this).call(this,b)}},{key:"formats",value:function(b){if(b.tagName==="SUB")return"sub";if(b.tagName==="SUP")return"super"}}]),m})(c.default);p.blotName="script",p.tagName=["SUB","SUP"],n.default=p}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=o(6),s=l(a);function l(h){return h&&h.__esModule?h:{default:h}}function c(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function u(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function d(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var f=(function(h){d(p,h);function p(){return c(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(s.default);f.blotName="strike",f.tagName="S",n.default=f}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=o(6),s=l(a);function l(h){return h&&h.__esModule?h:{default:h}}function c(h,p){if(!(h instanceof p))throw new TypeError("Cannot call a class as a function")}function u(h,p){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return p&&(typeof p=="object"||typeof p=="function")?p:h}function d(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)}var f=(function(h){d(p,h);function p(){return c(this,p),u(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}return p})(s.default);f.blotName="underline",f.tagName="U",n.default=f}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function x(b,w){for(var k=0;k<w.length;k++){var S=w[k];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,w,k){return w&&x(b.prototype,w),k&&x(b,k),b}})(),s=function x(b,w,k){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,w);if(S===void 0){var _=Object.getPrototypeOf(b);return _===null?void 0:x(_,w,k)}else{if("value"in S)return S.value;var P=S.get;return P===void 0?void 0:P.call(k)}},l=o(0),c=d(l),u=o(27);function d(x){return x&&x.__esModule?x:{default:x}}function f(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function h(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function p(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var y=["alt","height","width"],m=(function(x){p(b,x);function b(){return f(this,b),h(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"format",value:function(k,S){y.indexOf(k)>-1?S?this.domNode.setAttribute(k,S):this.domNode.removeAttribute(k):s(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,k,S)}}],[{key:"create",value:function(k){var S=s(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,k);return typeof k=="string"&&S.setAttribute("src",this.sanitize(k)),S}},{key:"formats",value:function(k){return y.reduce(function(S,_){return k.hasAttribute(_)&&(S[_]=k.getAttribute(_)),S},{})}},{key:"match",value:function(k){return/\.(jpe?g|gif|png)$/.test(k)||/^data:image\/.+;base64/.test(k)}},{key:"sanitize",value:function(k){return(0,u.sanitize)(k,["http","https","data"])?k:"//:0"}},{key:"value",value:function(k){return k.getAttribute("src")}}]),b})(c.default.Embed);m.blotName="image",m.tagName="IMG",n.default=m}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0});var a=(function(){function x(b,w){for(var k=0;k<w.length;k++){var S=w[k];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(b,S.key,S)}}return function(b,w,k){return w&&x(b.prototype,w),k&&x(b,k),b}})(),s=function x(b,w,k){b===null&&(b=Function.prototype);var S=Object.getOwnPropertyDescriptor(b,w);if(S===void 0){var _=Object.getPrototypeOf(b);return _===null?void 0:x(_,w,k)}else{if("value"in S)return S.value;var P=S.get;return P===void 0?void 0:P.call(k)}},l=o(4),c=o(27),u=d(c);function d(x){return x&&x.__esModule?x:{default:x}}function f(x,b){if(!(x instanceof b))throw new TypeError("Cannot call a class as a function")}function h(x,b){if(!x)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:x}function p(x,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);x.prototype=Object.create(b&&b.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(x,b):x.__proto__=b)}var y=["height","width"],m=(function(x){p(b,x);function b(){return f(this,b),h(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}return a(b,[{key:"format",value:function(k,S){y.indexOf(k)>-1?S?this.domNode.setAttribute(k,S):this.domNode.removeAttribute(k):s(b.prototype.__proto__||Object.getPrototypeOf(b.prototype),"format",this).call(this,k,S)}}],[{key:"create",value:function(k){var S=s(b.__proto__||Object.getPrototypeOf(b),"create",this).call(this,k);return S.setAttribute("frameborder","0"),S.setAttribute("allowfullscreen",!0),S.setAttribute("src",this.sanitize(k)),S}},{key:"formats",value:function(k){return y.reduce(function(S,_){return k.hasAttribute(_)&&(S[_]=k.getAttribute(_)),S},{})}},{key:"sanitize",value:function(k){return u.default.sanitize(k)}},{key:"value",value:function(k){return k.getAttribute("src")}}]),b})(l.BlockEmbed);m.blotName="video",m.className="ql-video",m.tagName="IFRAME",n.default=m}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.FormulaBlot=void 0;var a=(function(){function k(S,_){for(var P=0;P<_.length;P++){var O=_[P];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(S,O.key,O)}}return function(S,_,P){return _&&k(S.prototype,_),P&&k(S,P),S}})(),s=function k(S,_,P){S===null&&(S=Function.prototype);var O=Object.getOwnPropertyDescriptor(S,_);if(O===void 0){var T=Object.getPrototypeOf(S);return T===null?void 0:k(T,_,P)}else{if("value"in O)return O.value;var R=O.get;return R===void 0?void 0:R.call(P)}},l=o(35),c=p(l),u=o(5),d=p(u),f=o(9),h=p(f);function p(k){return k&&k.__esModule?k:{default:k}}function y(k,S){if(!(k instanceof S))throw new TypeError("Cannot call a class as a function")}function m(k,S){if(!k)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:k}function x(k,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);k.prototype=Object.create(S&&S.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(k,S):k.__proto__=S)}var b=(function(k){x(S,k);function S(){return y(this,S),m(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}return a(S,null,[{key:"create",value:function(P){var O=s(S.__proto__||Object.getPrototypeOf(S),"create",this).call(this,P);return typeof P=="string"&&(window.katex.render(P,O,{throwOnError:!1,errorColor:"#f00"}),O.setAttribute("data-value",P)),O}},{key:"value",value:function(P){return P.getAttribute("data-value")}}]),S})(c.default);b.blotName="formula",b.className="ql-formula",b.tagName="SPAN";var w=(function(k){x(S,k),a(S,null,[{key:"register",value:function(){d.default.register(b,!0)}}]);function S(){y(this,S);var _=m(this,(S.__proto__||Object.getPrototypeOf(S)).call(this));if(window.katex==null)throw new Error("Formula module requires KaTeX.");return _}return S})(h.default);n.FormulaBlot=b,n.default=w}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.CodeToken=n.CodeBlock=void 0;var a=(function(){function P(O,T){for(var R=0;R<T.length;R++){var I=T[R];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(O,I.key,I)}}return function(O,T,R){return T&&P(O.prototype,T),R&&P(O,R),O}})(),s=function P(O,T,R){O===null&&(O=Function.prototype);var I=Object.getOwnPropertyDescriptor(O,T);if(I===void 0){var E=Object.getPrototypeOf(O);return E===null?void 0:P(E,T,R)}else{if("value"in I)return I.value;var A=I.get;return A===void 0?void 0:A.call(R)}},l=o(0),c=m(l),u=o(5),d=m(u),f=o(9),h=m(f),p=o(13),y=m(p);function m(P){return P&&P.__esModule?P:{default:P}}function x(P,O){if(!(P instanceof O))throw new TypeError("Cannot call a class as a function")}function b(P,O){if(!P)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return O&&(typeof O=="object"||typeof O=="function")?O:P}function w(P,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof O);P.prototype=Object.create(O&&O.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}}),O&&(Object.setPrototypeOf?Object.setPrototypeOf(P,O):P.__proto__=O)}var k=(function(P){w(O,P);function O(){return x(this,O),b(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}return a(O,[{key:"replaceWith",value:function(R){this.domNode.textContent=this.domNode.textContent,this.attach(),s(O.prototype.__proto__||Object.getPrototypeOf(O.prototype),"replaceWith",this).call(this,R)}},{key:"highlight",value:function(R){var I=this.domNode.textContent;this.cachedText!==I&&((I.trim().length>0||this.cachedText==null)&&(this.domNode.innerHTML=R(I),this.domNode.normalize(),this.attach()),this.cachedText=I)}}]),O})(y.default);k.className="ql-syntax";var S=new c.default.Attributor.Class("token","hljs",{scope:c.default.Scope.INLINE}),_=(function(P){w(O,P),a(O,null,[{key:"register",value:function(){d.default.register(S,!0),d.default.register(k,!0)}}]);function O(T,R){x(this,O);var I=b(this,(O.__proto__||Object.getPrototypeOf(O)).call(this,T,R));if(typeof I.options.highlight!="function")throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var E=null;return I.quill.on(d.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(E),E=setTimeout(function(){I.highlight(),E=null},I.options.interval)}),I.highlight(),I}return a(O,[{key:"highlight",value:function(){var R=this;if(!this.quill.selection.composing){this.quill.update(d.default.sources.USER);var I=this.quill.getSelection();this.quill.scroll.descendants(k).forEach(function(E){E.highlight(R.options.highlight)}),this.quill.update(d.default.sources.SILENT),I!=null&&this.quill.setSelection(I,d.default.sources.SILENT)}}}]),O})(h.default);_.DEFAULTS={highlight:(function(){return window.hljs==null?null:function(P){var O=window.hljs.highlightAuto(P);return O.value}})(),interval:1e3},n.CodeBlock=k,n.CodeToken=S,n.default=_}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>'}),(function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>'}),(function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>'}),(function(r,n){r.exports='<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>'}),(function(r,n){r.exports='<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>'}),(function(r,n){r.exports='<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>'}),(function(r,n,o){Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.BubbleTooltip=void 0;var a=function O(T,R,I){T===null&&(T=Function.prototype);var E=Object.getOwnPropertyDescriptor(T,R);if(E===void 0){var A=Object.getPrototypeOf(T);return A===null?void 0:O(A,R,I)}else{if("value"in E)return E.value;var F=E.get;return F===void 0?void 0:F.call(I)}},s=(function(){function O(T,R){for(var I=0;I<R.length;I++){var E=R[I];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(T,E.key,E)}}return function(T,R,I){return R&&O(T.prototype,R),I&&O(T,I),T}})(),l=o(3),c=x(l),u=o(8),d=x(u),f=o(43),h=x(f),p=o(15),y=o(41),m=x(y);function x(O){return O&&O.__esModule?O:{default:O}}function b(O,T){if(!(O instanceof T))throw new TypeError("Cannot call a class as a function")}function w(O,T){if(!O)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T&&(typeof T=="object"||typeof T=="function")?T:O}function k(O,T){if(typeof T!="function"&&T!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof T);O.prototype=Object.create(T&&T.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),T&&(Object.setPrototypeOf?Object.setPrototypeOf(O,T):O.__proto__=T)}var S=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]],_=(function(O){k(T,O);function T(R,I){b(this,T),I.modules.toolbar!=null&&I.modules.toolbar.container==null&&(I.modules.toolbar.container=S);var E=w(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,R,I));return E.quill.container.classList.add("ql-bubble"),E}return s(T,[{key:"extendToolbar",value:function(I){this.tooltip=new P(this.quill,this.options.bounds),this.tooltip.root.appendChild(I.container),this.buildButtons([].slice.call(I.container.querySelectorAll("button")),m.default),this.buildPickers([].slice.call(I.container.querySelectorAll("select")),m.default)}}]),T})(h.default);_.DEFAULTS=(0,c.default)(!0,{},h.default.DEFAULTS,{modules:{toolbar:{handlers:{link:function(T){T?this.quill.theme.tooltip.edit():this.quill.format("link",!1)}}}}});var P=(function(O){k(T,O);function T(R,I){b(this,T);var E=w(this,(T.__proto__||Object.getPrototypeOf(T)).call(this,R,I));return E.quill.on(d.default.events.EDITOR_CHANGE,function(A,F,L,z){if(A===d.default.events.SELECTION_CHANGE)if(F!=null&&F.length>0&&z===d.default.sources.USER){E.show(),E.root.style.left="0px",E.root.style.width="",E.root.style.width=E.root.offsetWidth+"px";var V=E.quill.getLines(F.index,F.length);if(V.length===1)E.position(E.quill.getBounds(F));else{var Q=V[V.length-1],U=E.quill.getIndex(Q),ee=Math.min(Q.length()-1,F.index+F.length-U),H=E.quill.getBounds(new p.Range(U,ee));E.position(H)}}else document.activeElement!==E.textbox&&E.quill.hasFocus()&&E.hide()}),E}return s(T,[{key:"listen",value:function(){var I=this;a(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){I.root.classList.remove("ql-editing")}),this.quill.on(d.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!I.root.classList.contains("ql-hidden")){var E=I.quill.getSelection();E!=null&&I.position(I.quill.getBounds(E))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(I){var E=a(T.prototype.__proto__||Object.getPrototypeOf(T.prototype),"position",this).call(this,I),A=this.root.querySelector(".ql-tooltip-arrow");if(A.style.marginLeft="",E===0)return E;A.style.marginLeft=-1*E-A.offsetWidth/2+"px"}}]),T})(f.BaseTooltip);P.TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""),n.BubbleTooltip=P,n.default=_}),(function(r,n,o){r.exports=o(63)})]).default})})(w0)),w0.exports}var Ql,c9;function jTe(){if(c9)return Ql;c9=1;var e=Ql&&Ql.__extends||(function(){var d=function(f,h){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,y){p.__proto__=y}||function(p,y){for(var m in y)y.hasOwnProperty(m)&&(p[m]=y[m])},d(f,h)};return function(f,h){d(f,h);function p(){this.constructor=f}f.prototype=h===null?Object.create(h):(p.prototype=h.prototype,new p)}})(),t=Ql&&Ql.__assign||function(){return t=Object.assign||function(d){for(var f,h=1,p=arguments.length;h<p;h++){f=arguments[h];for(var y in f)Object.prototype.hasOwnProperty.call(f,y)&&(d[y]=f[y])}return d},t.apply(this,arguments)},r=Ql&&Ql.__spreadArrays||function(){for(var d=0,f=0,h=arguments.length;f<h;f++)d+=arguments[f].length;for(var p=Array(d),y=0,f=0;f<h;f++)for(var m=arguments[f],x=0,b=m.length;x<b;x++,y++)p[y]=m[x];return p},n=Ql&&Ql.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},o=n(_w()),a=n(j6()),s=n(FH()),l=n(STe()),c=(function(d){e(f,d);function f(h){var p=d.call(this,h)||this;p.dirtyProps=["modules","formats","bounds","theme","children"],p.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp"],p.state={generation:0},p.selection=null,p.onEditorChange=function(m,x,b,w){var k,S,_,P;m==="text-change"?(S=(k=p).onEditorChangeText)===null||S===void 0||S.call(k,p.editor.root.innerHTML,x,w,p.unprivilegedEditor):m==="selection-change"&&((P=(_=p).onEditorChangeSelection)===null||P===void 0||P.call(_,x,w,p.unprivilegedEditor))};var y=p.isControlled()?h.value:h.defaultValue;return p.value=y??"",p}return f.prototype.validateProps=function(h){var p;if(o.default.Children.count(h.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(o.default.Children.count(h.children)){var y=o.default.Children.only(h.children);if(((p=y)===null||p===void 0?void 0:p.type)==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.")}if(this.lastDeltaChangeSet&&h.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")},f.prototype.shouldComponentUpdate=function(h,p){var y=this,m;if(this.validateProps(h),!this.editor||this.state.generation!==p.generation)return!0;if("value"in h){var x=this.getEditorContents(),b=(m=h.value,m??"");this.isEqualValue(b,x)||this.setEditorContents(this.editor,b)}return h.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,h.readOnly),r(this.cleanProps,this.dirtyProps).some(function(w){return!s.default(h[w],y.props[w])})},f.prototype.shouldComponentRegenerate=function(h){var p=this;return this.dirtyProps.some(function(y){return!s.default(h[y],p.props[y])})},f.prototype.componentDidMount=function(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())},f.prototype.componentWillUnmount=function(){this.destroyEditor()},f.prototype.componentDidUpdate=function(h,p){var y=this;if(this.editor&&this.shouldComponentRegenerate(h)){var m=this.editor.getContents(),x=this.editor.getSelection();this.regenerationSnapshot={delta:m,selection:x},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.state.generation!==p.generation){var b=this.regenerationSnapshot,m=b.delta,w=b.selection;delete this.regenerationSnapshot,this.instantiateEditor();var k=this.editor;k.setContents(m),u(function(){return y.setEditorSelection(k,w)})}},f.prototype.instantiateEditor=function(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())},f.prototype.destroyEditor=function(){this.editor&&this.unhookEditor(this.editor)},f.prototype.isControlled=function(){return"value"in this.props},f.prototype.getEditorConfig=function(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,scrollingContainer:this.props.scrollingContainer,tabIndex:this.props.tabIndex,theme:this.props.theme}},f.prototype.getEditor=function(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor},f.prototype.createEditor=function(h,p){var y=new l.default(h,p);return p.tabIndex!=null&&this.setEditorTabIndex(y,p.tabIndex),this.hookEditor(y),y},f.prototype.hookEditor=function(h){this.unprivilegedEditor=this.makeUnprivilegedEditor(h),h.on("editor-change",this.onEditorChange)},f.prototype.unhookEditor=function(h){h.off("editor-change",this.onEditorChange)},f.prototype.getEditorContents=function(){return this.value},f.prototype.getEditorSelection=function(){return this.selection},f.prototype.isDelta=function(h){return h&&h.ops},f.prototype.isEqualValue=function(h,p){return this.isDelta(h)&&this.isDelta(p)?s.default(h.ops,p.ops):s.default(h,p)},f.prototype.setEditorContents=function(h,p){var y=this;this.value=p;var m=this.getEditorSelection();typeof p=="string"?h.setContents(h.clipboard.convert(p)):h.setContents(p),u(function(){return y.setEditorSelection(h,m)})},f.prototype.setEditorSelection=function(h,p){if(this.selection=p,p){var y=h.getLength();p.index=Math.max(0,Math.min(p.index,y-1)),p.length=Math.max(0,Math.min(p.length,y-1-p.index)),h.setSelection(p)}},f.prototype.setEditorTabIndex=function(h,p){var y,m;!((m=(y=h)===null||y===void 0?void 0:y.scroll)===null||m===void 0)&&m.domNode&&(h.scroll.domNode.tabIndex=p)},f.prototype.setEditorReadOnly=function(h,p){p?h.disable():h.enable()},f.prototype.makeUnprivilegedEditor=function(h){var p=h;return{getHTML:function(){return p.root.innerHTML},getLength:p.getLength.bind(p),getText:p.getText.bind(p),getContents:p.getContents.bind(p),getSelection:p.getSelection.bind(p),getBounds:p.getBounds.bind(p)}},f.prototype.getEditingArea=function(){if(!this.editingArea)throw new Error("Instantiating on missing editing area");var h=a.default.findDOMNode(this.editingArea);if(!h)throw new Error("Cannot find element for editing area");if(h.nodeType===3)throw new Error("Editing area cannot be a text node");return h},f.prototype.renderEditingArea=function(){var h=this,p=this.props,y=p.children,m=p.preserveWhitespace,x=this.state.generation,b={key:x,ref:function(w){h.editingArea=w}};return o.default.Children.count(y)?o.default.cloneElement(o.default.Children.only(y),b):m?o.default.createElement("pre",t({},b)):o.default.createElement("div",t({},b))},f.prototype.render=function(){var h;return o.default.createElement("div",{id:this.props.id,style:this.props.style,key:this.state.generation,className:"quill "+(h=this.props.className,h??""),onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp},this.renderEditingArea())},f.prototype.onEditorChangeText=function(h,p,y,m){var x,b;if(this.editor){var w=this.isDelta(this.value)?m.getContents():m.getHTML();w!==this.getEditorContents()&&(this.lastDeltaChangeSet=p,this.value=w,(b=(x=this.props).onChange)===null||b===void 0||b.call(x,h,p,y,m))}},f.prototype.onEditorChangeSelection=function(h,p,y){var m,x,b,w,k,S;if(this.editor){var _=this.getEditorSelection(),P=!_&&h,O=_&&!h;s.default(h,_)||(this.selection=h,(x=(m=this.props).onChangeSelection)===null||x===void 0||x.call(m,h,p,y),P?(w=(b=this.props).onFocus)===null||w===void 0||w.call(b,h,p,y):O&&((S=(k=this.props).onBlur)===null||S===void 0||S.call(k,_,p,y)))}},f.prototype.focus=function(){this.editor&&this.editor.focus()},f.prototype.blur=function(){this.editor&&(this.selection=null,this.editor.blur())},f.displayName="React Quill",f.Quill=l.default,f.defaultProps={theme:"snow",modules:{},readOnly:!1},f})(o.default.Component);function u(d){Promise.resolve().then(d)}return Ql=c,Ql}var kTe=jTe();const _Te=un(kTe),CTe={toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],[{align:[]}],["link"],["clean"]]},ETe=["header","bold","italic","underline","strike","list","bullet","align","link"];function BQ({value:e,onChange:t,placeholder:r}){const n=j.useMemo(()=>CTe,[]);return i.jsxs("div",{className:"rich-email-editor",style:{background:"var(--card)"},children:[i.jsx(_Te,{theme:"snow",value:e,onChange:t,modules:n,formats:ETe,placeholder:r,style:{minHeight:220}}),i.jsx("style",{children:`
|
||
.rich-email-editor .ql-container { min-height: 180px; font-family: var(--font-noto-sans), sans-serif; font-size: var(--text-sm); }
|
||
.rich-email-editor .ql-toolbar { border-color: var(--border); background: var(--secondary); }
|
||
.rich-email-editor .ql-container { border-color: var(--border); }
|
||
`})]})}const yw=[{token:"{{contact.firstName}}",label:"First name"},{token:"{{contact.lastName}}",label:"Last name"},{token:"{{contact.name}}",label:"Full name"},{token:"{{contact.email}}",label:"Email"},{token:"{{contact.organization}}",label:"Company"},{token:"{{contact.phone}}",label:"Phone"},{token:"{{event.name}}",label:"Event name"},{token:"{{event.startDate}}",label:"Event start"},{token:"{{event.endDate}}",label:"Event end"},{token:"{{event.venue}}",label:"Venue"},{token:"{{event.virtualLink}}",label:"Virtual link"}],cm=[{mergeKey:"",label:"— None (manual sample only) —"},...yw.map(({token:e,label:t})=>({mergeKey:e.replace(/^\{\{|\}\}$/g,"").trim(),label:t}))],a3={"contact.firstName":"Jane","contact.lastName":"Doe","contact.name":"Jane Doe","contact.email":"jane@example.com","contact.organization":"Acme Inc.","contact.phone":"+91 98765 43210","event.name":"Annual Conference 2026","event.startDate":"15 Mar 2026, 9:00 am","event.endDate":"17 Mar 2026, 6:00 pm","event.venue":"Grand Hall, Mumbai","event.virtualLink":"https://meet.example.com/room/abc"},Og={width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",outline:"none",boxSizing:"border-box"};function ATe(e){const t=e.event;return t&&typeof t=="object"&&"name"in t&&t.name||"—"}function u9(){var ie,Me,ke;const{user:e}=Ur(),{setActiveNav:t,setSettingsInitialSection:r}=eo(),n=zn(e),[o,a]=j.useState([]),[s,l]=j.useState(!0),[c,u]=j.useState([]),[d,f]=j.useState([]),[h,p]=j.useState([]),[y,m]=j.useState(!1),[x,b]=j.useState(null),[w,k]=j.useState(""),[S,_]=j.useState(""),[P,O]=j.useState(""),[T,R]=j.useState("template"),[I,E]=j.useState(""),[A,F]=j.useState(""),[L,z]=j.useState(""),[V,Q]=j.useState(""),[U,ee]=j.useState(!1),[H,B]=j.useState(null),[M,$]=j.useState(""),q=j.useCallback(async()=>{var fe;l(!0);const se=await co.listByOrg({channel:"email"});l(!1),(fe=se.data)!=null&&fe.campaigns&&a(se.data.campaigns)},[]);j.useEffect(()=>{q()},[q]),j.useEffect(()=>{n&&(zr.list({limit:200,organization:n}).then(se=>{var fe;(fe=se.data)!=null&&fe.events&&u(se.data.events)}),Fa.list({organization:n}).then(se=>{var fe;(fe=se.data)!=null&&fe.lists&&f(se.data.lists)}),Hs.list({type:"emailer",organization:n,limit:100}).then(se=>{var fe;(fe=se.data)!=null&&fe.templates&&p(se.data.templates)}))},[n]),j.useEffect(()=>{var fe;if(!y||x||T!=="template"||I)return;const se=(fe=h[0])==null?void 0:fe._id;se&&E(se)},[y,x,T,I,h]);const Y=()=>{var se,fe,Ie;b(null),k(((se=c[0])==null?void 0:se._id)||""),_(""),O(((fe=d[0])==null?void 0:fe._id)||""),R("template"),E(((Ie=h[0])==null?void 0:Ie._id)||""),F(""),z("<p>Hello {{contact.name}},</p><p>…</p>"),Q(""),$(""),m(!0)},K=se=>{var ce,je,qe,Ne,Je,vt;if(se.status!=="draft")return;b(se);const fe=typeof se.event=="string"?se.event:(ce=se.event)==null?void 0:ce._id;k(fe||""),_(se.name),O(((je=se.recipients)==null?void 0:je.participantList)||"");const Ie=!!((qe=se.content)!=null&&qe.template);R(Ie?"template":"manual"),E(((Ne=se.content)==null?void 0:Ne.template)||""),F(((Je=se.content)==null?void 0:Je.subject)||""),z(((vt=se.content)==null?void 0:vt.body)||"<p></p>"),Q(""),$(""),m(!0)},G=async()=>{if(!w||!S.trim())return $("Event and campaign name are required."),null;if(!P)return $("Select a contact list."),null;if(ee(!0),$(""),T==="template"&&!I)return $("Select an emailer template."),ee(!1),null;if(T==="manual"){const ce=L.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();if(!A.trim()||!ce)return $("Subject and message body are required for a manual message."),ee(!1),null}const se={type:"participant_list",participantList:P},fe=T==="template"?{subject:"",body:"",template:I}:{subject:A,body:L,template:""};if(x){const ce=await co.update(x._id,{name:S,recipients:se,content:fe});return ee(!1),ce.error?($(ce.error),null):x._id}const Ie=await co.create(w,{name:S,channel:"email",type:"broadcast",recipients:se,content:fe});return ee(!1),Ie.error?($(Ie.error),null):Ie.data?(b(Ie.data),Ie.data._id):null},re=async()=>{await G()&&(m(!1),await q())},J=async()=>{if(x){if(!w||!S.trim()){$("Event and campaign name are required.");return}if(!P){$("Select a contact list.");return}if(T==="template"&&!I){$("Select an emailer template.");return}if(T==="manual"){const qe=L.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();if(!A.trim()||!qe){$("Subject and message body are required for a manual message.");return}}ee(!0),$("");const Ie={type:"participant_list",participantList:P},ce=T==="template"?{subject:"",body:"",template:I}:{subject:A,body:L,template:""},je=await co.send(x._id,{name:S,recipients:Ie,content:ce});ee(!1),je.error?$(je.error):m(!1),await q();return}const se=await G();if(!se)return;const fe=await co.send(se,{});fe.error?$(fe.error):m(!1),await q()},ae=async()=>{if(!V){$("Pick a date and time to schedule.");return}const se=await G();if(!se)return;const fe=new Date(V).toISOString(),Ie=await co.schedule(se,fe);Ie.error?$(Ie.error):m(!1),await q()},le=async se=>{await co.stop(se),await q()},me=async se=>{const fe=await co.analytics(se._id);fe.data&&typeof fe.data=="object"&&"stats"in fe.data&&B(fe.data)},Oe=async se=>{await co.cancel(se),await q()},we=se=>{z(fe=>fe+se)};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:"Portfolio · Messaging"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"4px 0 0"},children:"Email campaigns"})]}),i.jsxs("button",{type:"button",onClick:Y,style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(Tq,{size:13})," New campaign"]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px",padding:"14px 16px",background:"var(--secondary)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)"},children:[i.jsx(Uf,{size:18,style:{color:"var(--primary)",flexShrink:0,marginTop:2}}),i.jsx("div",{style:{flex:1},children:i.jsx("p",{style:{margin:0,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:"Send from your own domain by configuring SMTP in Settings. When set, campaign emails use your provider; otherwise the platform default is used."})}),i.jsxs("button",{type:"button",onClick:()=>{r("email"),t("settings")},style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",whiteSpace:"nowrap"},children:[i.jsx(Pl,{size:14})," Email delivery"]})]}),i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:[i.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 120px 100px 140px 1fr",padding:"8px 16px",background:"var(--secondary)",borderBottom:"1px solid var(--border)",gap:"8px"},children:["Campaign","Event","Status","Scheduled","Actions"].map(se=>i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:600,color:"var(--muted)",textTransform:"uppercase"},children:se},se))}),s?i.jsx("p",{style:{padding:24,fontSize:"var(--text-sm)",color:"var(--muted)"},children:"Loading…"}):o.length===0?i.jsx("p",{style:{padding:24,fontSize:"var(--text-sm)",color:"var(--muted)"},children:"No email campaigns yet. Create one to get started."}):o.map(se=>i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 120px 100px 140px 1fr",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border)",gap:"8px"},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500,color:"var(--foreground)"},children:se.name}),i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:ATe(se)}),i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--card-foreground)"},children:se.status}),i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:se.scheduledFor?new Date(se.scheduledFor).toLocaleString():"—"}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:[se.status==="draft"&&i.jsxs("button",{type:"button",onClick:()=>K(se),style:$p,children:[i.jsx(Ii,{size:12})," Edit"]}),["sending","sent","failed","stopped"].includes(se.status)&&i.jsxs("button",{type:"button",onClick:()=>void me(se),style:$p,children:[i.jsx(nu,{size:12})," Stats"]}),se.status==="scheduled"&&i.jsx("button",{type:"button",onClick:()=>void Oe(se._id),style:$p,children:"Unschedule"}),se.status!=="stopped"&&i.jsxs("button",{type:"button",onClick:()=>void le(se._id),style:TTe,children:[i.jsx(Pq,{size:12})," Stop"]})]})]},se._id))]}),H&&i.jsx("div",{role:"dialog","aria-modal":!0,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:400,display:"flex",alignItems:"center",justifyContent:"center",padding:20},onClick:()=>B(null),children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",padding:24,maxWidth:420,width:"100%",border:"1px solid var(--border)"},onClick:se=>se.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[i.jsx("h2",{style:{margin:0,fontSize:"var(--text-lg)"},children:"Campaign stats"}),i.jsx("button",{type:"button","aria-label":"Close",onClick:()=>B(null),style:{background:"none",border:"none",cursor:"pointer"},children:i.jsx(er,{size:18})})]}),i.jsx("p",{style:{fontSize:"var(--text-sm)",margin:"0 0 8px"},children:H.name}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 12px"},children:["Status: ",H.status]}),i.jsxs("ul",{style:{margin:0,paddingLeft:18,fontSize:"var(--text-sm)"},children:[i.jsxs("li",{children:["Total queued: ",((ie=H.stats)==null?void 0:ie.total)??"—"]}),i.jsxs("li",{children:["Sent: ",((Me=H.stats)==null?void 0:Me.sent)??"—"]}),i.jsxs("li",{children:["Failed: ",((ke=H.stats)==null?void 0:ke.failed)??"—"]})]}),H.sentAt&&i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",marginTop:12},children:["Sent: ",new Date(H.sentAt).toLocaleString()]})]})}),y&&i.jsx(Zo,{onClose:()=>m(!1),title:x?"Edit campaign":"New email campaign",breadcrumb:"Messaging · Email",description:"Create an email campaign, choose recipients, then save, send, or schedule.",completedCount:0,totalSections:1,ctaLabel:"",showProgress:!1,hidePrimaryCta:!0,panelWidth:"min(720px, 100vw)",children:i.jsxs("div",{style:{padding:"20px 24px",display:"flex",flexDirection:"column",gap:14},children:[M&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-sm)",margin:0},children:M}),!x&&i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:6},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500},children:"Event"}),i.jsxs("select",{style:Og,value:w,onChange:se=>k(se.target.value),children:[i.jsx("option",{value:"",children:"Select…"}),c.map(se=>i.jsx("option",{value:se._id,children:se.name},se._id))]})]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:6},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500},children:"Campaign name"}),i.jsx("input",{style:Og,value:S,onChange:se=>_(se.target.value),placeholder:"e.g. Registration reminder"})]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:6},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500},children:"Contact list"}),i.jsxs("select",{style:Og,value:P,onChange:se=>O(se.target.value),children:[i.jsx("option",{value:"",children:"Select…"}),d.map(se=>i.jsx("option",{value:se._id,children:se.name},se._id))]})]}),i.jsxs("div",{style:{display:"flex",gap:8},children:[i.jsx("button",{type:"button",onClick:()=>R("template"),style:T==="template"?Fy:$p,children:"Design template"}),i.jsx("button",{type:"button",onClick:()=>R("manual"),style:T==="manual"?Fy:$p,children:"Manual message"})]}),T==="template"&&i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:6},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500},children:"Emailer template"}),i.jsxs("select",{style:Og,value:I,onChange:se=>E(se.target.value),children:[i.jsx("option",{value:"",children:"Select…"}),h.map(se=>i.jsx("option",{value:se._id,children:se.name},se._id))]}),i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:0},children:"Subject and body come from this template. The email subject defaults to your campaign name if the template does not set one."})]}),T==="manual"&&i.jsxs(i.Fragment,{children:[i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:6},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500},children:"Subject"}),i.jsx("input",{style:Og,value:A,onChange:se=>F(se.target.value),placeholder:"Subject line (placeholders ok)"})]}),i.jsxs("div",{children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500,display:"block",marginBottom:8},children:"Message body"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:yw.map(se=>i.jsx("button",{type:"button",onClick:()=>we(se.token),style:PTe,children:se.label},se.token))}),i.jsx(BQ,{value:L,onChange:z,placeholder:"Compose your email…"})]})]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:6},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500},children:"Schedule (optional)"}),i.jsx("input",{type:"datetime-local",style:Og,value:V,onChange:se=>Q(se.target.value)})]}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:8,marginTop:8},children:[i.jsx("button",{type:"button",disabled:U,onClick:()=>void re(),style:$p,children:"Save draft"}),i.jsx("button",{type:"button",disabled:U,onClick:()=>void J(),style:Fy,children:"Send now"}),i.jsx("button",{type:"button",disabled:U||!V,onClick:()=>void ae(),style:Fy,children:"Schedule"})]})]})})]})}const Fy={display:"inline-flex",alignItems:"center",gap:6,padding:"8px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},$p={...Fy,background:"var(--secondary)",color:"var(--card-foreground)",border:"1px solid var(--border)"},TTe={...$p,color:"var(--destructive)",borderColor:"var(--destructive)"},PTe={fontSize:"10px",padding:"4px 8px",borderRadius:99,border:"1px solid var(--border)",background:"var(--secondary)",cursor:"pointer",fontFamily:"var(--font-noto-sans)"},Uu={width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",outline:"none",boxSizing:"border-box"},l6={display:"inline-flex",alignItems:"center",gap:6,padding:"8px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},Mg={...l6,background:"var(--secondary)",color:"var(--card-foreground)",border:"1px solid var(--border)"},OTe={...Mg,color:"var(--destructive)",borderColor:"var(--destructive)"};function ITe(e){const t=e.event;return t&&typeof t=="object"&&"name"in t&&t.name||"—"}function s3(){return{mode:"default"}}function l3(e,t,r,n){var s;const o=(s=r==null?void 0:r.waOverrides)==null?void 0:s[t],a=[];for(let l=0;l<e;l+=1){const c=String(l+1),u=o==null?void 0:o[c];if(!u){a.push({mode:"default"});continue}if(u.kind==="fixed")a.push({mode:"fixed",fixed:u.value||""});else{const d=String((n==null?void 0:n[l])||"").trim();d&&u.key===d?a.push({mode:"default"}):a.push({mode:"merge",mergeKey:u.key||""})}}return a}function c3(e,t){const r={};for(let n=0;n<e.length;n+=1){const o=e[n],a=String((t==null?void 0:t[n])||"").trim();if(o.mode!=="default"){if(o.mode==="fixed")r[String(n+1)]={kind:"fixed",value:String(o.fixed||"")};else if(o.mode==="merge"){const s=String(o.mergeKey||"").trim();s&&s!==a&&(r[String(n+1)]={kind:"merge",key:s})}}}return Object.keys(r).length?r:void 0}function NTe(e){return e.some(t=>String(t.type||"").toUpperCase()==="HEADER"&&String(t.format||"").toUpperCase()==="IMAGE")}function RTe(){var ft,Pt,At,Ht,Se,ct,gt;const{user:e}=Ur(),{setActiveNav:t,setSettingsInitialSection:r}=eo(),n=zn(e),[o,a]=j.useState([]),[s,l]=j.useState(!0),[c,u]=j.useState([]),[d,f]=j.useState([]),[h,p]=j.useState([]),[y,m]=j.useState(null),[x,b]=j.useState(null),[w,k]=j.useState(!1),[S,_]=j.useState(!1),[P,O]=j.useState(null),[T,R]=j.useState(null),[I,E]=j.useState(""),[A,F]=j.useState(""),[L,z]=j.useState(""),[V,Q]=j.useState(""),[U,ee]=j.useState(""),[H,B]=j.useState([]),[M,$]=j.useState([]),[q,Y]=j.useState([]),[K,G]=j.useState(!1),[re,J]=j.useState(""),[ae,le]=j.useState(!1),[me,Oe]=j.useState(!1),[we,ie]=j.useState(null),[Me,ke]=j.useState(""),se=j.useRef(null),fe=j.useCallback(async()=>{var Pe;l(!0);const We=await co.listByOrg({channel:"whatsapp"});l(!1),(Pe=We.data)!=null&&Pe.campaigns&&a(We.data.campaigns)},[]);j.useEffect(()=>{fe()},[fe]),j.useEffect(()=>{n&&(zr.list({limit:200,organization:n}).then(We=>{var Pe;(Pe=We.data)!=null&&Pe.events&&u(We.data.events)}),Fa.list({organization:n}).then(We=>{var Pe;(Pe=We.data)!=null&&Pe.lists&&f(We.data.lists)}),Bg.list({}).then(We=>{var Pe;(Pe=We.data)!=null&&Pe.templates&&p(We.data.templates)}),ls.getWhatsAppSettings().then(We=>{if(We.error||!We.data){m(null),b(null),k(!1);return}const Pe=We.data;m(Pe.graphAccess),b(Pe.canSendMessages),k(!!Pe.usingServerDefaults)}))},[n]);const Ie=j.useCallback((We,Pe)=>{const rt=Array.isArray(We.components)?We.components:[],Ze=NTe(rt);G(Ze);const pe=We.variableBindings||{header:[],body:[],url:[]},xe=(pe.header||[]).length,De=(pe.body||[]).length,tt=(pe.url||[]).length;B(Pe?l3(xe,"header",Pe,pe.header):Array(xe).fill(0).map(()=>s3())),$(Pe?l3(De,"body",Pe,pe.body):Array(De).fill(0).map(()=>s3())),Y(Pe?l3(tt,"url",Pe,pe.url):Array(tt).fill(0).map(()=>s3())),Pe!=null&&Pe.waHeaderImageUrl?ee(Pe.waHeaderImageUrl):Ze&&ee("")},[]);j.useEffect(()=>{if(!V){R(null),G(!1),B([]),$([]),Y([]);return}Bg.get(V).then(We=>{We.data&&(R(We.data),Ie(We.data,P?P.content:void 0))})},[V,P==null?void 0:P._id,Ie,P]);const ce=()=>{var We,Pe,rt;O(null),E(((We=c[0])==null?void 0:We._id)||""),F(""),z(((Pe=d[0])==null?void 0:Pe._id)||""),Q(((rt=h[0])==null?void 0:rt._id)||""),ee(""),J(""),ke(""),R(null),B([]),$([]),Y([]),_(!0)},je=We=>{var rt,Ze,pe,xe;if(We.status!=="draft")return;O(We);const Pe=typeof We.event=="string"?We.event:(rt=We.event)==null?void 0:rt._id;E(Pe||""),F(We.name),z(((Ze=We.recipients)==null?void 0:Ze.participantList)||""),Q(((pe=We.content)==null?void 0:pe.whatsappTemplateId)||""),ee(((xe=We.content)==null?void 0:xe.waHeaderImageUrl)||""),J(""),ke(""),_(!0)},qe=()=>{const We=(T==null?void 0:T.variableBindings)||{header:[],body:[],url:[]},Pe={},rt=c3(H,We.header),Ze=c3(M,We.body),pe=c3(q,We.url);return rt&&(Pe.header=rt),Ze&&(Pe.body=Ze),pe&&(Pe.url=pe),{whatsappTemplateId:V,waHeaderImageUrl:K?U.trim():"",...Object.keys(Pe).length?{waOverrides:Pe}:{}}},Ne=async()=>{if(!I||!A.trim())return ke("Event and campaign name are required."),null;if(!L)return ke("Select a contact list."),null;if(!V)return ke("Select a WhatsApp template."),null;if(K&&!U.trim())return ke("This template uses an image header. Add a public https image URL (or upload)."),null;le(!0),ke("");const We={type:"participant_list",participantList:L},Pe=qe();if(P){const Ze=await co.update(P._id,{name:A,recipients:We,content:Pe});return le(!1),Ze.error?(ke(typeof Ze.error=="string"?Ze.error:"Save failed"),null):P._id}const rt=await co.create(I,{name:A,channel:"whatsapp",type:"broadcast",recipients:We,content:Pe});return le(!1),rt.error?(ke(typeof rt.error=="string"?rt.error:"Save failed"),null):rt.data?(O(rt.data),rt.data._id):null},Je=async()=>{await Ne()&&(_(!1),await fe())},vt=async()=>{if(P){if(!A.trim()){ke("Campaign name is required.");return}if(!L){ke("Select a contact list.");return}if(!V){ke("Select a WhatsApp template.");return}if(K&&!U.trim()){ke("This template uses an image header. Add a public https image URL (or upload).");return}le(!0),ke("");const rt={type:"participant_list",participantList:L},Ze=qe(),pe=await co.send(P._id,{name:A,recipients:rt,content:Ze});le(!1),pe.error?ke(typeof pe.error=="string"?pe.error:"Send failed"):_(!1),await fe();return}const We=await Ne();if(!We)return;const Pe=await co.send(We,{});Pe.error?ke(typeof Pe.error=="string"?Pe.error:"Send failed"):_(!1),await fe()},Ge=async()=>{if(!re){ke("Pick a date and time to schedule.");return}const We=await Ne();if(!We)return;const Pe=new Date(re).toISOString(),rt=await co.schedule(We,Pe);rt.error?ke(typeof rt.error=="string"?rt.error:"Schedule failed"):_(!1),await fe()},Ot=async We=>{await co.stop(We),await fe()},nt=async We=>{const Pe=await co.analytics(We._id);Pe.data&&typeof Pe.data=="object"&&"stats"in Pe.data&&ie(Pe.data)},Ae=async We=>{await co.cancel(We),await fe()},Te=async We=>{if(We){if(!We.type.startsWith("image/")){ke("Choose an image file.");return}Oe(!0),ke("");try{const Pe=await Ys(We,{eventId:"portfolio",module:"whatsapp/campaign-header"});Pe.url&&ee(Pe.url)}catch(Pe){ke(Pe instanceof Error?Pe.message:"Upload failed")}finally{Oe(!1),se.current&&(se.current.value="")}}},wt=(We,Pe,rt,Ze)=>i.jsxs("div",{style:{marginTop:8},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500,display:"block",marginBottom:6},children:We}),Pe.length===0?i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:0},children:"No variables in this section."}):i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:Pe.map((pe,xe)=>i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6,fontSize:"var(--text-xs)"},children:[i.jsxs("span",{children:[`{{${xe+1}}}`," ",i.jsxs("span",{style:{color:"var(--muted)"},children:["(",Ze[xe]||"—",")"]})]}),i.jsxs("select",{style:Uu,value:pe.mode,onChange:De=>{var Ke;const tt=De.target.value,Le=[...Pe];tt==="default"?Le[xe]={mode:"default"}:tt==="merge"?Le[xe]={mode:"merge",mergeKey:((Ke=cm.find(Fe=>Fe.mergeKey))==null?void 0:Ke.mergeKey)||"contact.firstName"}:Le[xe]={mode:"fixed",fixed:""},rt(Le)},children:[i.jsx("option",{value:"default",children:"Default (from template design)"}),i.jsx("option",{value:"merge",children:"Map to field"}),i.jsx("option",{value:"fixed",children:"Fixed text"})]}),pe.mode==="merge"&&i.jsx("select",{style:Uu,value:pe.mergeKey||"",onChange:De=>{const tt=[...Pe];tt[xe]={mode:"merge",mergeKey:De.target.value},rt(tt)},children:cm.filter(De=>De.mergeKey).map(De=>i.jsx("option",{value:De.mergeKey,children:De.label},De.mergeKey))}),pe.mode==="fixed"&&i.jsx("input",{style:Uu,value:pe.fixed||"",onChange:De=>{const tt=[...Pe];tt[xe]={mode:"fixed",fixed:De.target.value},rt(tt)},placeholder:"Literal value for this send"}),pe.mode==="default"&&i.jsx("span",{style:{color:"var(--muted)"},children:"Uses template merge mapping"})]},`${We}-${xe}`))})]});return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:"Portfolio · Messaging"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"4px 0 0"},children:"WhatsApp campaigns"})]}),i.jsxs("button",{type:"button",onClick:ce,style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(Tq,{size:13})," New campaign"]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:"12px",padding:"14px 16px",background:"var(--secondary)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)"},children:[i.jsx(Zs,{size:18,style:{color:"var(--primary)",flexShrink:0,marginTop:2}}),i.jsxs("div",{style:{flex:1},children:[i.jsx("p",{style:{margin:0,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:"Create approved message templates under Design, then run campaigns. Sending uses the organisation's WhatsApp Cloud settings in Settings, or the server's default Meta credentials (env) when the org has not added its own. Recipients need phone numbers. A queue worker (rate-limited) delivers messages."}),w&&i.jsx("p",{style:{margin:"8px 0 0",fontSize:"var(--text-xs)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"This organisation is using the platform default WhatsApp credentials from the server (no WABA saved under Settings)."})]}),i.jsxs("button",{type:"button",onClick:()=>{r("whatsapp"),t("settings")},style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",whiteSpace:"nowrap"},children:[i.jsx(Pl,{size:14})," WhatsApp"]})]}),y===!1&&i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--destructive)",margin:0},children:"WhatsApp is not available: no WABA and access token for this organisation, and no server defaults (e.g. META_WHATSAPP_DEFAULT_WABA_ID and META_WHATSAPP_ACCESS_TOKEN). Add credentials under Settings or in server env."}),y===!0&&x===!1&&i.jsxs("p",{style:{fontSize:"var(--text-sm)",color:"#a16207",margin:0,background:"rgba(234,179,8,0.1)",padding:"10px 12px",borderRadius:"var(--radius-button)",border:"1px solid rgba(234,179,8,0.35)"},children:["WABA and token are set, but a phone number ID is required to send. Set ",i.jsx("code",{style:{fontSize:12},children:"META_WHATSAPP_DEFAULT_PHONE_NUMBER_ID"})," on the server, or add it in Settings (WhatsApp Cloud)."]}),i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:[i.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 120px 100px 140px 1fr",padding:"8px 16px",background:"var(--secondary)",borderBottom:"1px solid var(--border)",gap:"8px"},children:["Campaign","Event","Status","Scheduled","Actions"].map(We=>i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:600,color:"var(--muted)",textTransform:"uppercase"},children:We},We))}),s?i.jsx("p",{style:{padding:24,fontSize:"var(--text-sm)",color:"var(--muted)"},children:"Loading…"}):o.length===0?i.jsx("p",{style:{padding:24,fontSize:"var(--text-sm)",color:"var(--muted)"},children:"No WhatsApp campaigns yet. Create one to get started."}):o.map(We=>i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 120px 100px 140px 1fr",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border)",gap:"8px"},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500,color:"var(--foreground)"},children:We.name}),i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:ITe(We)}),i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--card-foreground)"},children:We.status}),i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:We.scheduledFor?new Date(We.scheduledFor).toLocaleString():"—"}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:[We.status==="draft"&&i.jsxs("button",{type:"button",onClick:()=>je(We),style:Mg,children:[i.jsx(Ii,{size:12})," Edit"]}),["sending","sent","failed","stopped"].includes(We.status)&&i.jsxs("button",{type:"button",onClick:()=>void nt(We),style:Mg,children:[i.jsx(nu,{size:12})," Stats"]}),We.status==="scheduled"&&i.jsx("button",{type:"button",onClick:()=>void Ae(We._id),style:Mg,children:"Unschedule"}),We.status!=="stopped"&&i.jsxs("button",{type:"button",onClick:()=>void Ot(We._id),style:OTe,children:[i.jsx(Pq,{size:12})," Stop"]})]})]},We._id))]}),we&&i.jsx("div",{role:"dialog","aria-modal":!0,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:400,display:"flex",alignItems:"center",justifyContent:"center",padding:20},onClick:()=>ie(null),children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",padding:24,maxWidth:(ft=we.whatsappQueue)!=null&&ft.length?640:420,width:"100%",maxHeight:"90vh",overflow:"auto",border:"1px solid var(--border)"},onClick:We=>We.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[i.jsx("h2",{style:{margin:0,fontSize:"var(--text-lg)"},children:"Campaign stats"}),i.jsx("button",{type:"button","aria-label":"Close",onClick:()=>ie(null),style:{background:"none",border:"none",cursor:"pointer"},children:i.jsx(er,{size:18})})]}),i.jsx("p",{style:{fontSize:"var(--text-sm)",margin:"0 0 8px"},children:we.name}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 12px"},children:["Status: ",we.status]}),i.jsxs("ul",{style:{margin:0,paddingLeft:18,fontSize:"var(--text-sm)"},children:[i.jsxs("li",{children:["Total queued: ",((Pt=we.stats)==null?void 0:Pt.total)??"—"]}),i.jsxs("li",{children:["Sent: ",((At=we.stats)==null?void 0:At.sent)??"—"]}),i.jsxs("li",{children:["Failed: ",((Ht=we.stats)==null?void 0:Ht.failed)??"—"]})]}),we.sentAt&&i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",marginTop:12},children:["Sent: ",new Date(we.sentAt).toLocaleString()]}),we.whatsappQueue&&we.whatsappQueue.length>0&&i.jsxs("div",{style:{marginTop:16},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontWeight:600,color:"var(--muted)",margin:"0 0 8px",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Message IDs (webhook correlation)"}),i.jsx("div",{style:{overflowX:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius-button)"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--text-xs)"},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{background:"var(--secondary)",textAlign:"left"},children:[i.jsx("th",{style:{padding:"8px 10px",fontWeight:600},children:"To"}),i.jsx("th",{style:{padding:"8px 10px",fontWeight:600},children:"Status"}),i.jsx("th",{style:{padding:"8px 10px",fontWeight:600},children:"wamid"})]})}),i.jsx("tbody",{children:we.whatsappQueue.map(We=>i.jsxs("tr",{style:{borderTop:"1px solid var(--border)"},children:[i.jsx("td",{style:{padding:"8px 10px",fontFamily:"var(--font-noto-sans)",wordBreak:"break-all"},children:We.to}),i.jsx("td",{style:{padding:"8px 10px"},children:We.status}),i.jsx("td",{style:{padding:"8px 10px",wordBreak:"break-all",color:We.whatsappMessageId?"var(--card-foreground)":"var(--muted)"},children:We.whatsappMessageId||"—"})]},We._id))})]})})]})]})}),S&&i.jsx(Zo,{onClose:()=>_(!1),title:P?"Edit WhatsApp campaign":"New WhatsApp campaign",breadcrumb:"Messaging · WhatsApp",description:"Choose an approved template, optional per-send overrides, and a list with phone numbers. Run npm run whatsapp-worker on the server to deliver.",completedCount:0,totalSections:1,ctaLabel:"",showProgress:!1,hidePrimaryCta:!0,panelWidth:"min(720px, 100vw)",children:i.jsxs("div",{style:{padding:"20px 24px",display:"flex",flexDirection:"column",gap:14,maxHeight:"85vh",overflow:"auto"},children:[Me&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-sm)",margin:0},children:Me}),!P&&i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:6},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500},children:"Event"}),i.jsxs("select",{style:Uu,value:I,onChange:We=>E(We.target.value),children:[i.jsx("option",{value:"",children:"Select…"}),c.map(We=>i.jsx("option",{value:We._id,children:We.name},We._id))]})]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:6},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500},children:"Campaign name"}),i.jsx("input",{style:Uu,value:A,onChange:We=>F(We.target.value),placeholder:"e.g. Reminder – registered guests"})]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:6},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500},children:"Contact list"}),i.jsxs("select",{style:Uu,value:L,onChange:We=>z(We.target.value),children:[i.jsx("option",{value:"",children:"Select…"}),d.map(We=>i.jsx("option",{value:We._id,children:We.name},We._id))]})]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:6},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500},children:"Message template (APPROVED)"}),i.jsxs("select",{style:Uu,value:V,onChange:We=>Q(We.target.value),children:[i.jsx("option",{value:"",children:"Select…"}),h.map(We=>i.jsxs("option",{value:We._id,children:[We.name," (",We.language,") ",We.status?`· ${We.status}`:""]},We._id))]})]}),K&&i.jsxs("div",{children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500,display:"block",marginBottom:6},children:"Header image (https)"}),i.jsx("input",{style:Uu,value:U,onChange:We=>ee(We.target.value),placeholder:"https://…"}),i.jsxs("div",{style:{marginTop:8,display:"flex",alignItems:"center",gap:8},children:[i.jsx("input",{ref:se,type:"file",accept:"image/*",style:{display:"none"},onChange:We=>{var Pe;return void Te((Pe=We.target.files)==null?void 0:Pe[0])}}),i.jsx("button",{type:"button",style:Mg,disabled:me,onClick:()=>{var We;return(We=se.current)==null?void 0:We.click()},children:me?"Uploading…":"Upload image"})]}),i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"6px 0 0"},children:"Meta fetches this URL at send time; it must be publicly accessible."})]}),T&&i.jsxs(i.Fragment,{children:[wt("Header variables",H,B,((Se=T.variableBindings)==null?void 0:Se.header)||[]),wt("Body variables",M,$,((ct=T.variableBindings)==null?void 0:ct.body)||[]),wt("URL button variables",q,Y,((gt=T.variableBindings)==null?void 0:gt.url)||[])]}),i.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:6},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontWeight:500},children:"Schedule (optional)"}),i.jsx("input",{type:"datetime-local",style:Uu,value:re,onChange:We=>J(We.target.value)})]}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:8,marginTop:8},children:[i.jsx("button",{type:"button",disabled:ae,onClick:()=>void Je(),style:Mg,children:"Save draft"}),i.jsx("button",{type:"button",disabled:ae,onClick:()=>void vt(),style:l6,children:"Send now"}),i.jsx("button",{type:"button",disabled:ae||!re,onClick:()=>void Ge(),style:l6,children:"Schedule"})]})]})})]})}const d9=[{value:"admin",label:"Admin",desc:"Full access to all events and settings."},{value:"moderator",label:"Moderator",desc:"Can manage sessions, participants, and messaging."},{value:"viewer",label:"Viewer",desc:"Can view events and dashboards only."}],LTe={firstName:"",lastName:"",email:"",password:"",role:"moderator",assignedEvents:[],sendInviteNow:"Yes",personalMessage:""};function f9(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.trim())}function FTe({editUser:e,onClose:t,onSuccess:r}){const{user:n}=Ur(),o=zn(n),a=!!e,s=3,l=mc(s),[c,u]=j.useState(()=>e?{firstName:e.firstName??"",lastName:e.lastName??"",email:e.email??"",password:"",role:e.role??"moderator",assignedEvents:[],sendInviteNow:"Yes",personalMessage:""}:LTe),[d,f]=j.useState({}),[h,p]=j.useState(!1),[y,m]=j.useState([]),[x,b]=j.useState(!0);j.useEffect(()=>{e&&u({firstName:e.firstName??"",lastName:e.lastName??"",email:e.email??"",password:"",role:e.role??"moderator",assignedEvents:[],sendInviteNow:"Yes",personalMessage:""})},[e==null?void 0:e._id]),j.useEffect(()=>{let I=!1;return(async()=>{var E;b(!0);try{if(!o){I||m([]);return}const A=await zr.list({organization:o});I||m(((E=A.data)==null?void 0:E.events)??[])}catch{I||m([])}finally{I||b(!1)}})(),()=>{I=!0}},[o]);const w=(I,E)=>u(A=>({...A,[I]:E})),k=I=>u(E=>({...E,assignedEvents:E.assignedEvents.includes(I)?E.assignedEvents.filter(A=>A!==I):[...E.assignedEvents,I]})),S=j.useCallback((I,E)=>E===1?!(!I.firstName.trim()||!I.lastName.trim()||!I.email.trim()||!f9(I.email)||!a&&(!I.password||I.password.length<6)||a&&I.password.length>0&&I.password.length<6):!0,[a]),_=j.useCallback(I=>{const E=S(c,I);f(A=>({...A,[I]:E?"":"Please complete all required fields before continuing."})),E&&l.advance(I)},[c,S,l]),P=j.useCallback(async()=>{if(!S(c,1)){f(I=>({...I,1:"Please complete all required fields."}));return}if(p(!0),f({}),a&&e){const I=await nx.update(e._id,{email:c.email.trim(),firstName:c.firstName.trim()||void 0,lastName:c.lastName.trim()||void 0,role:c.role,...c.password?{password:c.password}:{},assignedEvents:c.assignedEvents.length?c.assignedEvents:void 0});if(p(!1),I.error){f(E=>({...E,1:I.error||"Failed to update user. Please try again."}));return}}else{const I=await nx.create({email:c.email.trim(),password:c.password,firstName:c.firstName.trim()||void 0,lastName:c.lastName.trim()||void 0,role:c.role,assignedEvents:c.assignedEvents.length?c.assignedEvents:void 0});if(p(!1),I.error){f(E=>({...E,1:I.error||"Failed to invite user. Please try again."}));return}}r==null||r(),t()},[c,S,a,e,r,t]),O=j.useCallback(()=>{if(!S(c,3)){f(I=>({...I,3:"Please complete required fields."}));return}f(I=>({...I,3:""})),P()},[c,S,P]),T=c.firstName.trim()&&c.lastName.trim()&&c.email.trim()&&f9(c.email)&&!h&&(a&&c.password.length===0||c.password.length>=6),R=d9.find(I=>I.value===c.role);return i.jsxs(Zo,{onClose:t,title:a?"Edit User":"Invite User",breadcrumb:"User Management",description:"Send an invitation to a new team member. They'll receive an email to set up their account.",completedCount:l.done.size,totalSections:s,ctaLabel:"Save",ctaDisabled:!T,onCtaClick:P,children:[i.jsx($r,{n:1,title:"User Details",subtitle:"Enter the new team member's information",open:l.open===1,completed:l.done.has(1),onToggle:()=>l.toggle(1),onSave:()=>_(1),nextLabel:"Role & Permissions",sectionError:d[1],children:i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"First Name",required:!0}),i.jsx("input",{style:$t,placeholder:"First name",value:c.firstName,onChange:I=>w("firstName",I.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Last Name",required:!0}),i.jsx("input",{style:$t,placeholder:"Last name",value:c.lastName,onChange:I=>w("lastName",I.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{span2:!0,children:[i.jsx(pt,{text:"Email Address",required:!0}),i.jsx("input",{type:"email",style:$t,placeholder:"name@organisation.com",value:c.email,onChange:I=>w("email",I.target.value),onFocus:kt,onBlur:_t}),i.jsx(Qt,{text:"An invitation link will be sent to this address."})]}),i.jsxs(lt,{span2:!0,children:[i.jsx(pt,{text:"Initial password",required:!0}),i.jsx("input",{type:"password",style:$t,placeholder:"Min 6 characters",value:c.password,onChange:I=>w("password",I.target.value),onFocus:kt,onBlur:_t,minLength:6}),i.jsx(Qt,{text:"User will need this to sign in. They can change it later."})]})]})}),i.jsxs($r,{n:2,title:"Role & Permissions",subtitle:"Choose the access level for this team member",open:l.open===2,completed:l.done.has(2),onToggle:()=>l.toggle(2),onSave:()=>_(2),nextLabel:"Event Access",sectionError:d[2],children:[i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:d9.map(I=>i.jsxs("button",{type:"button",onClick:()=>w("role",I.value),style:{display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 14px",borderRadius:"var(--radius-button)",border:`2px solid ${c.role===I.value?"var(--primary)":"var(--border)"}`,background:c.role===I.value?"var(--accent)":"var(--card)",cursor:"pointer",textAlign:"left",transition:"all .12s"},children:[i.jsx("div",{style:{width:"16px",height:"16px",borderRadius:"50%",border:`2px solid ${c.role===I.value?"var(--primary)":"var(--border)"}`,background:c.role===I.value?"var(--primary)":"transparent",display:"flex",alignItems:"center",justifyContent:"center",marginTop:"1px",flexShrink:0},children:c.role===I.value&&i.jsx("div",{style:{width:"6px",height:"6px",borderRadius:"50%",background:"#fff"}})}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:c.role===I.value?"var(--primary)":"var(--foreground)",margin:"0 0 2px"},children:I.label}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:I.desc})]})]},I.value))}),R&&i.jsx("div",{style:{padding:"10px 14px",borderRadius:"var(--radius-button)",background:"var(--secondary)",border:"1px solid var(--border)"},children:i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:[i.jsxs("strong",{style:{color:"var(--foreground)"},children:[R.label,":"]})," ",R.desc]})})]}),i.jsxs($r,{n:3,title:"Event Access & Invite",subtitle:"Assign events and configure the invitation",open:l.open===3,completed:l.done.has(3),onToggle:()=>l.toggle(3),onSave:O,nextLabel:"Save",sectionError:d[3],children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Assign to Events"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px",marginBottom:"8px"},children:c.assignedEvents.map(I=>{const E=y.find(A=>A._id===I);return i.jsx(gw,{text:(E==null?void 0:E.name)??I,onRemove:()=>k(I)},I)})}),x?i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)"},children:"Loading events…"}):i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",maxHeight:"160px",overflowY:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",overflow:"hidden"},children:[y.map(I=>{const E=c.assignedEvents.includes(I._id);return i.jsxs("button",{type:"button",onClick:()=>k(I._id),style:{display:"flex",alignItems:"center",gap:"10px",padding:"9px 14px",background:E?"var(--accent)":"transparent",border:"none",borderBottom:"1px solid var(--border)",cursor:"pointer",textAlign:"left"},children:[i.jsx("input",{type:"checkbox",readOnly:!0,checked:E,style:{accentColor:"var(--primary)",width:"14px",height:"14px",cursor:"pointer"}}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:E?"var(--primary)":"var(--card-foreground)"},children:I.name})]},I._id)}),y.length===0&&i.jsx("div",{style:{padding:"12px 14px",fontSize:"var(--text-xs)",color:"var(--muted)"},children:"No events found. Create events first."})]}),i.jsx(Qt,{text:"Leave empty to grant access to all events based on their role."})]}),i.jsxs(Zi,{cols:1,children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Send Invite Now",required:!0}),i.jsx(go,{name:"sendNow",value:c.sendInviteNow,onChange:I=>w("sendInviteNow",I),options:[{label:"Yes, send immediately",value:"Yes"},{label:"No, save as draft",value:"No"}]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Personal Message"}),i.jsx("textarea",{style:{...$t,resize:"vertical",minHeight:"72px"},placeholder:"Optional: Add a personal note to the invitation email…",value:c.personalMessage,onChange:I=>w("personalMessage",I.target.value),onFocus:kt,onBlur:_t,maxLength:300}),i.jsx(Qt,{text:`${c.personalMessage.length}/300 characters.`})]})]})]})]})}const MTe=["Cover Page","About the Event","Agenda / Programme","Speakers & Faculty","Sponsors & Partners","Venue & Directions","Registration Info","Contact Details"],DTe=["A4","A5","US Letter","US Legal","Custom"],zTe=["Portrait","Landscape"],BTe=[{id:"brand",label:"Brand Blue",colors:["#0B4DD1","#E8EFFC","#FFFFFF"]},{id:"dark",label:"Bold Dark",colors:["#1A1A2E","#16213E","#E2E8F0"]},{id:"minimal",label:"Minimal",colors:["#FFFFFF","#F8FAFC","#1E293B"]},{id:"warm",label:"Warm Amber",colors:["#D97706","#FEF3C7","#1E293B"]},{id:"emerald",label:"Emerald",colors:["#059669","#ECFDF5","#1E293B"]}],WTe=["Inter + Noto Sans","Playfair + Source Sans","Montserrat + Open Sans","Merriweather + Lato"],qTe=["PDF (Print-ready)","PDF (Screen)","PNG (High-res)","All formats"],$Te=[...DTe],UTe=[...zTe],HTe=[...BTe],p9=[...WTe],VTe=[...MTe],YTe=[...qTe],GTe=[{id:"tpl1",label:"Classic",thumb:"#CBD5E1"},{id:"tpl2",label:"Modern",thumb:"#93C5FD"},{id:"tpl3",label:"Bold",thumb:"#6D28D9"},{id:"tpl4",label:"Minimal",thumb:"#F1F5F9"},{id:"tpl5",label:"Vibrant",thumb:"#10B981"},{id:"tpl6",label:"Corporate",thumb:"#1E3A5F"}];function KTe({onClose:e,templateId:t,onSuccess:r}){const{user:n}=Ur(),o=zn(n),a=!!t,s=4,l=mc(s),[c,u]=j.useState([]),[d,f]=j.useState({name:"",description:"",event:"",pageSize:"A4",customW:"",customH:"",orientation:"Portrait",templateId:"tpl1",colorScheme:"brand",fontPair:p9[0],coverTitle:"",coverSubtitle:"",coverDate:"",sections:["Cover Page","About the Event","Agenda / Programme"],outputFormat:"PDF (Print-ready)",bleed:!1,cropMarks:!1}),[h,p]=j.useState(!1),y=(b,w)=>f(k=>({...k,[b]:w}));j.useEffect(()=>{o&&zr.list({limit:100,organization:o}).then(b=>{var w;(w=b.data)!=null&&w.events&&(u(b.data.events),f(k=>{var S;return{...k,event:k.event||((S=b.data.events[0])==null?void 0:S._id)||""}}))})},[o]),j.useEffect(()=>{t&&Hs.get(t).then(b=>{if(!b.data)return;const w=b.data;f(k=>{var P;const S={...k,name:w.name,description:w.category||""};if(!yq(w.content))return S;const _=w.content;return{...S,event:_.eventId||S.event,pageSize:_.pageSize,customW:_.customW??"",customH:_.customH??"",orientation:_.orientation,templateId:_.layoutId||"tpl1",colorScheme:_.colorScheme,fontPair:_.fontPair,coverTitle:_.coverTitle,coverSubtitle:_.coverSubtitle,coverDate:_.coverDate,sections:(P=_.sections)!=null&&P.length?_.sections:k.sections,outputFormat:_.outputFormat,bleed:_.bleed,cropMarks:_.cropMarks}})})},[t]);const m=async()=>{p(!0);const b={version:1,eventId:d.event,pageSize:d.pageSize,customW:d.pageSize==="Custom"?d.customW:void 0,customH:d.pageSize==="Custom"?d.customH:void 0,orientation:d.orientation,layoutId:d.templateId,colorScheme:d.colorScheme,fontPair:d.fontPair,coverTitle:d.coverTitle,coverSubtitle:d.coverSubtitle,coverDate:d.coverDate,sections:d.sections,outputFormat:d.outputFormat,bleed:d.bleed,cropMarks:d.cropMarks},w={name:d.name,type:"brochure",category:d.description||void 0,content:b},k=a?await Hs.update(t,w):await Hs.create(w);if(p(!1),k.error||!k.data)return;const S=k.data._id;d.event.trim()&&await Hs.useForEvent(S,d.event),r==null||r(),e()},x=b=>y("sections",d.sections.includes(b)?d.sections.filter(w=>w!==b):[...d.sections,b]);return i.jsxs(Zo,{onClose:e,title:a?"Edit Brochure":"Create Brochure",breadcrumb:"Design · Brochure",description:"Design a print-ready or digital brochure for your event.",completedCount:l.done.size,totalSections:s,ctaLabel:a?"Save changes":"Create Brochure",ctaDisabled:h||!d.name.trim(),onCtaClick:m,children:[i.jsxs($r,{n:1,title:"Brochure Details",subtitle:"Name, event and page setup",open:l.open===1,completed:l.done.has(1),onToggle:()=>l.toggle(1),onSave:()=>l.advance(1),nextLabel:"Layout & Design",children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Brochure Name",required:!0}),i.jsx("input",{style:$t,placeholder:"e.g. NAPCON 2026 Event Brochure",value:d.name,onChange:b=>y("name",b.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Description"}),i.jsx("textarea",{style:{...$t,resize:"vertical",minHeight:"64px"},placeholder:"Brief description of this brochure…",value:d.description,onChange:b=>y("description",b.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Associated Event",required:!0}),i.jsx(an,{children:i.jsxs("select",{style:Nr,value:d.event,onChange:b=>y("event",b.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"Select event…"}),c.map(b=>i.jsx("option",{value:b._id,children:b.name},b._id))]})})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Page Size",required:!0}),i.jsx(an,{children:i.jsx("select",{style:Nr,value:d.pageSize,onChange:b=>y("pageSize",b.target.value),onFocus:kt,onBlur:_t,children:$Te.map(b=>i.jsx("option",{children:b},b))})})]}),d.pageSize==="Custom"&&i.jsxs(i.Fragment,{children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Width (mm)",required:!0}),i.jsx("input",{style:$t,placeholder:"210",value:d.customW,onChange:b=>y("customW",b.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Height (mm)",required:!0}),i.jsx("input",{style:$t,placeholder:"297",value:d.customH,onChange:b=>y("customH",b.target.value),onFocus:kt,onBlur:_t})]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Orientation"}),i.jsx(go,{name:"brOrientation",value:d.orientation,onChange:b=>y("orientation",b),options:UTe.map(b=>({label:b,value:b}))})]})]})]}),i.jsxs($r,{n:2,title:"Layout & Design",subtitle:"Choose a template, colour scheme and fonts",open:l.open===2,completed:l.done.has(2),onToggle:()=>l.toggle(2),onSave:()=>l.advance(2),nextLabel:"Content",children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Template",required:!0}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:"8px"},children:GTe.map(b=>i.jsxs("button",{onClick:()=>y("templateId",b.id),style:{borderRadius:"var(--radius-button)",border:`2px solid ${d.templateId===b.id?"var(--primary)":"var(--border)"}`,overflow:"hidden",cursor:"pointer",background:"none",padding:0,transition:"border-color .12s"},children:[i.jsx("div",{style:{height:"72px",background:b.thumb}}),i.jsx("p",{style:{margin:"6px 0",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:d.templateId===b.id?"var(--primary)":"var(--card-foreground)"},children:b.label})]},b.id))})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Colour Scheme"}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:HTe.map(b=>i.jsxs("button",{onClick:()=>y("colorScheme",b.id),style:{display:"flex",alignItems:"center",gap:"10px",padding:"8px 12px",borderRadius:"var(--radius-button)",border:`1.5px solid ${d.colorScheme===b.id?"var(--primary)":"var(--border)"}`,background:d.colorScheme===b.id?"var(--accent)":"var(--card)",cursor:"pointer",transition:"all .12s"},children:[i.jsx("div",{style:{display:"flex",gap:"3px",flexShrink:0},children:b.colors.map((w,k)=>i.jsx("div",{style:{width:"14px",height:"14px",borderRadius:"50%",background:w,border:"1px solid rgba(0,0,0,0.1)"}},k))}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:b.label}),d.colorScheme===b.id&&i.jsx(Oi,{size:12,style:{color:"var(--primary)",marginLeft:"auto"}})]},b.id))})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Font Pairing"}),i.jsx(an,{children:i.jsx("select",{style:Nr,value:d.fontPair,onChange:b=>y("fontPair",b.target.value),onFocus:kt,onBlur:_t,children:p9.map(b=>i.jsx("option",{children:b},b))})})]})]}),i.jsxs($r,{n:3,title:"Content",subtitle:"Set cover details and choose sections to include",open:l.open===3,completed:l.done.has(3),onToggle:()=>l.toggle(3),onSave:()=>l.advance(3),nextLabel:"Output Settings",children:[i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{span2:!1,children:[i.jsx(pt,{text:"Cover Title",required:!0}),i.jsx("input",{style:$t,placeholder:"e.g. NAPCON 2026",value:d.coverTitle,onChange:b=>y("coverTitle",b.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{span2:!1,children:[i.jsx(pt,{text:"Event Date on Cover"}),i.jsx("input",{style:$t,placeholder:"e.g. Nov 14–16, 2026",value:d.coverDate,onChange:b=>y("coverDate",b.target.value),onFocus:kt,onBlur:_t})]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Cover Subtitle / Tagline"}),i.jsx("input",{style:$t,placeholder:"e.g. National Pulmonology Conference",value:d.coverSubtitle,onChange:b=>y("coverSubtitle",b.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Sections to Include",required:!0}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:VTe.map(b=>{const w=d.sections.includes(b);return i.jsxs("button",{onClick:()=>x(b),style:{display:"flex",alignItems:"center",gap:"10px",padding:"8px 12px",borderRadius:"var(--radius-button)",border:`1px solid ${w?"var(--primary)":"var(--border)"}`,background:w?"var(--accent)":"var(--card)",cursor:"pointer",textAlign:"left",transition:"all .12s"},children:[i.jsx("div",{style:{width:"16px",height:"16px",borderRadius:"4px",border:`2px solid ${w?"var(--primary)":"var(--border)"}`,background:w?"var(--primary)":"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"all .12s"},children:w&&i.jsx(Oi,{size:10,style:{color:"#fff"}})}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:b})]},b)})}),i.jsx(Qt,{text:`${d.sections.length} section${d.sections.length!==1?"s":""} selected.`})]})]}),i.jsxs($r,{n:4,title:"Output Settings",subtitle:"Format and print-production options",open:l.open===4,completed:l.done.has(4),onToggle:()=>l.toggle(4),onSave:()=>l.advance(4),nextLabel:"Create Brochure",children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Output Format",required:!0}),i.jsx(go,{name:"brOutput",value:d.outputFormat,onChange:b=>y("outputFormat",b),options:YTe.map(b=>({label:b,value:b}))})]}),i.jsx(ev,{text:"Print Production"}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[["bleed","Include Bleed (3 mm)","Adds bleed area around the page for professional printing."],["cropMarks","Crop Marks","Adds trim guides for print vendors."]].map(([b,w,k])=>i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",padding:"10px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{margin:0,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)"},children:w}),i.jsx("p",{style:{margin:"2px 0 0",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:k})]}),i.jsx(QTe,{value:d[b],onChange:S=>y(b,S)})]},b))}),i.jsx(Qt,{text:"Print-ready PDFs include embedded fonts and CMYK colour profiles."})]})]})}function QTe({value:e,onChange:t}){return i.jsx("button",{onClick:()=>t(!e),style:{width:"36px",height:"20px",borderRadius:"99px",border:"none",cursor:"pointer",flexShrink:0,background:e?"var(--primary)":"var(--border)",position:"relative",transition:"background .2s"},children:i.jsx("span",{style:{position:"absolute",top:"3px",left:e?"19px":"3px",width:"14px",height:"14px",borderRadius:"50%",background:"#fff",transition:"left .2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}})})}async function XTe(e){var a,s,l;if(e.type!=="brochure"||!yq(e.content))return{ok:!1,error:"This brochure has no saved layout. Edit it and save again."};const t=e.content;let r=null,n=[],o=[];if((a=t.eventId)!=null&&a.trim()){const c=await zr.get(t.eventId);c.data&&(r=c.data);const u=await Da.list(t.eventId);(s=u.data)!=null&&s.sessions&&(n=u.data.sessions);const d=await Ef.byEvent(t.eventId);(l=d.data)!=null&&l.speakers&&(o=d.data.speakers)}return{ok:!0,ctx:{templateName:e.name,content:t,event:r,sessions:n,speakers:o}}}const ZTe=[{name:"PharmaCorp India",tier:"Platinum"},{name:"MedTech Solutions",tier:"Gold"},{name:"Healthcare Systems Ltd",tier:"Silver"}];function JTe(e){try{return new Date(e).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}catch{return""}}function ePe(e){const t=e.speakers;return t!=null&&t.length?t.map(r=>typeof r=="string"?"":[r.firstName,r.lastName].filter(Boolean).join(" ").trim()).filter(Boolean).join(", "):""}function tPe(e){return e.map(t=>{var r;return{name:[t.firstName,t.lastName].filter(Boolean).join(" ").trim()||"—",title:t.title||t.organizationName||"",specialty:t.speakerRole||((r=t.expertise)==null?void 0:r[0])||"Speaker"}})}function rPe(e){const t=e.event;return!(t!=null&&t.startDate)||!(t!=null&&t.endDate)?"":`${new Date(t.startDate).toLocaleDateString()} – ${new Date(t.endDate).toLocaleDateString()}`}function WQ(e){var f,h,p,y,m,x,b,w;const{content:t,event:r,sessions:n,speakers:o,templateName:a}=e,s=r,l=[...n].sort((k,S)=>new Date(k.startTime).getTime()-new Date(S.startTime).getTime()).map(k=>({time:JTe(k.startTime),title:k.title,speaker:ePe(k)})),c=tPe(o),u=(h=(f=s==null?void 0:s.website)==null?void 0:f.registrationUrl)==null?void 0:h.trim(),d=u?`Register at: ${u}. Early bird and group rates may apply — see the registration page for details.`:s!=null&&s.joinCode?`Join the event hub with code ${s.joinCode} on EventBuzz. Conference materials and updates are shared with registered attendees.`:"Registration details will be published on the event website. Contact the organiser for group bookings and delegate passes.";return{templateName:a,coverTitle:((p=t.coverTitle)==null?void 0:p.trim())||(s==null?void 0:s.name)||a,coverSubtitle:((y=t.coverSubtitle)==null?void 0:y.trim())||(s==null?void 0:s.subtitle)||"",coverDate:((m=t.coverDate)==null?void 0:m.trim())||rPe(e)||"—",eventName:(s==null?void 0:s.name)||t.coverTitle||a,eventSubtitle:(s==null?void 0:s.subtitle)||t.coverSubtitle||"",description:((x=s==null?void 0:s.description)==null?void 0:x.trim())||"Add a description on the event record to show a full overview in this brochure.",venue:((b=s==null?void 0:s.location)==null?void 0:b.trim())||"Venue to be announced",venueNote:"Conveniently located with access from major transport links. See the event website for maps and parking.",virtualLink:((w=s==null?void 0:s.virtualLink)==null?void 0:w.trim())||"",expectedAttendees:"500+",sessionCount:n.length,speakerCount:o.length||c.length,logoEmoji:"🫁",agenda:l.length?l:[{time:"09:00 AM",title:"Registration & Welcome Coffee",speaker:""},{time:"10:00 AM",title:"Opening Session",speaker:""},{time:"12:30 PM",title:"Lunch",speaker:""}],speakers:c.length?c:[{name:"Featured speaker",title:"To be announced",specialty:"Programme"}],sponsors:ZTe,registrationBlurb:d,contactEmail:"info@event.example",contactPhone:"—",website:u||(s!=null&&s.joinCode?`eventbuzz.live/code/${s.joinCode}`:"—"),sections:[...t.sections]}}const jr={cover:"Cover Page",about:"About the Event",agenda:"Agenda / Programme",speakers:"Speakers & Faculty",sponsors:"Sponsors & Partners",venue:"Venue & Directions",registration:"Registration Info",contact:"Contact Details"};function nPe(e){return{tpl1:"Classic",tpl2:"Modern",tpl3:"Bold",tpl4:"Minimal",tpl5:"Vibrant",tpl6:"Corporate"}[e]||"Brochure"}function qQ({templateId:e,data:t}){return i.jsxs("div",{style:{width:"100%",maxWidth:680,margin:"0 auto",background:"#fff",boxSizing:"border-box"},children:[e==="tpl1"&&i.jsx(iPe,{data:t}),e==="tpl2"&&i.jsx(oPe,{data:t}),e==="tpl3"&&i.jsx(aPe,{data:t}),e==="tpl4"&&i.jsx(sPe,{data:t}),e==="tpl5"&&i.jsx(lPe,{data:t}),e==="tpl6"&&i.jsx(cPe,{data:t})]})}function iPe({data:e}){const t=n=>e.sections.includes(n),r=e;return i.jsxs("div",{style:{padding:"40px 50px",fontFamily:"Georgia, serif"},children:[t(jr.cover)&&i.jsx("div",{style:{borderWidth:2,borderStyle:"solid",borderColor:"#CBD5E1",padding:40,marginBottom:40,position:"relative"},children:i.jsxs("div",{style:{borderWidth:1,borderStyle:"solid",borderColor:"#CBD5E1",padding:30,textAlign:"center"},children:[i.jsx("div",{style:{fontSize:48,marginBottom:16},children:r.logoEmoji}),i.jsx("h1",{style:{fontFamily:"Georgia, serif",fontSize:36,fontWeight:700,color:"#1E293B",margin:"0 0 12px",lineHeight:1.2},children:r.coverTitle}),i.jsx("p",{style:{fontSize:18,color:"#64748B",margin:"0 0 24px",fontStyle:"italic"},children:r.coverSubtitle||r.eventSubtitle}),i.jsx("div",{style:{borderTop:"1px solid #CBD5E1",borderBottom:"1px solid #CBD5E1",padding:"16px 0",margin:"24px 0"},children:i.jsx("p",{style:{fontSize:16,color:"#475569",margin:0},children:r.coverDate})}),i.jsx("p",{style:{fontSize:14,color:"#94A3B8",margin:0},children:r.venue})]})}),t(jr.about)&&i.jsxs(Ip,{title:"About the Event",children:[i.jsx("p",{style:{fontSize:14,lineHeight:1.8,color:"#475569",margin:"0 0 16px"},children:r.description}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:16,marginTop:20},children:[i.jsx(u3,{icon:i.jsx(vi,{size:20}),label:"Expected Attendees",value:r.expectedAttendees}),i.jsx(u3,{icon:i.jsx(Wi,{size:20}),label:"Sessions",value:String(r.sessionCount)}),i.jsx(u3,{icon:i.jsx(vi,{size:20}),label:"Speakers",value:String(r.speakerCount)})]})]}),t(jr.agenda)&&i.jsx(Ip,{title:"Event Agenda",children:i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:r.agenda.map((n,o)=>i.jsxs("div",{style:{display:"flex",gap:16,padding:12,background:"#F8FAFC",borderLeft:"3px solid #0B4DD1"},children:[i.jsx("span",{style:{fontSize:13,fontWeight:700,color:"#0B4DD1",minWidth:70,fontFamily:"sans-serif"},children:n.time}),i.jsxs("div",{style:{flex:1},children:[i.jsx("p",{style:{fontSize:14,fontWeight:600,color:"#1E293B",margin:"0 0 2px"},children:n.title}),n.speaker?i.jsx("p",{style:{fontSize:12,color:"#64748B",margin:0},children:n.speaker}):null]})]},o))})}),t(jr.speakers)&&i.jsx(Ip,{title:"Featured Speakers",children:i.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:r.speakers.map((n,o)=>i.jsxs("div",{style:{padding:16,border:"1px solid #E2E8F0",borderRadius:4},children:[i.jsx("h4",{style:{fontSize:15,fontWeight:700,color:"#1E293B",margin:"0 0 4px"},children:n.name}),i.jsx("p",{style:{fontSize:12,color:"#64748B",margin:"0 0 6px"},children:n.title}),i.jsx("p",{style:{fontSize:12,color:"#0B4DD1",margin:0,fontWeight:600},children:n.specialty})]},o))})}),t(jr.sponsors)&&i.jsx(Ip,{title:"Sponsors & Partners",children:r.sponsors.map((n,o)=>i.jsxs("div",{style:{padding:"12px 16px",background:"#F8FAFC",marginBottom:8,borderRadius:4,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[i.jsx("span",{style:{fontSize:14,color:"#1E293B",fontWeight:600},children:n.name}),i.jsx("span",{style:{fontSize:11,color:"#fff",background:"#0B4DD1",padding:"3px 10px",borderRadius:12,fontWeight:700,textTransform:"uppercase"},children:n.tier})]},o))}),t(jr.venue)&&i.jsx(Ip,{title:"Venue & Directions",children:i.jsx("div",{style:{padding:16,background:"#F8FAFC",borderRadius:4},children:i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:10,marginBottom:10},children:[i.jsx(lb,{size:16,style:{color:"#0B4DD1",marginTop:2}}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:14,fontWeight:600,color:"#1E293B",margin:"0 0 4px"},children:r.venue}),r.virtualLink?i.jsxs("p",{style:{fontSize:13,color:"#64748B",margin:"0 0 8px"},children:["Virtual: ",r.virtualLink]}):null,i.jsx("p",{style:{fontSize:13,color:"#64748B",margin:0},children:r.venueNote})]})]})})}),t(jr.registration)&&i.jsx(Ip,{title:"Registration Information",children:i.jsx("p",{style:{fontSize:14,lineHeight:1.7,color:"#475569",margin:0},children:r.registrationBlurb})}),t(jr.contact)&&i.jsx(Ip,{title:"Contact Us",children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[i.jsx(um,{icon:i.jsx(Uf,{size:16}),label:"Email",value:r.contactEmail}),i.jsx(um,{icon:i.jsx(Iw,{size:16}),label:"Phone",value:r.contactPhone}),i.jsx(um,{icon:i.jsx(ud,{size:16}),label:"Website",value:r.website})]})})]})}function oPe({data:e}){const t=n=>e.sections.includes(n),r=e;return i.jsxs("div",{style:{fontFamily:"sans-serif"},children:[t(jr.cover)&&i.jsxs("div",{style:{background:"linear-gradient(135deg, #0B4DD1 0%, #2563EB 100%)",padding:"60px 40px",color:"#fff",position:"relative"},children:[i.jsx("div",{style:{position:"absolute",top:30,right:40,width:80,height:80,borderRadius:"50%",background:"rgba(255,255,255,0.15)"}}),i.jsx("div",{style:{fontSize:56,marginBottom:20},children:r.logoEmoji}),i.jsx("h1",{style:{fontSize:42,fontWeight:700,margin:"0 0 12px",lineHeight:1.1,maxWidth:500},children:r.coverTitle}),i.jsx("p",{style:{fontSize:18,margin:"0 0 30px",opacity:.9},children:r.coverSubtitle||r.eventSubtitle}),i.jsx("div",{style:{display:"inline-block",background:"rgba(255,255,255,0.2)",padding:"12px 24px",borderRadius:4},children:i.jsx("p",{style:{fontSize:16,margin:0,fontWeight:600},children:r.coverDate})})]}),i.jsxs("div",{style:{padding:40},children:[t(jr.about)&&i.jsxs(Np,{title:"About the Conference",children:[i.jsx("p",{style:{fontSize:15,lineHeight:1.7,color:"#475569",margin:0},children:r.description}),i.jsx("div",{style:{display:"flex",gap:20,marginTop:24},children:[{label:"Attendees",value:r.expectedAttendees},{label:"Sessions",value:r.sessionCount},{label:"Speakers",value:r.speakerCount}].map((n,o)=>i.jsxs("div",{style:{flex:1,padding:20,background:"#E8EFFC",borderRadius:8,textAlign:"center"},children:[i.jsx("div",{style:{fontSize:32,fontWeight:700,color:"#0B4DD1",marginBottom:6},children:n.value}),i.jsx("div",{style:{fontSize:13,color:"#64748B",textTransform:"uppercase",letterSpacing:"0.5px"},children:n.label})]},o))})]}),t(jr.agenda)&&i.jsx(Np,{title:"Conference Agenda",children:i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12},children:r.agenda.map((n,o)=>i.jsxs("div",{style:{display:"flex",gap:20,padding:16,background:"#F8FAFC",borderRadius:6,borderLeft:"4px solid #0B4DD1"},children:[i.jsx("div",{style:{minWidth:80},children:i.jsx("div",{style:{fontSize:14,fontWeight:700,color:"#0B4DD1"},children:n.time})}),i.jsxs("div",{style:{flex:1},children:[i.jsx("div",{style:{fontSize:15,fontWeight:600,color:"#1E293B",marginBottom:4},children:n.title}),n.speaker?i.jsx("div",{style:{fontSize:13,color:"#64748B"},children:n.speaker}):null]})]},o))})}),t(jr.speakers)&&i.jsx(Np,{title:"Keynote Speakers",children:i.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:20},children:r.speakers.map((n,o)=>i.jsxs("div",{style:{padding:20,border:"1px solid #E2E8F0",borderRadius:8,background:"#fff"},children:[i.jsx("div",{style:{width:50,height:50,borderRadius:"50%",background:"#E8EFFC",marginBottom:12}}),i.jsx("h4",{style:{fontSize:16,fontWeight:700,color:"#1E293B",margin:"0 0 6px"},children:n.name}),i.jsx("p",{style:{fontSize:13,color:"#64748B",margin:"0 0 8px"},children:n.title}),i.jsx("p",{style:{fontSize:12,color:"#0B4DD1",margin:0,fontWeight:600},children:n.specialty})]},o))})}),t(jr.sponsors)&&i.jsx(Np,{title:"Sponsors & Partners",children:r.sponsors.map((n,o)=>i.jsxs("div",{style:{padding:"14px 18px",background:"#F8FAFC",marginBottom:8,borderRadius:6,borderLeft:"4px solid #0B4DD1",display:"flex",justifyContent:"space-between"},children:[i.jsx("span",{style:{fontWeight:600,color:"#1E293B"},children:n.name}),i.jsx("span",{style:{fontSize:12,color:"#0B4DD1",fontWeight:700},children:n.tier})]},o))}),t(jr.venue)&&i.jsxs(Np,{title:"Venue",children:[i.jsx("p",{style:{color:"#475569",margin:0},children:r.venue}),r.virtualLink?i.jsx("p",{style:{color:"#64748B",margin:"8px 0 0"},children:r.virtualLink}):null]}),t(jr.registration)&&i.jsx(Np,{title:"Registration",children:i.jsx("p",{style:{color:"#475569",margin:0},children:r.registrationBlurb})}),t(jr.contact)?i.jsx(Np,{title:"Get in Touch",children:i.jsx("div",{style:{background:"#F8FAFC",padding:24,borderRadius:8},children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[i.jsx(um,{icon:i.jsx(Uf,{size:16}),label:"Email",value:r.contactEmail}),i.jsx(um,{icon:i.jsx(Iw,{size:16}),label:"Phone",value:r.contactPhone}),i.jsx(um,{icon:i.jsx(ud,{size:16}),label:"Website",value:r.website})]})})}):null]})]})}function aPe({data:e}){const t=n=>e.sections.includes(n),r=e;return i.jsxs("div",{style:{background:"#1A1A2E",color:"#E2E8F0",fontFamily:"sans-serif"},children:[t(jr.cover)&&i.jsxs("div",{style:{background:"linear-gradient(135deg, #6D28D9 0%, #8B5CF6 100%)",padding:"60px 40px",position:"relative",overflow:"hidden"},children:[i.jsx("div",{style:{fontSize:64,marginBottom:24,filter:"drop-shadow(0 4px 8px rgba(0,0,0,0.3))"},children:r.logoEmoji}),i.jsx("h1",{style:{fontSize:48,fontWeight:900,margin:"0 0 16px",lineHeight:1,textTransform:"uppercase",letterSpacing:"-1px"},children:r.coverTitle}),i.jsx("p",{style:{fontSize:20,margin:"0 0 30px",color:"#C4B5FD"},children:r.coverSubtitle||r.eventSubtitle}),i.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8,background:"rgba(255,255,255,0.15)",padding:"12px 20px",borderRadius:6},children:[i.jsx(Wi,{size:18}),i.jsx("span",{style:{fontSize:16,fontWeight:700},children:r.coverDate})]})]}),i.jsxs("div",{style:{padding:40},children:[t(jr.about)&&i.jsx(Rp,{title:"About",children:i.jsx("p",{style:{fontSize:15,lineHeight:1.8,color:"#CBD5E1",margin:0},children:r.description})}),t(jr.agenda)&&i.jsx(Rp,{title:"Schedule",children:r.agenda.map((n,o)=>i.jsx("div",{style:{background:"#312E81",padding:"16px 20px",marginBottom:10,borderRadius:4,borderLeft:"4px solid #A78BFA"},children:i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:16},children:[i.jsxs("div",{style:{flex:1},children:[i.jsx("div",{style:{fontSize:15,fontWeight:700,color:"#fff",marginBottom:4},children:n.title}),n.speaker?i.jsx("div",{style:{fontSize:13,color:"#A78BFA"},children:n.speaker}):null]}),i.jsx("div",{style:{fontSize:13,fontWeight:700,color:"#C4B5FD",minWidth:70,textAlign:"right"},children:n.time})]})},o))}),t(jr.speakers)&&i.jsx(Rp,{title:"Speakers",children:i.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:r.speakers.map((n,o)=>i.jsxs("div",{style:{background:"#312E81",padding:20,borderRadius:6},children:[i.jsx("h4",{style:{fontSize:16,fontWeight:700,color:"#fff",margin:"0 0 8px"},children:n.name}),i.jsx("p",{style:{fontSize:13,color:"#A78BFA",margin:"0 0 6px"},children:n.title}),i.jsx("p",{style:{fontSize:12,color:"#C4B5FD",margin:0},children:n.specialty})]},o))})}),t(jr.sponsors)&&i.jsx(Rp,{title:"Sponsors",children:r.sponsors.map((n,o)=>i.jsxs("div",{style:{background:"#312E81",padding:16,marginBottom:8,borderRadius:4,display:"flex",justifyContent:"space-between"},children:[i.jsx("span",{style:{fontWeight:700},children:n.name}),i.jsx("span",{style:{color:"#A78BFA",fontSize:12},children:n.tier})]},o))}),t(jr.venue)&&i.jsx(Rp,{title:"Venue",children:i.jsx("p",{style:{color:"#CBD5E1",margin:0},children:r.venue})}),t(jr.registration)&&i.jsx(Rp,{title:"Registration",children:i.jsx("p",{style:{color:"#CBD5E1",margin:0},children:r.registrationBlurb})}),t(jr.contact)&&i.jsx(Rp,{title:"Contact",children:i.jsx("div",{style:{background:"#312E81",padding:20,borderRadius:6},children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i.jsx(Uf,{size:16,style:{color:"#A78BFA"}}),i.jsx("span",{style:{fontSize:14,color:"#E2E8F0"},children:r.contactEmail})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i.jsx(ud,{size:16,style:{color:"#A78BFA"}}),i.jsx("span",{style:{fontSize:14,color:"#E2E8F0"},children:r.website})]})]})})})]})]})}function sPe({data:e}){const t=n=>e.sections.includes(n),r=e;return i.jsxs("div",{style:{padding:60,fontFamily:"sans-serif",color:"#0F172A"},children:[t(jr.cover)&&i.jsxs("div",{style:{textAlign:"center",marginBottom:60},children:[i.jsx("h1",{style:{fontSize:40,fontWeight:300,margin:"0 0 16px",letterSpacing:"-0.5px"},children:r.coverTitle}),i.jsx("p",{style:{fontSize:16,color:"#94A3B8",margin:"0 0 8px"},children:r.coverSubtitle||r.eventSubtitle}),i.jsx("p",{style:{fontSize:14,color:"#CBD5E1"},children:r.coverDate})]}),t(jr.about)&&i.jsx(Lp,{title:"About",children:r.description}),t(jr.agenda)&&i.jsx(Lp,{title:"Agenda",children:r.agenda.map((n,o)=>i.jsxs("div",{style:{marginBottom:10},children:[i.jsx("div",{style:{fontSize:13,fontWeight:600},children:n.time}),i.jsxs("div",{style:{fontSize:14,color:"#475569"},children:[n.title,n.speaker?` · ${n.speaker}`:""]})]},o))}),t(jr.speakers)&&i.jsx(Lp,{title:"Speakers",children:r.speakers.map((n,o)=>i.jsxs("div",{style:{marginBottom:12},children:[i.jsx("div",{style:{fontSize:15,fontWeight:600,color:"#0F172A"},children:n.name}),i.jsxs("div",{style:{fontSize:13,color:"#64748B"},children:[n.title," • ",n.specialty]})]},o))}),t(jr.sponsors)&&i.jsx(Lp,{title:"Sponsors",children:r.sponsors.map((n,o)=>i.jsxs("div",{style:{marginBottom:8,fontSize:14},children:[n.name," ",i.jsxs("span",{style:{color:"#94A3B8"},children:["(",n.tier,")"]})]},o))}),t(jr.venue)&&i.jsx(Lp,{title:"Venue",children:r.venue}),t(jr.registration)&&i.jsx(Lp,{title:"Registration",children:r.registrationBlurb}),t(jr.contact)&&i.jsx(Lp,{title:"Contact",children:i.jsxs("div",{style:{fontSize:14,color:"#475569"},children:[r.contactEmail," • ",r.website]})})]})}function lPe({data:e}){const t=n=>e.sections.includes(n),r=e;return i.jsxs("div",{style:{background:"linear-gradient(135deg, #10B981 0%, #3B82F6 100%)",color:"#fff",fontFamily:"sans-serif"},children:[t(jr.cover)&&i.jsxs("div",{style:{padding:"60px 40px",position:"relative"},children:[i.jsx("div",{style:{position:"absolute",top:40,right:60,width:120,height:120,borderRadius:"50%",background:"rgba(255,255,255,0.2)"}}),i.jsx("h1",{style:{fontSize:48,fontWeight:800,margin:"0 0 16px"},children:r.coverTitle}),i.jsx("p",{style:{fontSize:20,margin:"0 0 30px",opacity:.9},children:r.coverSubtitle||r.eventSubtitle}),i.jsx("p",{style:{fontSize:16,fontWeight:600},children:r.coverDate})]}),i.jsxs("div",{style:{background:"#fff",color:"#1E293B",padding:40},children:[t(jr.about)&&i.jsx(Fp,{title:"About",children:r.description}),t(jr.agenda)&&i.jsx(Fp,{title:"Agenda",children:r.agenda.map((n,o)=>i.jsxs("div",{style:{padding:12,background:"#F0F9FF",marginBottom:8,borderRadius:6},children:[i.jsx("div",{style:{fontWeight:700,fontSize:13,color:"#0369A1"},children:n.time}),i.jsx("div",{style:{fontWeight:600},children:n.title}),n.speaker?i.jsx("div",{style:{fontSize:13,color:"#64748B"},children:n.speaker}):null]},o))}),t(jr.speakers)&&i.jsx(Fp,{title:"Speakers",children:r.speakers.map((n,o)=>i.jsxs("div",{style:{padding:16,background:"#F0FDF4",marginBottom:8,borderRadius:6},children:[i.jsx("div",{style:{fontWeight:700,fontSize:15},children:n.name}),i.jsx("div",{style:{fontSize:13,color:"#64748B"},children:n.specialty})]},o))}),t(jr.sponsors)&&i.jsx(Fp,{title:"Sponsors",children:r.sponsors.map((n,o)=>i.jsxs("div",{style:{marginBottom:8,fontSize:14},children:[i.jsx("strong",{children:n.name})," — ",n.tier]},o))}),t(jr.venue)&&i.jsx(Fp,{title:"Venue",children:r.venue}),t(jr.registration)&&i.jsx(Fp,{title:"Registration",children:r.registrationBlurb}),t(jr.contact)&&i.jsxs(Fp,{title:"Contact",children:[r.contactEmail," • ",r.website]})]})]})}function cPe({data:e}){const t=n=>e.sections.includes(n),r=e;return i.jsxs("div",{style:{background:"#1E3A5F",color:"#E2E8F0",fontFamily:"sans-serif"},children:[t(jr.cover)&&i.jsx("div",{style:{borderTop:"4px solid #D4AF37",borderBottom:"4px solid #D4AF37",padding:"50px 40px",background:"#1E3A5F"},children:i.jsxs("div",{style:{textAlign:"center"},children:[i.jsx("div",{style:{fontSize:56,marginBottom:20},children:r.logoEmoji}),i.jsx("h1",{style:{fontSize:40,fontWeight:700,margin:"0 0 16px",color:"#fff"},children:r.coverTitle}),i.jsx("p",{style:{fontSize:18,color:"#94A3B8",margin:"0 0 24px"},children:r.coverSubtitle||r.eventSubtitle}),i.jsx("div",{style:{borderTop:"1px solid #D4AF37",borderBottom:"1px solid #D4AF37",padding:"12px 0",display:"inline-block"},children:i.jsx("p",{style:{fontSize:16,margin:0},children:r.coverDate})})]})}),i.jsxs("div",{style:{padding:40},children:[t(jr.about)&&i.jsx(Mp,{title:"About",children:r.description}),t(jr.agenda)&&i.jsx(Mp,{title:"Programme",children:r.agenda.map((n,o)=>i.jsxs("div",{style:{padding:14,background:"#334155",marginBottom:8,borderRadius:4,borderLeft:"3px solid #D4AF37"},children:[i.jsx("div",{style:{fontSize:12,color:"#D4AF37",fontWeight:700},children:n.time}),i.jsx("div",{style:{fontWeight:600,color:"#fff"},children:n.title}),n.speaker?i.jsx("div",{style:{fontSize:13,color:"#94A3B8"},children:n.speaker}):null]},o))}),t(jr.speakers)&&i.jsx(Mp,{title:"Distinguished Speakers",children:r.speakers.map((n,o)=>i.jsxs("div",{style:{padding:16,background:"#334155",marginBottom:10,borderRadius:4,border:"1px solid #D4AF37"},children:[i.jsx("div",{style:{fontWeight:700,fontSize:15,color:"#fff"},children:n.name}),i.jsx("div",{style:{fontSize:13,color:"#94A3B8"},children:n.title})]},o))}),t(jr.sponsors)&&i.jsx(Mp,{title:"Partners",children:r.sponsors.map((n,o)=>i.jsxs("div",{style:{padding:12,background:"#334155",marginBottom:8,borderRadius:4},children:[n.name," — ",i.jsx("span",{style:{color:"#D4AF37"},children:n.tier})]},o))}),t(jr.venue)&&i.jsx(Mp,{title:"Venue",children:r.venue}),t(jr.registration)&&i.jsx(Mp,{title:"Registration",children:r.registrationBlurb}),t(jr.contact)&&i.jsx(Mp,{title:"Contact Information",children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,fontSize:14},children:[i.jsx("div",{children:r.contactEmail}),i.jsx("div",{children:r.website})]})})]}),i.jsxs("div",{style:{borderTop:"4px solid #D4AF37",padding:"20px 40px",textAlign:"center",fontSize:12,color:"#64748B"},children:["© ",new Date().getFullYear()," ",r.eventName,". All rights reserved."]})]})}function Ip({title:e,children:t}){return i.jsxs("div",{style:{marginBottom:32},children:[i.jsx("h2",{style:{fontSize:22,fontWeight:700,color:"#1E293B",margin:"0 0 16px",borderBottom:"2px solid #CBD5E1",paddingBottom:8},children:e}),t]})}function Np({title:e,children:t}){return i.jsxs("div",{style:{marginBottom:40},children:[i.jsxs("h2",{style:{fontSize:24,fontWeight:700,color:"#0B4DD1",margin:"0 0 20px",position:"relative",paddingLeft:16},children:[i.jsx("div",{style:{position:"absolute",left:0,top:"50%",transform:"translateY(-50%)",width:4,height:24,background:"#0B4DD1",borderRadius:2}}),e]}),t]})}function Rp({title:e,children:t}){return i.jsxs("div",{style:{marginBottom:36},children:[i.jsx("h2",{style:{fontSize:26,fontWeight:900,color:"#A78BFA",margin:"0 0 20px",textTransform:"uppercase",letterSpacing:"1px"},children:e}),t]})}function Lp({title:e,children:t}){return i.jsxs("div",{style:{marginBottom:48},children:[i.jsx("h2",{style:{fontSize:18,fontWeight:600,color:"#0F172A",margin:"0 0 20px",letterSpacing:"0.5px"},children:e}),i.jsx("div",{style:{fontSize:14,lineHeight:1.8,color:"#475569"},children:t})]})}function Fp({title:e,children:t}){return i.jsxs("div",{style:{marginBottom:32},children:[i.jsx("h2",{style:{fontSize:24,fontWeight:800,color:"#10B981",margin:"0 0 16px"},children:e}),i.jsx("div",{style:{fontSize:14,lineHeight:1.7,color:"#475569"},children:t})]})}function Mp({title:e,children:t}){return i.jsxs("div",{style:{marginBottom:36},children:[i.jsx("h2",{style:{fontSize:22,fontWeight:700,color:"#D4AF37",margin:"0 0 16px",borderBottom:"2px solid #D4AF37",paddingBottom:8},children:e}),t]})}function u3({icon:e,label:t,value:r}){return i.jsxs("div",{style:{padding:16,background:"#F8FAFC",borderRadius:4,textAlign:"center",border:"1px solid #E2E8F0"},children:[i.jsx("div",{style:{color:"#0B4DD1",marginBottom:8,display:"flex",justifyContent:"center"},children:e}),i.jsx("div",{style:{fontSize:20,fontWeight:700,color:"#1E293B",marginBottom:4},children:r}),i.jsx("div",{style:{fontSize:11,color:"#64748B",textTransform:"uppercase",letterSpacing:"0.5px"},children:t})]})}function um({icon:e,label:t,value:r}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i.jsx("div",{style:{color:"#0B4DD1"},children:e}),i.jsxs("div",{children:[i.jsx("div",{style:{fontSize:11,color:"#94A3B8",textTransform:"uppercase",letterSpacing:"0.5px"},children:t}),i.jsx("div",{style:{fontSize:14,color:"#1E293B",fontWeight:500},children:r})]})]})}const uPe="modulepreload",dPe=function(e){return"/"+e},h9={},d3=function(t,r,n){let o=Promise.resolve();if(r&&r.length>0){let s=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));o=s(r.map(u=>{if(u=dPe(u),u in h9)return;h9[u]=!0;const d=u.endsWith(".css"),f=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${f}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":uPe,d||(h.as="script"),h.crossOrigin="",h.href=u,c&&h.setAttribute("nonce",c),document.head.appendChild(h),d)return new Promise((p,y)=>{h.addEventListener("load",p),h.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${u}`)))})}))}function a(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return o.then(s=>{for(const l of s||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})};function On(e){"@babel/helpers - typeof";return On=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},On(e)}var pc=Uint8Array,Vs=Uint16Array,_8=Int32Array,C8=new pc([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),E8=new pc([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),g9=new pc([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$Q=function(e,t){for(var r=new Vs(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new _8(r[30]),n=1;n<30;++n)for(var a=r[n];a<r[n+1];++a)o[a]=a-r[n]<<5|n;return{b:r,r:o}},UQ=$Q(C8,2),fPe=UQ.b,c6=UQ.r;fPe[28]=258,c6[258]=28;var pPe=$Q(E8,0),m9=pPe.r,u6=new Vs(32768);for(var ii=0;ii<32768;++ii){var hf=(ii&43690)>>1|(ii&21845)<<1;hf=(hf&52428)>>2|(hf&13107)<<2,hf=(hf&61680)>>4|(hf&3855)<<4,u6[ii]=((hf&65280)>>8|(hf&255)<<8)>>1}var Jy=(function(e,t,r){for(var n=e.length,o=0,a=new Vs(t);o<n;++o)e[o]&&++a[e[o]-1];var s=new Vs(t);for(o=1;o<t;++o)s[o]=s[o-1]+a[o-1]<<1;var l;if(r){l=new Vs(1<<t);var c=15-t;for(o=0;o<n;++o)if(e[o])for(var u=o<<4|e[o],d=t-e[o],f=s[e[o]-1]++<<d,h=f|(1<<d)-1;f<=h;++f)l[u6[f]>>c]=u}else for(l=new Vs(n),o=0;o<n;++o)e[o]&&(l[o]=u6[s[e[o]-1]++]>>15-e[o]);return l}),_h=new pc(288);for(var ii=0;ii<144;++ii)_h[ii]=8;for(var ii=144;ii<256;++ii)_h[ii]=9;for(var ii=256;ii<280;++ii)_h[ii]=7;for(var ii=280;ii<288;++ii)_h[ii]=8;var xw=new pc(32);for(var ii=0;ii<32;++ii)xw[ii]=5;var hPe=Jy(_h,9,0),gPe=Jy(xw,5,0),HQ=function(e){return(e+7)/8|0},mPe=function(e,t,r){return(r==null||r>e.length)&&(r=e.length),new pc(e.subarray(t,r))},Hu=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8},Ay=function(e,t,r){r<<=t&7;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},f3=function(e,t){for(var r=[],n=0;n<e.length;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,a=r.slice();if(!o)return{t:YQ,l:0};if(o==1){var s=new pc(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort(function(_,P){return _.f-P.f}),r.push({s:-1,f:25001});var l=r[0],c=r[1],u=0,d=1,f=2;for(r[0]={s:-1,f:l.f+c.f,l,r:c};d!=o-1;)l=r[r[u].f<r[f].f?u++:f++],c=r[u!=d&&r[u].f<r[f].f?u++:f++],r[d++]={s:-1,f:l.f+c.f,l,r:c};for(var h=a[0].s,n=1;n<o;++n)a[n].s>h&&(h=a[n].s);var p=new Vs(h+1),y=d6(r[d-1],p,0);if(y>t){var n=0,m=0,x=y-t,b=1<<x;for(a.sort(function(P,O){return p[O.s]-p[P.s]||P.f-O.f});n<o;++n){var w=a[n].s;if(p[w]>t)m+=b-(1<<y-p[w]),p[w]=t;else break}for(m>>=x;m>0;){var k=a[n].s;p[k]<t?m-=1<<t-p[k]++-1:++n}for(;n>=0&&m;--n){var S=a[n].s;p[S]==t&&(--p[S],++m)}y=t}return{t:new pc(p),l:y}},d6=function(e,t,r){return e.s==-1?Math.max(d6(e.l,t,r+1),d6(e.r,t,r+1)):t[e.s]=r},v9=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Vs(++t),n=0,o=e[0],a=1,s=function(c){r[n++]=c},l=1;l<=t;++l)if(e[l]==o&&l!=t)++a;else{if(!o&&a>2){for(;a>138;a-=138)s(32754);a>2&&(s(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(s(o),--a;a>6;a-=6)s(8304);a>2&&(s(a-3<<5|8208),a=0)}for(;a--;)s(o);a=1,o=e[l]}return{c:r.subarray(0,n),n:t}},Ty=function(e,t){for(var r=0,n=0;n<t.length;++n)r+=e[n]*t[n];return r},VQ=function(e,t,r){var n=r.length,o=HQ(t+2);e[o]=n&255,e[o+1]=n>>8,e[o+2]=e[o]^255,e[o+3]=e[o+1]^255;for(var a=0;a<n;++a)e[o+a+4]=r[a];return(o+4+n)*8},y9=function(e,t,r,n,o,a,s,l,c,u,d){Hu(t,d++,r),++o[256];for(var f=f3(o,15),h=f.t,p=f.l,y=f3(a,15),m=y.t,x=y.l,b=v9(h),w=b.c,k=b.n,S=v9(m),_=S.c,P=S.n,O=new Vs(19),T=0;T<w.length;++T)++O[w[T]&31];for(var T=0;T<_.length;++T)++O[_[T]&31];for(var R=f3(O,7),I=R.t,E=R.l,A=19;A>4&&!I[g9[A-1]];--A);var F=u+5<<3,L=Ty(o,_h)+Ty(a,xw)+s,z=Ty(o,h)+Ty(a,m)+s+14+3*A+Ty(O,I)+2*O[16]+3*O[17]+7*O[18];if(c>=0&&F<=L&&F<=z)return VQ(t,d,e.subarray(c,c+u));var V,Q,U,ee;if(Hu(t,d,1+(z<L)),d+=2,z<L){V=Jy(h,p,0),Q=h,U=Jy(m,x,0),ee=m;var H=Jy(I,E,0);Hu(t,d,k-257),Hu(t,d+5,P-1),Hu(t,d+10,A-4),d+=14;for(var T=0;T<A;++T)Hu(t,d+3*T,I[g9[T]]);d+=3*A;for(var B=[w,_],M=0;M<2;++M)for(var $=B[M],T=0;T<$.length;++T){var q=$[T]&31;Hu(t,d,H[q]),d+=I[q],q>15&&(Hu(t,d,$[T]>>5&127),d+=$[T]>>12)}}else V=hPe,Q=_h,U=gPe,ee=xw;for(var T=0;T<l;++T){var Y=n[T];if(Y>255){var q=Y>>18&31;Ay(t,d,V[q+257]),d+=Q[q+257],q>7&&(Hu(t,d,Y>>23&31),d+=C8[q]);var K=Y&31;Ay(t,d,U[K]),d+=ee[K],K>3&&(Ay(t,d,Y>>5&8191),d+=E8[K])}else Ay(t,d,V[Y]),d+=Q[Y]}return Ay(t,d,V[256]),d+Q[256]},vPe=new _8([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),YQ=new pc(0),yPe=function(e,t,r,n,o,a){var s=a.z||e.length,l=new pc(n+s+5*(1+Math.ceil(s/7e3))+o),c=l.subarray(n,l.length-o),u=a.l,d=(a.r||0)&7;if(t){d&&(c[0]=a.r>>3);for(var f=vPe[t-1],h=f>>13,p=f&8191,y=(1<<r)-1,m=a.p||new Vs(32768),x=a.h||new Vs(y+1),b=Math.ceil(r/3),w=2*b,k=function(we){return(e[we]^e[we+1]<<b^e[we+2]<<w)&y},S=new _8(25e3),_=new Vs(288),P=new Vs(32),O=0,T=0,R=a.i||0,I=0,E=a.w||0,A=0;R+2<s;++R){var F=k(R),L=R&32767,z=x[F];if(m[L]=z,x[F]=L,E<=R){var V=s-R;if((O>7e3||I>24576)&&(V>423||!u)){d=y9(e,c,0,S,_,P,T,I,A,R-A,d),I=O=T=0,A=R;for(var Q=0;Q<286;++Q)_[Q]=0;for(var Q=0;Q<30;++Q)P[Q]=0}var U=2,ee=0,H=p,B=L-z&32767;if(V>2&&F==k(R-B))for(var M=Math.min(h,V)-1,$=Math.min(32767,R),q=Math.min(258,V);B<=$&&--H&&L!=z;){if(e[R+U]==e[R+U-B]){for(var Y=0;Y<q&&e[R+Y]==e[R+Y-B];++Y);if(Y>U){if(U=Y,ee=B,Y>M)break;for(var K=Math.min(B,Y-2),G=0,Q=0;Q<K;++Q){var re=R-B+Q&32767,J=m[re],ae=re-J&32767;ae>G&&(G=ae,z=re)}}}L=z,z=m[L],B+=L-z&32767}if(ee){S[I++]=268435456|c6[U]<<18|m9[ee];var le=c6[U]&31,me=m9[ee]&31;T+=C8[le]+E8[me],++_[257+le],++P[me],E=R+U,++O}else S[I++]=e[R],++_[e[R]]}}for(R=Math.max(R,E);R<s;++R)S[I++]=e[R],++_[e[R]];d=y9(e,c,u,S,_,P,T,I,A,R-A,d),u||(a.r=d&7|c[d/8|0]<<3,d-=7,a.h=x,a.p=m,a.i=R,a.w=E)}else{for(var R=a.w||0;R<s+u;R+=65535){var Oe=R+65535;Oe>=s&&(c[d/8|0]=u,Oe=s),d=VQ(c,d+1,e.subarray(R,Oe))}a.i=s}return mPe(l,0,n+HQ(d)+o)},GQ=function(){var e=1,t=0;return{p:function(r){for(var n=e,o=t,a=r.length|0,s=0;s!=a;){for(var l=Math.min(s+2655,a);s<l;++s)o+=n+=r[s];n=(n&65535)+15*(n>>16),o=(o&65535)+15*(o>>16)}e=n,t=o},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},xPe=function(e,t,r,n,o){if(!o&&(o={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),s=new pc(a.length+e.length);s.set(a),s.set(e,a.length),e=s,o.w=a.length}return yPe(e,t.level==null?6:t.level,t.mem==null?o.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,r,n,o)},KQ=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8},bPe=function(e,t){var r=t.level,n=r==0?0:r<6?1:r==9?3:2;if(e[0]=120,e[1]=n<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var o=GQ();o.p(t.dictionary),KQ(e,2,o.d())}};function f6(e,t){t||(t={});var r=GQ();r.p(e);var n=xPe(e,t,t.dictionary?6:2,4);return bPe(n,t),KQ(n,n.length-4,r.d()),n}var wPe=typeof TextDecoder<"u"&&new TextDecoder,SPe=0;try{wPe.decode(YQ,{stream:!0}),SPe=1}catch{}function jPe(e){if(Array.isArray(e))return e}function kPe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,s,l=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function x9(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _Pe(e,t){if(e){if(typeof e=="string")return x9(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?x9(e,t):void 0}}function CPe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b9(e,t){return jPe(e)||kPe(e,t)||_Pe(e,t)||CPe()}function w9(e,t="utf8"){return new TextDecoder(t).decode(e)}const EPe=new TextEncoder;function APe(e){return EPe.encode(e)}const TPe=1024*8,PPe=(()=>{const e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),p3={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class A8{constructor(t=TPe,r={}){yn(this,"buffer");yn(this,"byteLength");yn(this,"byteOffset");yn(this,"length");yn(this,"offset");yn(this,"lastWrittenByte");yn(this,"littleEndian");yn(this,"_data");yn(this,"_mark");yn(this,"_marks");let n=!1;typeof t=="number"?t=new ArrayBuffer(t):(n=!0,this.lastWrittenByte=t.byteLength);const o=r.offset?r.offset>>>0:0,a=t.byteLength-o;let s=o;(ArrayBuffer.isView(t)||t instanceof A8)&&(t.byteLength!==t.buffer.byteLength&&(s=t.byteOffset+o),t=t.buffer),n?this.lastWrittenByte=a:this.lastWrittenByte=0,this.buffer=t,this.length=a,this.byteLength=a,this.byteOffset=s,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,s,a),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}back(t=1){return this.offset-=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const t=this._marks.pop();if(t===void 0)throw new Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){const n=(this.offset+t)*2,o=new Uint8Array(n);o.set(new Uint8Array(this.buffer)),this.buffer=o.buffer,this.length=n,this.byteLength=n,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(t=1){return this.readArray(t,"uint8")}readArray(t,r){const n=p3[r].BYTES_PER_ELEMENT*t,o=this.byteOffset+this.offset,a=this.buffer.slice(o,o+n);if(this.littleEndian===PPe&&r!=="uint8"&&r!=="int8"){const l=new Uint8Array(this.buffer.slice(o,o+n));l.reverse();const c=new p3[r](l.buffer);return this.offset+=n,c.reverse(),c}const s=new p3[r](a);return this.offset+=n,s}readInt16(){const t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){const t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){const t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){const t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){const t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){const t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readBigInt64(){const t=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,t}readBigUint64(){const t=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let r="";for(let n=0;n<t;n++)r+=this.readChar();return r}readUtf8(t=1){return w9(this.readBytes(t))}decodeText(t=1,r="utf8"){return w9(this.readBytes(t),r)}writeBoolean(t){return this.writeUint8(t?255:0),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let r=0;r<t.length;r++)this._data.setUint8(this.offset++,t[r]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(t){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(t){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let r=0;r<t.length;r++)this.writeUint8(t.charCodeAt(r));return this}writeUtf8(t){return this.writeBytes(APe(t))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function Av(e){let t=e.length;for(;--t>=0;)e[t]=0}const OPe=3,IPe=258,QQ=29,NPe=256,RPe=NPe+1+QQ,XQ=30,LPe=512,FPe=new Array((RPe+2)*2);Av(FPe);const MPe=new Array(XQ*2);Av(MPe);const DPe=new Array(LPe);Av(DPe);const zPe=new Array(IPe-OPe+1);Av(zPe);const BPe=new Array(QQ);Av(BPe);const WPe=new Array(XQ);Av(WPe);const qPe=(e,t,r,n)=>{let o=e&65535|0,a=e>>>16&65535|0,s=0;for(;r!==0;){s=r>2e3?2e3:r,r-=s;do o=o+t[n++]|0,a=a+o|0;while(--s);o%=65521,a%=65521}return o|a<<16|0};var p6=qPe;const $Pe=()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t},UPe=new Uint32Array($Pe()),HPe=(e,t,r,n)=>{const o=UPe,a=n+r;e^=-1;for(let s=n;s<a;s++)e=e>>>8^o[(e^t[s])&255];return e^-1};var Dc=HPe,h6={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},ZQ={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const VPe=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var YPe=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const n in r)VPe(r,n)&&(e[n]=r[n])}}return e},GPe=e=>{let t=0;for(let n=0,o=e.length;n<o;n++)t+=e[n].length;const r=new Uint8Array(t);for(let n=0,o=0,a=e.length;n<a;n++){let s=e[n];r.set(s,o),o+=s.length}return r},JQ={assign:YPe,flattenChunks:GPe};let eX=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{eX=!1}const eb=new Uint8Array(256);for(let e=0;e<256;e++)eb[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;eb[254]=eb[254]=1;var KPe=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,r,n,o,a,s=e.length,l=0;for(o=0;o<s;o++)r=e.charCodeAt(o),(r&64512)===55296&&o+1<s&&(n=e.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(l),a=0,o=0;a<l;o++)r=e.charCodeAt(o),(r&64512)===55296&&o+1<s&&(n=e.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|r&63):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|r&63):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|r&63);return t};const QPe=(e,t)=>{if(t<65534&&e.subarray&&eX)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r};var XPe=(e,t)=>{const r=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let n,o;const a=new Array(r*2);for(o=0,n=0;n<r;){let s=e[n++];if(s<128){a[o++]=s;continue}let l=eb[s];if(l>4){a[o++]=65533,n+=l-1;continue}for(s&=l===2?31:l===3?15:7;l>1&&n<r;)s=s<<6|e[n++]&63,l--;if(l>1){a[o++]=65533;continue}s<65536?a[o++]=s:(s-=65536,a[o++]=55296|s>>10&1023,a[o++]=56320|s&1023)}return QPe(a,o)},ZPe=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let r=t-1;for(;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+eb[e[r]]>t?r:t},g6={string2buf:KPe,buf2string:XPe,utf8border:ZPe};function JPe(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var e8e=JPe;const n0=16209,t8e=16191;var r8e=function(t,r){let n,o,a,s,l,c,u,d,f,h,p,y,m,x,b,w,k,S,_,P,O,T,R,I;const E=t.state;n=t.next_in,R=t.input,o=n+(t.avail_in-5),a=t.next_out,I=t.output,s=a-(r-t.avail_out),l=a+(t.avail_out-257),c=E.dmax,u=E.wsize,d=E.whave,f=E.wnext,h=E.window,p=E.hold,y=E.bits,m=E.lencode,x=E.distcode,b=(1<<E.lenbits)-1,w=(1<<E.distbits)-1;e:do{y<15&&(p+=R[n++]<<y,y+=8,p+=R[n++]<<y,y+=8),k=m[p&b];t:for(;;){if(S=k>>>24,p>>>=S,y-=S,S=k>>>16&255,S===0)I[a++]=k&65535;else if(S&16){_=k&65535,S&=15,S&&(y<S&&(p+=R[n++]<<y,y+=8),_+=p&(1<<S)-1,p>>>=S,y-=S),y<15&&(p+=R[n++]<<y,y+=8,p+=R[n++]<<y,y+=8),k=x[p&w];r:for(;;){if(S=k>>>24,p>>>=S,y-=S,S=k>>>16&255,S&16){if(P=k&65535,S&=15,y<S&&(p+=R[n++]<<y,y+=8,y<S&&(p+=R[n++]<<y,y+=8)),P+=p&(1<<S)-1,P>c){t.msg="invalid distance too far back",E.mode=n0;break e}if(p>>>=S,y-=S,S=a-s,P>S){if(S=P-S,S>d&&E.sane){t.msg="invalid distance too far back",E.mode=n0;break e}if(O=0,T=h,f===0){if(O+=u-S,S<_){_-=S;do I[a++]=h[O++];while(--S);O=a-P,T=I}}else if(f<S){if(O+=u+f-S,S-=f,S<_){_-=S;do I[a++]=h[O++];while(--S);if(O=0,f<_){S=f,_-=S;do I[a++]=h[O++];while(--S);O=a-P,T=I}}}else if(O+=f-S,S<_){_-=S;do I[a++]=h[O++];while(--S);O=a-P,T=I}for(;_>2;)I[a++]=T[O++],I[a++]=T[O++],I[a++]=T[O++],_-=3;_&&(I[a++]=T[O++],_>1&&(I[a++]=T[O++]))}else{O=a-P;do I[a++]=I[O++],I[a++]=I[O++],I[a++]=I[O++],_-=3;while(_>2);_&&(I[a++]=I[O++],_>1&&(I[a++]=I[O++]))}}else if((S&64)===0){k=x[(k&65535)+(p&(1<<S)-1)];continue r}else{t.msg="invalid distance code",E.mode=n0;break e}break}}else if((S&64)===0){k=m[(k&65535)+(p&(1<<S)-1)];continue t}else if(S&32){E.mode=t8e;break e}else{t.msg="invalid literal/length code",E.mode=n0;break e}break}}while(n<o&&a<l);_=y>>3,n-=_,y-=_<<3,p&=(1<<y)-1,t.next_in=n,t.next_out=a,t.avail_in=n<o?5+(o-n):5-(n-o),t.avail_out=a<l?257+(l-a):257-(a-l),E.hold=p,E.bits=y};const Ig=15,S9=852,j9=592,k9=0,h3=1,_9=2,n8e=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),i8e=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),o8e=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),a8e=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),s8e=(e,t,r,n,o,a,s,l)=>{const c=l.bits;let u=0,d=0,f=0,h=0,p=0,y=0,m=0,x=0,b=0,w=0,k,S,_,P,O,T=null,R;const I=new Uint16Array(Ig+1),E=new Uint16Array(Ig+1);let A=null,F,L,z;for(u=0;u<=Ig;u++)I[u]=0;for(d=0;d<n;d++)I[t[r+d]]++;for(p=c,h=Ig;h>=1&&I[h]===0;h--);if(p>h&&(p=h),h===0)return o[a++]=1<<24|64<<16|0,o[a++]=1<<24|64<<16|0,l.bits=1,0;for(f=1;f<h&&I[f]===0;f++);for(p<f&&(p=f),x=1,u=1;u<=Ig;u++)if(x<<=1,x-=I[u],x<0)return-1;if(x>0&&(e===k9||h!==1))return-1;for(E[1]=0,u=1;u<Ig;u++)E[u+1]=E[u]+I[u];for(d=0;d<n;d++)t[r+d]!==0&&(s[E[t[r+d]]++]=d);if(e===k9?(T=A=s,R=20):e===h3?(T=n8e,A=i8e,R=257):(T=o8e,A=a8e,R=0),w=0,d=0,u=f,O=a,y=p,m=0,_=-1,b=1<<p,P=b-1,e===h3&&b>S9||e===_9&&b>j9)return 1;for(;;){F=u-m,s[d]+1<R?(L=0,z=s[d]):s[d]>=R?(L=A[s[d]-R],z=T[s[d]-R]):(L=96,z=0),k=1<<u-m,S=1<<y,f=S;do S-=k,o[O+(w>>m)+S]=F<<24|L<<16|z|0;while(S!==0);for(k=1<<u-1;w&k;)k>>=1;if(k!==0?(w&=k-1,w+=k):w=0,d++,--I[u]===0){if(u===h)break;u=t[r+s[d]]}if(u>p&&(w&P)!==_){for(m===0&&(m=p),O+=f,y=u-m,x=1<<y;y+m<h&&(x-=I[y+m],!(x<=0));)y++,x<<=1;if(b+=1<<y,e===h3&&b>S9||e===_9&&b>j9)return 1;_=w&P,o[_]=p<<24|y<<16|O-a|0}}return w!==0&&(o[O+w]=u-m<<24|64<<16|0),l.bits=p,0};var ex=s8e;const l8e=0,tX=1,rX=2,{Z_FINISH:C9,Z_BLOCK:c8e,Z_TREES:i0,Z_OK:Ch,Z_STREAM_END:u8e,Z_NEED_DICT:d8e,Z_STREAM_ERROR:Il,Z_DATA_ERROR:nX,Z_MEM_ERROR:iX,Z_BUF_ERROR:f8e,Z_DEFLATED:E9}=ZQ,FS=16180,A9=16181,T9=16182,P9=16183,O9=16184,I9=16185,N9=16186,R9=16187,L9=16188,F9=16189,bw=16190,Vu=16191,g3=16192,M9=16193,m3=16194,D9=16195,z9=16196,B9=16197,W9=16198,o0=16199,a0=16200,q9=16201,$9=16202,U9=16203,H9=16204,V9=16205,v3=16206,Y9=16207,G9=16208,ci=16209,oX=16210,aX=16211,p8e=852,h8e=592,g8e=15,m8e=g8e,K9=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function v8e(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const zh=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<FS||t.mode>aX?1:0},sX=e=>{if(zh(e))return Il;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=FS,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(p8e),t.distcode=t.distdyn=new Int32Array(h8e),t.sane=1,t.back=-1,Ch},lX=e=>{if(zh(e))return Il;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,sX(e)},cX=(e,t)=>{let r;if(zh(e))return Il;const n=e.state;return t<0?(r=0,t=-t):(r=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Il:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,lX(e))},uX=(e,t)=>{if(!e)return Il;const r=new v8e;e.state=r,r.strm=e,r.window=null,r.mode=FS;const n=cX(e,t);return n!==Ch&&(e.state=null),n},y8e=e=>uX(e,m8e);let Q9=!0,y3,x3;const x8e=e=>{if(Q9){y3=new Int32Array(512),x3=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ex(tX,e.lens,0,288,y3,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ex(rX,e.lens,0,32,x3,0,e.work,{bits:5}),Q9=!1}e.lencode=y3,e.lenbits=9,e.distcode=x3,e.distbits=5},dX=(e,t,r,n)=>{let o;const a=e.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),n>=a.wsize?(a.window.set(t.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(o=a.wsize-a.wnext,o>n&&(o=n),a.window.set(t.subarray(r-n,r-n+o),a.wnext),n-=o,n?(a.window.set(t.subarray(r-n,r),0),a.wnext=n,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0},b8e=(e,t)=>{let r,n,o,a,s,l,c,u,d,f,h,p,y,m,x=0,b,w,k,S,_,P,O,T;const R=new Uint8Array(4);let I,E;const A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(zh(e)||!e.output||!e.input&&e.avail_in!==0)return Il;r=e.state,r.mode===Vu&&(r.mode=g3),s=e.next_out,o=e.output,c=e.avail_out,a=e.next_in,n=e.input,l=e.avail_in,u=r.hold,d=r.bits,f=l,h=c,T=Ch;e:for(;;)switch(r.mode){case FS:if(r.wrap===0){r.mode=g3;break}for(;d<16;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}if(r.wrap&2&&u===35615){r.wbits===0&&(r.wbits=15),r.check=0,R[0]=u&255,R[1]=u>>>8&255,r.check=Dc(r.check,R,2,0),u=0,d=0,r.mode=A9;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",r.mode=ci;break}if((u&15)!==E9){e.msg="unknown compression method",r.mode=ci;break}if(u>>>=4,d-=4,O=(u&15)+8,r.wbits===0&&(r.wbits=O),O>15||O>r.wbits){e.msg="invalid window size",r.mode=ci;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=u&512?F9:Vu,u=0,d=0;break;case A9:for(;d<16;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}if(r.flags=u,(r.flags&255)!==E9){e.msg="unknown compression method",r.mode=ci;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=ci;break}r.head&&(r.head.text=u>>8&1),r.flags&512&&r.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,r.check=Dc(r.check,R,2,0)),u=0,d=0,r.mode=T9;case T9:for(;d<32;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}r.head&&(r.head.time=u),r.flags&512&&r.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,R[2]=u>>>16&255,R[3]=u>>>24&255,r.check=Dc(r.check,R,4,0)),u=0,d=0,r.mode=P9;case P9:for(;d<16;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}r.head&&(r.head.xflags=u&255,r.head.os=u>>8),r.flags&512&&r.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,r.check=Dc(r.check,R,2,0)),u=0,d=0,r.mode=O9;case O9:if(r.flags&1024){for(;d<16;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}r.length=u,r.head&&(r.head.extra_len=u),r.flags&512&&r.wrap&4&&(R[0]=u&255,R[1]=u>>>8&255,r.check=Dc(r.check,R,2,0)),u=0,d=0}else r.head&&(r.head.extra=null);r.mode=I9;case I9:if(r.flags&1024&&(p=r.length,p>l&&(p=l),p&&(r.head&&(O=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(a,a+p),O)),r.flags&512&&r.wrap&4&&(r.check=Dc(r.check,n,p,a)),l-=p,a+=p,r.length-=p),r.length))break e;r.length=0,r.mode=N9;case N9:if(r.flags&2048){if(l===0)break e;p=0;do O=n[a+p++],r.head&&O&&r.length<65536&&(r.head.name+=String.fromCharCode(O));while(O&&p<l);if(r.flags&512&&r.wrap&4&&(r.check=Dc(r.check,n,p,a)),l-=p,a+=p,O)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=R9;case R9:if(r.flags&4096){if(l===0)break e;p=0;do O=n[a+p++],r.head&&O&&r.length<65536&&(r.head.comment+=String.fromCharCode(O));while(O&&p<l);if(r.flags&512&&r.wrap&4&&(r.check=Dc(r.check,n,p,a)),l-=p,a+=p,O)break e}else r.head&&(r.head.comment=null);r.mode=L9;case L9:if(r.flags&512){for(;d<16;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}if(r.wrap&4&&u!==(r.check&65535)){e.msg="header crc mismatch",r.mode=ci;break}u=0,d=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Vu;break;case F9:for(;d<32;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}e.adler=r.check=K9(u),u=0,d=0,r.mode=bw;case bw:if(r.havedict===0)return e.next_out=s,e.avail_out=c,e.next_in=a,e.avail_in=l,r.hold=u,r.bits=d,d8e;e.adler=r.check=1,r.mode=Vu;case Vu:if(t===c8e||t===i0)break e;case g3:if(r.last){u>>>=d&7,d-=d&7,r.mode=v3;break}for(;d<3;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}switch(r.last=u&1,u>>>=1,d-=1,u&3){case 0:r.mode=M9;break;case 1:if(x8e(r),r.mode=o0,t===i0){u>>>=2,d-=2;break e}break;case 2:r.mode=z9;break;case 3:e.msg="invalid block type",r.mode=ci}u>>>=2,d-=2;break;case M9:for(u>>>=d&7,d-=d&7;d<32;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){e.msg="invalid stored block lengths",r.mode=ci;break}if(r.length=u&65535,u=0,d=0,r.mode=m3,t===i0)break e;case m3:r.mode=D9;case D9:if(p=r.length,p){if(p>l&&(p=l),p>c&&(p=c),p===0)break e;o.set(n.subarray(a,a+p),s),l-=p,a+=p,c-=p,s+=p,r.length-=p;break}r.mode=Vu;break;case z9:for(;d<14;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}if(r.nlen=(u&31)+257,u>>>=5,d-=5,r.ndist=(u&31)+1,u>>>=5,d-=5,r.ncode=(u&15)+4,u>>>=4,d-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=ci;break}r.have=0,r.mode=B9;case B9:for(;r.have<r.ncode;){for(;d<3;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}r.lens[A[r.have++]]=u&7,u>>>=3,d-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,I={bits:r.lenbits},T=ex(l8e,r.lens,0,19,r.lencode,0,r.work,I),r.lenbits=I.bits,T){e.msg="invalid code lengths set",r.mode=ci;break}r.have=0,r.mode=W9;case W9:for(;r.have<r.nlen+r.ndist;){for(;x=r.lencode[u&(1<<r.lenbits)-1],b=x>>>24,w=x>>>16&255,k=x&65535,!(b<=d);){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}if(k<16)u>>>=b,d-=b,r.lens[r.have++]=k;else{if(k===16){for(E=b+2;d<E;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}if(u>>>=b,d-=b,r.have===0){e.msg="invalid bit length repeat",r.mode=ci;break}O=r.lens[r.have-1],p=3+(u&3),u>>>=2,d-=2}else if(k===17){for(E=b+3;d<E;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}u>>>=b,d-=b,O=0,p=3+(u&7),u>>>=3,d-=3}else{for(E=b+7;d<E;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}u>>>=b,d-=b,O=0,p=11+(u&127),u>>>=7,d-=7}if(r.have+p>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=ci;break}for(;p--;)r.lens[r.have++]=O}}if(r.mode===ci)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=ci;break}if(r.lenbits=9,I={bits:r.lenbits},T=ex(tX,r.lens,0,r.nlen,r.lencode,0,r.work,I),r.lenbits=I.bits,T){e.msg="invalid literal/lengths set",r.mode=ci;break}if(r.distbits=6,r.distcode=r.distdyn,I={bits:r.distbits},T=ex(rX,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,I),r.distbits=I.bits,T){e.msg="invalid distances set",r.mode=ci;break}if(r.mode=o0,t===i0)break e;case o0:r.mode=a0;case a0:if(l>=6&&c>=258){e.next_out=s,e.avail_out=c,e.next_in=a,e.avail_in=l,r.hold=u,r.bits=d,r8e(e,h),s=e.next_out,o=e.output,c=e.avail_out,a=e.next_in,n=e.input,l=e.avail_in,u=r.hold,d=r.bits,r.mode===Vu&&(r.back=-1);break}for(r.back=0;x=r.lencode[u&(1<<r.lenbits)-1],b=x>>>24,w=x>>>16&255,k=x&65535,!(b<=d);){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}if(w&&(w&240)===0){for(S=b,_=w,P=k;x=r.lencode[P+((u&(1<<S+_)-1)>>S)],b=x>>>24,w=x>>>16&255,k=x&65535,!(S+b<=d);){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}u>>>=S,d-=S,r.back+=S}if(u>>>=b,d-=b,r.back+=b,r.length=k,w===0){r.mode=V9;break}if(w&32){r.back=-1,r.mode=Vu;break}if(w&64){e.msg="invalid literal/length code",r.mode=ci;break}r.extra=w&15,r.mode=q9;case q9:if(r.extra){for(E=r.extra;d<E;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}r.length+=u&(1<<r.extra)-1,u>>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=$9;case $9:for(;x=r.distcode[u&(1<<r.distbits)-1],b=x>>>24,w=x>>>16&255,k=x&65535,!(b<=d);){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}if((w&240)===0){for(S=b,_=w,P=k;x=r.distcode[P+((u&(1<<S+_)-1)>>S)],b=x>>>24,w=x>>>16&255,k=x&65535,!(S+b<=d);){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}u>>>=S,d-=S,r.back+=S}if(u>>>=b,d-=b,r.back+=b,w&64){e.msg="invalid distance code",r.mode=ci;break}r.offset=k,r.extra=w&15,r.mode=U9;case U9:if(r.extra){for(E=r.extra;d<E;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}r.offset+=u&(1<<r.extra)-1,u>>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=ci;break}r.mode=H9;case H9:if(c===0)break e;if(p=h-c,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=ci;break}p>r.wnext?(p-=r.wnext,y=r.wsize-p):y=r.wnext-p,p>r.length&&(p=r.length),m=r.window}else m=o,y=s-r.offset,p=r.length;p>c&&(p=c),c-=p,r.length-=p;do o[s++]=m[y++];while(--p);r.length===0&&(r.mode=a0);break;case V9:if(c===0)break e;o[s++]=r.length,c--,r.mode=a0;break;case v3:if(r.wrap){for(;d<32;){if(l===0)break e;l--,u|=n[a++]<<d,d+=8}if(h-=c,e.total_out+=h,r.total+=h,r.wrap&4&&h&&(e.adler=r.check=r.flags?Dc(r.check,o,h,s-h):p6(r.check,o,h,s-h)),h=c,r.wrap&4&&(r.flags?u:K9(u))!==r.check){e.msg="incorrect data check",r.mode=ci;break}u=0,d=0}r.mode=Y9;case Y9:if(r.wrap&&r.flags){for(;d<32;){if(l===0)break e;l--,u+=n[a++]<<d,d+=8}if(r.wrap&4&&u!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=ci;break}u=0,d=0}r.mode=G9;case G9:T=u8e;break e;case ci:T=nX;break e;case oX:return iX;case aX:default:return Il}return e.next_out=s,e.avail_out=c,e.next_in=a,e.avail_in=l,r.hold=u,r.bits=d,(r.wsize||h!==e.avail_out&&r.mode<ci&&(r.mode<v3||t!==C9))&&dX(e,e.output,e.next_out,h-e.avail_out),f-=e.avail_in,h-=e.avail_out,e.total_in+=f,e.total_out+=h,r.total+=h,r.wrap&4&&h&&(e.adler=r.check=r.flags?Dc(r.check,o,h,e.next_out-h):p6(r.check,o,h,e.next_out-h)),e.data_type=r.bits+(r.last?64:0)+(r.mode===Vu?128:0)+(r.mode===o0||r.mode===m3?256:0),(f===0&&h===0||t===C9)&&T===Ch&&(T=f8e),T},w8e=e=>{if(zh(e))return Il;let t=e.state;return t.window&&(t.window=null),e.state=null,Ch},S8e=(e,t)=>{if(zh(e))return Il;const r=e.state;return(r.wrap&2)===0?Il:(r.head=t,t.done=!1,Ch)},j8e=(e,t)=>{const r=t.length;let n,o,a;return zh(e)||(n=e.state,n.wrap!==0&&n.mode!==bw)?Il:n.mode===bw&&(o=1,o=p6(o,t,r,0),o!==n.check)?nX:(a=dX(e,t,r,r),a?(n.mode=oX,iX):(n.havedict=1,Ch))};var k8e=lX,_8e=cX,C8e=sX,E8e=y8e,A8e=uX,T8e=b8e,P8e=w8e,O8e=S8e,I8e=j8e,N8e="pako inflate (from Nodeca project)",Xu={inflateReset:k8e,inflateReset2:_8e,inflateResetKeep:C8e,inflateInit:E8e,inflateInit2:A8e,inflate:T8e,inflateEnd:P8e,inflateGetHeader:O8e,inflateSetDictionary:I8e,inflateInfo:N8e};function R8e(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var L8e=R8e;const fX=Object.prototype.toString,{Z_NO_FLUSH:F8e,Z_FINISH:M8e,Z_OK:tb,Z_STREAM_END:b3,Z_NEED_DICT:w3,Z_STREAM_ERROR:D8e,Z_DATA_ERROR:X9,Z_MEM_ERROR:z8e}=ZQ;function Nb(e){this.options=JQ.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new e8e,this.strm.avail_out=0;let r=Xu.inflateInit2(this.strm,t.windowBits);if(r!==tb)throw new Error(h6[r]);if(this.header=new L8e,Xu.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=g6.string2buf(t.dictionary):fX.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Xu.inflateSetDictionary(this.strm,t.dictionary),r!==tb)))throw new Error(h6[r])}Nb.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,o=this.options.dictionary;let a,s,l;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?M8e:F8e,fX.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),a=Xu.inflate(r,s),a===w3&&o&&(a=Xu.inflateSetDictionary(r,o),a===tb?a=Xu.inflate(r,s):a===X9&&(a=w3));r.avail_in>0&&a===b3&&r.state.wrap>0&&e[r.next_in]!==0;)Xu.inflateReset(r),a=Xu.inflate(r,s);switch(a){case D8e:case X9:case w3:case z8e:return this.onEnd(a),this.ended=!0,!1}if(l=r.avail_out,r.next_out&&(r.avail_out===0||a===b3))if(this.options.to==="string"){let c=g6.utf8border(r.output,r.next_out),u=r.next_out-c,d=g6.buf2string(r.output,c);r.next_out=u,r.avail_out=n-u,u&&r.output.set(r.output.subarray(c,c+u),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(a===tb&&l===0)){if(a===b3)return a=Xu.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};Nb.prototype.onData=function(e){this.chunks.push(e)};Nb.prototype.onEnd=function(e){e===tb&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=JQ.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function B8e(e,t){const r=new Nb(t);if(r.push(e),r.err)throw r.msg||h6[r.err];return r.result}var W8e=Nb,q8e=B8e,$8e={Inflate:W8e,inflate:q8e};const{Inflate:U8e,inflate:H8e}=$8e;var Z9=U8e,V8e=H8e;const pX=[];for(let e=0;e<256;e++){let t=e;for(let r=0;r<8;r++)t&1?t=3988292384^t>>>1:t=t>>>1;pX[e]=t}const J9=4294967295;function Y8e(e,t,r){let n=e;for(let o=0;o<r;o++)n=pX[(n^t[o])&255]^n>>>8;return n}function G8e(e,t){return(Y8e(J9,e,t)^J9)>>>0}function eW(e,t,r){const n=e.readUint32(),o=G8e(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(o!==n)throw new Error(`CRC mismatch for chunk ${r}. Expected ${n}, found ${o}`)}function hX(e,t,r){for(let n=0;n<r;n++)t[n]=e[n]}function gX(e,t,r,n){let o=0;for(;o<n;o++)t[o]=e[o];for(;o<r;o++)t[o]=e[o]+t[o-n]&255}function mX(e,t,r,n){let o=0;if(r.length===0)for(;o<n;o++)t[o]=e[o];else for(;o<n;o++)t[o]=e[o]+r[o]&255}function vX(e,t,r,n,o){let a=0;if(r.length===0){for(;a<o;a++)t[a]=e[a];for(;a<n;a++)t[a]=e[a]+(t[a-o]>>1)&255}else{for(;a<o;a++)t[a]=e[a]+(r[a]>>1)&255;for(;a<n;a++)t[a]=e[a]+(t[a-o]+r[a]>>1)&255}}function yX(e,t,r,n,o){let a=0;if(r.length===0){for(;a<o;a++)t[a]=e[a];for(;a<n;a++)t[a]=e[a]+t[a-o]&255}else{for(;a<o;a++)t[a]=e[a]+r[a]&255;for(;a<n;a++)t[a]=e[a]+K8e(t[a-o],r[a],r[a-o])&255}}function K8e(e,t,r){const n=e+t-r,o=Math.abs(n-e),a=Math.abs(n-t),s=Math.abs(n-r);return o<=a&&o<=s?e:a<=s?t:r}function Q8e(e,t,r,n,o,a){switch(e){case 0:hX(t,r,o);break;case 1:gX(t,r,o,a);break;case 2:mX(t,r,n,o);break;case 3:vX(t,r,n,o,a);break;case 4:yX(t,r,n,o,a);break;default:throw new Error(`Unsupported filter: ${e}`)}}const X8e=new Uint16Array([255]),Z8e=new Uint8Array(X8e.buffer),J8e=Z8e[0]===255;function eOe(e){const{data:t,width:r,height:n,channels:o,depth:a}=e,s=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],l=Math.ceil(a/8)*o,c=new Uint8Array(n*r*l);let u=0;for(let d=0;d<7;d++){const f=s[d],h=Math.ceil((r-f.x)/f.xStep),p=Math.ceil((n-f.y)/f.yStep);if(h<=0||p<=0)continue;const y=h*l,m=new Uint8Array(y);for(let x=0;x<p;x++){const b=t[u++],w=t.subarray(u,u+y);u+=y;const k=new Uint8Array(y);Q8e(b,w,k,m,y,l),m.set(k);for(let S=0;S<h;S++){const _=f.x+S*f.xStep,P=f.y+x*f.yStep;if(!(_>=r||P>=n))for(let O=0;O<l;O++)c[(P*r+_)*l+O]=k[S*l+O]}}}if(a===16){const d=new Uint16Array(c.buffer);if(J8e)for(let f=0;f<d.length;f++)d[f]=tOe(d[f]);return d}else return c}function tOe(e){return(e&255)<<8|e>>8&255}const rOe=new Uint16Array([255]),nOe=new Uint8Array(rOe.buffer),iOe=nOe[0]===255,oOe=new Uint8Array(0);function tW(e){const{data:t,width:r,height:n,channels:o,depth:a}=e,s=Math.ceil(a/8)*o,l=Math.ceil(a/8*o*r),c=new Uint8Array(n*l);let u=oOe,d=0,f,h;for(let p=0;p<n;p++){switch(f=t.subarray(d+1,d+1+l),h=c.subarray(p*l,(p+1)*l),t[d]){case 0:hX(f,h,l);break;case 1:gX(f,h,l,s);break;case 2:mX(f,h,u,l);break;case 3:vX(f,h,u,l,s);break;case 4:yX(f,h,u,l,s);break;default:throw new Error(`Unsupported filter: ${t[d]}`)}u=h,d+=l+1}if(a===16){const p=new Uint16Array(c.buffer);if(iOe)for(let y=0;y<p.length;y++)p[y]=aOe(p[y]);return p}else return c}function aOe(e){return(e&255)<<8|e>>8&255}const S0=Uint8Array.of(137,80,78,71,13,10,26,10);function rW(e){if(!sOe(e.readBytes(S0.length)))throw new Error("wrong PNG signature")}function sOe(e){if(e.length<S0.length)return!1;for(let t=0;t<S0.length;t++)if(e[t]!==S0[t])return!1;return!0}const lOe="tEXt",cOe=0,xX=new TextDecoder("latin1");function uOe(e){if(fOe(e),e.length===0||e.length>79)throw new Error("keyword length must be between 1 and 79")}const dOe=/^[\u0000-\u00FF]*$/;function fOe(e){if(!dOe.test(e))throw new Error("invalid latin1 text")}function pOe(e,t,r){const n=bX(t);e[n]=hOe(t,r-n.length-1)}function bX(e){for(e.mark();e.readByte()!==cOe;);const t=e.offset;e.reset();const r=xX.decode(e.readBytes(t-e.offset-1));return e.skip(1),uOe(r),r}function hOe(e,t){return xX.decode(e.readBytes(t))}const Ls={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},S3={UNKNOWN:-1,DEFLATE:0},nW={UNKNOWN:-1,ADAPTIVE:0},j3={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},s0={NONE:0,BACKGROUND:1,PREVIOUS:2},k3={SOURCE:0,OVER:1};class gOe extends A8{constructor(r,n={}){super(r);yn(this,"_checkCrc");yn(this,"_inflator");yn(this,"_png");yn(this,"_apng");yn(this,"_end");yn(this,"_hasPalette");yn(this,"_palette");yn(this,"_hasTransparency");yn(this,"_transparency");yn(this,"_compressionMethod");yn(this,"_filterMethod");yn(this,"_interlaceMethod");yn(this,"_colorType");yn(this,"_isAnimated");yn(this,"_numberOfFrames");yn(this,"_numberOfPlays");yn(this,"_frames");yn(this,"_writingDataChunks");const{checkCrc:o=!1}=n;this._checkCrc=o,this._inflator=new Z9,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=S3.UNKNOWN,this._filterMethod=nW.UNKNOWN,this._interlaceMethod=j3.UNKNOWN,this._colorType=Ls.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(rW(this);!this._end;){const r=this.readUint32(),n=this.readChars(4);this.decodeChunk(r,n)}return this.decodeImage(),this._png}decodeApng(){for(rW(this);!this._end;){const r=this.readUint32(),n=this.readChars(4);this.decodeApngChunk(r,n)}return this.decodeApngImage(),this._apng}decodeChunk(r,n){const o=this.offset;switch(n){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(r);break;case"IDAT":this.decodeIDAT(r);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(r);break;case"iCCP":this.decodeiCCP(r);break;case lOe:pOe(this._png.text,this,r);break;case"pHYs":this.decodepHYs();break;default:this.skip(r);break}if(this.offset-o!==r)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?eW(this,r+4,n):this.skip(4)}decodeApngChunk(r,n){const o=this.offset;switch(n!=="fdAT"&&n!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),n){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(r);break;default:this.decodeChunk(r,n),this.offset=o+r;break}if(this.offset-o!==r)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?eW(this,r+4,n):this.skip(4)}decodeIHDR(){const r=this._png;r.width=this.readUint32(),r.height=this.readUint32(),r.depth=mOe(this.readUint8());const n=this.readUint8();this._colorType=n;let o;switch(n){case Ls.GREYSCALE:o=1;break;case Ls.TRUECOLOUR:o=3;break;case Ls.INDEXED_COLOUR:o=1;break;case Ls.GREYSCALE_ALPHA:o=2;break;case Ls.TRUECOLOUR_ALPHA:o=4;break;case Ls.UNKNOWN:default:throw new Error(`Unknown color type: ${n}`)}if(this._png.channels=o,this._compressionMethod=this.readUint8(),this._compressionMethod!==S3.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const r={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(r)}decodePLTE(r){if(r%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${r}`);const n=r/3;this._hasPalette=!0;const o=[];this._palette=o;for(let a=0;a<n;a++)o.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(r){this._writingDataChunks=!0;const n=r,o=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,o,n)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(r)}decodeFDAT(r){this._writingDataChunks=!0;let n=r,o=this.offset+this.byteOffset;if(o+=4,n-=4,this._inflator.push(new Uint8Array(this.buffer,o,n)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(r)}decodetRNS(r){switch(this._colorType){case Ls.GREYSCALE:case Ls.TRUECOLOUR:{if(r%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${r}`);if(r/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${r/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(r/2);for(let n=0;n<r/2;n++)this._transparency[n]=this.readUint16();break}case Ls.INDEXED_COLOUR:{if(r>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${r} vs ${this._palette.length})`);let n=0;for(;n<r;n++){const o=this.readByte();this._palette[n].push(o)}for(;n<this._palette.length;n++)this._palette[n].push(255);break}case Ls.UNKNOWN:case Ls.GREYSCALE_ALPHA:case Ls.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(r){const n=bX(this),o=this.readUint8();if(o!==S3.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${o}`);const a=this.readBytes(r-n.length-2);this._png.iccEmbeddedProfile={name:n,profile:V8e(a)}}decodepHYs(){const r=this.readUint32(),n=this.readUint32(),o=this.readByte();this._png.resolution={x:r,y:n,unit:o}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let r=0;r<this._numberOfFrames;r++){const n={sequenceNumber:this._frames[r].sequenceNumber,delayNumber:this._frames[r].delayNumber,delayDenominator:this._frames[r].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},o=this._frames.at(r);if(o){if(o.data=tW({data:o.data,width:o.width,height:o.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),r===0||o.xOffset===0&&o.yOffset===0&&o.width===this._png.width&&o.height===this._png.height)n.data=o.data;else{const a=this._apng.frames.at(r-1);this.disposeFrame(o,a,n),this.addFrameDataToCanvas(n,o)}this._apng.frames.push(n)}}return this._apng}disposeFrame(r,n,o){switch(r.disposeOp){case s0.NONE:break;case s0.BACKGROUND:for(let a=0;a<this._png.height;a++)for(let s=0;s<this._png.width;s++){const l=(a*r.width+s)*this._png.channels;for(let c=0;c<this._png.channels;c++)o.data[l+c]=0}break;case s0.PREVIOUS:o.data.set(n.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(r,n){const o=1<<this._png.depth,a=(s,l)=>{const c=((s+n.yOffset)*this._png.width+n.xOffset+l)*this._png.channels,u=(s*n.width+l)*this._png.channels;return{index:c,frameIndex:u}};switch(n.blendOp){case k3.SOURCE:for(let s=0;s<n.height;s++)for(let l=0;l<n.width;l++){const{index:c,frameIndex:u}=a(s,l);for(let d=0;d<this._png.channels;d++)r.data[c+d]=n.data[u+d]}break;case k3.OVER:for(let s=0;s<n.height;s++)for(let l=0;l<n.width;l++){const{index:c,frameIndex:u}=a(s,l);for(let d=0;d<this._png.channels;d++){const f=n.data[u+this._png.channels-1]/o,h=d%(this._png.channels-1)===0?1:n.data[u+d],p=Math.floor(f*h+(1-f)*r.data[c+d]);r.data[c+d]+=p}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){var n;if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const r=this._isAnimated?((n=this._frames)==null?void 0:n.at(0)).data:this._inflator.result;if(this._filterMethod!==nW.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===j3.NO_INTERLACE)this._png.data=tW({data:r,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===j3.ADAM7)this._png.data=eOe({data:r,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const r=this._inflator.result,n=this._frames.at(-1);n?n.data=r:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:s0.NONE,blendOp:k3.SOURCE,data:r}),this._inflator=new Z9,this._writingDataChunks=!1}}function mOe(e){if(e!==1&&e!==2&&e!==4&&e!==8&&e!==16)throw new Error(`invalid bit depth: ${e}`);return e}var iW;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.METRE=1]="METRE"})(iW||(iW={}));function vOe(e,t){return new gOe(e,t).decode()}var Er=(function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this})();function _3(){Er.console&&typeof Er.console.log=="function"&&Er.console.log.apply(Er.console,arguments)}var Dn={log:_3,warn:function(e){Er.console&&(typeof Er.console.warn=="function"?Er.console.warn.apply(Er.console,arguments):_3.call(null,arguments))},error:function(e){Er.console&&(typeof Er.console.error=="function"?Er.console.error.apply(Er.console,arguments):_3(e))}};function C3(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){Up(n.response,t,r)},n.onerror=function(){Dn.error("could not download file")},n.send()}function oW(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function l0(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var Up=Er.saveAs||((typeof window>"u"?"undefined":On(window))!=="object"||window!==Er?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,t,r){var n=Er.URL||Er.webkitURL,o=document.createElement("a");t=t||e.name||"download",o.download=t,o.rel="noopener",typeof e=="string"?(o.href=e,o.origin!==location.origin?oW(o.href)?C3(e,t,r):l0(o,o.target="_blank"):l0(o)):(o.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(o.href)},4e4),setTimeout(function(){l0(o)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download",typeof e=="string")if(oW(e))C3(e,t,r);else{var n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){l0(n)})}else navigator.msSaveOrOpenBlob((function(o,a){return a===void 0?a={autoBom:!1}:On(a)!=="object"&&(Dn.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(o.type)?new Blob(["\uFEFF",o],{type:o.type}):o})(e,r),t)}:function(e,t,r,n){if((n=n||open("","_blank"))&&(n.document.title=n.document.body.innerText="downloading..."),typeof e=="string")return C3(e,t,r);var o=e.type==="application/octet-stream",a=/constructor/i.test(Er.HTMLElement)||Er.safari,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||o&&a)&&(typeof FileReader>"u"?"undefined":On(FileReader))==="object"){var l=new FileReader;l.onloadend=function(){var d=l.result;d=s?d:d.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=d:location=d,n=null},l.readAsDataURL(e)}else{var c=Er.URL||Er.webkitURL,u=c.createObjectURL(e);n?n.location=u:location.href=u,n=null,setTimeout(function(){c.revokeObjectURL(u)},4e4)}});/**
|
||
* A class to parse color values
|
||
* @author Stoyan Stefanov <sstoo@gmail.com>
|
||
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
|
||
* @license Use it if you like it
|
||
*/function wX(e){var t;e=e||"",this.ok=!1,e.charAt(0)=="#"&&(e=e.substr(1,6)),e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;for(var r=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(l){return[parseInt(l[1]),parseInt(l[2]),parseInt(l[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(l){return[parseInt(l[1],16),parseInt(l[2],16),parseInt(l[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(l){return[parseInt(l[1]+l[1],16),parseInt(l[2]+l[2],16),parseInt(l[3]+l[3],16)]}}],n=0;n<r.length;n++){var o=r[n].re,a=r[n].process,s=o.exec(e);s&&(t=a(s),this.r=t[0],this.g=t[1],this.b=t[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var l=this.r.toString(16),c=this.g.toString(16),u=this.b.toString(16);return l.length==1&&(l="0"+l),c.length==1&&(c="0"+c),u.length==1&&(u="0"+u),"#"+l+c+u}}var j0=Er.atob.bind(Er),aW=Er.btoa.bind(Er);/**
|
||
* @license
|
||
* Joseph Myers does not specify a particular license for his work.
|
||
*
|
||
* Author: Joseph Myers
|
||
* Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
|
||
*
|
||
* Modified by: Owen Leong
|
||
*/function E3(e,t){var r=e[0],n=e[1],o=e[2],a=e[3];r=aa(r,n,o,a,t[0],7,-680876936),a=aa(a,r,n,o,t[1],12,-389564586),o=aa(o,a,r,n,t[2],17,606105819),n=aa(n,o,a,r,t[3],22,-1044525330),r=aa(r,n,o,a,t[4],7,-176418897),a=aa(a,r,n,o,t[5],12,1200080426),o=aa(o,a,r,n,t[6],17,-1473231341),n=aa(n,o,a,r,t[7],22,-45705983),r=aa(r,n,o,a,t[8],7,1770035416),a=aa(a,r,n,o,t[9],12,-1958414417),o=aa(o,a,r,n,t[10],17,-42063),n=aa(n,o,a,r,t[11],22,-1990404162),r=aa(r,n,o,a,t[12],7,1804603682),a=aa(a,r,n,o,t[13],12,-40341101),o=aa(o,a,r,n,t[14],17,-1502002290),r=sa(r,n=aa(n,o,a,r,t[15],22,1236535329),o,a,t[1],5,-165796510),a=sa(a,r,n,o,t[6],9,-1069501632),o=sa(o,a,r,n,t[11],14,643717713),n=sa(n,o,a,r,t[0],20,-373897302),r=sa(r,n,o,a,t[5],5,-701558691),a=sa(a,r,n,o,t[10],9,38016083),o=sa(o,a,r,n,t[15],14,-660478335),n=sa(n,o,a,r,t[4],20,-405537848),r=sa(r,n,o,a,t[9],5,568446438),a=sa(a,r,n,o,t[14],9,-1019803690),o=sa(o,a,r,n,t[3],14,-187363961),n=sa(n,o,a,r,t[8],20,1163531501),r=sa(r,n,o,a,t[13],5,-1444681467),a=sa(a,r,n,o,t[2],9,-51403784),o=sa(o,a,r,n,t[7],14,1735328473),r=la(r,n=sa(n,o,a,r,t[12],20,-1926607734),o,a,t[5],4,-378558),a=la(a,r,n,o,t[8],11,-2022574463),o=la(o,a,r,n,t[11],16,1839030562),n=la(n,o,a,r,t[14],23,-35309556),r=la(r,n,o,a,t[1],4,-1530992060),a=la(a,r,n,o,t[4],11,1272893353),o=la(o,a,r,n,t[7],16,-155497632),n=la(n,o,a,r,t[10],23,-1094730640),r=la(r,n,o,a,t[13],4,681279174),a=la(a,r,n,o,t[0],11,-358537222),o=la(o,a,r,n,t[3],16,-722521979),n=la(n,o,a,r,t[6],23,76029189),r=la(r,n,o,a,t[9],4,-640364487),a=la(a,r,n,o,t[12],11,-421815835),o=la(o,a,r,n,t[15],16,530742520),r=ca(r,n=la(n,o,a,r,t[2],23,-995338651),o,a,t[0],6,-198630844),a=ca(a,r,n,o,t[7],10,1126891415),o=ca(o,a,r,n,t[14],15,-1416354905),n=ca(n,o,a,r,t[5],21,-57434055),r=ca(r,n,o,a,t[12],6,1700485571),a=ca(a,r,n,o,t[3],10,-1894986606),o=ca(o,a,r,n,t[10],15,-1051523),n=ca(n,o,a,r,t[1],21,-2054922799),r=ca(r,n,o,a,t[8],6,1873313359),a=ca(a,r,n,o,t[15],10,-30611744),o=ca(o,a,r,n,t[6],15,-1560198380),n=ca(n,o,a,r,t[13],21,1309151649),r=ca(r,n,o,a,t[4],6,-145523070),a=ca(a,r,n,o,t[11],10,-1120210379),o=ca(o,a,r,n,t[2],15,718787259),n=ca(n,o,a,r,t[9],21,-343485551),e[0]=_f(r,e[0]),e[1]=_f(n,e[1]),e[2]=_f(o,e[2]),e[3]=_f(a,e[3])}function MS(e,t,r,n,o,a){return t=_f(_f(t,e),_f(n,a)),_f(t<<o|t>>>32-o,r)}function aa(e,t,r,n,o,a,s){return MS(t&r|~t&n,e,t,o,a,s)}function sa(e,t,r,n,o,a,s){return MS(t&n|r&~n,e,t,o,a,s)}function la(e,t,r,n,o,a,s){return MS(t^r^n,e,t,o,a,s)}function ca(e,t,r,n,o,a,s){return MS(r^(t|~n),e,t,o,a,s)}function SX(e){var t,r=e.length,n=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)E3(n,yOe(e.substring(t-64,t)));e=e.substring(t-64);var o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)o[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(o[t>>2]|=128<<(t%4<<3),t>55)for(E3(n,o),t=0;t<16;t++)o[t]=0;return o[14]=8*r,E3(n,o),n}function yOe(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}var sW="0123456789abcdef".split("");function xOe(e){for(var t="",r=0;r<4;r++)t+=sW[e>>8*r+4&15]+sW[e>>8*r&15];return t}function bOe(e){return String.fromCharCode(255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function m6(e){return SX(e).map(bOe).join("")}var wOe=(function(e){for(var t=0;t<e.length;t++)e[t]=xOe(e[t]);return e.join("")})(SX("hello"))!="5d41402abc4b2a76b9719d911017c592";function _f(e,t){if(wOe){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}return e+t&4294967295}/**
|
||
* @license
|
||
* FPDF is released under a permissive license: there is no usage restriction.
|
||
* You may embed it freely in your application (commercial or not), with or
|
||
* without modifications.
|
||
*
|
||
* Reference: http://www.fpdf.org/en/script/script37.php
|
||
*/function v6(e,t){var r,n,o,a;if(e!==r){for(var s=(o=e,a=1+(256/e.length|0),new Array(a+1).join(o)),l=[],c=0;c<256;c++)l[c]=c;var u=0;for(c=0;c<256;c++){var d=l[c];u=(u+d+s.charCodeAt(c))%256,l[c]=l[u],l[u]=d}r=e,n=l}else l=n;var f=t.length,h=0,p=0,y="";for(c=0;c<f;c++)p=(p+(d=l[h=(h+1)%256]))%256,l[h]=l[p],l[p]=d,s=l[(l[h]+l[p])%256],y+=String.fromCharCode(t.charCodeAt(c)^s);return y}/**
|
||
* @license
|
||
* Licensed under the MIT License.
|
||
* http://opensource.org/licenses/mit-license
|
||
* Author: Owen Leong (@owenl131)
|
||
* Date: 15 Oct 2020
|
||
* References:
|
||
* https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
|
||
* https://github.com/foliojs/pdfkit/blob/master/lib/security.js
|
||
* http://www.fpdf.org/en/script/script37.php
|
||
*/var lW={print:4,modify:8,copy:16,"annot-forms":32};function Dg(e,t,r,n){this.v=1,this.r=2;var o=192;e.forEach(function(l){if(lW.perm!==void 0)throw new Error("Invalid permission: "+l);o+=lW[l]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var a=(t+this.padding).substr(0,32),s=(r+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,s),this.P=-(1+(255^o)),this.encryptionKey=m6(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=v6(this.encryptionKey,this.padding)}function zg(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",r=e.length,n=0;n<r;n++){var o=e.charCodeAt(n);t+=o<33||o===35||o===37||o===40||o===41||o===47||o===60||o===62||o===91||o===93||o===123||o===125||o>126?"#"+("0"+o.toString(16)).slice(-2):e[n]}return t}function cW(e){if(On(e)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(r,n,o){if(o=o||!1,typeof r!="string"||typeof n!="function"||typeof o!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(r)||(t[r]={});var a=Math.random().toString(35);return t[r][a]=[n,!!o],a},this.unsubscribe=function(r){for(var n in t)if(t[n][r])return delete t[n][r],Object.keys(t[n]).length===0&&delete t[n],!0;return!1},this.publish=function(r){if(t.hasOwnProperty(r)){var n=Array.prototype.slice.call(arguments,1),o=[];for(var a in t[r]){var s=t[r][a];try{s[0].apply(e,n)}catch(l){Er.console&&Dn.error("jsPDF PubSub Error",l.message,l)}s[1]&&o.push(a)}o.length&&o.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function ww(e){if(!(this instanceof ww))return new ww(e);var t="opacity,stroke-opacity".split(",");for(var r in e)e.hasOwnProperty(r)&&t.indexOf(r)>=0&&(this[r]=e[r]);this.id="",this.objectNumber=-1}function jX(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function Yp(e,t,r,n,o){if(!(this instanceof Yp))return new Yp(e,t,r,n,o);this.type=e==="axial"?2:3,this.coords=t,this.colors=r,jX.call(this,n,o)}function Qg(e,t,r,n,o){if(!(this instanceof Qg))return new Qg(e,t,r,n,o);this.boundingBox=e,this.xStep=t,this.yStep=r,this.stream="",this.cloneIndex=0,jX.call(this,n,o)}function dr(e){var t,r=typeof arguments[0]=="string"?arguments[0]:"p",n=arguments[1],o=arguments[2],a=arguments[3],s=[],l=1,c=16,u="S",d=null;On(e=e||{})==="object"&&(r=e.orientation,n=e.unit||n,o=e.format||o,a=e.compress||e.compressPdf||a,(d=e.encryption||null)!==null&&(d.userPassword=d.userPassword||"",d.ownerPassword=d.ownerPassword||"",d.userPermissions=d.userPermissions||[]),l=typeof e.userUnit=="number"?Math.abs(e.userUnit):1,e.precision!==void 0&&(t=e.precision),e.floatPrecision!==void 0&&(c=e.floatPrecision),u=e.defaultPathOperation||"S"),s=e.filters||(a===!0?["FlateEncode"]:s),n=n||"mm",r=(""+(r||"P")).toLowerCase();var f=e.putOnlyUsedFonts||!1,h={},p={internal:{},__private__:{}};p.__private__.PubSub=cW;var y="1.3",m=p.__private__.getPdfVersion=function(){return y};p.__private__.setPdfVersion=function(X){y=X};var x={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};p.__private__.getPageFormats=function(){return x};var b=p.__private__.getPageFormat=function(X){return x[X]};o=o||"a4";var w="compat",k="advanced",S=w;function _(){this.saveGraphicsState(),ie(new Ke(Ae,0,0,-Ae,0,ks()*Ae).toString()+" cm"),this.setFontSize(this.getFontSize()/Ae),u="n",S=k}function P(){this.restoreGraphicsState(),u="S",S=w}var O=p.__private__.combineFontStyleAndFontWeight=function(X,ue){if(X=="bold"&&ue=="normal"||X=="bold"&&ue==400||X=="normal"&&ue=="italic"||X=="bold"&&ue=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return ue&&(X=ue==400||ue==="normal"?X==="italic"?"italic":"normal":ue!=700&&ue!=="bold"||X!=="normal"?(ue==700?"bold":ue)+""+X:"bold"),X};p.advancedAPI=function(X){var ue=S===w;return ue&&_.call(this),typeof X!="function"||(X(this),ue&&P.call(this)),this},p.compatAPI=function(X){var ue=S===k;return ue&&P.call(this),typeof X!="function"||(X(this),ue&&_.call(this)),this},p.isAdvancedAPI=function(){return S===k};var T,R=function(X){if(S!==k)throw new Error(X+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},I=p.roundToPrecision=p.__private__.roundToPrecision=function(X,ue){var _e=t||ue;if(isNaN(X)||isNaN(_e))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return X.toFixed(_e).replace(/0+$/,"")};T=p.hpf=p.__private__.hpf=typeof c=="number"?function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.hpf");return I(X,c)}:c==="smart"?function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.hpf");return I(X,X>-1&&X<1?16:5)}:function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.hpf");return I(X,16)};var E=p.f2=p.__private__.f2=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.f2");return I(X,2)},A=p.__private__.f3=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.f3");return I(X,3)},F=p.scale=p.__private__.scale=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.scale");return S===w?X*Ae:S===k?X:void 0},L=function(X){return F((function(ue){return S===w?ks()-ue:S===k?ue:void 0})(X))};p.__private__.setPrecision=p.setPrecision=function(X){typeof parseInt(X,10)=="number"&&(t=parseInt(X,10))};var z,V="00000000000000000000000000000000",Q=p.__private__.getFileId=function(){return V},U=p.__private__.setFileId=function(X){return V=X!==void 0&&/^[a-fA-F0-9]{32}$/.test(X)?X.toUpperCase():V.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),d!==null&&(Ui=new Dg(d.userPermissions,d.userPassword,d.ownerPassword,V)),V};p.setFileId=function(X){return U(X),this},p.getFileId=function(){return Q()};var ee=p.__private__.convertDateToPDFDate=function(X){var ue=X.getTimezoneOffset(),_e=ue<0?"+":"-",Be=Math.floor(Math.abs(ue/60)),Qe=Math.abs(ue%60),bt=[_e,q(Be),"'",q(Qe),"'"].join("");return["D:",X.getFullYear(),q(X.getMonth()+1),q(X.getDate()),q(X.getHours()),q(X.getMinutes()),q(X.getSeconds()),bt].join("")},H=p.__private__.convertPDFDateToDate=function(X){var ue=parseInt(X.substr(2,4),10),_e=parseInt(X.substr(6,2),10)-1,Be=parseInt(X.substr(8,2),10),Qe=parseInt(X.substr(10,2),10),bt=parseInt(X.substr(12,2),10),It=parseInt(X.substr(14,2),10);return new Date(ue,_e,Be,Qe,bt,It,0)},B=p.__private__.setCreationDate=function(X){var ue;if(X===void 0&&(X=new Date),X instanceof Date)ue=ee(X);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(X))throw new Error("Invalid argument passed to jsPDF.setCreationDate");ue=X}return z=ue},M=p.__private__.getCreationDate=function(X){var ue=z;return X==="jsDate"&&(ue=H(z)),ue};p.setCreationDate=function(X){return B(X),this},p.getCreationDate=function(X){return M(X)};var $,q=p.__private__.padd2=function(X){return("0"+parseInt(X)).slice(-2)},Y=p.__private__.padd2Hex=function(X){return("00"+(X=X.toString())).substr(X.length)},K=0,G=[],re=[],J=0,ae=[],le=[],me=!1,Oe=re;p.__private__.setCustomOutputDestination=function(X){me=!0,Oe=X};var we=function(X){me||(Oe=X)};p.__private__.resetCustomOutputDestination=function(){me=!1,Oe=re};var ie=p.__private__.out=function(X){return X=X.toString(),J+=X.length+1,Oe.push(X),Oe},Me=p.__private__.write=function(X){return ie(arguments.length===1?X.toString():Array.prototype.join.call(arguments," "))},ke=p.__private__.getArrayBuffer=function(X){for(var ue=X.length,_e=new ArrayBuffer(ue),Be=new Uint8Array(_e);ue--;)Be[ue]=X.charCodeAt(ue);return _e},se=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];p.__private__.getStandardFonts=function(){return se};var fe=e.fontSize||16;p.__private__.setFontSize=p.setFontSize=function(X){return fe=S===k?X/Ae:X,this};var Ie,ce=p.__private__.getFontSize=p.getFontSize=function(){return S===w?fe:fe*Ae},je=e.R2L||!1;p.__private__.setR2L=p.setR2L=function(X){return je=X,this},p.__private__.getR2L=p.getR2L=function(){return je};var qe,Ne=p.__private__.setZoomMode=function(X){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(X))Ie=X;else if(isNaN(X)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(X)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+X+'" is not recognized.');Ie=X}else Ie=parseInt(X,10)};p.__private__.getZoomMode=function(){return Ie};var Je,vt=p.__private__.setPageMode=function(X){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(X)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+X+'" is not recognized.');qe=X};p.__private__.getPageMode=function(){return qe};var Ge=p.__private__.setLayoutMode=function(X){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(X)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+X+'" is not recognized.');Je=X};p.__private__.getLayoutMode=function(){return Je},p.__private__.setDisplayMode=p.setDisplayMode=function(X,ue,_e){return Ne(X),Ge(ue),vt(_e),this};var Ot={title:"",subject:"",author:"",keywords:"",creator:""};p.__private__.getDocumentProperty=function(X){if(Object.keys(Ot).indexOf(X)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return Ot[X]},p.__private__.getDocumentProperties=function(){return Ot},p.__private__.setDocumentProperties=p.setProperties=p.setDocumentProperties=function(X){for(var ue in Ot)Ot.hasOwnProperty(ue)&&X[ue]&&(Ot[ue]=X[ue]);return this},p.__private__.setDocumentProperty=function(X,ue){if(Object.keys(Ot).indexOf(X)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return Ot[X]=ue};var nt,Ae,Te,wt,ft,Pt={},At={},Ht=[],Se={},ct={},gt={},We={},Pe=null,rt=0,Ze=[],pe=new cW(p),xe=e.hotfixes||[],De={},tt={},Le=[],Ke=function X(ue,_e,Be,Qe,bt,It){if(!(this instanceof X))return new X(ue,_e,Be,Qe,bt,It);isNaN(ue)&&(ue=1),isNaN(_e)&&(_e=0),isNaN(Be)&&(Be=0),isNaN(Qe)&&(Qe=1),isNaN(bt)&&(bt=0),isNaN(It)&&(It=0),this._matrix=[ue,_e,Be,Qe,bt,It]};Object.defineProperty(Ke.prototype,"sx",{get:function(){return this._matrix[0]},set:function(X){this._matrix[0]=X}}),Object.defineProperty(Ke.prototype,"shy",{get:function(){return this._matrix[1]},set:function(X){this._matrix[1]=X}}),Object.defineProperty(Ke.prototype,"shx",{get:function(){return this._matrix[2]},set:function(X){this._matrix[2]=X}}),Object.defineProperty(Ke.prototype,"sy",{get:function(){return this._matrix[3]},set:function(X){this._matrix[3]=X}}),Object.defineProperty(Ke.prototype,"tx",{get:function(){return this._matrix[4]},set:function(X){this._matrix[4]=X}}),Object.defineProperty(Ke.prototype,"ty",{get:function(){return this._matrix[5]},set:function(X){this._matrix[5]=X}}),Object.defineProperty(Ke.prototype,"a",{get:function(){return this._matrix[0]},set:function(X){this._matrix[0]=X}}),Object.defineProperty(Ke.prototype,"b",{get:function(){return this._matrix[1]},set:function(X){this._matrix[1]=X}}),Object.defineProperty(Ke.prototype,"c",{get:function(){return this._matrix[2]},set:function(X){this._matrix[2]=X}}),Object.defineProperty(Ke.prototype,"d",{get:function(){return this._matrix[3]},set:function(X){this._matrix[3]=X}}),Object.defineProperty(Ke.prototype,"e",{get:function(){return this._matrix[4]},set:function(X){this._matrix[4]=X}}),Object.defineProperty(Ke.prototype,"f",{get:function(){return this._matrix[5]},set:function(X){this._matrix[5]=X}}),Object.defineProperty(Ke.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Ke.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Ke.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Ke.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),Ke.prototype.join=function(X){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(T).join(X)},Ke.prototype.multiply=function(X){var ue=X.sx*this.sx+X.shy*this.shx,_e=X.sx*this.shy+X.shy*this.sy,Be=X.shx*this.sx+X.sy*this.shx,Qe=X.shx*this.shy+X.sy*this.sy,bt=X.tx*this.sx+X.ty*this.shx+this.tx,It=X.tx*this.shy+X.ty*this.sy+this.ty;return new Ke(ue,_e,Be,Qe,bt,It)},Ke.prototype.decompose=function(){var X=this.sx,ue=this.shy,_e=this.shx,Be=this.sy,Qe=this.tx,bt=this.ty,It=Math.sqrt(X*X+ue*ue),tr=(X/=It)*_e+(ue/=It)*Be;_e-=X*tr,Be-=ue*tr;var Kt=Math.sqrt(_e*_e+Be*Be);return tr/=Kt,X*(Be/=Kt)<ue*(_e/=Kt)&&(X=-X,ue=-ue,tr=-tr,It=-It),{scale:new Ke(It,0,0,Kt,0,0),translate:new Ke(1,0,0,1,Qe,bt),rotate:new Ke(X,ue,-ue,X,0,0),skew:new Ke(1,0,tr,1,0,0)}},Ke.prototype.toString=function(X){return this.join(" ")},Ke.prototype.inversed=function(){var X=this.sx,ue=this.shy,_e=this.shx,Be=this.sy,Qe=this.tx,bt=this.ty,It=1/(X*Be-ue*_e),tr=Be*It,Kt=-ue*It,_r=-_e*It,Tr=X*It;return new Ke(tr,Kt,_r,Tr,-tr*Qe-_r*bt,-Kt*Qe-Tr*bt)},Ke.prototype.applyToPoint=function(X){var ue=X.x*this.sx+X.y*this.shx+this.tx,_e=X.x*this.shy+X.y*this.sy+this.ty;return new Sc(ue,_e)},Ke.prototype.applyToRectangle=function(X){var ue=this.applyToPoint(X),_e=this.applyToPoint(new Sc(X.x+X.w,X.y+X.h));return new Ha(ue.x,ue.y,_e.x-ue.x,_e.y-ue.y)},Ke.prototype.clone=function(){var X=this.sx,ue=this.shy,_e=this.shx,Be=this.sy,Qe=this.tx,bt=this.ty;return new Ke(X,ue,_e,Be,Qe,bt)},p.Matrix=Ke;var Fe=p.matrixMult=function(X,ue){return ue.multiply(X)},Ve=new Ke(1,0,0,1,0,0);p.unitMatrix=p.identityMatrix=Ve;var xt=function(X,ue){if(!ct[X]){var _e=(ue instanceof Yp?"Sh":"P")+(Object.keys(Se).length+1).toString(10);ue.id=_e,ct[X]=_e,Se[_e]=ue,pe.publish("addPattern",ue)}};p.ShadingPattern=Yp,p.TilingPattern=Qg,p.addShadingPattern=function(X,ue){return R("addShadingPattern()"),xt(X,ue),this},p.beginTilingPattern=function(X){R("beginTilingPattern()"),kc(X.boundingBox[0],X.boundingBox[1],X.boundingBox[2]-X.boundingBox[0],X.boundingBox[3]-X.boundingBox[1],X.matrix)},p.endTilingPattern=function(X,ue){R("endTilingPattern()"),ue.stream=le[$].join(`
|
||
`),xt(X,ue),pe.publish("endTilingPattern",ue),Le.pop().restore()};var dt,Tt=p.__private__.newObject=function(){var X=Mt();return fr(X,!0),X},Mt=p.__private__.newObjectDeferred=function(){return K++,G[K]=function(){return J},K},fr=function(X,ue){return ue=typeof ue=="boolean"&&ue,G[X]=J,ue&&ie(X+" 0 obj"),X},hr=p.__private__.newAdditionalObject=function(){var X={objId:Mt(),content:""};return ae.push(X),X},Qr=Mt(),Rn=Mt(),to=p.__private__.decodeColorString=function(X){var ue=X.split(" ");if(ue.length!==2||ue[1]!=="g"&&ue[1]!=="G")ue.length!==5||ue[4]!=="k"&&ue[4]!=="K"||(ue=[(1-ue[0])*(1-ue[3]),(1-ue[1])*(1-ue[3]),(1-ue[2])*(1-ue[3]),"r"]);else{var _e=parseFloat(ue[0]);ue=[_e,_e,_e,"r"]}for(var Be="#",Qe=0;Qe<3;Qe++)Be+=("0"+Math.floor(255*parseFloat(ue[Qe])).toString(16)).slice(-2);return Be},Ln=p.__private__.encodeColorString=function(X){var ue;typeof X=="string"&&(X={ch1:X});var _e=X.ch1,Be=X.ch2,Qe=X.ch3,bt=X.ch4,It=X.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof _e=="string"&&_e.charAt(0)!=="#"){var tr=new wX(_e);if(tr.ok)_e=tr.toHex();else if(!/^\d*\.?\d*$/.test(_e))throw new Error('Invalid color "'+_e+'" passed to jsPDF.encodeColorString.')}if(typeof _e=="string"&&/^#[0-9A-Fa-f]{3}$/.test(_e)&&(_e="#"+_e[1]+_e[1]+_e[2]+_e[2]+_e[3]+_e[3]),typeof _e=="string"&&/^#[0-9A-Fa-f]{6}$/.test(_e)){var Kt=parseInt(_e.substr(1),16);_e=Kt>>16&255,Be=Kt>>8&255,Qe=255&Kt}if(Be===void 0||bt===void 0&&_e===Be&&Be===Qe)ue=typeof _e=="string"?_e+" "+It[0]:X.precision===2?E(_e/255)+" "+It[0]:A(_e/255)+" "+It[0];else if(bt===void 0||On(bt)==="object"){if(bt&&!isNaN(bt.a)&&bt.a===0)return["1.","1.","1.",It[1]].join(" ");ue=typeof _e=="string"?[_e,Be,Qe,It[1]].join(" "):X.precision===2?[E(_e/255),E(Be/255),E(Qe/255),It[1]].join(" "):[A(_e/255),A(Be/255),A(Qe/255),It[1]].join(" ")}else ue=typeof _e=="string"?[_e,Be,Qe,bt,It[2]].join(" "):X.precision===2?[E(_e),E(Be),E(Qe),E(bt),It[2]].join(" "):[A(_e),A(Be),A(Qe),A(bt),It[2]].join(" ");return ue},vo=p.__private__.getFilters=function(){return s},ro=p.__private__.putStream=function(X){var ue=(X=X||{}).data||"",_e=X.filters||vo(),Be=X.alreadyAppliedFilters||[],Qe=X.addLength1||!1,bt=ue.length,It=X.objectId,tr=function(Fn){return Fn};if(d!==null&&It===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");d!==null&&(tr=Ui.encryptor(It,0));var Kt={};_e===!0&&(_e=["FlateEncode"]);var _r=X.additionalKeyValues||[],Tr=(Kt=dr.API.processDataByFilters!==void 0?dr.API.processDataByFilters(ue,_e):{data:ue,reverseChain:[]}).reverseChain+(Array.isArray(Be)?Be.join(" "):Be.toString());if(Kt.data.length!==0&&(_r.push({key:"Length",value:Kt.data.length}),Qe===!0&&_r.push({key:"Length1",value:bt})),Tr.length!=0)if(Tr.split("/").length-1==1)_r.push({key:"Filter",value:Tr});else{_r.push({key:"Filter",value:"["+Tr+"]"});for(var Kr=0;Kr<_r.length;Kr+=1)if(_r[Kr].key==="DecodeParms"){for(var bi=[],jn=0;jn<Kt.reverseChain.split("/").length-1;jn+=1)bi.push("null");bi.push(_r[Kr].value),_r[Kr].value="["+bi.join(" ")+"]"}}ie("<<");for(var dn=0;dn<_r.length;dn++)ie("/"+_r[dn].key+" "+_r[dn].value);ie(">>"),Kt.data.length!==0&&(ie("stream"),ie(tr(Kt.data)),ie("endstream"))},ys=p.__private__.putPage=function(X){var ue=X.number,_e=X.data,Be=X.objId,Qe=X.contentsObjId;fr(Be,!0),ie("<</Type /Page"),ie("/Parent "+X.rootDictionaryObjId+" 0 R"),ie("/Resources "+X.resourceDictionaryObjId+" 0 R"),ie("/MediaBox ["+parseFloat(T(X.mediaBox.bottomLeftX))+" "+parseFloat(T(X.mediaBox.bottomLeftY))+" "+T(X.mediaBox.topRightX)+" "+T(X.mediaBox.topRightY)+"]"),X.cropBox!==null&&ie("/CropBox ["+T(X.cropBox.bottomLeftX)+" "+T(X.cropBox.bottomLeftY)+" "+T(X.cropBox.topRightX)+" "+T(X.cropBox.topRightY)+"]"),X.bleedBox!==null&&ie("/BleedBox ["+T(X.bleedBox.bottomLeftX)+" "+T(X.bleedBox.bottomLeftY)+" "+T(X.bleedBox.topRightX)+" "+T(X.bleedBox.topRightY)+"]"),X.trimBox!==null&&ie("/TrimBox ["+T(X.trimBox.bottomLeftX)+" "+T(X.trimBox.bottomLeftY)+" "+T(X.trimBox.topRightX)+" "+T(X.trimBox.topRightY)+"]"),X.artBox!==null&&ie("/ArtBox ["+T(X.artBox.bottomLeftX)+" "+T(X.artBox.bottomLeftY)+" "+T(X.artBox.topRightX)+" "+T(X.artBox.topRightY)+"]"),typeof X.userUnit=="number"&&X.userUnit!==1&&ie("/UserUnit "+X.userUnit),pe.publish("putPage",{objId:Be,pageContext:Ze[ue],pageNumber:ue,page:_e}),ie("/Contents "+Qe+" 0 R"),ie(">>"),ie("endobj");var bt=_e.join(`
|
||
`);return S===k&&(bt+=`
|
||
Q`),fr(Qe,!0),ro({data:bt,filters:vo(),objectId:Qe}),ie("endobj"),Be},zo=p.__private__.putPages=function(){var X,ue,_e=[];for(X=1;X<=rt;X++)Ze[X].objId=Mt(),Ze[X].contentsObjId=Mt();for(X=1;X<=rt;X++)_e.push(ys({number:X,data:le[X],objId:Ze[X].objId,contentsObjId:Ze[X].contentsObjId,mediaBox:Ze[X].mediaBox,cropBox:Ze[X].cropBox,bleedBox:Ze[X].bleedBox,trimBox:Ze[X].trimBox,artBox:Ze[X].artBox,userUnit:Ze[X].userUnit,rootDictionaryObjId:Qr,resourceDictionaryObjId:Rn}));fr(Qr,!0),ie("<</Type /Pages");var Be="/Kids [";for(ue=0;ue<rt;ue++)Be+=_e[ue]+" 0 R ";ie(Be+"]"),ie("/Count "+rt),ie(">>"),ie("endobj"),pe.publish("postPutPages")},$a=function(X){pe.publish("putFont",{font:X,out:ie,newObject:Tt,putStream:ro}),X.isAlreadyPutted!==!0&&(X.objectNumber=Tt(),ie("<<"),ie("/Type /Font"),ie("/BaseFont /"+zg(X.postScriptName)),ie("/Subtype /Type1"),typeof X.encoding=="string"&&ie("/Encoding /"+X.encoding),ie("/FirstChar 32"),ie("/LastChar 255"),ie(">>"),ie("endobj"))},xa=function(X){X.objectNumber=Tt();var ue=[];ue.push({key:"Type",value:"/XObject"}),ue.push({key:"Subtype",value:"/Form"}),ue.push({key:"BBox",value:"["+[T(X.x),T(X.y),T(X.x+X.width),T(X.y+X.height)].join(" ")+"]"}),ue.push({key:"Matrix",value:"["+X.matrix.toString()+"]"});var _e=X.pages[1].join(`
|
||
`);ro({data:_e,additionalKeyValues:ue,objectId:X.objectNumber}),ie("endobj")},zt=function(X,ue){ue||(ue=21);var _e=Tt(),Be=(function(It,tr){var Kt,_r=[],Tr=1/(tr-1);for(Kt=0;Kt<1;Kt+=Tr)_r.push(Kt);if(_r.push(1),It[0].offset!=0){var Kr={offset:0,color:It[0].color};It.unshift(Kr)}if(It[It.length-1].offset!=1){var bi={offset:1,color:It[It.length-1].color};It.push(bi)}for(var jn="",dn=0,Fn=0;Fn<_r.length;Fn++){for(Kt=_r[Fn];Kt>It[dn+1].offset;)dn++;var Zn=It[dn].offset,Jn=(Kt-Zn)/(It[dn+1].offset-Zn),bo=It[dn].color,_s=It[dn+1].color;jn+=Y(Math.round((1-Jn)*bo[0]+Jn*_s[0]).toString(16))+Y(Math.round((1-Jn)*bo[1]+Jn*_s[1]).toString(16))+Y(Math.round((1-Jn)*bo[2]+Jn*_s[2]).toString(16))}return jn.trim()})(X.colors,ue),Qe=[];Qe.push({key:"FunctionType",value:"0"}),Qe.push({key:"Domain",value:"[0.0 1.0]"}),Qe.push({key:"Size",value:"["+ue+"]"}),Qe.push({key:"BitsPerSample",value:"8"}),Qe.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Qe.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ro({data:Be,additionalKeyValues:Qe,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:_e}),ie("endobj"),X.objectNumber=Tt(),ie("<< /ShadingType "+X.type),ie("/ColorSpace /DeviceRGB");var bt="/Coords ["+T(parseFloat(X.coords[0]))+" "+T(parseFloat(X.coords[1]))+" ";X.type===2?bt+=T(parseFloat(X.coords[2]))+" "+T(parseFloat(X.coords[3])):bt+=T(parseFloat(X.coords[2]))+" "+T(parseFloat(X.coords[3]))+" "+T(parseFloat(X.coords[4]))+" "+T(parseFloat(X.coords[5])),ie(bt+="]"),X.matrix&&ie("/Matrix ["+X.matrix.toString()+"]"),ie("/Function "+_e+" 0 R"),ie("/Extend [true true]"),ie(">>"),ie("endobj")},yr=function(X,ue){var _e=Mt(),Be=Tt();ue.push({resourcesOid:_e,objectOid:Be}),X.objectNumber=Be;var Qe=[];Qe.push({key:"Type",value:"/Pattern"}),Qe.push({key:"PatternType",value:"1"}),Qe.push({key:"PaintType",value:"1"}),Qe.push({key:"TilingType",value:"1"}),Qe.push({key:"BBox",value:"["+X.boundingBox.map(T).join(" ")+"]"}),Qe.push({key:"XStep",value:T(X.xStep)}),Qe.push({key:"YStep",value:T(X.yStep)}),Qe.push({key:"Resources",value:_e+" 0 R"}),X.matrix&&Qe.push({key:"Matrix",value:"["+X.matrix.toString()+"]"}),ro({data:X.stream,additionalKeyValues:Qe,objectId:X.objectNumber}),ie("endobj")},Xn=function(X){for(var ue in X.objectNumber=Tt(),ie("<<"),X)switch(ue){case"opacity":ie("/ca "+E(X[ue]));break;case"stroke-opacity":ie("/CA "+E(X[ue]))}ie(">>"),ie("endobj")},Gr=function(X){fr(X.resourcesOid,!0),ie("<<"),ie("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),(function(){for(var ue in ie("/Font <<"),Pt)Pt.hasOwnProperty(ue)&&(f===!1||f===!0&&h.hasOwnProperty(ue))&&ie("/"+ue+" "+Pt[ue].objectNumber+" 0 R");ie(">>")})(),(function(){if(Object.keys(Se).length>0){for(var ue in ie("/Shading <<"),Se)Se.hasOwnProperty(ue)&&Se[ue]instanceof Yp&&Se[ue].objectNumber>=0&&ie("/"+ue+" "+Se[ue].objectNumber+" 0 R");pe.publish("putShadingPatternDict"),ie(">>")}})(),(function(ue){if(Object.keys(Se).length>0){for(var _e in ie("/Pattern <<"),Se)Se.hasOwnProperty(_e)&&Se[_e]instanceof p.TilingPattern&&Se[_e].objectNumber>=0&&Se[_e].objectNumber<ue&&ie("/"+_e+" "+Se[_e].objectNumber+" 0 R");pe.publish("putTilingPatternDict"),ie(">>")}})(X.objectOid),(function(){if(Object.keys(gt).length>0){var ue;for(ue in ie("/ExtGState <<"),gt)gt.hasOwnProperty(ue)&>[ue].objectNumber>=0&&ie("/"+ue+" "+gt[ue].objectNumber+" 0 R");pe.publish("putGStateDict"),ie(">>")}})(),(function(){for(var ue in ie("/XObject <<"),De)De.hasOwnProperty(ue)&&De[ue].objectNumber>=0&&ie("/"+ue+" "+De[ue].objectNumber+" 0 R");pe.publish("putXobjectDict"),ie(">>")})(),ie(">>"),ie("endobj")},Ut=function(X){At[X.fontName]=At[X.fontName]||{},At[X.fontName][X.fontStyle]=X.id},$i=function(X,ue,_e,Be,Qe){var bt={id:"F"+(Object.keys(Pt).length+1).toString(10),postScriptName:X,fontName:ue,fontStyle:_e,encoding:Be,isStandardFont:Qe||!1,metadata:{}};return pe.publish("addFont",{font:bt,instance:this}),Pt[bt.id]=bt,Ut(bt),bt.id},yo=p.__private__.pdfEscape=p.pdfEscape=function(X,ue){return(function(_e,Be){var Qe,bt,It,tr,Kt,_r,Tr,Kr,bi;if(It=(Be=Be||{}).sourceEncoding||"Unicode",Kt=Be.outputEncoding,(Be.autoencode||Kt)&&Pt[nt].metadata&&Pt[nt].metadata[It]&&Pt[nt].metadata[It].encoding&&(tr=Pt[nt].metadata[It].encoding,!Kt&&Pt[nt].encoding&&(Kt=Pt[nt].encoding),!Kt&&tr.codePages&&(Kt=tr.codePages[0]),typeof Kt=="string"&&(Kt=tr[Kt]),Kt)){for(Tr=!1,_r=[],Qe=0,bt=_e.length;Qe<bt;Qe++)(Kr=Kt[_e.charCodeAt(Qe)])?_r.push(String.fromCharCode(Kr)):_r.push(_e[Qe]),_r[Qe].charCodeAt(0)>>8&&(Tr=!0);_e=_r.join("")}for(Qe=_e.length;Tr===void 0&&Qe!==0;)_e.charCodeAt(Qe-1)>>8&&(Tr=!0),Qe--;if(!Tr)return _e;for(_r=Be.noBOM?[]:[254,255],Qe=0,bt=_e.length;Qe<bt;Qe++){if((bi=(Kr=_e.charCodeAt(Qe))>>8)>>8)throw new Error("Character at position "+Qe+" of string '"+_e+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");_r.push(bi),_r.push(Kr-(bi<<8))}return String.fromCharCode.apply(void 0,_r)})(X,ue).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},oi=p.__private__.beginPage=function(X){le[++rt]=[],Ze[rt]={objId:0,contentsObjId:0,userUnit:Number(l),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(X[0]),topRightY:Number(X[1])}},uu(rt),we(le[$])},xc=function(X,ue){var _e,Be,Qe;switch(r=ue||r,typeof X=="string"&&(_e=b(X.toLowerCase()),Array.isArray(_e)&&(Be=_e[0],Qe=_e[1])),Array.isArray(X)&&(Be=X[0]*Ae,Qe=X[1]*Ae),isNaN(Be)&&(Be=o[0],Qe=o[1]),(Be>14400||Qe>14400)&&(Dn.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),Be=Math.min(14400,Be),Qe=Math.min(14400,Qe)),o=[Be,Qe],r.substr(0,1)){case"l":Qe>Be&&(o=[Qe,Be]);break;case"p":Be>Qe&&(o=[Qe,Be])}oi(o),Ov(pr),ie(il),gu!==0&&ie(gu+" J"),js!==0&&ie(js+" j"),pe.publish("addPage",{pageNumber:rt})},Ed=function(X){X>0&&X<=rt&&(le.splice(X,1),Ze.splice(X,1),rt--,$>rt&&($=rt),this.setPage($))},uu=function(X){X>0&&X<=rt&&($=X)},ba=p.__private__.getNumberOfPages=p.getNumberOfPages=function(){return le.length-1},$h=function(X,ue,_e){var Be,Qe=void 0;return _e=_e||{},X=X!==void 0?X:Pt[nt].fontName,ue=ue!==void 0?ue:Pt[nt].fontStyle,Be=X.toLowerCase(),At[Be]!==void 0&&At[Be][ue]!==void 0?Qe=At[Be][ue]:At[X]!==void 0&&At[X][ue]!==void 0?Qe=At[X][ue]:_e.disableWarning===!1&&Dn.warn("Unable to look up font label for font '"+X+"', '"+ue+"'. Refer to getFontList() for available fonts."),Qe||_e.noFallback||(Qe=At.times[ue])==null&&(Qe=At.times.normal),Qe},yi=p.__private__.putInfo=function(){var X=Tt(),ue=function(Be){return Be};for(var _e in d!==null&&(ue=Ui.encryptor(X,0)),ie("<<"),ie("/Producer ("+yo(ue("jsPDF "+dr.version))+")"),Ot)Ot.hasOwnProperty(_e)&&Ot[_e]&&ie("/"+_e.substr(0,1).toUpperCase()+_e.substr(1)+" ("+yo(ue(Ot[_e]))+")");ie("/CreationDate ("+yo(ue(z))+")"),ie(">>"),ie("endobj")},Ad=p.__private__.putCatalog=function(X){var ue=(X=X||{}).rootDictionaryObjId||Qr;switch(Tt(),ie("<<"),ie("/Type /Catalog"),ie("/Pages "+ue+" 0 R"),Ie||(Ie="fullwidth"),Ie){case"fullwidth":ie("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ie("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ie("/OpenAction [3 0 R /Fit]");break;case"original":ie("/OpenAction [3 0 R /XYZ null null 1]");break;default:var _e=""+Ie;_e.substr(_e.length-1)==="%"&&(Ie=parseInt(Ie)/100),typeof Ie=="number"&&ie("/OpenAction [3 0 R /XYZ null null "+E(Ie)+"]")}switch(Je||(Je="continuous"),Je){case"continuous":ie("/PageLayout /OneColumn");break;case"single":ie("/PageLayout /SinglePage");break;case"two":case"twoleft":ie("/PageLayout /TwoColumnLeft");break;case"tworight":ie("/PageLayout /TwoColumnRight")}qe&&ie("/PageMode /"+qe),pe.publish("putCatalog"),ie(">>"),ie("endobj")},Tv=p.__private__.putTrailer=function(){ie("trailer"),ie("<<"),ie("/Size "+(K+1)),ie("/Root "+K+" 0 R"),ie("/Info "+(K-1)+" 0 R"),d!==null&&ie("/Encrypt "+Ui.oid+" 0 R"),ie("/ID [ <"+V+"> <"+V+"> ]"),ie(">>")},xi=p.__private__.putHeader=function(){ie("%PDF-"+y),ie("%ºß¬à")},du=p.__private__.putXRef=function(){var X="0000000000";ie("xref"),ie("0 "+(K+1)),ie("0000000000 65535 f ");for(var ue=1;ue<=K;ue++)typeof G[ue]=="function"?ie((X+G[ue]()).slice(-10)+" 00000 n "):G[ue]!==void 0?ie((X+G[ue]).slice(-10)+" 00000 n "):ie("0000000000 00000 n ")},wa=p.__private__.buildDocument=function(){var X;K=0,J=0,re=[],G=[],ae=[],Qr=Mt(),Rn=Mt(),we(re),pe.publish("buildDocument"),xi(),zo(),(function(){pe.publish("putAdditionalObjects");for(var _e=0;_e<ae.length;_e++){var Be=ae[_e];fr(Be.objId,!0),ie(Be.content),ie("endobj")}pe.publish("postPutAdditionalObjects")})(),X=[],(function(){for(var _e in Pt)Pt.hasOwnProperty(_e)&&(f===!1||f===!0&&h.hasOwnProperty(_e))&&$a(Pt[_e])})(),(function(){var _e;for(_e in gt)gt.hasOwnProperty(_e)&&Xn(gt[_e])})(),(function(){for(var _e in De)De.hasOwnProperty(_e)&&xa(De[_e])})(),(function(_e){var Be;for(Be in Se)Se.hasOwnProperty(Be)&&(Se[Be]instanceof Yp?zt(Se[Be]):Se[Be]instanceof Qg&&yr(Se[Be],_e))})(X),pe.publish("putResources"),X.forEach(Gr),Gr({resourcesOid:Rn,objectOid:Number.MAX_SAFE_INTEGER}),pe.publish("postPutResources"),d!==null&&(Ui.oid=Tt(),ie("<<"),ie("/Filter /Standard"),ie("/V "+Ui.v),ie("/R "+Ui.r),ie("/U <"+Ui.toHexString(Ui.U)+">"),ie("/O <"+Ui.toHexString(Ui.O)+">"),ie("/P "+Ui.P),ie(">>"),ie("endobj")),yi(),Ad();var ue=J;return du(),Tv(),ie("startxref"),ie(""+ue),ie("%%EOF"),we(le[$]),re.join(`
|
||
`)},el=p.__private__.getBlob=function(X){return new Blob([ke(X)],{type:"application/pdf"})},bc=function(X){for(;X.firstChild;)X.removeChild(X.firstChild)},Sa=function(X){var ue,_e=X.document,Be=_e.documentElement,Qe=_e.head,bt=_e.body;return Qe||(Qe=_e.createElement("head"),Be.appendChild(Qe)),bt||(bt=_e.createElement("body"),Be.appendChild(bt)),bc(Qe),bc(bt),(ue=_e.createElement("style")).appendChild(_e.createTextNode("html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}")),Qe.appendChild(ue),{document:_e,body:bt}},Td=p.output=p.__private__.output=(dt=function(X,ue){switch(typeof(ue=ue||{})=="string"?ue={filename:ue}:ue.filename=ue.filename||"generated.pdf",X){case void 0:return wa();case"save":p.save(ue.filename);break;case"arraybuffer":return ke(wa());case"blob":return el(wa());case"bloburi":case"bloburl":if(Er.URL!==void 0&&typeof Er.URL.createObjectURL=="function")return Er.URL&&Er.URL.createObjectURL(el(wa()))||void 0;Dn.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var _e="",Be=wa();try{_e=aW(Be)}catch{_e=aW(unescape(encodeURIComponent(Be)))}return"data:application/pdf;filename="+encodeURIComponent(ue.filename)+";base64,"+_e;case"pdfobjectnewwindow":if(Object.prototype.toString.call(Er)==="[object Window]"){var Qe="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",bt=!ue.pdfObjectUrl;bt||(Qe=ue.pdfObjectUrl);var It=Er.open();if(It!==null){var tr=Sa(It),Kt=tr.document.createElement("script"),_r=this;Kt.src=Qe,bt&&(Kt.integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==",Kt.crossOrigin="anonymous"),Kt.onload=function(){It.PDFObject.embed(_r.output("dataurlstring"),ue)},tr.body.appendChild(Kt)}return It}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(Er)==="[object Window]"){var Tr=ue.pdfJsUrl||"examples/PDF.js/web/viewer.html",Kr=Er.open();if(Kr!==null){var bi=Sa(Kr),jn=bi.document.createElement("iframe"),dn=Tr.indexOf("?")===-1?"?":"&";_r=this,jn.id="pdfViewer",jn.width="500px",jn.height="400px",jn.src=Tr+dn+"file=&downloadName="+encodeURIComponent(ue.filename),jn.onload=function(){Kr.document.title=ue.filename,jn.contentWindow.PDFViewerApplication.open(_r.output("bloburl"))},bi.body.appendChild(jn)}return Kr}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(Er)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var Fn=Er.open();if(Fn!==null){var Zn=Sa(Fn),Jn=Zn.document.createElement("iframe");Jn.src=this.output("datauristring",ue),Zn.body.appendChild(Jn),Fn.document.title=ue.filename}if(Fn||typeof safari>"u")return Fn;break;case"datauri":case"dataurl":return Er.document.location.href=this.output("datauristring",ue);default:return null}},dt.foo=function(){try{return dt.apply(this,arguments)}catch(_e){var X=_e.stack||"";~X.indexOf(" at ")&&(X=X.split(" at ")[1]);var ue="Error in function "+X.split(`
|
||
`)[0].split("<")[0]+": "+_e.message;if(!Er.console)throw new Error(ue);Er.console.error(ue,_e),Er.alert&&alert(ue)}},dt.foo.bar=dt,dt.foo),xs=function(X){return Array.isArray(xe)===!0&&xe.indexOf(X)>-1};switch(n){case"pt":Ae=1;break;case"mm":Ae=72/25.4;break;case"cm":Ae=72/2.54;break;case"in":Ae=72;break;case"px":Ae=xs("px_scaling")==1?.75:96/72;break;case"pc":case"em":Ae=12;break;case"ex":Ae=6;break;default:if(typeof n!="number")throw new Error("Invalid unit: "+n);Ae=n}var Ui=null;B(),U();var Pd=p.__private__.getPageInfo=p.getPageInfo=function(X){if(isNaN(X)||X%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Ze[X].objId,pageNumber:X,pageContext:Ze[X]}},fu=p.__private__.getPageInfoByObjId=function(X){if(isNaN(X)||X%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var ue in Ze)if(Ze[ue].objId===X)break;return Pd(ue)},Pv=p.__private__.getCurrentPageInfo=p.getCurrentPageInfo=function(){return{objId:Ze[$].objId,pageNumber:$,pageContext:Ze[$]}};p.addPage=function(){return xc.apply(this,arguments),this},p.setPage=function(){return uu.apply(this,arguments),we.call(this,le[$]),this},p.insertPage=function(X){return this.addPage(),this.movePage($,X),this},p.movePage=function(X,ue){var _e,Be;if(X>ue){_e=le[X],Be=Ze[X];for(var Qe=X;Qe>ue;Qe--)le[Qe]=le[Qe-1],Ze[Qe]=Ze[Qe-1];le[ue]=_e,Ze[ue]=Be,this.setPage(ue)}else if(X<ue){_e=le[X],Be=Ze[X];for(var bt=X;bt<ue;bt++)le[bt]=le[bt+1],Ze[bt]=Ze[bt+1];le[ue]=_e,Ze[ue]=Be,this.setPage(ue)}return this},p.deletePage=function(){return Ed.apply(this,arguments),this},p.__private__.text=p.text=function(X,ue,_e,Be,Qe){var bt,It,tr,Kt,_r,Tr,Kr,bi,jn,dn=(Be=Be||{}).scope||this;if(typeof X=="number"&&typeof ue=="number"&&(typeof _e=="string"||Array.isArray(_e))){var Fn=_e;_e=ue,ue=X,X=Fn}if(arguments[3]instanceof Ke==0?(tr=arguments[4],Kt=arguments[5],On(Kr=arguments[3])==="object"&&Kr!==null||(typeof tr=="string"&&(Kt=tr,tr=null),typeof Kr=="string"&&(Kt=Kr,Kr=null),typeof Kr=="number"&&(tr=Kr,Kr=null),Be={flags:Kr,angle:tr,align:Kt})):(R("The transform parameter of text() with a Matrix value"),jn=Qe),isNaN(ue)||isNaN(_e)||X==null)throw new Error("Invalid arguments passed to jsPDF.text");if(X.length===0)return dn;var Zn,Jn="",bo=typeof Be.lineHeightFactor=="number"?Be.lineHeightFactor:Ss,_s=dn.internal.scaleFactor;function ep(kn){return kn=kn.split(" ").join(Array(Be.TabLen||9).join(" ")),yo(kn,Kr)}function xu(kn){for(var _n,ei=kn.concat(),Ri=[],zl=ei.length;zl--;)typeof(_n=ei.shift())=="string"?Ri.push(_n):Array.isArray(kn)&&(_n.length===1||_n[1]===void 0&&_n[2]===void 0)?Ri.push(_n[0]):Ri.push([_n[0],_n[1],_n[2]]);return Ri}function bu(kn,_n){var ei;if(typeof kn=="string")ei=_n(kn)[0];else if(Array.isArray(kn)){for(var Ri,zl,ll=kn.concat(),Ac=[],Tc=ll.length;Tc--;)typeof(Ri=ll.shift())=="string"?Ac.push(_n(Ri)[0]):Array.isArray(Ri)&&typeof Ri[0]=="string"&&(zl=_n(Ri[0],Ri[1],Ri[2]),Ac.push([zl[0],zl[1],zl[2]]));ei=Ac}return ei}var Ml=!1,wu=!0;if(typeof X=="string")Ml=!0;else if(Array.isArray(X)){var Ld=X.concat();It=[];for(var Fd,wo=Ld.length;wo--;)(typeof(Fd=Ld.shift())!="string"||Array.isArray(Fd)&&typeof Fd[0]!="string")&&(wu=!1);Ml=wu}if(Ml===!1)throw new Error('Type of text must be string or Array. "'+X+'" is not recognized.');typeof X=="string"&&(X=X.match(/[\r?\n]/)?X.split(/\r\n|\r|\n/g):[X]);var Su=fe/dn.internal.scaleFactor,ju=Su*(bo-1);switch(Be.baseline){case"bottom":_e-=ju;break;case"top":_e+=Su-ju;break;case"hanging":_e+=Su-2*ju;break;case"middle":_e+=Su/2-ju}if((Tr=Be.maxWidth||0)>0&&(typeof X=="string"?X=dn.splitTextToSize(X,Tr):Object.prototype.toString.call(X)==="[object Array]"&&(X=X.reduce(function(kn,_n){return kn.concat(dn.splitTextToSize(_n,Tr))},[]))),bt={text:X,x:ue,y:_e,options:Be,mutex:{pdfEscape:yo,activeFontKey:nt,fonts:Pt,activeFontSize:fe}},pe.publish("preProcessText",bt),X=bt.text,tr=(Be=bt.options).angle,jn instanceof Ke==0&&tr&&typeof tr=="number"){tr*=Math.PI/180,Be.rotationDirection===0&&(tr=-tr),S===k&&(tr=-tr);var tp=Math.cos(tr),Ya=Math.sin(tr);jn=new Ke(tp,Ya,-Ya,tp,0,0)}else tr&&tr instanceof Ke&&(jn=tr);S!==k||jn||(jn=Ve),(_r=Be.charSpace||Nd)!==void 0&&(Jn+=T(F(_r))+` Tc
|
||
`,this.setCharSpace(this.getCharSpace()||0)),(bi=Be.horizontalScale)!==void 0&&(Jn+=T(100*bi)+` Tz
|
||
`),Be.lang;var Ni=-1,Kh=Be.renderingMode!==void 0?Be.renderingMode:Be.stroke,ku=dn.internal.getCurrentPageInfo().pageContext;switch(Kh){case 0:case!1:case"fill":Ni=0;break;case 1:case!0:case"stroke":Ni=1;break;case 2:case"fillThenStroke":Ni=2;break;case 3:case"invisible":Ni=3;break;case 4:case"fillAndAddForClipping":Ni=4;break;case 5:case"strokeAndAddPathForClipping":Ni=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":Ni=6;break;case 7:case"addToPathForClipping":Ni=7}var rp=ku.usedRenderingMode!==void 0?ku.usedRenderingMode:-1;Ni!==-1?Jn+=Ni+` Tr
|
||
`:rp!==-1&&(Jn+=`0 Tr
|
||
`),Ni!==-1&&(ku.usedRenderingMode=Ni),Kt=Be.align||"left";var ja,_c=fe*bo,Md=dn.internal.pageSize.getWidth(),Cs=Pt[nt];_r=Be.charSpace||Nd,Tr=Be.maxWidth||0,Kr=Object.assign({autoencode:!0,noBOM:!0},Be.flags);var _u=[],np=function(kn){return dn.getStringUnitWidth(kn,{font:Cs,charSpace:_r,fontSize:fe,doKerning:!1})*fe/_s};if(Object.prototype.toString.call(X)==="[object Array]"){var qo;It=xu(X),Kt!=="left"&&(ja=It.map(np));var $o,Cu=0;if(Kt==="right"){ue-=ja[0],X=[],wo=It.length;for(var Ga=0;Ga<wo;Ga++)Ga===0?($o=nl(ue),qo=Ua(_e)):($o=F(Cu-ja[Ga]),qo=-_c),X.push([It[Ga],$o,qo]),Cu=ja[Ga]}else if(Kt==="center"){ue-=ja[0]/2,X=[],wo=It.length;for(var Ka=0;Ka<wo;Ka++)Ka===0?($o=nl(ue),qo=Ua(_e)):($o=F((Cu-ja[Ka])/2),qo=-_c),X.push([It[Ka],$o,qo]),Cu=ja[Ka]}else if(Kt==="left"){X=[],wo=It.length;for(var Dd=0;Dd<wo;Dd++)X.push(It[Dd])}else if(Kt==="justify"&&Cs.encoding==="Identity-H"){X=[],wo=It.length,Tr=Tr!==0?Tr:Md;for(var al=0,wi=0;wi<wo;wi++)if(qo=wi===0?Ua(_e):-_c,$o=wi===0?nl(ue):al,wi<wo-1){var Qh=F((Tr-ja[wi])/(It[wi].split(" ").length-1)),Qa=It[wi].split(" ");X.push([Qa[0]+" ",$o,qo]),al=0;for(var ka=1;ka<Qa.length;ka++){var Cc=(np(Qa[ka-1]+" "+Qa[ka])-np(Qa[ka]))*_s+Qh;ka==Qa.length-1?X.push([Qa[ka],Cc,0]):X.push([Qa[ka]+" ",Cc,0]),al-=Cc}}else X.push([It[wi],$o,qo]);X.push(["",al,0])}else{if(Kt!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(X=[],wo=It.length,Tr=Tr!==0?Tr:Md,wi=0;wi<wo;wi++){qo=wi===0?Ua(_e):-_c,$o=wi===0?nl(ue):0;var zd=It[wi].split(" ").length-1,Bd=zd>0?(Tr-ja[wi])/zd:0;wi<wo-1?_u.push(T(F(Bd))):_u.push(0),X.push([It[wi],$o,qo])}}}(typeof Be.R2L=="boolean"?Be.R2L:je)===!0&&(X=bu(X,function(kn,_n,ei){return[kn.split("").reverse().join(""),_n,ei]})),bt={text:X,x:ue,y:_e,options:Be,mutex:{pdfEscape:yo,activeFontKey:nt,fonts:Pt,activeFontSize:fe}},pe.publish("postProcessText",bt),X=bt.text,Zn=bt.mutex.isHex||!1;var Wd=Pt[nt].encoding;Wd!=="WinAnsiEncoding"&&Wd!=="StandardEncoding"||(X=bu(X,function(kn,_n,ei){return[ep(kn),_n,ei]})),It=xu(X),X=[];for(var Eu,Au,Ec,Dl=Array.isArray(It[0])?1:0,Hi="",sl=function(kn,_n,ei){var Ri="";return ei instanceof Ke?(ei=typeof Be.angle=="number"?Fe(ei,new Ke(1,0,0,1,kn,_n)):Fe(new Ke(1,0,0,1,kn,_n),ei),S===k&&(ei=Fe(new Ke(1,0,0,-1,0,0),ei)),Ri=ei.join(" ")+` Tm
|
||
`):Ri=T(kn)+" "+T(_n)+` Td
|
||
`,Ri},no=0;no<It.length;no++){switch(Hi="",Dl){case 1:Ec=(Zn?"<":"(")+It[no][0]+(Zn?">":")"),Eu=parseFloat(It[no][1]),Au=parseFloat(It[no][2]);break;case 0:Ec=(Zn?"<":"(")+It[no]+(Zn?">":")"),Eu=nl(ue),Au=Ua(_e)}_u!==void 0&&_u[no]!==void 0&&(Hi=_u[no]+` Tw
|
||
`),no===0?X.push(Hi+sl(Eu,Au,jn)+Ec):Dl===0?X.push(Hi+Ec):Dl===1&&X.push(Hi+sl(Eu,Au,jn)+Ec)}X=Dl===0?X.join(` Tj
|
||
T* `):X.join(` Tj
|
||
`),X+=` Tj
|
||
`;var Es=`BT
|
||
/`;return Es+=nt+" "+fe+` Tf
|
||
`,Es+=T(fe*bo)+` TL
|
||
`,Es+=Wo+`
|
||
`,Es+=Jn,Es+=X,ie(Es+="ET"),h[nt]=!0,dn};var Xf=p.__private__.clip=p.clip=function(X){return ie(X==="evenodd"?"W*":"W"),this};p.clipEvenOdd=function(){return Xf("evenodd")},p.__private__.discardPath=p.discardPath=function(){return ie("n"),this};var Fr=p.__private__.isValidStyle=function(X){var ue=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(X)!==-1&&(ue=!0),ue};p.__private__.setDefaultPathOperation=p.setDefaultPathOperation=function(X){return Fr(X)&&(u=X),this};var Zf=p.__private__.getStyle=p.getStyle=function(X){var ue=u;switch(X){case"D":case"S":ue="S";break;case"F":ue="f";break;case"FD":case"DF":ue="B";break;case"f":case"f*":case"B":case"B*":ue=X}return ue},pu=p.close=function(){return ie("h"),this};p.stroke=function(){return ie("S"),this},p.fill=function(X){return wc("f",X),this},p.fillEvenOdd=function(X){return wc("f*",X),this},p.fillStroke=function(X){return wc("B",X),this},p.fillStrokeEvenOdd=function(X){return wc("B*",X),this};var wc=function(X,ue){On(ue)==="object"?Hh(ue,X):ie(X)},Od=function(X){X===null||S===k&&X===void 0||(X=Zf(X),ie(X))};function Uh(X,ue,_e,Be,Qe){var bt=new Qg(ue||this.boundingBox,_e||this.xStep,Be||this.yStep,this.gState,Qe||this.matrix);bt.stream=this.stream;var It=X+"$$"+this.cloneIndex+++"$$";return xt(It,bt),bt}var Hh=function(X,ue){var _e=ct[X.key],Be=Se[_e];if(Be instanceof Yp)ie("q"),ie(Jf(ue)),Be.gState&&p.setGState(Be.gState),ie(X.matrix.toString()+" cm"),ie("/"+_e+" sh"),ie("Q");else if(Be instanceof Qg){var Qe=new Ke(1,0,0,-1,0,ks());X.matrix&&(Qe=Qe.multiply(X.matrix||Ve),_e=Uh.call(Be,X.key,X.boundingBox,X.xStep,X.yStep,Qe).id),ie("q"),ie("/Pattern cs"),ie("/"+_e+" scn"),Be.gState&&p.setGState(Be.gState),ie(ue),ie("Q")}},Jf=function(X){switch(X){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},bs=p.moveTo=function(X,ue){return ie(T(F(X))+" "+T(L(ue))+" m"),this},ws=p.lineTo=function(X,ue){return ie(T(F(X))+" "+T(L(ue))+" l"),this},Bo=p.curveTo=function(X,ue,_e,Be,Qe,bt){return ie([T(F(X)),T(L(ue)),T(F(_e)),T(L(Be)),T(F(Qe)),T(L(bt)),"c"].join(" ")),this};p.__private__.line=p.line=function(X,ue,_e,Be,Qe){if(isNaN(X)||isNaN(ue)||isNaN(_e)||isNaN(Be)||!Fr(Qe))throw new Error("Invalid arguments passed to jsPDF.line");return S===w?this.lines([[_e-X,Be-ue]],X,ue,[1,1],Qe||"S"):this.lines([[_e-X,Be-ue]],X,ue,[1,1]).stroke()},p.__private__.lines=p.lines=function(X,ue,_e,Be,Qe,bt){var It,tr,Kt,_r,Tr,Kr,bi,jn,dn,Fn,Zn,Jn;if(typeof X=="number"&&(Jn=_e,_e=ue,ue=X,X=Jn),Be=Be||[1,1],bt=bt||!1,isNaN(ue)||isNaN(_e)||!Array.isArray(X)||!Array.isArray(Be)||!Fr(Qe)||typeof bt!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(bs(ue,_e),It=Be[0],tr=Be[1],_r=X.length,Fn=ue,Zn=_e,Kt=0;Kt<_r;Kt++)(Tr=X[Kt]).length===2?(Fn=Tr[0]*It+Fn,Zn=Tr[1]*tr+Zn,ws(Fn,Zn)):(Kr=Tr[0]*It+Fn,bi=Tr[1]*tr+Zn,jn=Tr[2]*It+Fn,dn=Tr[3]*tr+Zn,Fn=Tr[4]*It+Fn,Zn=Tr[5]*tr+Zn,Bo(Kr,bi,jn,dn,Fn,Zn));return bt&&pu(),Od(Qe),this},p.path=function(X){for(var ue=0;ue<X.length;ue++){var _e=X[ue],Be=_e.c;switch(_e.op){case"m":bs(Be[0],Be[1]);break;case"l":ws(Be[0],Be[1]);break;case"c":Bo.apply(this,Be);break;case"h":pu()}}return this},p.__private__.rect=p.rect=function(X,ue,_e,Be,Qe){if(isNaN(X)||isNaN(ue)||isNaN(_e)||isNaN(Be)||!Fr(Qe))throw new Error("Invalid arguments passed to jsPDF.rect");return S===w&&(Be=-Be),ie([T(F(X)),T(L(ue)),T(F(_e)),T(F(Be)),"re"].join(" ")),Od(Qe),this},p.__private__.triangle=p.triangle=function(X,ue,_e,Be,Qe,bt,It){if(isNaN(X)||isNaN(ue)||isNaN(_e)||isNaN(Be)||isNaN(Qe)||isNaN(bt)||!Fr(It))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[_e-X,Be-ue],[Qe-_e,bt-Be],[X-Qe,ue-bt]],X,ue,[1,1],It,!0),this},p.__private__.roundedRect=p.roundedRect=function(X,ue,_e,Be,Qe,bt,It){if(isNaN(X)||isNaN(ue)||isNaN(_e)||isNaN(Be)||isNaN(Qe)||isNaN(bt)||!Fr(It))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var tr=4/3*(Math.SQRT2-1);return Qe=Math.min(Qe,.5*_e),bt=Math.min(bt,.5*Be),this.lines([[_e-2*Qe,0],[Qe*tr,0,Qe,bt-bt*tr,Qe,bt],[0,Be-2*bt],[0,bt*tr,-Qe*tr,bt,-Qe,bt],[2*Qe-_e,0],[-Qe*tr,0,-Qe,-bt*tr,-Qe,-bt],[0,2*bt-Be],[0,-bt*tr,Qe*tr,-bt,Qe,-bt]],X+Qe,ue,[1,1],It,!0),this},p.__private__.ellipse=p.ellipse=function(X,ue,_e,Be,Qe){if(isNaN(X)||isNaN(ue)||isNaN(_e)||isNaN(Be)||!Fr(Qe))throw new Error("Invalid arguments passed to jsPDF.ellipse");var bt=4/3*(Math.SQRT2-1)*_e,It=4/3*(Math.SQRT2-1)*Be;return bs(X+_e,ue),Bo(X+_e,ue-It,X+bt,ue-Be,X,ue-Be),Bo(X-bt,ue-Be,X-_e,ue-It,X-_e,ue),Bo(X-_e,ue+It,X-bt,ue+Be,X,ue+Be),Bo(X+bt,ue+Be,X+_e,ue+It,X+_e,ue),Od(Qe),this},p.__private__.circle=p.circle=function(X,ue,_e,Be){if(isNaN(X)||isNaN(ue)||isNaN(_e)||!Fr(Be))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(X,ue,_e,_e,Be)},p.setFont=function(X,ue,_e){return _e&&(ue=O(ue,_e)),nt=$h(X,ue,{disableWarning:!1}),this};var tl=p.__private__.getFont=p.getFont=function(){return Pt[$h.apply(p,arguments)]};p.__private__.getFontList=p.getFontList=function(){var X,ue,_e={};for(X in At)if(At.hasOwnProperty(X))for(ue in _e[X]=[],At[X])At[X].hasOwnProperty(ue)&&_e[X].push(ue);return _e},p.addFont=function(X,ue,_e,Be,Qe){var bt=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&bt.indexOf(arguments[3])!==-1?Qe=arguments[3]:arguments[3]&&bt.indexOf(arguments[3])==-1&&(_e=O(_e,Be)),$i.call(this,X,ue,_e,Qe=Qe||"Identity-H")};var Ss,pr=e.lineWidth||.200025,rl=p.__private__.getLineWidth=p.getLineWidth=function(){return pr},Ov=p.__private__.setLineWidth=p.setLineWidth=function(X){return pr=X,ie(T(F(X))+" w"),this};p.__private__.setLineDash=dr.API.setLineDash=dr.API.setLineDashPattern=function(X,ue){if(X=X||[],ue=ue||0,isNaN(ue)||!Array.isArray(X))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return X=X.map(function(_e){return T(F(_e))}).join(" "),ue=T(F(ue)),ie("["+X+"] "+ue+" d"),this};var Vh=p.__private__.getLineHeight=p.getLineHeight=function(){return fe*Ss};p.__private__.getLineHeight=p.getLineHeight=function(){return fe*Ss};var hu=p.__private__.setLineHeightFactor=p.setLineHeightFactor=function(X){return typeof(X=X||1.15)=="number"&&(Ss=X),this},Iv=p.__private__.getLineHeightFactor=p.getLineHeightFactor=function(){return Ss};hu(e.lineHeight);var nl=p.__private__.getHorizontalCoordinate=function(X){return F(X)},Ua=p.__private__.getVerticalCoordinate=function(X){return S===k?X:Ze[$].mediaBox.topRightY-Ze[$].mediaBox.bottomLeftY-F(X)},Yh=p.__private__.getHorizontalCoordinateString=p.getHorizontalCoordinateString=function(X){return T(nl(X))},Nv=p.__private__.getVerticalCoordinateString=p.getVerticalCoordinateString=function(X){return T(Ua(X))},il=e.strokeColor||"0 G";p.__private__.getStrokeColor=p.getDrawColor=function(){return to(il)},p.__private__.setStrokeColor=p.setDrawColor=function(X,ue,_e,Be){return il=Ln({ch1:X,ch2:ue,ch3:_e,ch4:Be,pdfColorType:"draw",precision:2}),ie(il),this};var Ll=e.fillColor||"0 g";p.__private__.getFillColor=p.getFillColor=function(){return to(Ll)},p.__private__.setFillColor=p.setFillColor=function(X,ue,_e,Be){return Ll=Ln({ch1:X,ch2:ue,ch3:_e,ch4:Be,pdfColorType:"fill",precision:2}),ie(Ll),this};var Wo=e.textColor||"0 g",Id=p.__private__.getTextColor=p.getTextColor=function(){return to(Wo)};p.__private__.setTextColor=p.setTextColor=function(X,ue,_e,Be){return Wo=Ln({ch1:X,ch2:ue,ch3:_e,ch4:Be,pdfColorType:"text",precision:3}),this};var Nd=e.charSpace,Rv=p.__private__.getCharSpace=p.getCharSpace=function(){return parseFloat(Nd||0)};p.__private__.setCharSpace=p.setCharSpace=function(X){if(isNaN(X))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Nd=X,this};var gu=0;p.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},p.__private__.setLineCap=p.setLineCap=function(X){var ue=p.CapJoinStyles[X];if(ue===void 0)throw new Error("Line cap style of '"+X+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return gu=ue,ie(ue+" J"),this};var js=0;p.__private__.setLineJoin=p.setLineJoin=function(X){var ue=p.CapJoinStyles[X];if(ue===void 0)throw new Error("Line join style of '"+X+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return js=ue,ie(ue+" j"),this},p.__private__.setLineMiterLimit=p.__private__.setMiterLimit=p.setLineMiterLimit=p.setMiterLimit=function(X){if(X=X||0,isNaN(X))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return ie(T(F(X))+" M"),this},p.GState=ww,p.setGState=function(X){(X=typeof X=="string"?gt[We[X]]:mu(null,X)).equals(Pe)||(ie("/"+X.id+" gs"),Pe=X)};var mu=function(X,ue){if(!X||!We[X]){var _e=!1;for(var Be in gt)if(gt.hasOwnProperty(Be)&>[Be].equals(ue)){_e=!0;break}if(_e)ue=gt[Be];else{var Qe="GS"+(Object.keys(gt).length+1).toString(10);gt[Qe]=ue,ue.id=Qe}return X&&(We[X]=ue.id),pe.publish("addGState",ue),ue}};p.addGState=function(X,ue){return mu(X,ue),this},p.saveGraphicsState=function(){return ie("q"),Ht.push({key:nt,size:fe,color:Wo}),this},p.restoreGraphicsState=function(){ie("Q");var X=Ht.pop();return nt=X.key,fe=X.size,Wo=X.color,Pe=null,this},p.setCurrentTransformationMatrix=function(X){return ie(X.toString()+" cm"),this},p.comment=function(X){return ie("#"+X),this};var Sc=function(X,ue){var _e=X||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return _e},set:function(bt){isNaN(bt)||(_e=parseFloat(bt))}});var Be=ue||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return Be},set:function(bt){isNaN(bt)||(Be=parseFloat(bt))}});var Qe="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return Qe},set:function(bt){Qe=bt.toString()}}),this},Ha=function(X,ue,_e,Be){Sc.call(this,X,ue),this.type="rect";var Qe=_e||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return Qe},set:function(It){isNaN(It)||(Qe=parseFloat(It))}});var bt=Be||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return bt},set:function(It){isNaN(It)||(bt=parseFloat(It))}}),this},jc=function(){this.page=rt,this.currentPage=$,this.pages=le.slice(0),this.pagesContext=Ze.slice(0),this.x=Te,this.y=wt,this.matrix=ft,this.width=yu($),this.height=ol($),this.outputDestination=Oe,this.id="",this.objectNumber=-1};jc.prototype.restore=function(){rt=this.page,$=this.currentPage,Ze=this.pagesContext,le=this.pages,Te=this.x,wt=this.y,ft=this.matrix,Va($,this.width),xo($,this.height),Oe=this.outputDestination};var kc=function(X,ue,_e,Be,Qe){Le.push(new jc),rt=$=0,le=[],Te=X,wt=ue,ft=Qe,oi([_e,Be])};for(var vu in p.beginFormObject=function(X,ue,_e,Be,Qe){return kc(X,ue,_e,Be,Qe),this},p.endFormObject=function(X){return(function(ue){if(tt[ue])Le.pop().restore();else{var _e=new jc,Be="Xo"+(Object.keys(De).length+1).toString(10);_e.id=Be,tt[ue]=Be,De[Be]=_e,pe.publish("addFormObject",_e),Le.pop().restore()}})(X),this},p.doFormObject=function(X,ue){var _e=De[tt[X]];return ie("q"),ie(ue.toString()+" cm"),ie("/"+_e.id+" Do"),ie("Q"),this},p.getFormObject=function(X){var ue=De[tt[X]];return{x:ue.x,y:ue.y,width:ue.width,height:ue.height,matrix:ue.matrix}},p.save=function(X,ue){return X=X||"generated.pdf",(ue=ue||{}).returnPromise=ue.returnPromise||!1,ue.returnPromise===!1?(Up(el(wa()),X),typeof Up.unload=="function"&&Er.setTimeout&&setTimeout(Up.unload,911),this):new Promise(function(_e,Be){try{var Qe=Up(el(wa()),X);typeof Up.unload=="function"&&Er.setTimeout&&setTimeout(Up.unload,911),_e(Qe)}catch(bt){Be(bt.message)}})},dr.API)dr.API.hasOwnProperty(vu)&&(vu==="events"&&dr.API.events.length?(function(X,ue){var _e,Be,Qe;for(Qe=ue.length-1;Qe!==-1;Qe--)_e=ue[Qe][0],Be=ue[Qe][1],X.subscribe.apply(X,[_e].concat(typeof Be=="function"?[Be]:Be))})(pe,dr.API.events):p[vu]=dr.API[vu]);function yu(X){return Ze[X].mediaBox.topRightX-Ze[X].mediaBox.bottomLeftX}function Va(X,ue){Ze[X].mediaBox.topRightX=ue+Ze[X].mediaBox.bottomLeftX}function ol(X){return Ze[X].mediaBox.topRightY-Ze[X].mediaBox.bottomLeftY}function xo(X,ue){Ze[X].mediaBox.topRightY=ue+Ze[X].mediaBox.bottomLeftY}var Fl=p.getPageWidth=function(X){return yu(X=X||$)/Ae},Rd=p.setPageWidth=function(X,ue){Va(X,ue*Ae)},ks=p.getPageHeight=function(X){return ol(X=X||$)/Ae},Gh=p.setPageHeight=function(X,ue){xo(X,ue*Ae)};return p.internal={pdfEscape:yo,getStyle:Zf,getFont:tl,getFontSize:ce,getCharSpace:Rv,getTextColor:Id,getLineHeight:Vh,getLineHeightFactor:Iv,getLineWidth:rl,write:Me,getHorizontalCoordinate:nl,getVerticalCoordinate:Ua,getCoordinateString:Yh,getVerticalCoordinateString:Nv,collections:{},newObject:Tt,newAdditionalObject:hr,newObjectDeferred:Mt,newObjectDeferredBegin:fr,getFilters:vo,putStream:ro,events:pe,scaleFactor:Ae,pageSize:{getWidth:function(){return Fl($)},setWidth:function(X){Rd($,X)},getHeight:function(){return ks($)},setHeight:function(X){Gh($,X)}},encryptionOptions:d,encryption:Ui,getEncryptor:function(X){return d!==null?Ui.encryptor(X,0):function(ue){return ue}},output:Td,getNumberOfPages:ba,get pages(){return le},out:ie,f2:E,f3:A,getPageInfo:Pd,getPageInfoByObjId:fu,getCurrentPageInfo:Pv,getPDFVersion:m,Point:Sc,Rectangle:Ha,Matrix:Ke,hasHotfix:xs},Object.defineProperty(p.internal.pageSize,"width",{get:function(){return Fl($)},set:function(X){Rd($,X)},enumerable:!0,configurable:!0}),Object.defineProperty(p.internal.pageSize,"height",{get:function(){return ks($)},set:function(X){Gh($,X)},enumerable:!0,configurable:!0}),(function(X){for(var ue=0,_e=se.length;ue<_e;ue++){var Be=$i.call(this,X[ue][0],X[ue][1],X[ue][2],se[ue][3],!0);f===!1&&(h[Be]=!0);var Qe=X[ue][0].split("-");Ut({id:Be,fontName:Qe[0],fontStyle:Qe[1]||""})}pe.publish("addFonts",{fonts:Pt,dictionary:At})}).call(p,se),nt="F1",xc(o,r),pe.publish("initialized"),p}Dg.prototype.lsbFirstWord=function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)},Dg.prototype.toHexString=function(e){return e.split("").map(function(t){return("0"+(255&t.charCodeAt(0)).toString(16)).slice(-2)}).join("")},Dg.prototype.hexToBytes=function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(String.fromCharCode(parseInt(e.substr(r,2),16)));return t.join("")},Dg.prototype.processOwnerPassword=function(e,t){return v6(m6(t).substr(0,5),e)},Dg.prototype.encryptor=function(e,t){var r=m6(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(n){return v6(r,n)}},ww.prototype.equals=function(e){var t,r="id,objectNumber,equals";if(!e||On(e)!==On(this))return!1;var n=0;for(t in this)if(!(r.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t)||this[t]!==e[t])return!1;n++}for(t in e)e.hasOwnProperty(t)&&r.indexOf(t)<0&&n--;return n===0},dr.API={events:[]},dr.version="4.2.1";var Ci=dr.API,T8=1,Bh=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Ng=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Eh=function(e){return e.toString().replace(/#/g,"#23").replace(/[\s\n\r()<>[\]{}\/%]/g,function(t){var r=t.charCodeAt(0).toString(16).toUpperCase();return"#"+(r.length===1?"0"+r:r)})},Ir=function(e){return e.toFixed(2)},gf=function(e){return e.toFixed(5)};Ci.__acroform__={};var vs=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},uW=function(e){return e*T8},Bc=function(e){var t=new _X,r=or.internal.getHeight(e)||0,n=or.internal.getWidth(e)||0;return t.BBox=[0,0,Number(Ir(n)),Number(Ir(r))],t},SOe=Ci.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|1<<t},jOe=Ci.__acroform__.clearBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&~(1<<t)},kOe=Ci.__acroform__.getBit=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return e&1<<t?1:0},Di=Ci.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return kOe(e,t-1)},zi=Ci.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return SOe(e,t-1)},Bi=Ci.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return jOe(e,t-1)},_Oe=Ci.__acroform__.calculateCoordinates=function(e,t){var r=t.internal.getHorizontalCoordinate,n=t.internal.getVerticalCoordinate,o=e[0],a=e[1],s=e[2],l=e[3],c={};return c.lowerLeft_X=r(o)||0,c.lowerLeft_Y=n(a+l)||0,c.upperRight_X=r(o+s)||0,c.upperRight_Y=n(a)||0,[Number(Ir(c.lowerLeft_X)),Number(Ir(c.lowerLeft_Y)),Number(Ir(c.upperRight_X)),Number(Ir(c.upperRight_Y))]},COe=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],r=e._V||e.DV,n=y6(e,r),o=e.scope.internal.getFont(e.fontName,e.fontStyle).id;t.push("/Tx BMC"),t.push("q"),t.push("BT"),t.push(e.scope.__private__.encodeColorString(e.color)),t.push("/"+o+" "+Ir(n.fontSize)+" Tf"),t.push("1 0 0 1 0 0 Tm"),t.push(n.text),t.push("ET"),t.push("Q"),t.push("EMC");var a=Bc(e);return a.scope=e.scope,a.stream=t.join(`
|
||
`),a}},y6=function(e,t){var r=e.fontSize===0?e.maxFontSize:e.fontSize,n={text:"",fontSize:""},o=(t=(t=t.substr(0,1)=="("?t.substr(1):t).substr(t.length-1)==")"?t.substr(0,t.length-1):t).split(" ");o=e.multiline?o.map(function(E){return E.split(`
|
||
`)}):o.map(function(E){return[E]});var a=r,s=or.internal.getHeight(e)||0;s=s<0?-s:s;var l=or.internal.getWidth(e)||0;l=l<0?-l:l;var c=function(E,A,F){if(E+1<o.length){var L=A+" "+o[E+1][0];return c0(L,e,F).width<=l-4}return!1};a++;e:for(;a>0;){t="",a--;var u,d,f=c0("3",e,a).height,h=e.multiline?s-a:(s-f)/2,p=h+=2,y=0,m=0,x=0;if(a<=0){t=`(...) Tj
|
||
`,t+="% Width of Text: "+c0(t,e,a=12).width+", FieldWidth:"+l+`
|
||
`;break}for(var b="",w=0,k=0;k<o.length;k++)if(o.hasOwnProperty(k)){var S=!1;if(o[k].length!==1&&x!==o[k].length-1){if((f+2)*(w+2)+2>s)continue e;b+=o[k][x],S=!0,m=k,k--}else{b=(b+=o[k][x]+" ").substr(b.length-1)==" "?b.substr(0,b.length-1):b;var _=parseInt(k),P=c(_,b,a),O=k>=o.length-1;if(P&&!O){b+=" ",x=0;continue}if(P||O){if(O)m=_;else if(e.multiline&&(f+2)*(w+2)+2>s)continue e}else{if(!e.multiline||(f+2)*(w+2)+2>s)continue e;m=_}}for(var T="",R=y;R<=m;R++){var I=o[R];if(e.multiline){if(R===m){T+=I[x]+" ",x=(x+1)%I.length;continue}if(R===y){T+=I[I.length-1]+" ";continue}}T+=I[0]+" "}switch(T=T.substr(T.length-1)==" "?T.substr(0,T.length-1):T,d=c0(T,e,a).width,e.textAlign){case"right":u=l-d-2;break;case"center":u=(l-d)/2;break;default:u=2}t+=Ir(u)+" "+Ir(p)+` Td
|
||
`,t+="("+Bh(T)+`) Tj
|
||
`,t+=-Ir(u)+` 0 Td
|
||
`,p=-(a+2),d=0,y=S?m:m+1,w++,b=""}break}return n.text=t,n.fontSize=a,n},c0=function(e,t,r){var n=t.scope.internal.getFont(t.fontName,t.fontStyle),o=t.scope.getStringUnitWidth(e,{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r);return{height:t.scope.getStringUnitWidth("3",{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r)*1.5,width:o}},EOe={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},AOe=function(e,t){var r={type:"reference",object:e};t.internal.getPageInfo(e.page).pageContext.annotations.find(function(n){return n.type===r.type&&n.object===r.object})===void 0&&t.internal.getPageInfo(e.page).pageContext.annotations.push(r)},TOe=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(vc.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(EOe)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");T8=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new CX,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){(function(r){r.internal.events.unsubscribe(r.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete r.internal.acroformPlugin.acroFormDictionaryRoot._eventID,r.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe("buildDocument",function(){(function(r){r.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var n=r.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];a.objId=void 0,a.hasAnnotation&&AOe(a,r)}})(e)}),e.internal.events.subscribe("putCatalog",function(){(function(r){if(r.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");r.internal.write("/AcroForm "+r.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(e)}),e.internal.events.subscribe("postPutPages",function(r){(function(n,o){var a=!n;for(var s in n||(o.internal.newObjectDeferredBegin(o.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),o.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),n=n||o.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(n.hasOwnProperty(s)){var l=n[s],c=[],u=l.Rect;if(l.Rect&&(l.Rect=_Oe(l.Rect,o)),o.internal.newObjectDeferredBegin(l.objId,!0),l.DA=or.createDefaultAppearanceStream(l),On(l)==="object"&&typeof l.getKeyValueListForStream=="function"&&(c=l.getKeyValueListForStream()),l.Rect=u,l.hasAppearanceStream&&!l.appearanceStreamContent){var d=COe(l);c.push({key:"AP",value:"<</N "+d+">>"}),o.internal.acroformPlugin.xForms.push(d)}if(l.appearanceStreamContent){var f="";for(var h in l.appearanceStreamContent)if(l.appearanceStreamContent.hasOwnProperty(h)){var p=l.appearanceStreamContent[h];if(f+="/"+h+" ",f+="<<",Object.keys(p).length>=1||Array.isArray(p)){for(var s in p)if(p.hasOwnProperty(s)){var y=p[s];typeof y=="function"&&(y=y.call(o,l)),f+="/"+s+" "+y+" ",o.internal.acroformPlugin.xForms.indexOf(y)>=0||o.internal.acroformPlugin.xForms.push(y)}}else typeof(y=p)=="function"&&(y=y.call(o,l)),f+="/"+s+" "+y,o.internal.acroformPlugin.xForms.indexOf(y)>=0||o.internal.acroformPlugin.xForms.push(y);f+=">>"}c.push({key:"AP",value:`<<
|
||
`+f+">>"})}o.internal.putStream({additionalKeyValues:c,objectId:l.objId}),o.internal.out("endobj")}a&&(function(m,x){for(var b in m)if(m.hasOwnProperty(b)){var w=b,k=m[b];x.internal.newObjectDeferredBegin(k.objId,!0),On(k)==="object"&&typeof k.putStream=="function"&&k.putStream(),delete m[w]}})(o.internal.acroformPlugin.xForms,o)})(r,e)}),e.internal.acroformPlugin.isInitialized=!0}},kX=Ci.__acroform__.arrayToPdfArray=function(e,t,r){var n=function(s){return s};if(Array.isArray(e)){for(var o="[",a=0;a<e.length;a++)switch(a!==0&&(o+=" "),On(e[a])){case"boolean":case"number":case"object":o+=e[a].toString();break;case"string":e[a].substr(0,1)==="/"?o+="/"+Eh(e[a].substr(1)):(t!==void 0&&r&&(n=r.internal.getEncryptor(t)),o+="("+Bh(n(e[a].toString()))+")")}return o+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},A3=function(e,t,r){var n=function(o){return o};return t!==void 0&&r&&(n=r.internal.getEncryptor(t)),(e=e||"").toString(),"("+Bh(n(e))+")"},Kc=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};Kc.prototype.toString=function(){return this.objId+" 0 R"},Kc.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},Kc.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(a){return a!="content"&&a!="appearanceStreamContent"&&a!="scope"&&a!="objId"&&a.substring(0,1)!="_"});for(var r in t)if(Object.getOwnPropertyDescriptor(this,t[r]).configurable===!1){var n=t[r],o=this[n];o&&(Array.isArray(o)?e.push({key:n,value:kX(o,this.objId,this.scope)}):o instanceof Kc?(o.scope=this.scope,e.push({key:n,value:o.objId+" 0 R"})):typeof o!="function"&&e.push({key:n,value:o}))}return e};var _X=function(){Kc.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(r){t=r}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(r){e=r.trim()},get:function(){return e||null}})};vs(_X,Kc);var CX=function(){Kc.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var r=function(n){return n};return this.scope&&(r=this.scope.internal.getEncryptor(this.objId)),"("+Bh(r(e))+")"}},set:function(r){e=r}})};vs(CX,Kc);var vc=function e(){Kc.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(b){if(isNaN(b))throw new Error('Invalid value "'+b+'" for attribute F supplied.');t=b}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Di(t,3)},set:function(b){b?this.F=zi(t,3):this.F=Bi(t,3)}});var r=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return r},set:function(b){if(isNaN(b))throw new Error('Invalid value "'+b+'" for attribute Ff supplied.');r=b}});var n=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(n.length!==0)return n},set:function(b){n=b!==void 0?b:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:n[0]},set:function(b){n[0]=b}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:n[1]},set:function(b){n[1]=b}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:n[2]},set:function(b){n[2]=b}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:n[3]},set:function(b){n[3]=b}});var o="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return o},set:function(b){switch(b){case"/Btn":case"/Tx":case"/Ch":case"/Sig":o=b;break;default:throw new Error('Invalid value "'+b+'" for attribute FT supplied.')}}});var a=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!a||a.length<1){if(this instanceof Sw)return;a="FieldObject"+e.FieldNum++}var b=function(w){return w};return this.scope&&(b=this.scope.internal.getEncryptor(this.objId)),"("+Bh(b(a))+")"},set:function(b){a=b.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return a},set:function(b){a=b}});var s="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return s},set:function(b){s=b}});var l="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return l},set:function(b){l=b}});var c=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return c},set:function(b){c=b}});var u=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return u===void 0?50/T8:u},set:function(b){u=b}});var d="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return d},set:function(b){d=b}});var f="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!f||this instanceof Sw||this instanceof ah))return A3(f,this.objId,this.scope)},set:function(b){b=b.toString(),f=b}});var h=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(h)return this instanceof Lo==0?A3(h,this.objId,this.scope):h},set:function(b){b=b.toString(),h=this instanceof Lo==0?b.substr(0,1)==="("?Ng(b.substr(1,b.length-2)):Ng(b):b}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Lo==1?Ng(h.substr(1,h.length-1)):h},set:function(b){b=b.toString(),h=this instanceof Lo==1?"/"+Eh(b):b}});var p=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(p)return p},set:function(b){this.V=b}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(p)return this instanceof Lo==0?A3(p,this.objId,this.scope):p},set:function(b){b=b.toString(),p=this instanceof Lo==0?b.substr(0,1)==="("?Ng(b.substr(1,b.length-2)):Ng(b):b}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Lo==1?Ng(p.substr(1,p.length-1)):p},set:function(b){b=b.toString(),p=this instanceof Lo==1?"/"+Eh(b):b}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var y,m=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return m},set:function(b){b=!!b,m=b}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(y)return y},set:function(b){y=b}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,1)},set:function(b){b?this.Ff=zi(this.Ff,1):this.Ff=Bi(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,2)},set:function(b){b?this.Ff=zi(this.Ff,2):this.Ff=Bi(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,3)},set:function(b){b?this.Ff=zi(this.Ff,3):this.Ff=Bi(this.Ff,3)}});var x=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(x!==null)return x},set:function(b){if([0,1,2].indexOf(b)===-1)throw new Error('Invalid value "'+b+'" for attribute Q supplied.');x=b}}),Object.defineProperty(this,"textAlign",{get:function(){var b;switch(x){case 0:default:b="left";break;case 1:b="center";break;case 2:b="right"}return b},configurable:!0,enumerable:!0,set:function(b){switch(b){case"right":case 2:x=2;break;case"center":case 1:x=1;break;default:x=0}}})};vs(vc,Kc);var dm=function(){vc.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(r){e=r}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(r){e=r}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return kX(t,this.objId,this.scope)},set:function(r){var n,o;o=[],typeof(n=r)=="string"&&(o=(function(a,s,l){l||(l=1);for(var c,u=[];c=s.exec(a);)u.push(c[l]);return u})(n,/\((.*?)\)/g)),t=o}}),this.getOptions=function(){return t},this.setOptions=function(r){t=r,this.sort&&t.sort()},this.addOption=function(r){r=(r=r||"").toString(),t.push(r),this.sort&&t.sort()},this.removeOption=function(r,n){for(n=n||!1,r=(r=r||"").toString();t.indexOf(r)!==-1&&(t.splice(t.indexOf(r),1),n!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,18)},set:function(r){r?this.Ff=zi(this.Ff,18):this.Ff=Bi(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,19)},set:function(r){this.combo===!0&&(r?this.Ff=zi(this.Ff,19):this.Ff=Bi(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,20)},set:function(r){r?(this.Ff=zi(this.Ff,20),t.sort()):this.Ff=Bi(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,22)},set:function(r){r?this.Ff=zi(this.Ff,22):this.Ff=Bi(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,23)},set:function(r){r?this.Ff=zi(this.Ff,23):this.Ff=Bi(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,27)},set:function(r){r?this.Ff=zi(this.Ff,27):this.Ff=Bi(this.Ff,27)}}),this.hasAppearanceStream=!1};vs(dm,vc);var fm=function(){dm.call(this),this.fontName="helvetica",this.combo=!1};vs(fm,dm);var pm=function(){fm.call(this),this.combo=!0};vs(pm,fm);var k0=function(){pm.call(this),this.edit=!0};vs(k0,pm);var Lo=function(){vc.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,15)},set:function(r){r?this.Ff=zi(this.Ff,15):this.Ff=Bi(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,16)},set:function(r){r?this.Ff=zi(this.Ff,16):this.Ff=Bi(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,17)},set:function(r){r?this.Ff=zi(this.Ff,17):this.Ff=Bi(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,26)},set:function(r){r?this.Ff=zi(this.Ff,26):this.Ff=Bi(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var r=function(a){return a};if(this.scope&&(r=this.scope.internal.getEncryptor(this.objId)),Object.keys(t).length!==0){var n,o=[];for(n in o.push("<<"),t)o.push("/"+n+" ("+Bh(r(t[n]))+")");return o.push(">>"),o.join(`
|
||
`)}},set:function(r){On(r)==="object"&&(t=r)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(r){typeof r=="string"&&(t.CA=r)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(r){var n=r==null?"":r.toString();n.substr(0,1)==="/"&&(n=n.substr(1)),e="/"+Eh(n)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(r){e="/"+Eh(r)}})};vs(Lo,vc);var _0=function(){Lo.call(this),this.pushButton=!0};vs(_0,Lo);var hm=function(){Lo.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t!==void 0?t:[]}})};vs(hm,Lo);var Sw=function(){var e,t;vc.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(o){e=o}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(o){t=o}});var r,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var o=function(l){return l};this.scope&&(o=this.scope.internal.getEncryptor(this.objId));var a,s=[];for(a in s.push("<<"),n)s.push("/"+a+" ("+Bh(o(n[a]))+")");return s.push(">>"),s.join(`
|
||
`)},set:function(o){On(o)==="object"&&(n=o)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(o){typeof o=="string"&&(n.CA=o)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return r},set:function(o){var a=o==null?"":o.toString();a.substr(0,1)==="/"&&(a=a.substr(1)),r="/"+Eh(a)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(o){var a=o==null?"":o.toString();a.substr(0,1)==="/"&&(a=a.substr(1)),r="/"+Eh(a)}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=or.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};vs(Sw,vc),hm.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var r=this.Kids[t];r.appearanceStreamContent=e.createAppearanceStream(r.optionName),r.caption=e.getCA()}},hm.prototype.createOption=function(e){var t=new Sw;return t.Parent=this,t.optionName=e,this.Kids.push(t),POe.call(this.scope,t),t};var C0=function(){Lo.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=or.CheckBox.createAppearanceStream()};vs(C0,Lo);var ah=function(){vc.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,13)},set:function(t){t?this.Ff=zi(this.Ff,13):this.Ff=Bi(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,21)},set:function(t){t?this.Ff=zi(this.Ff,21):this.Ff=Bi(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,23)},set:function(t){t?this.Ff=zi(this.Ff,23):this.Ff=Bi(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,24)},set:function(t){t?this.Ff=zi(this.Ff,24):this.Ff=Bi(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,25)},set:function(t){t?this.Ff=zi(this.Ff,25):this.Ff=Bi(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,26)},set:function(t){t?this.Ff=zi(this.Ff,26):this.Ff=Bi(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};vs(ah,vc);var E0=function(){ah.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!Di(this.Ff,14)},set:function(e){e?this.Ff=zi(this.Ff,14):this.Ff=Bi(this.Ff,14)}}),this.password=!0};vs(E0,ah);var or={CheckBox:{createAppearanceStream:function(){return{N:{On:or.CheckBox.YesNormal},D:{On:or.CheckBox.YesPushDown,Off:or.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=Bc(e);t.scope=e.scope;var r=[],n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,o=e.scope.__private__.encodeColorString(e.color),a=y6(e,e.caption);return r.push("0.749023 g"),r.push("0 0 "+Ir(or.internal.getWidth(e))+" "+Ir(or.internal.getHeight(e))+" re"),r.push("f"),r.push("BMC"),r.push("q"),r.push("0 0 1 rg"),r.push("/"+n+" "+Ir(a.fontSize)+" Tf "+o),r.push("BT"),r.push(a.text),r.push("ET"),r.push("Q"),r.push("EMC"),t.stream=r.join(`
|
||
`),t},YesNormal:function(e){var t=Bc(e);t.scope=e.scope;var r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color),o=[],a=or.internal.getHeight(e),s=or.internal.getWidth(e),l=y6(e,e.caption);return o.push("1 g"),o.push("0 0 "+Ir(s)+" "+Ir(a)+" re"),o.push("f"),o.push("q"),o.push("0 0 1 rg"),o.push("0 0 "+Ir(s-1)+" "+Ir(a-1)+" re"),o.push("W"),o.push("n"),o.push("0 g"),o.push("BT"),o.push("/"+r+" "+Ir(l.fontSize)+" Tf "+n),o.push(l.text),o.push("ET"),o.push("Q"),t.stream=o.join(`
|
||
`),t},OffPushDown:function(e){var t=Bc(e);t.scope=e.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+Ir(or.internal.getWidth(e))+" "+Ir(or.internal.getHeight(e))+" re"),r.push("f"),t.stream=r.join(`
|
||
`),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:or.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=or.RadioButton.Circle.YesNormal,t.D[e]=or.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=Bc(e);t.scope=e.scope;var r=[],n=or.internal.getWidth(e)<=or.internal.getHeight(e)?or.internal.getWidth(e)/4:or.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var o=or.internal.Bezier_C,a=Number((n*o).toFixed(5));return r.push("q"),r.push("1 0 0 1 "+gf(or.internal.getWidth(e)/2)+" "+gf(or.internal.getHeight(e)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+a+" "+a+" "+n+" 0 "+n+" c"),r.push("-"+a+" "+n+" -"+n+" "+a+" -"+n+" 0 c"),r.push("-"+n+" -"+a+" -"+a+" -"+n+" 0 -"+n+" c"),r.push(a+" -"+n+" "+n+" -"+a+" "+n+" 0 c"),r.push("f"),r.push("Q"),t.stream=r.join(`
|
||
`),t},YesPushDown:function(e){var t=Bc(e);t.scope=e.scope;var r=[],n=or.internal.getWidth(e)<=or.internal.getHeight(e)?or.internal.getWidth(e)/4:or.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var o=Number((2*n).toFixed(5)),a=Number((o*or.internal.Bezier_C).toFixed(5)),s=Number((n*or.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+gf(or.internal.getWidth(e)/2)+" "+gf(or.internal.getHeight(e)/2)+" cm"),r.push(o+" 0 m"),r.push(o+" "+a+" "+a+" "+o+" 0 "+o+" c"),r.push("-"+a+" "+o+" -"+o+" "+a+" -"+o+" 0 c"),r.push("-"+o+" -"+a+" -"+a+" -"+o+" 0 -"+o+" c"),r.push(a+" -"+o+" "+o+" -"+a+" "+o+" 0 c"),r.push("f"),r.push("Q"),r.push("0 g"),r.push("q"),r.push("1 0 0 1 "+gf(or.internal.getWidth(e)/2)+" "+gf(or.internal.getHeight(e)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+s+" "+s+" "+n+" 0 "+n+" c"),r.push("-"+s+" "+n+" -"+n+" "+s+" -"+n+" 0 c"),r.push("-"+n+" -"+s+" -"+s+" -"+n+" 0 -"+n+" c"),r.push(s+" -"+n+" "+n+" -"+s+" "+n+" 0 c"),r.push("f"),r.push("Q"),t.stream=r.join(`
|
||
`),t},OffPushDown:function(e){var t=Bc(e);t.scope=e.scope;var r=[],n=or.internal.getWidth(e)<=or.internal.getHeight(e)?or.internal.getWidth(e)/4:or.internal.getHeight(e)/4;n=Number((.9*n).toFixed(5));var o=Number((2*n).toFixed(5)),a=Number((o*or.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+gf(or.internal.getWidth(e)/2)+" "+gf(or.internal.getHeight(e)/2)+" cm"),r.push(o+" 0 m"),r.push(o+" "+a+" "+a+" "+o+" 0 "+o+" c"),r.push("-"+a+" "+o+" -"+o+" "+a+" -"+o+" 0 c"),r.push("-"+o+" -"+a+" -"+a+" -"+o+" 0 -"+o+" c"),r.push(a+" -"+o+" "+o+" -"+a+" "+o+" 0 c"),r.push("f"),r.push("Q"),t.stream=r.join(`
|
||
`),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:or.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=or.RadioButton.Cross.YesNormal,t.D[e]=or.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=Bc(e);t.scope=e.scope;var r=[],n=or.internal.calculateCross(e);return r.push("q"),r.push("1 1 "+Ir(or.internal.getWidth(e)-2)+" "+Ir(or.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(Ir(n.x1.x)+" "+Ir(n.x1.y)+" m"),r.push(Ir(n.x2.x)+" "+Ir(n.x2.y)+" l"),r.push(Ir(n.x4.x)+" "+Ir(n.x4.y)+" m"),r.push(Ir(n.x3.x)+" "+Ir(n.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join(`
|
||
`),t},YesPushDown:function(e){var t=Bc(e);t.scope=e.scope;var r=or.internal.calculateCross(e),n=[];return n.push("0.749023 g"),n.push("0 0 "+Ir(or.internal.getWidth(e))+" "+Ir(or.internal.getHeight(e))+" re"),n.push("f"),n.push("q"),n.push("1 1 "+Ir(or.internal.getWidth(e)-2)+" "+Ir(or.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(Ir(r.x1.x)+" "+Ir(r.x1.y)+" m"),n.push(Ir(r.x2.x)+" "+Ir(r.x2.y)+" l"),n.push(Ir(r.x4.x)+" "+Ir(r.x4.y)+" m"),n.push(Ir(r.x3.x)+" "+Ir(r.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join(`
|
||
`),t},OffPushDown:function(e){var t=Bc(e);t.scope=e.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+Ir(or.internal.getWidth(e))+" "+Ir(or.internal.getHeight(e))+" re"),r.push("f"),t.stream=r.join(`
|
||
`),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+r}};or.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=or.internal.getWidth(e),r=or.internal.getHeight(e),n=Math.min(t,r);return{x1:{x:(t-n)/2,y:(r-n)/2+n},x2:{x:(t-n)/2+n,y:(r-n)/2},x3:{x:(t-n)/2,y:(r-n)/2},x4:{x:(t-n)/2+n,y:(r-n)/2+n}}}},or.internal.getWidth=function(e){var t=0;return On(e)==="object"&&(t=uW(e.Rect[2])),t},or.internal.getHeight=function(e){var t=0;return On(e)==="object"&&(t=uW(e.Rect[3])),t};var POe=Ci.addField=function(e){if(TOe(this,e),!(e instanceof vc))throw new Error("Invalid argument passed to jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};Ci.AcroFormChoiceField=dm,Ci.AcroFormListBox=fm,Ci.AcroFormComboBox=pm,Ci.AcroFormEditBox=k0,Ci.AcroFormButton=Lo,Ci.AcroFormPushButton=_0,Ci.AcroFormRadioButton=hm,Ci.AcroFormCheckBox=C0,Ci.AcroFormTextField=ah,Ci.AcroFormPasswordField=E0,Ci.AcroFormAppearance=or,Ci.AcroForm={ChoiceField:dm,ListBox:fm,ComboBox:pm,EditBox:k0,Button:Lo,PushButton:_0,RadioButton:hm,CheckBox:C0,TextField:ah,PasswordField:E0,Appearance:or},dr.AcroForm={ChoiceField:dm,ListBox:fm,ComboBox:pm,EditBox:k0,Button:Lo,PushButton:_0,RadioButton:hm,CheckBox:C0,TextField:ah,PasswordField:E0,Appearance:or};dr.AcroForm;function EX(e){return e.reduce(function(t,r,n){return t[r]=n,t},{})}(function(e){var t="addImage_";e.__addimage__={};var r="UNKNOWN",n={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},o=e.__addimage__.getImageFileTypeByImageData=function(E,A){var F,L,z,V,Q,U=r;if((A=A||r)==="RGBA"||E.data!==void 0&&E.data instanceof Uint8ClampedArray&&"height"in E&&"width"in E)return"RGBA";if(P(E))for(Q in n)for(z=n[Q],F=0;F<z.length;F+=1){for(V=!0,L=0;L<z[F].length;L+=1)if(z[F][L]!==void 0&&z[F][L]!==E[L]){V=!1;break}if(V===!0){U=Q;break}}else for(Q in n)for(z=n[Q],F=0;F<z.length;F+=1){for(V=!0,L=0;L<z[F].length;L+=1)if(z[F][L]!==void 0&&z[F][L]!==E.charCodeAt(L)){V=!1;break}if(V===!0){U=Q;break}}return U===r&&A!==r&&(U=A),U},a=function E(A){for(var F=this.internal.write,L=this.internal.putStream,z=(0,this.internal.getFilters)();z.indexOf("FlateEncode")!==-1;)z.splice(z.indexOf("FlateEncode"),1);A.objectId=this.internal.newObject();var V=[];if(V.push({key:"Type",value:"/XObject"}),V.push({key:"Subtype",value:"/Image"}),V.push({key:"Width",value:A.width}),V.push({key:"Height",value:A.height}),A.colorSpace===b.INDEXED?V.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(A.palette.length/3-1)+" "+("sMask"in A&&A.sMask!==void 0?A.objectId+2:A.objectId+1)+" 0 R]"}):(V.push({key:"ColorSpace",value:"/"+A.colorSpace}),A.colorSpace===b.DEVICE_CMYK&&V.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),V.push({key:"BitsPerComponent",value:A.bitsPerComponent}),"decodeParameters"in A&&A.decodeParameters!==void 0&&V.push({key:"DecodeParms",value:"<<"+A.decodeParameters+">>"}),"transparency"in A&&Array.isArray(A.transparency)&&A.transparency.length>0){for(var Q="",U=0,ee=A.transparency.length;U<ee;U++)Q+=A.transparency[U]+" "+A.transparency[U]+" ";V.push({key:"Mask",value:"["+Q+"]"})}A.sMask!==void 0&&V.push({key:"SMask",value:A.objectId+1+" 0 R"});var H=A.filter!==void 0?["/"+A.filter]:void 0;if(L({data:A.data,additionalKeyValues:V,alreadyAppliedFilters:H,objectId:A.objectId}),F("endobj"),"sMask"in A&&A.sMask!==void 0){var B,M=(B=A.sMaskBitsPerComponent)!==null&&B!==void 0?B:A.bitsPerComponent,$={width:A.width,height:A.height,colorSpace:"DeviceGray",bitsPerComponent:M,data:A.sMask};"filter"in A&&($.decodeParameters="/Predictor ".concat(A.predictor," /Colors 1 /BitsPerComponent ").concat(M," /Columns ").concat(A.width),$.filter=A.filter),E.call(this,$)}if(A.colorSpace===b.INDEXED){var q=this.internal.newObject();L({data:T(new Uint8Array(A.palette)),objectId:q}),F("endobj")}},s=function(){var E=this.internal.collections[t+"images"];for(var A in E)a.call(this,E[A])},l=function(){var E,A=this.internal.collections[t+"images"],F=this.internal.write;for(var L in A)F("/I"+(E=A[L]).index,E.objectId,"0","R")},c=function(){this.internal.collections[t+"images"]||(this.internal.collections[t+"images"]={},this.internal.events.subscribe("putResources",s),this.internal.events.subscribe("putXobjectDict",l))},u=function(){var E=this.internal.collections[t+"images"];return c.call(this),E},d=function(){return Object.keys(this.internal.collections[t+"images"]).length},f=function(E){return typeof e["process"+E.toUpperCase()]=="function"},h=function(E){return On(E)==="object"&&E.nodeType===1},p=function(E,A){if(E.nodeName==="IMG"&&E.hasAttribute("src")){var F=""+E.getAttribute("src");if(F.indexOf("data:image/")===0)return j0(unescape(F).split("base64,").pop());var L=e.loadFile(F,!0);if(L!==void 0)return L}if(E.nodeName==="CANVAS"){if(E.width===0||E.height===0)throw new Error("Given canvas must have data. Canvas width: "+E.width+", height: "+E.height);var z;switch(A){case"PNG":z="image/png";break;case"WEBP":z="image/webp";break;default:z="image/jpeg"}return j0(E.toDataURL(z,1).split("base64,").pop())}},y=function(E){var A=this.internal.collections[t+"images"];if(A){for(var F in A)if(E===A[F].alias)return A[F]}},m=function(E,A,F){return E||A||(E=-96,A=-96),E<0&&(E=-1*F.width*72/E/this.internal.scaleFactor),A<0&&(A=-1*F.height*72/A/this.internal.scaleFactor),E===0&&(E=A*F.width/F.height),A===0&&(A=E*F.height/F.width),[E,A]},x=function(E,A,F,L,z,V){var Q=m.call(this,F,L,z),U=this.internal.getCoordinateString,ee=this.internal.getVerticalCoordinateString,H=u.call(this);if(F=Q[0],L=Q[1],H[z.index]=z,V){V*=Math.PI/180;var B=Math.cos(V),M=Math.sin(V),$=function(Y){return Y.toFixed(4)},q=[$(B),$(M),$(-1*M),$(B),0,0,"cm"]}this.internal.write("q"),V?(this.internal.write([1,"0","0",1,U(E),ee(A+L),"cm"].join(" ")),this.internal.write(q.join(" ")),this.internal.write([U(F),"0","0",U(L),"0","0","cm"].join(" "))):this.internal.write([U(F),"0","0",U(L),U(E),ee(A+L),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+z.index+" Do"),this.internal.write("Q")},b=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var w=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},k=e.__addimage__.sHashCode=function(E){var A,F,L=0;if(typeof E=="string")for(F=E.length,A=0;A<F;A++)L=(L<<5)-L+E.charCodeAt(A),L|=0;else if(P(E))for(F=E.byteLength/2,A=0;A<F;A++)L=(L<<5)-L+E[A],L|=0;return L},S=e.__addimage__.validateStringAsBase64=function(E){(E=E||"").toString().trim();var A=!0;return E.length===0&&(A=!1),E.length%4!=0&&(A=!1),/^[A-Za-z0-9+/]+$/.test(E.substr(0,E.length-2))===!1&&(A=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(E.substr(-2))===!1&&(A=!1),A},_=e.__addimage__.extractImageFromDataUrl=function(E){if(E==null||!(E=E.trim()).startsWith("data:"))return null;var A=E.indexOf(",");return A<0?null:E.substring(0,A).trim().endsWith("base64")?E.substring(A+1):null};e.__addimage__.isArrayBuffer=function(E){return E instanceof ArrayBuffer};var P=e.__addimage__.isArrayBufferView=function(E){return E instanceof Int8Array||E instanceof Uint8Array||E instanceof Uint8ClampedArray||E instanceof Int16Array||E instanceof Uint16Array||E instanceof Int32Array||E instanceof Uint32Array||E instanceof Float32Array||E instanceof Float64Array},O=e.__addimage__.binaryStringToUint8Array=function(E){for(var A=E.length,F=new Uint8Array(A),L=0;L<A;L++)F[L]=E.charCodeAt(L);return F},T=e.__addimage__.arrayBufferToBinaryString=function(E){for(var A="",F=P(E)?E:new Uint8Array(E),L=0;L<F.length;L+=8192)A+=String.fromCharCode.apply(null,F.subarray(L,L+8192));return A};e.addImage=function(){var E,A,F,L,z,V,Q,U,ee;if(typeof arguments[1]=="number"?(A=r,F=arguments[1],L=arguments[2],z=arguments[3],V=arguments[4],Q=arguments[5],U=arguments[6],ee=arguments[7]):(A=arguments[1],F=arguments[2],L=arguments[3],z=arguments[4],V=arguments[5],Q=arguments[6],U=arguments[7],ee=arguments[8]),On(E=arguments[0])==="object"&&!h(E)&&"imageData"in E){var H=E;E=H.imageData,A=H.format||A||r,F=H.x||F||0,L=H.y||L||0,z=H.w||H.width||z,V=H.h||H.height||V,Q=H.alias||Q,U=H.compression||U,ee=H.rotation||H.angle||ee}var B=this.internal.getFilters();if(U===void 0&&B.indexOf("FlateEncode")!==-1&&(U="SLOW"),isNaN(F)||isNaN(L))throw new Error("Invalid coordinates passed to jsPDF.addImage");c.call(this);var M=R.call(this,E,A,Q,U);return x.call(this,F,L,z,V,M,ee),this};var R=function(E,A,F,L){var z,V,Q;if(typeof E=="string"&&o(E)===r){E=unescape(E);var U=I(E,!1);(U!==""||(U=e.loadFile(E,!0))!==void 0)&&(E=U)}if(h(E)&&(E=p(E,A)),A=o(E,A),!f(A))throw new Error("addImage does not support files of type '"+A+"', please ensure that a plugin for '"+A+"' support is added.");if(((Q=F)==null||Q.length===0)&&(F=(function(ee){return typeof ee=="string"||P(ee)?k(ee):P(ee.data)?k(ee.data):null})(E)),(z=y.call(this,F))||(E instanceof Uint8Array||A==="RGBA"||(V=E,E=O(E)),z=this["process"+A.toUpperCase()](E,d.call(this),F,(function(ee){return ee&&typeof ee=="string"&&(ee=ee.toUpperCase()),ee in e.image_compression?ee:w.NONE})(L),V)),!z)throw new Error("An unknown error occurred whilst processing the image.");return z},I=e.__addimage__.convertBase64ToBinaryString=function(E,A){A=typeof A!="boolean"||A;var F,L="";if(typeof E=="string"){var z;F=(z=_(E))!==null&&z!==void 0?z:E;try{L=j0(F)}catch(V){if(A)throw S(F)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+V.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return L};e.getImageProperties=function(E){var A,F,L="";if(h(E)&&(E=p(E)),typeof E=="string"&&o(E)===r&&((L=I(E,!1))===""&&(L=e.loadFile(E)||""),E=L),F=o(E),!f(F))throw new Error("addImage does not support files of type '"+F+"', please ensure that a plugin for '"+F+"' support is added.");if(E instanceof Uint8Array||(E=O(E)),!(A=this["process"+F.toUpperCase()](E)))throw new Error("An unknown error occurred whilst processing the image");return A.fileType=F,A}})(dr.API),(function(e){var t=function(r){if(r!==void 0&&r!="")return!0};dr.API.events.push(["addPage",function(r){this.internal.getPageInfo(r.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(r){for(var n,o,a,s=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString,c=this.internal.getPageInfoByObjId(r.objId),u=r.pageContext.annotations,d=!1,f=0;f<u.length&&!d;f++)switch((n=u[f]).type){case"link":(t(n.options.url)||t(n.options.pageNumber))&&(d=!0);break;case"reference":case"text":case"freetext":d=!0}if(d!=0){this.internal.write("/Annots [");for(var h=0;h<u.length;h++){n=u[h];var p=this.internal.pdfEscape,y=this.internal.getEncryptor(r.objId);switch(n.type){case"reference":this.internal.write(" "+n.object.objId+" 0 R ");break;case"text":var m=this.internal.newAdditionalObject(),x=this.internal.newAdditionalObject(),b=this.internal.getEncryptor(m.objId),w=n.title||"Note";a="<</Type /Annot /Subtype /Text "+(o="/Rect ["+s(n.bounds.x)+" "+l(n.bounds.y+n.bounds.h)+" "+s(n.bounds.x+n.bounds.w)+" "+l(n.bounds.y)+"] ")+"/Contents ("+p(b(n.contents))+")",a+=" /Popup "+x.objId+" 0 R",a+=" /P "+c.objId+" 0 R",a+=" /T ("+p(b(w))+") >>",m.content=a;var k=m.objId+" 0 R";a="<</Type /Annot /Subtype /Popup "+(o="/Rect ["+s(n.bounds.x+30)+" "+l(n.bounds.y+n.bounds.h)+" "+s(n.bounds.x+n.bounds.w+30)+" "+l(n.bounds.y)+"] ")+" /Parent "+k,n.open&&(a+=" /Open true"),a+=" >>",x.content=a,this.internal.write(m.objId,"0 R",x.objId,"0 R");break;case"freetext":o="/Rect ["+s(n.bounds.x)+" "+l(n.bounds.y)+" "+s(n.bounds.x+n.bounds.w)+" "+l(n.bounds.y+n.bounds.h)+"] ";var S="font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+(n.color||"#000000");a="<</Type /Annot /Subtype /FreeText "+o+"/Contents ("+p(y(n.contents))+")",a+=" /DS("+p(y(S))+")",a+=" /Border [0 0 0]",a+=" >>",this.internal.write(a);break;case"link":if(n.options.name){var _=this.annotations._nameMap[n.options.name];n.options.pageNumber=_.page,n.options.top=_.y}else n.options.top||(n.options.top=0);if(o="/Rect ["+n.finalBounds.x+" "+n.finalBounds.y+" "+n.finalBounds.w+" "+n.finalBounds.h+"] ",a="",n.options.url)a="<</Type /Annot /Subtype /Link "+o+"/Border [0 0 0] /A <</S /URI /URI ("+p(y(n.options.url))+") >>";else if(n.options.pageNumber)switch(a="<</Type /Annot /Subtype /Link "+o+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(n.options.pageNumber).objId+" 0 R",n.options.magFactor=n.options.magFactor||"XYZ",n.options.magFactor){case"Fit":a+=" /Fit]";break;case"FitH":a+=" /FitH "+n.options.top+"]";break;case"FitV":n.options.left=n.options.left||0,a+=" /FitV "+n.options.left+"]";break;default:var P=l(n.options.top);n.options.left=n.options.left||0,n.options.zoom===void 0&&(n.options.zoom=0),a+=" /XYZ "+n.options.left+" "+P+" "+n.options.zoom+"]"}a!=""&&(a+=" >>",this.internal.write(a))}}this.internal.write("]")}}]),e.createAnnotation=function(r){var n=this.internal.getCurrentPageInfo();switch(r.type){case"link":this.link(r.bounds.x,r.bounds.y,r.bounds.w,r.bounds.h,r);break;case"text":case"freetext":n.pageContext.annotations.push(r)}},e.link=function(r,n,o,a,s){var l=this.internal.getCurrentPageInfo(),c=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;l.pageContext.annotations.push({finalBounds:{x:c(r),y:u(n),w:c(r+o),h:u(n+a)},options:s,type:"link"})},e.textWithLink=function(r,n,o,a){var s,l,c=this.getTextWidth(r),u=this.internal.getLineHeight()/this.internal.scaleFactor;if(a.maxWidth!==void 0){l=a.maxWidth;var d=this.splitTextToSize(r,l).length;s=Math.ceil(u*d)}else l=c,s=u;return this.text(r,n,o,a),o+=.2*u,a.align==="center"&&(n-=c/2),a.align==="right"&&(n-=c),this.link(n,o-u,l,s,a),c},e.getTextWidth=function(r){var n=this.internal.getFontSize();return this.getStringUnitWidth(r)*n/this.internal.scaleFactor}})(dr.API),(function(e){var t={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},r={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},n={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},o=[1570,1571,1573,1575];e.__arabicParser__={};var a=e.__arabicParser__.isInArabicSubstitutionA=function(m){return t[m.charCodeAt(0)]!==void 0},s=e.__arabicParser__.isArabicLetter=function(m){return typeof m=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(m)},l=e.__arabicParser__.isArabicEndLetter=function(m){return s(m)&&a(m)&&t[m.charCodeAt(0)].length<=2},c=e.__arabicParser__.isArabicAlfLetter=function(m){return s(m)&&o.indexOf(m.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(m){return s(m)&&a(m)&&t[m.charCodeAt(0)].length>=1};var u=e.__arabicParser__.arabicLetterHasFinalForm=function(m){return s(m)&&a(m)&&t[m.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(m){return s(m)&&a(m)&&t[m.charCodeAt(0)].length>=3};var d=e.__arabicParser__.arabicLetterHasMedialForm=function(m){return s(m)&&a(m)&&t[m.charCodeAt(0)].length==4},f=e.__arabicParser__.resolveLigatures=function(m){var x=0,b=r,w="",k=0;for(x=0;x<m.length;x+=1)b[m.charCodeAt(x)]!==void 0?(k++,typeof(b=b[m.charCodeAt(x)])=="number"&&(w+=String.fromCharCode(b),b=r,k=0),x===m.length-1&&(b=r,w+=m.charAt(x-(k-1)),x-=k-1,k=0)):(b=r,w+=m.charAt(x-k),x-=k,k=0);return w};e.__arabicParser__.isArabicDiacritic=function(m){return m!==void 0&&n[m.charCodeAt(0)]!==void 0};var h=e.__arabicParser__.getCorrectForm=function(m,x,b){return s(m)?a(m)===!1?-1:!u(m)||!s(x)&&!s(b)||!s(b)&&l(x)||l(m)&&!s(x)||l(m)&&c(x)||l(m)&&l(x)?0:d(m)&&s(x)&&!l(x)&&s(b)&&u(b)?3:l(m)||!s(b)?1:2:-1},p=function(m){var x=0,b=0,w=0,k="",S="",_="",P=(m=m||"").split("\\s+"),O=[];for(x=0;x<P.length;x+=1){for(O.push(""),b=0;b<P[x].length;b+=1)k=P[x][b],S=P[x][b-1],_=P[x][b+1],s(k)?(w=h(k,S,_),O[x]+=w!==-1?String.fromCharCode(t[k.charCodeAt(0)][w]):k):O[x]+=k;O[x]=f(O[x])}return O.join(" ")},y=e.__arabicParser__.processArabic=e.processArabic=function(){var m,x=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,b=[];if(Array.isArray(x)){var w=0;for(b=[],w=0;w<x.length;w+=1)Array.isArray(x[w])?b.push([p(x[w][0]),x[w][1],x[w][2]]):b.push([p(x[w])]);m=b}else m=p(x);return typeof arguments[0]=="string"?m:(arguments[0].text=m,arguments[0])};e.events.push(["preProcessText",y])})(dr.API),dr.API.autoPrint=function(e){var t;return(e=e||{}).variant=e.variant||"non-conform",e.variant==="javascript"?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+t+" 0 R")})),this},(function(e){var t=function(){var r=void 0;Object.defineProperty(this,"pdf",{get:function(){return r},set:function(l){r=l}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(l){n=isNaN(l)||Number.isInteger(l)===!1||l<0?150:l,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var o=300;Object.defineProperty(this,"height",{get:function(){return o},set:function(l){o=isNaN(l)||Number.isInteger(l)===!1||l<0?300:l,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=o+1)}});var a=[];Object.defineProperty(this,"childNodes",{get:function(){return a},set:function(l){a=l}});var s={};Object.defineProperty(this,"style",{get:function(){return s},set:function(l){s=l}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(r,n){var o;if((r=r||"2d")!=="2d")return null;for(o in n)this.pdf.context2d.hasOwnProperty(o)&&(this.pdf.context2d[o]=n[o]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])})(dr.API),(function(e){var t={left:0,top:0,bottom:0,right:0},r=!1,n=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},t),this.internal.__cell__.margins.width=this.getPageWidth(),o.call(this))},o=function(){this.internal.__cell__.lastCell=new a,this.internal.__cell__.pages=1},a=function(){var c=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return c},set:function(m){c=m}});var u=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return u},set:function(m){u=m}});var d=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return d},set:function(m){d=m}});var f=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return f},set:function(m){f=m}});var h=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return h},set:function(m){h=m}});var p=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return p},set:function(m){p=m}});var y=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return y},set:function(m){y=m}}),this};a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},a.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(c){return n.call(this),this.internal.__cell__.headerFunction=typeof c=="function"?c:void 0,this},e.getTextDimensions=function(c,u){n.call(this);var d=(u=u||{}).fontSize||this.getFontSize(),f=u.font||this.getFont(),h=u.scaleFactor||this.internal.scaleFactor,p=0,y=0,m=0,x=this;if(!Array.isArray(c)&&typeof c!="string"){if(typeof c!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");c=String(c)}var b=u.maxWidth;b>0?typeof c=="string"?c=this.splitTextToSize(c,b):Object.prototype.toString.call(c)==="[object Array]"&&(c=c.reduce(function(k,S){return k.concat(x.splitTextToSize(S,b))},[])):c=Array.isArray(c)?c:[c];for(var w=0;w<c.length;w++)p<(m=this.getStringUnitWidth(c[w],{font:f})*d)&&(p=m);return p!==0&&(y=c.length),{w:p/=h,h:Math.max((y*d*this.getLineHeightFactor()-d*(this.getLineHeightFactor()-1))/h,0)}},e.cellAddPage=function(){n.call(this),this.addPage();var c=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new a(c.left,c.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var s=e.cell=function(){var c;c=arguments[0]instanceof a?arguments[0]:new a(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),n.call(this);var u=this.internal.__cell__.lastCell,d=this.internal.__cell__.padding,f=this.internal.__cell__.margins||t,h=this.internal.__cell__.tableHeaderRow,p=this.internal.__cell__.printHeaders;return u.lineNumber!==void 0&&(u.lineNumber===c.lineNumber?(c.x=(u.x||0)+(u.width||0),c.y=u.y||0):u.y+u.height+c.height+f.bottom>this.getPageHeight()?(this.cellAddPage(),c.y=f.top,p&&h&&(this.printHeaderRow(c.lineNumber,!0),c.y+=h[0].height)):c.y=u.y+u.height||c.y),c.text[0]!==void 0&&(this.rect(c.x,c.y,c.width,c.height,r===!0?"FD":void 0),c.align==="right"?this.text(c.text,c.x+c.width-d,c.y+d,{align:"right",baseline:"top"}):c.align==="center"?this.text(c.text,c.x+c.width/2,c.y+d,{align:"center",baseline:"top",maxWidth:c.width-d-d}):this.text(c.text,c.x+d,c.y+d,{align:"left",baseline:"top",maxWidth:c.width-d-d})),this.internal.__cell__.lastCell=c,this};e.table=function(c,u,d,f,h){if(n.call(this),!d)throw new Error("No data for PDF table.");var p,y,m,x,b=[],w=[],k=[],S={},_={},P=[],O=[],T=(h=h||{}).autoSize||!1,R=h.printHeaders!==!1,I=h.css&&h.css["font-size"]!==void 0?16*h.css["font-size"]:h.fontSize||12,E=h.margins||Object.assign({width:this.getPageWidth()},t),A=typeof h.padding=="number"?h.padding:3,F=h.headerBackgroundColor||"#c8c8c8",L=h.headerTextColor||"#000";if(o.call(this),this.internal.__cell__.printHeaders=R,this.internal.__cell__.margins=E,this.internal.__cell__.table_font_size=I,this.internal.__cell__.padding=A,this.internal.__cell__.headerBackgroundColor=F,this.internal.__cell__.headerTextColor=L,this.setFontSize(I),f==null)w=b=Object.keys(d[0]),k=b.map(function(){return"left"});else if(Array.isArray(f)&&On(f[0])==="object")for(b=f.map(function(H){return H.name}),w=f.map(function(H){return H.prompt||H.name||""}),k=f.map(function(H){return H.align||"left"}),p=0;p<f.length;p+=1)_[f[p].name]=.7499990551181103*f[p].width;else Array.isArray(f)&&typeof f[0]=="string"&&(w=b=f,k=b.map(function(){return"left"}));if(T||Array.isArray(f)&&typeof f[0]=="string")for(p=0;p<b.length;p+=1){for(S[x=b[p]]=d.map(function(H){return H[x]}),this.setFont(void 0,"bold"),P.push(this.getTextDimensions(w[p],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),y=S[x],this.setFont(void 0,"normal"),m=0;m<y.length;m+=1)P.push(this.getTextDimensions(y[m],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);_[x]=Math.max.apply(null,P)+A+A,P=[]}if(R){var z={};for(p=0;p<b.length;p+=1)z[b[p]]={},z[b[p]].text=w[p],z[b[p]].align=k[p];var V=l.call(this,z,_);O=b.map(function(H){return new a(c,u,_[H],V,z[H].text,void 0,z[H].align)}),this.setTableHeaderRow(O),this.printHeaderRow(1,!1)}var Q=f.reduce(function(H,B){return H[B.name]=B.align,H},{});for(p=0;p<d.length;p+=1){"rowStart"in h&&h.rowStart instanceof Function&&h.rowStart({row:p,data:d[p]},this);var U=l.call(this,d[p],_);for(m=0;m<b.length;m+=1){var ee=d[p][b[m]];"cellStart"in h&&h.cellStart instanceof Function&&h.cellStart({row:p,col:m,data:ee},this),s.call(this,new a(c,u,_[b[m]],U,ee,p+2,Q[b[m]]))}}return this.internal.__cell__.table_x=c,this.internal.__cell__.table_y=u,this};var l=function(c,u){var d=this.internal.__cell__.padding,f=this.internal.__cell__.table_font_size,h=this.internal.scaleFactor;return Object.keys(c).map(function(p){var y=c[p];return this.splitTextToSize(y.hasOwnProperty("text")?y.text:y,u[p]-d-d)},this).map(function(p){return this.getLineHeightFactor()*p.length*f/h+d+d},this).reduce(function(p,y){return Math.max(p,y)},0)};e.setTableHeaderRow=function(c){n.call(this),this.internal.__cell__.tableHeaderRow=c},e.printHeaderRow=function(c,u){if(n.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var d;if(r=!0,typeof this.internal.__cell__.headerFunction=="function"){var f=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new a(f[0],f[1],f[2],f[3],void 0,-1)}this.setFont(void 0,"bold");for(var h=[],p=0;p<this.internal.__cell__.tableHeaderRow.length;p+=1){d=this.internal.__cell__.tableHeaderRow[p].clone(),u&&(d.y=this.internal.__cell__.margins.top||0,h.push(d)),d.lineNumber=c;var y=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),s.call(this,d),this.setTextColor(y)}h.length>0&&this.setTableHeaderRow(h),this.setFont(void 0,"normal"),r=!1}})(dr.API);var AX={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},TX=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],x6=EX(TX),PX=[100,200,300,400,500,600,700,800,900],OOe=EX(PX);function T3(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),r=(function(a){return AX[a=a||"normal"]?a:"normal"})(e.style),n=(function(a){return a?typeof a=="number"?a>=100&&a<=900&&a%100==0?a:400:/^\d00$/.test(a)?parseInt(a):a==="bold"?700:400:400})(e.weight),o=(function(a){return typeof x6[a=a||"normal"]=="number"?a:"normal"})(e.stretch);return{family:t,style:r,weight:n,stretch:o,src:e.src||[],ref:e.ref||{name:t,style:[o,r,n].join(" ")}}}function dW(e,t,r,n){var o;for(o=r;o>=0&&o<t.length;o+=n)if(e[t[o]])return e[t[o]];for(o=r;o>=0&&o<t.length;o-=n)if(e[t[o]])return e[t[o]]}var IOe={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},fW={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function pW(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function hW(e){return e.trimLeft()}function NOe(e,t){for(var r=0;r<e.length;){if(e.charAt(r)===t)return[e.substring(0,r),e.substring(r+1)];r+=1}return null}function ROe(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return t===null?null:[t[0],e.substring(t[0].length)]}var Rg,u0,gW,mW,vW,P3=["times"];function yW(e,t,r,n,o){var a=4,s=bW;switch(o){case dr.API.image_compression.FAST:a=1,s=xW;break;case dr.API.image_compression.MEDIUM:a=6,s=wW;break;case dr.API.image_compression.SLOW:a=9,s=SW}e=(function(c,u,d,f){for(var h,p=c.length/u,y=new Uint8Array(c.length+p),m=[LOe,xW,bW,wW,SW],x=0;x<p;x+=1){var b=x*u,w=c.subarray(b,b+u);if(f)y.set(f(w,d,h),b+x);else{for(var k=m.length,S=[],_=0;_<k;_+=1)S[_]=m[_](w,d,h);var P=MOe(S.concat());y.set(S[P],b+x)}h=w}return y})(e,t,Math.ceil(r*n/8),s);var l=f6(e,{level:a});return dr.API.__addimage__.arrayBufferToBinaryString(l)}function LOe(e){var t=Array.apply([],e);return t.unshift(0),t}function xW(e,t){var r=e.length,n=[];n[0]=1;for(var o=0;o<r;o+=1){var a=e[o-t]||0;n[o+1]=e[o]-a+256&255}return n}function bW(e,t,r){var n=e.length,o=[];o[0]=2;for(var a=0;a<n;a+=1){var s=r&&r[a]||0;o[a+1]=e[a]-s+256&255}return o}function wW(e,t,r){var n=e.length,o=[];o[0]=3;for(var a=0;a<n;a+=1){var s=e[a-t]||0,l=r&&r[a]||0;o[a+1]=e[a]+256-(s+l>>>1)&255}return o}function SW(e,t,r){var n=e.length,o=[];o[0]=4;for(var a=0;a<n;a+=1){var s=FOe(e[a-t]||0,r&&r[a]||0,r&&r[a-t]||0);o[a+1]=e[a]-s+256&255}return o}function FOe(e,t,r){if(e===t&&t===r)return e;var n=Math.abs(t-r),o=Math.abs(e-r),a=Math.abs(e+t-r-r);return n<=o&&n<=a?e:o<=a?t:r}function MOe(e){var t=e.map(function(r){return r.reduce(function(n,o){return n+Math.abs(o)},0)});return t.indexOf(Math.min.apply(null,t))}function O3(e,t,r){var n=t*r,o=Math.floor(n/8),a=16-(n-8*o+r),s=(1<<r)-1;return OX(e,o)>>a&s}function jW(e,t,r,n){var o=r*n,a=Math.floor(o/8),s=16-(o-8*a+n),l=(1<<n)-1,c=(t&l)<<s;(function(u,d,f){if(d+1<u.byteLength)u.setUint16(d,f,!1);else{var h=f>>8&255;u.setUint8(d,h)}})(e,a,OX(e,a)&~(l<<s)&65535|c)}function OX(e,t){return t+1<e.byteLength?e.getUint16(t,!1):e.getUint8(t)<<8}function DOe(e){var t=0;if(e[t++]!==71||e[t++]!==73||e[t++]!==70||e[t++]!==56||(e[t++]+1&253)!=56||e[t++]!==97)throw new Error("Invalid GIF 87a/89a header.");var r=e[t++]|e[t++]<<8,n=e[t++]|e[t++]<<8,o=e[t++],a=o>>7,s=1<<1+(7&o);e[t++],e[t++];var l=null,c=null;a&&(l=t,c=s,t+=3*s);var u=!0,d=[],f=0,h=null,p=0,y=null;for(this.width=r,this.height=n;u&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(e[t]!==11||e[t+1]==78&&e[t+2]==69&&e[t+3]==84&&e[t+4]==83&&e[t+5]==67&&e[t+6]==65&&e[t+7]==80&&e[t+8]==69&&e[t+9]==50&&e[t+10]==46&&e[t+11]==48&&e[t+12]==3&&e[t+13]==1&&e[t+16]==0)t+=14,y=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((E=e[t++])>=0))throw Error("Invalid block size");if(E===0)break;t+=E}break;case 249:if(e[t++]!==4||e[t+4]!==0)throw new Error("Invalid graphics extension block.");var m=e[t++];f=e[t++]|e[t++]<<8,h=e[t++],1&m||(h=null),p=m>>2&7,t++;break;case 254:for(;;){if(!((E=e[t++])>=0))throw Error("Invalid block size");if(E===0)break;t+=E}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var x=e[t++]|e[t++]<<8,b=e[t++]|e[t++]<<8,w=e[t++]|e[t++]<<8,k=e[t++]|e[t++]<<8,S=e[t++],_=S>>6&1,P=1<<1+(7&S),O=l,T=c,R=!1;S>>7&&(R=!0,O=t,T=P,t+=3*P);var I=t;for(t++;;){var E;if(!((E=e[t++])>=0))throw Error("Invalid block size");if(E===0)break;t+=E}d.push({x,y:b,width:w,height:k,has_local_palette:R,palette_offset:O,palette_size:T,data_offset:I,data_length:t-I,transparent_index:h,interlaced:!!_,delay:f,disposal:p});break;case 59:u=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return d.length},this.loopCount=function(){return y},this.frameInfo=function(A){if(A<0||A>=d.length)throw new Error("Frame index out of range.");return d[A]},this.decodeAndBlitFrameBGRA=function(A,F){var L=this.frameInfo(A),z=L.width*L.height;if(z>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var V=new Uint8Array(z);kW(e,L.data_offset,V,z);var Q=L.palette_offset,U=L.transparent_index;U===null&&(U=256);var ee=L.width,H=r-ee,B=ee,M=4*(L.y*r+L.x),$=4*((L.y+L.height)*r+L.x),q=M,Y=4*H;L.interlaced===!0&&(Y+=4*r*7);for(var K=8,G=0,re=V.length;G<re;++G){var J=V[G];if(B===0&&(B=ee,(q+=Y)>=$&&(Y=4*H+4*r*(K-1),q=M+(ee+H)*(K<<1),K>>=1)),J===U)q+=4;else{var ae=e[Q+3*J],le=e[Q+3*J+1],me=e[Q+3*J+2];F[q++]=me,F[q++]=le,F[q++]=ae,F[q++]=255}--B}},this.decodeAndBlitFrameRGBA=function(A,F){var L=this.frameInfo(A),z=L.width*L.height;if(z>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var V=new Uint8Array(z);kW(e,L.data_offset,V,z);var Q=L.palette_offset,U=L.transparent_index;U===null&&(U=256);var ee=L.width,H=r-ee,B=ee,M=4*(L.y*r+L.x),$=4*((L.y+L.height)*r+L.x),q=M,Y=4*H;L.interlaced===!0&&(Y+=4*r*7);for(var K=8,G=0,re=V.length;G<re;++G){var J=V[G];if(B===0&&(B=ee,(q+=Y)>=$&&(Y=4*H+4*r*(K-1),q=M+(ee+H)*(K<<1),K>>=1)),J===U)q+=4;else{var ae=e[Q+3*J],le=e[Q+3*J+1],me=e[Q+3*J+2];F[q++]=ae,F[q++]=le,F[q++]=me,F[q++]=255}--B}}}function kW(e,t,r,n){for(var o=e[t++],a=1<<o,s=a+1,l=s+1,c=o+1,u=(1<<c)-1,d=0,f=0,h=0,p=e[t++],y=new Int32Array(4096),m=null;;){for(;d<16&&p!==0;)f|=e[t++]<<d,d+=8,p===1?p=e[t++]:--p;if(d<c)break;var x=f&u;if(f>>=c,d-=c,x!==a){if(x===s)break;for(var b=x<l?x:m,w=0,k=b;k>a;)k=y[k]>>8,++w;var S=k;if(h+w+(b!==x?1:0)>n)return void Dn.log("Warning, gif stream longer than expected.");r[h++]=S;var _=h+=w;for(b!==x&&(r[h++]=S),k=b;w--;)k=y[k],r[--_]=255&k,k>>=8;m!==null&&l<4096&&(y[l++]=m<<8|S,l>=u+1&&c<12&&(++c,u=u<<1|1)),m=x}else l=s+1,u=(1<<(c=o+1))-1,m=null}return h!==n&&Dn.log("Warning, gif stream shorter than expected."),r}/**
|
||
* @license
|
||
Copyright (c) 2008, Adobe Systems Incorporated
|
||
All rights reserved.
|
||
|
||
Redistribution and use in source and binary forms, with or without
|
||
modification, are permitted provided that the following conditions are
|
||
met:
|
||
|
||
* Redistributions of source code must retain the above copyright notice,
|
||
this list of conditions and the following disclaimer.
|
||
|
||
* Redistributions in binary form must reproduce the above copyright
|
||
notice, this list of conditions and the following disclaimer in the
|
||
documentation and/or other materials provided with the distribution.
|
||
|
||
* Neither the name of Adobe Systems Incorporated nor the names of its
|
||
contributors may be used to endorse or promote products derived from
|
||
this software without specific prior written permission.
|
||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
*/function I3(e){var t,r,n,o,a,s=Math.floor,l=new Array(64),c=new Array(64),u=new Array(64),d=new Array(64),f=new Array(65535),h=new Array(65535),p=new Array(64),y=new Array(64),m=[],x=0,b=7,w=new Array(64),k=new Array(64),S=new Array(64),_=new Array(256),P=new Array(2048),O=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],T=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],R=[0,1,2,3,4,5,6,7,8,9,10,11],I=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],E=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],A=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],F=[0,1,2,3,4,5,6,7,8,9,10,11],L=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],z=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function V(M,$){for(var q=0,Y=0,K=new Array,G=1;G<=16;G++){for(var re=1;re<=M[G];re++)K[$[Y]]=[],K[$[Y]][0]=q,K[$[Y]][1]=G,Y++,q++;q*=2}return K}function Q(M){for(var $=M[0],q=M[1]-1;q>=0;)$&1<<q&&(x|=1<<b),q--,--b<0&&(x==255?(U(255),U(0)):U(x),b=7,x=0)}function U(M){m.push(M)}function ee(M){U(M>>8&255),U(255&M)}function H(M,$,q,Y,K){for(var G,re=K[0],J=K[240],ae=(function(fe,Ie){var ce,je,qe,Ne,Je,vt,Ge,Ot,nt,Ae,Te=0;for(nt=0;nt<8;++nt){ce=fe[Te],je=fe[Te+1],qe=fe[Te+2],Ne=fe[Te+3],Je=fe[Te+4],vt=fe[Te+5],Ge=fe[Te+6];var wt=ce+(Ot=fe[Te+7]),ft=ce-Ot,Pt=je+Ge,At=je-Ge,Ht=qe+vt,Se=qe-vt,ct=Ne+Je,gt=Ne-Je,We=wt+ct,Pe=wt-ct,rt=Pt+Ht,Ze=Pt-Ht;fe[Te]=We+rt,fe[Te+4]=We-rt;var pe=.707106781*(Ze+Pe);fe[Te+2]=Pe+pe,fe[Te+6]=Pe-pe;var xe=.382683433*((We=gt+Se)-(Ze=At+ft)),De=.5411961*We+xe,tt=1.306562965*Ze+xe,Le=.707106781*(rt=Se+At),Ke=ft+Le,Fe=ft-Le;fe[Te+5]=Fe+De,fe[Te+3]=Fe-De,fe[Te+1]=Ke+tt,fe[Te+7]=Ke-tt,Te+=8}for(Te=0,nt=0;nt<8;++nt){ce=fe[Te],je=fe[Te+8],qe=fe[Te+16],Ne=fe[Te+24],Je=fe[Te+32],vt=fe[Te+40],Ge=fe[Te+48];var Ve=ce+(Ot=fe[Te+56]),xt=ce-Ot,dt=je+Ge,Tt=je-Ge,Mt=qe+vt,fr=qe-vt,hr=Ne+Je,Qr=Ne-Je,Rn=Ve+hr,to=Ve-hr,Ln=dt+Mt,vo=dt-Mt;fe[Te]=Rn+Ln,fe[Te+32]=Rn-Ln;var ro=.707106781*(vo+to);fe[Te+16]=to+ro,fe[Te+48]=to-ro;var ys=.382683433*((Rn=Qr+fr)-(vo=Tt+xt)),zo=.5411961*Rn+ys,$a=1.306562965*vo+ys,xa=.707106781*(Ln=fr+Tt),zt=xt+xa,yr=xt-xa;fe[Te+40]=yr+zo,fe[Te+24]=yr-zo,fe[Te+8]=zt+$a,fe[Te+56]=zt-$a,Te++}for(nt=0;nt<64;++nt)Ae=fe[nt]*Ie[nt],p[nt]=Ae>0?Ae+.5|0:Ae-.5|0;return p})(M,$),le=0;le<64;++le)y[O[le]]=ae[le];var me=y[0]-q;q=y[0],me==0?Q(Y[0]):(Q(Y[h[G=32767+me]]),Q(f[G]));for(var Oe=63;Oe>0&&y[Oe]==0;)Oe--;if(Oe==0)return Q(re),q;for(var we,ie=1;ie<=Oe;){for(var Me=ie;y[ie]==0&&ie<=Oe;)++ie;var ke=ie-Me;if(ke>=16){we=ke>>4;for(var se=1;se<=we;++se)Q(J);ke&=15}G=32767+y[ie],Q(K[(ke<<4)+h[G]]),Q(f[G]),ie++}return Oe!=63&&Q(re),q}function B(M){M=Math.min(Math.max(M,1),100),a!=M&&((function($){for(var q=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],Y=0;Y<64;Y++){var K=s((q[Y]*$+50)/100);K=Math.min(Math.max(K,1),255),l[O[Y]]=K}for(var G=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],re=0;re<64;re++){var J=s((G[re]*$+50)/100);J=Math.min(Math.max(J,1),255),c[O[re]]=J}for(var ae=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],le=0,me=0;me<8;me++)for(var Oe=0;Oe<8;Oe++)u[le]=1/(l[O[le]]*ae[me]*ae[Oe]*8),d[le]=1/(c[O[le]]*ae[me]*ae[Oe]*8),le++})(M<50?Math.floor(5e3/M):Math.floor(200-2*M)),a=M)}this.encode=function(M,$){$&&B($),m=new Array,x=0,b=7,ee(65496),ee(65504),ee(16),U(74),U(70),U(73),U(70),U(0),U(1),U(1),U(0),ee(1),ee(1),U(0),U(0),(function(){ee(65499),ee(132),U(0);for(var je=0;je<64;je++)U(l[je]);U(1);for(var qe=0;qe<64;qe++)U(c[qe])})(),(function(je,qe){ee(65472),ee(17),U(8),ee(qe),ee(je),U(3),U(1),U(17),U(0),U(2),U(17),U(1),U(3),U(17),U(1)})(M.width,M.height),(function(){ee(65476),ee(418),U(0);for(var je=0;je<16;je++)U(T[je+1]);for(var qe=0;qe<=11;qe++)U(R[qe]);U(16);for(var Ne=0;Ne<16;Ne++)U(I[Ne+1]);for(var Je=0;Je<=161;Je++)U(E[Je]);U(1);for(var vt=0;vt<16;vt++)U(A[vt+1]);for(var Ge=0;Ge<=11;Ge++)U(F[Ge]);U(17);for(var Ot=0;Ot<16;Ot++)U(L[Ot+1]);for(var nt=0;nt<=161;nt++)U(z[nt])})(),ee(65498),ee(12),U(3),U(1),U(0),U(2),U(17),U(3),U(17),U(0),U(63),U(0);var q=0,Y=0,K=0;x=0,b=7,this.encode.displayName="_encode_";for(var G,re,J,ae,le,me,Oe,we,ie,Me=M.data,ke=M.width,se=M.height,fe=4*ke,Ie=0;Ie<se;){for(G=0;G<fe;){for(le=fe*Ie+G,Oe=-1,we=0,ie=0;ie<64;ie++)me=le+(we=ie>>3)*fe+(Oe=4*(7&ie)),Ie+we>=se&&(me-=fe*(Ie+1+we-se)),G+Oe>=fe&&(me-=G+Oe-fe+4),re=Me[me++],J=Me[me++],ae=Me[me++],w[ie]=(P[re]+P[J+256|0]+P[ae+512|0]>>16)-128,k[ie]=(P[re+768|0]+P[J+1024|0]+P[ae+1280|0]>>16)-128,S[ie]=(P[re+1280|0]+P[J+1536|0]+P[ae+1792|0]>>16)-128;q=H(w,u,q,t,n),Y=H(k,d,Y,r,o),K=H(S,d,K,r,o),G+=32}Ie+=8}if(b>=0){var ce=[];ce[1]=b+1,ce[0]=(1<<b+1)-1,Q(ce)}return ee(65497),new Uint8Array(m)},e=e||50,(function(){for(var M=String.fromCharCode,$=0;$<256;$++)_[$]=M($)})(),t=V(T,R),r=V(A,F),n=V(I,E),o=V(L,z),(function(){for(var M=1,$=2,q=1;q<=15;q++){for(var Y=M;Y<$;Y++)h[32767+Y]=q,f[32767+Y]=[],f[32767+Y][1]=q,f[32767+Y][0]=Y;for(var K=-($-1);K<=-M;K++)h[32767+K]=q,f[32767+K]=[],f[32767+K][1]=q,f[32767+K][0]=$-1+K;M<<=1,$<<=1}})(),(function(){for(var M=0;M<256;M++)P[M]=19595*M,P[M+256|0]=38470*M,P[M+512|0]=7471*M+32768,P[M+768|0]=-11059*M,P[M+1024|0]=-21709*M,P[M+1280|0]=32768*M+8421375,P[M+1536|0]=-27439*M,P[M+1792|0]=-5329*M})(),B(e)}/**
|
||
* @license
|
||
* Copyright (c) 2017 Aras Abbasi
|
||
*
|
||
* Licensed under the MIT License.
|
||
* http://opensource.org/licenses/mit-license
|
||
*/function Xl(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function _W(e){function t(R){if(!R)throw Error("assert :P")}function r(R,I,E){for(var A=0;4>A;A++)if(R[I+A]!=E.charCodeAt(A))return!0;return!1}function n(R,I,E,A,F){for(var L=0;L<F;L++)R[I+L]=E[A+L]}function o(R,I,E,A){for(var F=0;F<A;F++)R[I+F]=E}function a(R){return new Int32Array(R)}function s(R,I){for(var E=[],A=0;A<R;A++)E.push(new I);return E}function l(R,I){var E=[];return(function A(F,L,z){for(var V=z[L],Q=0;Q<V&&(F.push(z.length>L+1?[]:new I),!(z.length<L+1));Q++)A(F[Q],L+1,z)})(E,0,R),E}var c=function(){var R=this;function I(N,W){for(var te=1<<W-1>>>0;N&te;)te>>>=1;return te?(N&te-1)+te:N}function E(N,W,te,oe,de){t(!(oe%te));do N[W+(oe-=te)]=de;while(0<oe)}function A(N,W,te,oe,de){if(t(2328>=de),512>=de)var ge=a(512);else if((ge=a(de))==null)return 0;return(function(ve,ye,be,Ce,$e,it){var Ee,He,et=ye,yt=1<<be,at=a(16),ht=a(16);for(t($e!=0),t(Ce!=null),t(ve!=null),t(0<be),He=0;He<$e;++He){if(15<Ce[He])return 0;++at[Ce[He]]}if(at[0]==$e)return 0;for(ht[1]=0,Ee=1;15>Ee;++Ee){if(at[Ee]>1<<Ee)return 0;ht[Ee+1]=ht[Ee]+at[Ee]}for(He=0;He<$e;++He)Ee=Ce[He],0<Ce[He]&&(it[ht[Ee]++]=He);if(ht[15]==1)return(Ce=new F).g=0,Ce.value=it[0],E(ve,et,1,yt,Ce),yt;var mt,jt=-1,Et=yt-1,sr=0,Yt=1,Pr=1,Jt=1<<be;for(He=0,Ee=1,$e=2;Ee<=be;++Ee,$e<<=1){if(Yt+=Pr<<=1,0>(Pr-=at[Ee]))return 0;for(;0<at[Ee];--at[Ee])(Ce=new F).g=Ee,Ce.value=it[He++],E(ve,et+sr,$e,Jt,Ce),sr=I(sr,Ee)}for(Ee=be+1,$e=2;15>=Ee;++Ee,$e<<=1){if(Yt+=Pr<<=1,0>(Pr-=at[Ee]))return 0;for(;0<at[Ee];--at[Ee]){if(Ce=new F,(sr&Et)!=jt){for(et+=Jt,mt=1<<(jt=Ee)-be;15>jt&&!(0>=(mt-=at[jt]));)++jt,mt<<=1;yt+=Jt=1<<(mt=jt-be),ve[ye+(jt=sr&Et)].g=mt+be,ve[ye+jt].value=et-ye-jt}Ce.g=Ee-be,Ce.value=it[He++],E(ve,et+(sr>>be),$e,Jt,Ce),sr=I(sr,Ee)}}return Yt!=2*ht[15]-1?0:yt})(N,W,te,oe,de,ge)}function F(){this.value=this.g=0}function L(){this.value=this.g=0}function z(){this.G=s(5,F),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=s(Cs,L)}function V(N,W,te,oe){t(N!=null),t(W!=null),t(2147483648>oe),N.Ca=254,N.I=0,N.b=-8,N.Ka=0,N.oa=W,N.pa=te,N.Jd=W,N.Yc=te+oe,N.Zc=4<=oe?te+oe-4+1:te,re(N)}function Q(N,W){for(var te=0;0<W--;)te|=ae(N,128)<<W;return te}function U(N,W){var te=Q(N,W);return J(N)?-te:te}function ee(N,W,te,oe){var de,ge=0;for(t(N!=null),t(W!=null),t(4294967288>oe),N.Sb=oe,N.Ra=0,N.u=0,N.h=0,4<oe&&(oe=4),de=0;de<oe;++de)ge+=W[te+de]<<8*de;N.Ra=ge,N.bb=oe,N.oa=W,N.pa=te}function H(N){for(;8<=N.u&&N.bb<N.Sb;)N.Ra>>>=8,N.Ra+=N.oa[N.pa+N.bb]<<qo-8>>>0,++N.bb,N.u-=8;Y(N)&&(N.h=1,N.u=0)}function B(N,W){if(t(0<=W),!N.h&&W<=np){var te=q(N)&_u[W];return N.u+=W,H(N),te}return N.h=1,N.u=0}function M(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function $(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function q(N){return N.Ra>>>(N.u&qo-1)>>>0}function Y(N){return t(N.bb<=N.Sb),N.h||N.bb==N.Sb&&N.u>qo}function K(N,W){N.u=W,N.h=Y(N)}function G(N){N.u>=$o&&(t(N.u>=$o),H(N))}function re(N){t(N!=null&&N.oa!=null),N.pa<N.Zc?(N.I=(N.oa[N.pa++]|N.I<<8)>>>0,N.b+=8):(t(N!=null&&N.oa!=null),N.pa<N.Yc?(N.b+=8,N.I=N.oa[N.pa++]|N.I<<8):N.Ka?N.b=0:(N.I<<=8,N.b+=8,N.Ka=1))}function J(N){return Q(N,1)}function ae(N,W){var te=N.Ca;0>N.b&&re(N);var oe=N.b,de=te*W>>>8,ge=(N.I>>>oe>de)+0;for(ge?(te-=de,N.I-=de+1<<oe>>>0):te=de+1,oe=te,de=0;256<=oe;)de+=8,oe>>=8;return oe=7^de+Cu[oe],N.b-=oe,N.Ca=(te<<oe)-1,ge}function le(N,W,te){N[W+0]=te>>24&255,N[W+1]=te>>16&255,N[W+2]=te>>8&255,N[W+3]=255&te}function me(N,W){return N[W+0]|N[W+1]<<8}function Oe(N,W){return me(N,W)|N[W+2]<<16}function we(N,W){return me(N,W)|me(N,W+2)<<16}function ie(N,W){var te=1<<W;return t(N!=null),t(0<W),N.X=a(te),N.X==null?0:(N.Mb=32-W,N.Xa=W,1)}function Me(N,W){t(N!=null),t(W!=null),t(N.Xa==W.Xa),n(W.X,0,N.X,0,1<<W.Xa)}function ke(){this.X=[],this.Xa=this.Mb=0}function se(N,W,te,oe){t(te!=null),t(oe!=null);var de=te[0],ge=oe[0];return de==0&&(de=(N*ge+W/2)/W),ge==0&&(ge=(W*de+N/2)/N),0>=de||0>=ge?0:(te[0]=de,oe[0]=ge,1)}function fe(N,W){return N+(1<<W)-1>>>W}function Ie(N,W){return((4278255360&N)+(4278255360&W)>>>0&4278255360)+((16711935&N)+(16711935&W)>>>0&16711935)>>>0}function ce(N,W){R[W]=function(te,oe,de,ge,ve,ye,be){var Ce;for(Ce=0;Ce<ve;++Ce){var $e=R[N](ye[be+Ce-1],de,ge+Ce);ye[be+Ce]=Ie(te[oe+Ce],$e)}}}function je(){this.ud=this.hd=this.jd=0}function qe(N,W){return((4278124286&(N^W))>>>1)+(N&W)>>>0}function Ne(N){return 0<=N&&256>N?N:0>N?0:255<N?255:void 0}function Je(N,W){return Ne(N+(N-W+.5>>1))}function vt(N,W,te){return Math.abs(W-te)-Math.abs(N-te)}function Ge(N,W,te,oe,de,ge,ve){for(oe=ge[ve-1],te=0;te<de;++te)ge[ve+te]=oe=Ie(N[W+te],oe)}function Ot(N,W,te,oe,de){var ge;for(ge=0;ge<te;++ge){var ve=N[W+ge],ye=ve>>8&255,be=16711935&(be=(be=16711935&ve)+((ye<<16)+ye));oe[de+ge]=(4278255360&ve)+be>>>0}}function nt(N,W){W.jd=255&N,W.hd=N>>8&255,W.ud=N>>16&255}function Ae(N,W,te,oe,de,ge){var ve;for(ve=0;ve<oe;++ve){var ye=W[te+ve],be=ye>>>8,Ce=ye,$e=255&($e=($e=ye>>>16)+((N.jd<<24>>24)*(be<<24>>24)>>>5));Ce=255&(Ce=(Ce+=(N.hd<<24>>24)*(be<<24>>24)>>>5)+((N.ud<<24>>24)*($e<<24>>24)>>>5)),de[ge+ve]=(4278255360&ye)+($e<<16)+Ce}}function Te(N,W,te,oe,de){R[W]=function(ge,ve,ye,be,Ce,$e,it,Ee,He){for(be=it;be<Ee;++be)for(it=0;it<He;++it)Ce[$e++]=de(ye[oe(ge[ve++])])},R[N]=function(ge,ve,ye,be,Ce,$e,it){var Ee=8>>ge.b,He=ge.Ea,et=ge.K[0],yt=ge.w;if(8>Ee)for(ge=(1<<ge.b)-1,yt=(1<<Ee)-1;ve<ye;++ve){var at,ht=0;for(at=0;at<He;++at)at&ge||(ht=oe(be[Ce++])),$e[it++]=de(et[ht&yt]),ht>>=Ee}else R["VP8LMapColor"+te](be,Ce,et,yt,$e,it,ve,ye,He)}}function wt(N,W,te,oe,de){for(te=W+te;W<te;){var ge=N[W++];oe[de++]=ge>>16&255,oe[de++]=ge>>8&255,oe[de++]=255&ge}}function ft(N,W,te,oe,de){for(te=W+te;W<te;){var ge=N[W++];oe[de++]=ge>>16&255,oe[de++]=ge>>8&255,oe[de++]=255&ge,oe[de++]=ge>>24&255}}function Pt(N,W,te,oe,de){for(te=W+te;W<te;){var ge=(ve=N[W++])>>16&240|ve>>12&15,ve=240&ve|ve>>28&15;oe[de++]=ge,oe[de++]=ve}}function At(N,W,te,oe,de){for(te=W+te;W<te;){var ge=(ve=N[W++])>>16&248|ve>>13&7,ve=ve>>5&224|ve>>3&31;oe[de++]=ge,oe[de++]=ve}}function Ht(N,W,te,oe,de){for(te=W+te;W<te;){var ge=N[W++];oe[de++]=255&ge,oe[de++]=ge>>8&255,oe[de++]=ge>>16&255}}function Se(N,W,te,oe,de,ge){if(ge==0)for(te=W+te;W<te;)le(oe,((ge=N[W++])[0]>>24|ge[1]>>8&65280|ge[2]<<8&16711680|ge[3]<<24)>>>0),de+=32;else n(oe,de,N,W,te)}function ct(N,W){R[W][0]=R[N+"0"],R[W][1]=R[N+"1"],R[W][2]=R[N+"2"],R[W][3]=R[N+"3"],R[W][4]=R[N+"4"],R[W][5]=R[N+"5"],R[W][6]=R[N+"6"],R[W][7]=R[N+"7"],R[W][8]=R[N+"8"],R[W][9]=R[N+"9"],R[W][10]=R[N+"10"],R[W][11]=R[N+"11"],R[W][12]=R[N+"12"],R[W][13]=R[N+"13"],R[W][14]=R[N+"0"],R[W][15]=R[N+"0"]}function gt(N){return N==$d||N==Ou||N==lp||N==cp}function We(){this.eb=[],this.size=this.A=this.fb=0}function Pe(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function rt(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new We,this.f.kb=new Pe,this.sd=null}function Ze(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function pe(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function xe(N){return alert("todo:WebPSamplerProcessPlane"),N.T}function De(N,W){var te=N.T,oe=W.ba.f.RGBA,de=oe.eb,ge=oe.fb+N.ka*oe.A,ve=ea[W.ba.S],ye=N.y,be=N.O,Ce=N.f,$e=N.N,it=N.ea,Ee=N.W,He=W.cc,et=W.dc,yt=W.Mc,at=W.Nc,ht=N.ka,mt=N.ka+N.T,jt=N.U,Et=jt+1>>1;for(ht==0?ve(ye,be,null,null,Ce,$e,it,Ee,Ce,$e,it,Ee,de,ge,null,null,jt):(ve(W.ec,W.fc,ye,be,He,et,yt,at,Ce,$e,it,Ee,de,ge-oe.A,de,ge,jt),++te);ht+2<mt;ht+=2)He=Ce,et=$e,yt=it,at=Ee,$e+=N.Rc,Ee+=N.Rc,ge+=2*oe.A,ve(ye,(be+=2*N.fa)-N.fa,ye,be,He,et,yt,at,Ce,$e,it,Ee,de,ge-oe.A,de,ge,jt);return be+=N.fa,N.j+mt<N.o?(n(W.ec,W.fc,ye,be,jt),n(W.cc,W.dc,Ce,$e,Et),n(W.Mc,W.Nc,it,Ee,Et),te--):1&mt||ve(ye,be,null,null,Ce,$e,it,Ee,Ce,$e,it,Ee,de,ge+oe.A,null,null,jt),te}function tt(N,W,te){var oe=N.F,de=[N.J];if(oe!=null){var ge=N.U,ve=W.ba.S,ye=ve==sp||ve==lp;W=W.ba.f.RGBA;var be=[0],Ce=N.ka;be[0]=N.T,N.Kb&&(Ce==0?--be[0]:(--Ce,de[0]-=N.width),N.j+N.ka+N.T==N.o&&(be[0]=N.o-N.j-Ce));var $e=W.eb;Ce=W.fb+Ce*W.A,N=op(oe,de[0],N.width,ge,be,$e,Ce+(ye?0:3),W.A),t(te==be),N&>(ve)&&Pu($e,Ce,ye,ge,be,W.A)}return 0}function Le(N){var W=N.ma,te=W.ba.S,oe=11>te,de=te==Pc||te==ap||te==sp||te==Cn||te==12||gt(te);if(W.memory=null,W.Ib=null,W.Jb=null,W.Nd=null,!ja(W.Oa,N,de?11:12))return 0;if(de&>(te)&&_s(),N.da)alert("todo:use_scaling");else{if(oe){if(W.Ib=xe,N.Kb){if(te=N.U+1>>1,W.memory=a(N.U+2*te),W.memory==null)return 0;W.ec=W.memory,W.fc=0,W.cc=W.ec,W.dc=W.fc+N.U,W.Mc=W.cc,W.Nc=W.dc+te,W.Ib=De,_s()}}else alert("todo:EmitYUV");de&&(W.Jb=tt,oe&&Jn())}if(oe&&!io){for(N=0;256>N;++N)ta[N]=89858*(N-128)+As>>Bl,ra[N]=-22014*(N-128)+As,Yd[N]=-45773*(N-128),Lu[N]=113618*(N-128)+As>>Bl;for(N=fn;N<mn;++N)W=76283*(N-16)+As>>Bl,rg[N-fn]=yi(W,255),zb[N-fn]=yi(W+8>>4,15);io=1}return 1}function Ke(N){var W=N.ma,te=N.U,oe=N.T;return t(!(1&N.ka)),0>=te||0>=oe?0:(te=W.Ib(N,W),W.Jb!=null&&W.Jb(N,W,te),W.Dc+=te,1)}function Fe(N){N.ma.memory=null}function Ve(N,W,te,oe){return B(N,8)!=47?0:(W[0]=B(N,14)+1,te[0]=B(N,14)+1,oe[0]=B(N,1),B(N,3)!=0?0:!N.h)}function xt(N,W){if(4>N)return N+1;var te=N-2>>1;return(2+(1&N)<<te)+B(W,te)+1}function dt(N,W){return 120<W?W-120:1<=(te=((te=zS[W-1])>>4)*N+(8-(15&te)))?te:1;var te}function Tt(N,W,te){var oe=q(te),de=N[W+=255&oe].g-8;return 0<de&&(K(te,te.u+8),oe=q(te),W+=N[W].value,W+=oe&(1<<de)-1),K(te,te.u+N[W].g),N[W].value}function Mt(N,W,te){return te.g+=N.g,te.value+=N.value<<W>>>0,t(8>=te.g),N.g}function fr(N,W,te){var oe=N.xc;return t((W=oe==0?0:N.vc[N.md*(te>>oe)+(W>>oe)])<N.Wb),N.Ya[W]}function hr(N,W,te,oe){var de=N.ab,ge=N.c*W,ve=N.C;W=ve+W;var ye=te,be=oe;for(oe=N.Ta,te=N.Ua;0<de--;){var Ce=N.gc[de],$e=ve,it=W,Ee=ye,He=be,et=(be=oe,ye=te,Ce.Ea);switch(t($e<it),t(it<=Ce.nc),Ce.hc){case 2:Dd(Ee,He,(it-$e)*et,be,ye);break;case 0:var yt=$e,at=it,ht=be,mt=ye,jt=(Jt=Ce).Ea;yt==0&&(Ga(Ee,He,null,null,1,ht,mt),Ge(Ee,He+1,0,0,jt-1,ht,mt+1),He+=jt,mt+=jt,++yt);for(var Et=1<<Jt.b,sr=Et-1,Yt=fe(jt,Jt.b),Pr=Jt.K,Jt=Jt.w+(yt>>Jt.b)*Yt;yt<at;){var Br=Pr,ai=Jt,Or=1;for(Ka(Ee,He,ht,mt-jt,1,ht,mt);Or<jt;){var Gt=(Or&~sr)+Et;Gt>jt&&(Gt=jt),(0,ka[Br[ai++]>>8&15])(Ee,He+ +Or,ht,mt+Or-jt,Gt-Or,ht,mt+Or),Or=Gt}He+=jt,mt+=jt,++yt&sr||(Jt+=Yt)}it!=Ce.nc&&n(be,ye-et,be,ye+(it-$e-1)*et,et);break;case 1:for(et=Ee,at=He,jt=(Ee=Ce.Ea)-(mt=Ee&~(ht=(He=1<<Ce.b)-1)),yt=fe(Ee,Ce.b),Et=Ce.K,Ce=Ce.w+($e>>Ce.b)*yt;$e<it;){for(sr=Et,Yt=Ce,Pr=new je,Jt=at+mt,Br=at+Ee;at<Jt;)nt(sr[Yt++],Pr),Cc(Pr,et,at,He,be,ye),at+=He,ye+=He;at<Br&&(nt(sr[Yt++],Pr),Cc(Pr,et,at,jt,be,ye),at+=jt,ye+=jt),++$e&ht||(Ce+=yt)}break;case 3:if(Ee==be&&He==ye&&0<Ce.b){for(at=be,Ee=et=ye+(it-$e)*et-(mt=(it-$e)*fe(Ce.Ea,Ce.b)),He=be,ht=ye,yt=[],mt=(jt=mt)-1;0<=mt;--mt)yt[mt]=He[ht+mt];for(mt=jt-1;0<=mt;--mt)at[Ee+mt]=yt[mt];al(Ce,$e,it,be,et,be,ye)}else al(Ce,$e,it,Ee,He,be,ye)}ye=oe,be=te}be!=te&&n(oe,te,ye,be,ge)}function Qr(N,W){var te=N.V,oe=N.Ba+N.c*N.C,de=W-N.C;if(t(W<=N.l.o),t(16>=de),0<de){var ge=N.l,ve=N.Ta,ye=N.Ua,be=ge.width;if(hr(N,de,te,oe),de=ye=[ye],t((te=N.C)<(oe=W)),t(ge.v<ge.va),oe>ge.o&&(oe=ge.o),te<ge.j){var Ce=ge.j-te;te=ge.j,de[0]+=Ce*be}if(te>=oe?te=0:(de[0]+=4*ge.v,ge.ka=te-ge.j,ge.U=ge.va-ge.v,ge.T=oe-te,te=1),te){if(ye=ye[0],11>(te=N.ca).S){var $e=te.f.RGBA,it=(oe=te.S,de=ge.U,ge=ge.T,Ce=$e.eb,$e.A),Ee=ge;for($e=$e.fb+N.Ma*$e.A;0<Ee--;){var He=ve,et=ye,yt=de,at=Ce,ht=$e;switch(oe){case Zh:zd(He,et,yt,at,ht);break;case Pc:Bd(He,et,yt,at,ht);break;case $d:Bd(He,et,yt,at,ht),Pu(at,ht,0,yt,1,0);break;case Rb:Au(He,et,yt,at,ht);break;case ap:Se(He,et,yt,at,ht,1);break;case Ou:Se(He,et,yt,at,ht,1),Pu(at,ht,0,yt,1,0);break;case sp:Se(He,et,yt,at,ht,0);break;case lp:Se(He,et,yt,at,ht,0),Pu(at,ht,1,yt,1,0);break;case Cn:Wd(He,et,yt,at,ht);break;case cp:Wd(He,et,yt,at,ht),Fv(at,ht,yt,1,0);break;case Jh:Eu(He,et,yt,at,ht);break;default:t(0)}ye+=be,$e+=it}N.Ma+=ge}else alert("todo:EmitRescaledRowsYUVA");t(N.Ma<=te.height)}}N.C=W,t(N.C<=N.i)}function Rn(N){var W;if(0<N.ua)return 0;for(W=0;W<N.Wb;++W){var te=N.Ya[W].G,oe=N.Ya[W].H;if(0<te[1][oe[1]+0].g||0<te[2][oe[2]+0].g||0<te[3][oe[3]+0].g)return 0}return 1}function to(N,W,te,oe,de,ge){if(N.Z!=0){var ve=N.qd,ye=N.rd;for(t(So[N.Z]!=null);W<te;++W)So[N.Z](ve,ye,oe,de,oe,de,ge),ve=oe,ye=de,de+=ge;N.qd=ve,N.rd=ye}}function Ln(N,W){var te=N.l.ma,oe=te.Z==0||te.Z==1?N.l.j:N.C;if(oe=N.C<oe?oe:N.C,t(W<=N.l.o),W>oe){var de=N.l.width,ge=te.ca,ve=te.tb+de*oe,ye=N.V,be=N.Ba+N.c*oe,Ce=N.gc;t(N.ab==1),t(Ce[0].hc==3),Qh(Ce[0],oe,W,ye,be,ge,ve),to(te,oe,W,ge,ve,de)}N.C=N.Ma=W}function vo(N,W,te,oe,de,ge,ve){var ye=N.$/oe,be=N.$%oe,Ce=N.m,$e=N.s,it=te+N.$,Ee=it;de=te+oe*de;var He=te+oe*ge,et=280+$e.ua,yt=N.Pb?ye:16777216,at=0<$e.ua?$e.Wa:null,ht=$e.wc,mt=it<He?fr($e,be,ye):null;t(N.C<ge),t(He<=de);var jt=!1;e:for(;;){for(;jt||it<He;){var Et=0;if(ye>=yt){var sr=it-te;t((yt=N).Pb),yt.wd=yt.m,yt.xd=sr,0<yt.s.ua&&Me(yt.s.Wa,yt.s.vb),yt=ye+tg}if(be&ht||(mt=fr($e,be,ye)),t(mt!=null),mt.Qb&&(W[it]=mt.qb,jt=!0),!jt)if(G(Ce),mt.jc){Et=Ce,sr=W;var Yt=it,Pr=mt.pd[q(Et)&Cs-1];t(mt.jc),256>Pr.g?(K(Et,Et.u+Pr.g),sr[Yt]=Pr.value,Et=0):(K(Et,Et.u+Pr.g-256),t(256<=Pr.value),Et=Pr.value),Et==0&&(jt=!0)}else Et=Tt(mt.G[0],mt.H[0],Ce);if(Ce.h)break;if(jt||256>Et){if(!jt)if(mt.nd)W[it]=(mt.qb|Et<<8)>>>0;else{if(G(Ce),jt=Tt(mt.G[1],mt.H[1],Ce),G(Ce),sr=Tt(mt.G[2],mt.H[2],Ce),Yt=Tt(mt.G[3],mt.H[3],Ce),Ce.h)break;W[it]=(Yt<<24|jt<<16|Et<<8|sr)>>>0}if(jt=!1,++it,++be>=oe&&(be=0,++ye,ve!=null&&ye<=ge&&!(ye%16)&&ve(N,ye),at!=null))for(;Ee<it;)Et=W[Ee++],at.X[(506832829*Et&4294967295)>>>at.Mb]=Et}else if(280>Et){if(Et=xt(Et-256,Ce),sr=Tt(mt.G[4],mt.H[4],Ce),G(Ce),sr=dt(oe,sr=xt(sr,Ce)),Ce.h)break;if(it-te<sr||de-it<Et)break e;for(Yt=0;Yt<Et;++Yt)W[it+Yt]=W[it+Yt-sr];for(it+=Et,be+=Et;be>=oe;)be-=oe,++ye,ve!=null&&ye<=ge&&!(ye%16)&&ve(N,ye);if(t(it<=de),be&ht&&(mt=fr($e,be,ye)),at!=null)for(;Ee<it;)Et=W[Ee++],at.X[(506832829*Et&4294967295)>>>at.Mb]=Et}else{if(!(Et<et))break e;for(jt=Et-280,t(at!=null);Ee<it;)Et=W[Ee++],at.X[(506832829*Et&4294967295)>>>at.Mb]=Et;Et=it,t(!(jt>>>(sr=at).Xa)),W[Et]=sr.X[jt],jt=!0}jt||t(Ce.h==Y(Ce))}if(N.Pb&&Ce.h&&it<de)t(N.m.h),N.a=5,N.m=N.wd,N.$=N.xd,0<N.s.ua&&Me(N.s.vb,N.s.Wa);else{if(Ce.h)break e;ve!=null&&ve(N,ye>ge?ge:ye),N.a=0,N.$=it-te}return 1}return N.a=3,0}function ro(N){t(N!=null),N.vc=null,N.yc=null,N.Ya=null;var W=N.Wa;W!=null&&(W.X=null),N.vb=null,t(N!=null)}function ys(){var N=new tr;return N==null?null:(N.a=0,N.xb=Hd,ct("Predictor","VP8LPredictors"),ct("Predictor","VP8LPredictors_C"),ct("PredictorAdd","VP8LPredictorsAdd"),ct("PredictorAdd","VP8LPredictorsAdd_C"),Dd=Ot,Cc=Ae,zd=wt,Bd=ft,Wd=Pt,Eu=At,Au=Ht,R.VP8LMapColor32b=wi,R.VP8LMapColor8b=Qa,N)}function zo(N,W,te,oe,de){var ge=1,ve=[N],ye=[W],be=oe.m,Ce=oe.s,$e=null,it=0;e:for(;;){if(te)for(;ge&&B(be,1);){var Ee=ve,He=ye,et=oe,yt=1,at=et.m,ht=et.gc[et.ab],mt=B(at,2);if(et.Oc&1<<mt)ge=0;else{switch(et.Oc|=1<<mt,ht.hc=mt,ht.Ea=Ee[0],ht.nc=He[0],ht.K=[null],++et.ab,t(4>=et.ab),mt){case 0:case 1:ht.b=B(at,3)+2,yt=zo(fe(ht.Ea,ht.b),fe(ht.nc,ht.b),0,et,ht.K),ht.K=ht.K[0];break;case 3:var jt,Et=B(at,8)+1,sr=16<Et?0:4<Et?1:2<Et?2:3;if(Ee[0]=fe(ht.Ea,sr),ht.b=sr,jt=yt=zo(Et,1,0,et,ht.K)){var Yt,Pr=Et,Jt=ht,Br=1<<(8>>Jt.b),ai=a(Br);if(ai==null)jt=0;else{var Or=Jt.K[0],Gt=Jt.w;for(ai[0]=Jt.K[0][0],Yt=1;Yt<1*Pr;++Yt)ai[Yt]=Ie(Or[Gt+Yt],ai[Yt-1]);for(;Yt<4*Br;++Yt)ai[Yt]=0;Jt.K[0]=null,Jt.K[0]=ai,jt=1}}yt=jt;break;case 2:break;default:t(0)}ge=yt}}if(ve=ve[0],ye=ye[0],ge&&B(be,1)&&!(ge=1<=(it=B(be,4))&&11>=it)){oe.a=3;break e}var qt;if(qt=ge)t:{var di,br,Mr,In=oe,Vi=ve,Si=ye,ti=it,Li=te,Yi=In.m,qn=In.s,Hr=[null],en=1,$n=0,tn=Fb[ti];r:for(;;){if(Li&&B(Yi,1)){var si=B(Yi,3)+2,li=fe(Vi,si),En=fe(Si,si),jo=li*En;if(!zo(li,En,0,In,Hr))break r;for(Hr=Hr[0],qn.xc=si,di=0;di<jo;++di){var vn=Hr[di]>>8&65535;Hr[di]=vn,vn>=en&&(en=vn+1)}}if(Yi.h)break r;for(br=0;5>br;++br){var An=Iu[br];!br&&0<ti&&(An+=1<<ti),$n<An&&($n=An)}var ji=s(en*tn,F),oo=en,na=s(oo,z);if(na==null)var fi=null;else t(65536>=oo),fi=na;var pi=a($n);if(fi==null||pi==null||ji==null){In.a=1;break r}var ko=ji;for(di=Mr=0;di<en;++di){var Tn=fi[di],_o=Tn.G,Ja=Tn.H,Ts=0,Gi=1,hi=0;for(br=0;5>br;++br){An=Iu[br],_o[br]=ko,Ja[br]=Mr,!br&&0<ti&&(An+=1<<ti);i:{var Nc,ql=An,Gd=In,dl=pi,Wb=ko,Gv=Mr,Mn=0,Ps=Gd.m,Kv=B(Ps,1);if(o(dl,0,0,ql),Kv){var Qv=B(Ps,1)+1,ng=B(Ps,1),ig=B(Ps,ng==0?1:8);dl[ig]=1,Qv==2&&(dl[ig=B(Ps,8)]=1);var fl=1}else{var Un=a(19),ki=B(Ps,4)+4;if(19<ki){Gd.a=3;var gi=0;break i}for(Nc=0;Nc<ki;++Nc)Un[DS[Nc]]=B(Ps,3);var Kd=void 0,$l=void 0,Qd=Gd,US=Un,Fi=ql,og=dl,hp=0,pl=Qd.m,Os=8,_a=s(128,F);n:for(;A(_a,0,7,US,19);){if(B(pl,1)){var gp=2+2*B(pl,3);if((Kd=2+B(pl,gp))>Fi)break n}else Kd=Fi;for($l=0;$l<Fi&&Kd--;){G(pl);var ag=_a[0+(127&q(pl))];K(pl,pl.u+ag.g);var Rc=ag.value;if(16>Rc)og[$l++]=Rc,Rc!=0&&(Os=Rc);else{var qb=Rc==16,Xv=Rc-16,$b=eg[Xv],Zv=B(pl,up[Xv])+$b;if($l+Zv>Fi)break n;for(var Ub=qb?Os:0;0<Zv--;)og[$l++]=Ub}}hp=1;break n}hp||(Qd.a=3),fl=hp}(fl=fl&&!Ps.h)&&(Mn=A(Wb,Gv,8,dl,ql)),fl&&Mn!=0?gi=Mn:(Gd.a=3,gi=0)}if(gi==0)break r;if(Gi&&Lb[br]==1&&(Gi=ko[Mr].g==0),Ts+=ko[Mr].g,Mr+=gi,3>=br){var Xd,sg=pi[0];for(Xd=1;Xd<An;++Xd)pi[Xd]>sg&&(sg=pi[Xd]);hi+=sg}}if(Tn.nd=Gi,Tn.Qb=0,Gi&&(Tn.qb=(_o[3][Ja[3]+0].value<<24|_o[1][Ja[1]+0].value<<16|_o[2][Ja[2]+0].value)>>>0,Ts==0&&256>_o[0][Ja[0]+0].value&&(Tn.Qb=1,Tn.qb+=_o[0][Ja[0]+0].value<<8)),Tn.jc=!Tn.Qb&&6>hi,Tn.jc){var mp,Ca=Tn;for(mp=0;mp<Cs;++mp){var Ul=mp,Is=Ca.pd[Ul],Mu=Ca.G[0][Ca.H[0]+Ul];256<=Mu.value?(Is.g=Mu.g+256,Is.value=Mu.value):(Is.g=0,Is.value=0,Ul>>=Mt(Mu,8,Is),Ul>>=Mt(Ca.G[1][Ca.H[1]+Ul],16,Is),Ul>>=Mt(Ca.G[2][Ca.H[2]+Ul],0,Is),Mt(Ca.G[3][Ca.H[3]+Ul],24,Is))}}}qn.vc=Hr,qn.Wb=en,qn.Ya=fi,qn.yc=ji,qt=1;break t}qt=0}if(!(ge=qt)){oe.a=3;break e}if(0<it){if(Ce.ua=1<<it,!ie(Ce.Wa,it)){oe.a=1,ge=0;break e}}else Ce.ua=0;var lg=oe,cg=ve,Hb=ye,ug=lg.s,dg=ug.xc;if(lg.c=cg,lg.i=Hb,ug.md=fe(cg,dg),ug.wc=dg==0?-1:(1<<dg)-1,te){oe.xb=ul;break e}if(($e=a(ve*ye))==null){oe.a=1,ge=0;break e}ge=(ge=vo(oe,$e,0,ve,ye,ye,null))&&!be.h;break e}return ge?(de!=null?de[0]=$e:(t($e==null),t(te)),oe.$=0,te||ro(Ce)):ro(Ce),ge}function $a(N,W){var te=N.c*N.i,oe=te+W+16*W;return t(N.c<=W),N.V=a(oe),N.V==null?(N.Ta=null,N.Ua=0,N.a=1,0):(N.Ta=N.V,N.Ua=N.Ba+te+W,1)}function xa(N,W){var te=N.C,oe=W-te,de=N.V,ge=N.Ba+N.c*te;for(t(W<=N.l.o);0<oe;){var ve=16<oe?16:oe,ye=N.l.ma,be=N.l.width,Ce=be*ve,$e=ye.ca,it=ye.tb+be*te,Ee=N.Ta,He=N.Ua;hr(N,ve,de,ge),Mv(Ee,He,$e,it,Ce),to(ye,te,te+ve,$e,it,be),oe-=ve,de+=ve*N.c,te+=ve}t(te==W),N.C=N.Ma=W}function zt(){this.ub=this.yd=this.td=this.Rb=0}function yr(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Xn(){this.Fb=this.Bb=this.Cb=0,this.Zb=a(4),this.Lb=a(4)}function Gr(){this.Yb=(function(){var N=[];return(function W(te,oe,de){for(var ge=de[oe],ve=0;ve<ge&&(te.push(de.length>oe+1?[]:0),!(de.length<oe+1));ve++)W(te[ve],oe+1,de)})(N,0,[3,11]),N})()}function Ut(){this.jb=a(3),this.Wc=l([4,8],Gr),this.Xc=l([4,17],Gr)}function $i(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new a(4),this.od=new a(4)}function yo(){this.ld=this.La=this.dd=this.tc=0}function oi(){this.Na=this.la=0}function xc(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Ed(){this.ad=a(384),this.Za=0,this.Ob=a(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function uu(){this.uc=this.M=this.Nb=0,this.wa=Array(new yo),this.Y=0,this.ya=Array(new Ed),this.aa=0,this.l=new Ad}function ba(){this.y=a(16),this.f=a(8),this.ea=a(8)}function $h(){this.cb=this.a=0,this.sc="",this.m=new M,this.Od=new zt,this.Kc=new yr,this.ed=new $i,this.Qa=new Xn,this.Ic=this.$c=this.Aa=0,this.D=new uu,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=s(8,M),this.ia=0,this.pb=s(4,xc),this.Pa=new Ut,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new ba),this.Hd=0,this.rb=Array(new oi),this.sb=0,this.wa=Array(new yo),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new Ed),this.L=this.aa=0,this.gd=l([4,2],yo),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function yi(N,W){return 0>N?0:N>W?W:N}function Ad(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Tv(){var N=new $h;return N!=null&&(N.a=0,N.sc="OK",N.cb=0,N.Xb=0,Nu||(Nu=el)),N}function xi(N,W,te){return N.a==0&&(N.a=W,N.sc=te,N.cb=0),0}function du(N,W,te){return 3<=te&&N[W+0]==157&&N[W+1]==1&&N[W+2]==42}function wa(N,W){if(N==null)return 0;if(N.a=0,N.sc="OK",W==null)return xi(N,2,"null VP8Io passed to VP8GetHeaders()");var te=W.data,oe=W.w,de=W.ha;if(4>de)return xi(N,7,"Truncated header.");var ge=te[oe+0]|te[oe+1]<<8|te[oe+2]<<16,ve=N.Od;if(ve.Rb=!(1&ge),ve.td=ge>>1&7,ve.yd=ge>>4&1,ve.ub=ge>>5,3<ve.td)return xi(N,3,"Incorrect keyframe parameters.");if(!ve.yd)return xi(N,4,"Frame not displayable.");oe+=3,de-=3;var ye=N.Kc;if(ve.Rb){if(7>de)return xi(N,7,"cannot parse picture header");if(!du(te,oe,de))return xi(N,3,"Bad code word");ye.c=16383&(te[oe+4]<<8|te[oe+3]),ye.Td=te[oe+4]>>6,ye.i=16383&(te[oe+6]<<8|te[oe+5]),ye.Ud=te[oe+6]>>6,oe+=7,de-=7,N.za=ye.c+15>>4,N.Ub=ye.i+15>>4,W.width=ye.c,W.height=ye.i,W.Da=0,W.j=0,W.v=0,W.va=W.width,W.o=W.height,W.da=0,W.ib=W.width,W.hb=W.height,W.U=W.width,W.T=W.height,o((ge=N.Pa).jb,0,255,ge.jb.length),t((ge=N.Qa)!=null),ge.Cb=0,ge.Bb=0,ge.Fb=1,o(ge.Zb,0,0,ge.Zb.length),o(ge.Lb,0,0,ge.Lb)}if(ve.ub>de)return xi(N,7,"bad partition length");V(ge=N.m,te,oe,ve.ub),oe+=ve.ub,de-=ve.ub,ve.Rb&&(ye.Ld=J(ge),ye.Kd=J(ge)),ye=N.Qa;var be,Ce=N.Pa;if(t(ge!=null),t(ye!=null),ye.Cb=J(ge),ye.Cb){if(ye.Bb=J(ge),J(ge)){for(ye.Fb=J(ge),be=0;4>be;++be)ye.Zb[be]=J(ge)?U(ge,7):0;for(be=0;4>be;++be)ye.Lb[be]=J(ge)?U(ge,6):0}if(ye.Bb)for(be=0;3>be;++be)Ce.jb[be]=J(ge)?Q(ge,8):255}else ye.Bb=0;if(ge.Ka)return xi(N,3,"cannot parse segment header");if((ye=N.ed).zd=J(ge),ye.Tb=Q(ge,6),ye.wb=Q(ge,3),ye.Pc=J(ge),ye.Pc&&J(ge)){for(Ce=0;4>Ce;++Ce)J(ge)&&(ye.vd[Ce]=U(ge,6));for(Ce=0;4>Ce;++Ce)J(ge)&&(ye.od[Ce]=U(ge,6))}if(N.L=ye.Tb==0?0:ye.zd?1:2,ge.Ka)return xi(N,3,"cannot parse filter header");var $e=de;if(de=be=oe,oe=be+$e,ye=$e,N.Xb=(1<<Q(N.m,2))-1,$e<3*(Ce=N.Xb))te=7;else{for(be+=3*Ce,ye-=3*Ce,$e=0;$e<Ce;++$e){var it=te[de+0]|te[de+1]<<8|te[de+2]<<16;it>ye&&(it=ye),V(N.Jc[+$e],te,be,it),be+=it,ye-=it,de+=3}V(N.Jc[+Ce],te,be,ye),te=be<oe?0:5}if(te!=0)return xi(N,te,"cannot parse partitions");for(te=Q(be=N.m,7),de=J(be)?U(be,4):0,oe=J(be)?U(be,4):0,ye=J(be)?U(be,4):0,Ce=J(be)?U(be,4):0,be=J(be)?U(be,4):0,$e=N.Qa,it=0;4>it;++it){if($e.Cb){var Ee=$e.Zb[it];$e.Fb||(Ee+=te)}else{if(0<it){N.pb[it]=N.pb[0];continue}Ee=te}var He=N.pb[it];He.Sc[0]=Ud[yi(Ee+de,127)],He.Sc[1]=dp[yi(Ee+0,127)],He.Eb[0]=2*Ud[yi(Ee+oe,127)],He.Eb[1]=101581*dp[yi(Ee+ye,127)]>>16,8>He.Eb[1]&&(He.Eb[1]=8),He.Qc[0]=Ud[yi(Ee+Ce,117)],He.Qc[1]=dp[yi(Ee+be,127)],He.lc=Ee+be}if(!ve.Rb)return xi(N,4,"Not a key frame.");for(J(ge),ve=N.Pa,te=0;4>te;++te){for(de=0;8>de;++de)for(oe=0;3>oe;++oe)for(ye=0;11>ye;++ye)Ce=ae(ge,WS[te][de][oe][ye])?Q(ge,8):Db[te][de][oe][ye],ve.Wc[te][de].Yb[oe][ye]=Ce;for(de=0;17>de;++de)ve.Xc[te][de]=ve.Wc[te][Hv[de]]}return N.kc=J(ge),N.kc&&(N.Bd=Q(ge,8)),N.cb=1}function el(N,W,te,oe,de,ge,ve){var ye=W[de].Yb[te];for(te=0;16>de;++de){if(!ae(N,ye[te+0]))return de;for(;!ae(N,ye[te+1]);)if(ye=W[++de].Yb[0],te=0,de==16)return 16;var be=W[de+1].Yb;if(ae(N,ye[te+2])){var Ce=N,$e=0;if(ae(Ce,(Ee=ye)[(it=te)+3]))if(ae(Ce,Ee[it+6])){for(ye=0,it=2*($e=ae(Ce,Ee[it+8]))+(Ee=ae(Ce,Ee[it+9+$e])),$e=0,Ee=$v[it];Ee[ye];++ye)$e+=$e+ae(Ce,Ee[ye]);$e+=3+(8<<it)}else ae(Ce,Ee[it+7])?($e=7+2*ae(Ce,165),$e+=ae(Ce,145)):$e=5+ae(Ce,159);else $e=ae(Ce,Ee[it+4])?3+ae(Ce,Ee[it+5]):2;ye=be[2]}else $e=1,ye=be[1];be=ve+Uv[de],0>(Ce=N).b&&re(Ce);var it,Ee=Ce.b,He=(it=Ce.Ca>>1)-(Ce.I>>Ee)>>31;--Ce.b,Ce.Ca+=He,Ce.Ca|=1,Ce.I-=(it+1&He)<<Ee,ge[be]=(($e^He)-He)*oe[(0<de)+0]}return 16}function bc(N){var W=N.rb[N.sb-1];W.la=0,W.Na=0,o(N.zc,0,0,N.zc.length),N.ja=0}function Sa(N,W,te,oe,de){de=N[W+te+32*oe]+(de>>3),N[W+te+32*oe]=-256&de?0>de?0:255:de}function Td(N,W,te,oe,de,ge){Sa(N,W,0,te,oe+de),Sa(N,W,1,te,oe+ge),Sa(N,W,2,te,oe-ge),Sa(N,W,3,te,oe-de)}function xs(N){return(20091*N>>16)+N}function Ui(N,W,te,oe){var de,ge=0,ve=a(16);for(de=0;4>de;++de){var ye=N[W+0]+N[W+8],be=N[W+0]-N[W+8],Ce=(35468*N[W+4]>>16)-xs(N[W+12]),$e=xs(N[W+4])+(35468*N[W+12]>>16);ve[ge+0]=ye+$e,ve[ge+1]=be+Ce,ve[ge+2]=be-Ce,ve[ge+3]=ye-$e,ge+=4,W++}for(de=ge=0;4>de;++de)ye=(N=ve[ge+0]+4)+ve[ge+8],be=N-ve[ge+8],Ce=(35468*ve[ge+4]>>16)-xs(ve[ge+12]),Sa(te,oe,0,0,ye+($e=xs(ve[ge+4])+(35468*ve[ge+12]>>16))),Sa(te,oe,1,0,be+Ce),Sa(te,oe,2,0,be-Ce),Sa(te,oe,3,0,ye-$e),ge++,oe+=32}function Pd(N,W,te,oe){var de=N[W+0]+4,ge=35468*N[W+4]>>16,ve=xs(N[W+4]),ye=35468*N[W+1]>>16;Td(te,oe,0,de+ve,N=xs(N[W+1]),ye),Td(te,oe,1,de+ge,N,ye),Td(te,oe,2,de-ge,N,ye),Td(te,oe,3,de-ve,N,ye)}function fu(N,W,te,oe,de){Ui(N,W,te,oe),de&&Ui(N,W+16,te,oe+4)}function Pv(N,W,te,oe){Dl(N,W+0,te,oe,1),Dl(N,W+32,te,oe+128,1)}function Xf(N,W,te,oe){var de;for(N=N[W+0]+4,de=0;4>de;++de)for(W=0;4>W;++W)Sa(te,oe,W,de,N)}function Fr(N,W,te,oe){N[W+0]&&no(N,W+0,te,oe),N[W+16]&&no(N,W+16,te,oe+4),N[W+32]&&no(N,W+32,te,oe+128),N[W+48]&&no(N,W+48,te,oe+128+4)}function Zf(N,W,te,oe){var de,ge=a(16);for(de=0;4>de;++de){var ve=N[W+0+de]+N[W+12+de],ye=N[W+4+de]+N[W+8+de],be=N[W+4+de]-N[W+8+de],Ce=N[W+0+de]-N[W+12+de];ge[0+de]=ve+ye,ge[8+de]=ve-ye,ge[4+de]=Ce+be,ge[12+de]=Ce-be}for(de=0;4>de;++de)ve=(N=ge[0+4*de]+3)+ge[3+4*de],ye=ge[1+4*de]+ge[2+4*de],be=ge[1+4*de]-ge[2+4*de],Ce=N-ge[3+4*de],te[oe+0]=ve+ye>>3,te[oe+16]=Ce+be>>3,te[oe+32]=ve-ye>>3,te[oe+48]=Ce-be>>3,oe+=64}function pu(N,W,te){var oe,de=W-32,ge=Uo,ve=255-N[de-1];for(oe=0;oe<te;++oe){var ye,be=ge,Ce=ve+N[W-1];for(ye=0;ye<te;++ye)N[W+ye]=be[Ce+N[de+ye]];W+=32}}function wc(N,W){pu(N,W,4)}function Od(N,W){pu(N,W,8)}function Uh(N,W){pu(N,W,16)}function Hh(N,W){var te;for(te=0;16>te;++te)n(N,W+32*te,N,W-32,16)}function Jf(N,W){var te;for(te=16;0<te;--te)o(N,W,N[W-1],16),W+=32}function bs(N,W,te){var oe;for(oe=0;16>oe;++oe)o(W,te+32*oe,N,16)}function ws(N,W){var te,oe=16;for(te=0;16>te;++te)oe+=N[W-1+32*te]+N[W+te-32];bs(oe>>5,N,W)}function Bo(N,W){var te,oe=8;for(te=0;16>te;++te)oe+=N[W-1+32*te];bs(oe>>4,N,W)}function tl(N,W){var te,oe=8;for(te=0;16>te;++te)oe+=N[W+te-32];bs(oe>>4,N,W)}function Ss(N,W){bs(128,N,W)}function pr(N,W,te){return N+2*W+te+2>>2}function rl(N,W){var te,oe=W-32;for(oe=new Uint8Array([pr(N[oe-1],N[oe+0],N[oe+1]),pr(N[oe+0],N[oe+1],N[oe+2]),pr(N[oe+1],N[oe+2],N[oe+3]),pr(N[oe+2],N[oe+3],N[oe+4])]),te=0;4>te;++te)n(N,W+32*te,oe,0,oe.length)}function Ov(N,W){var te=N[W-1],oe=N[W-1+32],de=N[W-1+64],ge=N[W-1+96];le(N,W+0,16843009*pr(N[W-1-32],te,oe)),le(N,W+32,16843009*pr(te,oe,de)),le(N,W+64,16843009*pr(oe,de,ge)),le(N,W+96,16843009*pr(de,ge,ge))}function Vh(N,W){var te,oe=4;for(te=0;4>te;++te)oe+=N[W+te-32]+N[W-1+32*te];for(oe>>=3,te=0;4>te;++te)o(N,W+32*te,oe,4)}function hu(N,W){var te=N[W-1+0],oe=N[W-1+32],de=N[W-1+64],ge=N[W-1-32],ve=N[W+0-32],ye=N[W+1-32],be=N[W+2-32],Ce=N[W+3-32];N[W+0+96]=pr(oe,de,N[W-1+96]),N[W+1+96]=N[W+0+64]=pr(te,oe,de),N[W+2+96]=N[W+1+64]=N[W+0+32]=pr(ge,te,oe),N[W+3+96]=N[W+2+64]=N[W+1+32]=N[W+0+0]=pr(ve,ge,te),N[W+3+64]=N[W+2+32]=N[W+1+0]=pr(ye,ve,ge),N[W+3+32]=N[W+2+0]=pr(be,ye,ve),N[W+3+0]=pr(Ce,be,ye)}function Iv(N,W){var te=N[W+1-32],oe=N[W+2-32],de=N[W+3-32],ge=N[W+4-32],ve=N[W+5-32],ye=N[W+6-32],be=N[W+7-32];N[W+0+0]=pr(N[W+0-32],te,oe),N[W+1+0]=N[W+0+32]=pr(te,oe,de),N[W+2+0]=N[W+1+32]=N[W+0+64]=pr(oe,de,ge),N[W+3+0]=N[W+2+32]=N[W+1+64]=N[W+0+96]=pr(de,ge,ve),N[W+3+32]=N[W+2+64]=N[W+1+96]=pr(ge,ve,ye),N[W+3+64]=N[W+2+96]=pr(ve,ye,be),N[W+3+96]=pr(ye,be,be)}function nl(N,W){var te=N[W-1+0],oe=N[W-1+32],de=N[W-1+64],ge=N[W-1-32],ve=N[W+0-32],ye=N[W+1-32],be=N[W+2-32],Ce=N[W+3-32];N[W+0+0]=N[W+1+64]=ge+ve+1>>1,N[W+1+0]=N[W+2+64]=ve+ye+1>>1,N[W+2+0]=N[W+3+64]=ye+be+1>>1,N[W+3+0]=be+Ce+1>>1,N[W+0+96]=pr(de,oe,te),N[W+0+64]=pr(oe,te,ge),N[W+0+32]=N[W+1+96]=pr(te,ge,ve),N[W+1+32]=N[W+2+96]=pr(ge,ve,ye),N[W+2+32]=N[W+3+96]=pr(ve,ye,be),N[W+3+32]=pr(ye,be,Ce)}function Ua(N,W){var te=N[W+0-32],oe=N[W+1-32],de=N[W+2-32],ge=N[W+3-32],ve=N[W+4-32],ye=N[W+5-32],be=N[W+6-32],Ce=N[W+7-32];N[W+0+0]=te+oe+1>>1,N[W+1+0]=N[W+0+64]=oe+de+1>>1,N[W+2+0]=N[W+1+64]=de+ge+1>>1,N[W+3+0]=N[W+2+64]=ge+ve+1>>1,N[W+0+32]=pr(te,oe,de),N[W+1+32]=N[W+0+96]=pr(oe,de,ge),N[W+2+32]=N[W+1+96]=pr(de,ge,ve),N[W+3+32]=N[W+2+96]=pr(ge,ve,ye),N[W+3+64]=pr(ve,ye,be),N[W+3+96]=pr(ye,be,Ce)}function Yh(N,W){var te=N[W-1+0],oe=N[W-1+32],de=N[W-1+64],ge=N[W-1+96];N[W+0+0]=te+oe+1>>1,N[W+2+0]=N[W+0+32]=oe+de+1>>1,N[W+2+32]=N[W+0+64]=de+ge+1>>1,N[W+1+0]=pr(te,oe,de),N[W+3+0]=N[W+1+32]=pr(oe,de,ge),N[W+3+32]=N[W+1+64]=pr(de,ge,ge),N[W+3+64]=N[W+2+64]=N[W+0+96]=N[W+1+96]=N[W+2+96]=N[W+3+96]=ge}function Nv(N,W){var te=N[W-1+0],oe=N[W-1+32],de=N[W-1+64],ge=N[W-1+96],ve=N[W-1-32],ye=N[W+0-32],be=N[W+1-32],Ce=N[W+2-32];N[W+0+0]=N[W+2+32]=te+ve+1>>1,N[W+0+32]=N[W+2+64]=oe+te+1>>1,N[W+0+64]=N[W+2+96]=de+oe+1>>1,N[W+0+96]=ge+de+1>>1,N[W+3+0]=pr(ye,be,Ce),N[W+2+0]=pr(ve,ye,be),N[W+1+0]=N[W+3+32]=pr(te,ve,ye),N[W+1+32]=N[W+3+64]=pr(oe,te,ve),N[W+1+64]=N[W+3+96]=pr(de,oe,te),N[W+1+96]=pr(ge,de,oe)}function il(N,W){var te;for(te=0;8>te;++te)n(N,W+32*te,N,W-32,8)}function Ll(N,W){var te;for(te=0;8>te;++te)o(N,W,N[W-1],8),W+=32}function Wo(N,W,te){var oe;for(oe=0;8>oe;++oe)o(W,te+32*oe,N,8)}function Id(N,W){var te,oe=8;for(te=0;8>te;++te)oe+=N[W+te-32]+N[W-1+32*te];Wo(oe>>4,N,W)}function Nd(N,W){var te,oe=4;for(te=0;8>te;++te)oe+=N[W+te-32];Wo(oe>>3,N,W)}function Rv(N,W){var te,oe=4;for(te=0;8>te;++te)oe+=N[W-1+32*te];Wo(oe>>3,N,W)}function gu(N,W){Wo(128,N,W)}function js(N,W,te){var oe=N[W-te],de=N[W+0],ge=3*(de-oe)+cl[1020+N[W-2*te]-N[W+te]],ve=qd[112+(ge+4>>3)];N[W-te]=Uo[255+oe+qd[112+(ge+3>>3)]],N[W+0]=Uo[255+de-ve]}function mu(N,W,te,oe){var de=N[W+0],ge=N[W+te];return Xa[255+N[W-2*te]-N[W-te]]>oe||Xa[255+ge-de]>oe}function Sc(N,W,te,oe){return 4*Xa[255+N[W-te]-N[W+0]]+Xa[255+N[W-2*te]-N[W+te]]<=oe}function Ha(N,W,te,oe,de){var ge=N[W-3*te],ve=N[W-2*te],ye=N[W-te],be=N[W+0],Ce=N[W+te],$e=N[W+2*te],it=N[W+3*te];return 4*Xa[255+ye-be]+Xa[255+ve-Ce]>oe?0:Xa[255+N[W-4*te]-ge]<=de&&Xa[255+ge-ve]<=de&&Xa[255+ve-ye]<=de&&Xa[255+it-$e]<=de&&Xa[255+$e-Ce]<=de&&Xa[255+Ce-be]<=de}function jc(N,W,te,oe){var de=2*oe+1;for(oe=0;16>oe;++oe)Sc(N,W+oe,te,de)&&js(N,W+oe,te)}function kc(N,W,te,oe){var de=2*oe+1;for(oe=0;16>oe;++oe)Sc(N,W+oe*te,1,de)&&js(N,W+oe*te,1)}function vu(N,W,te,oe){var de;for(de=3;0<de;--de)jc(N,W+=4*te,te,oe)}function yu(N,W,te,oe){var de;for(de=3;0<de;--de)kc(N,W+=4,te,oe)}function Va(N,W,te,oe,de,ge,ve,ye){for(ge=2*ge+1;0<de--;){if(Ha(N,W,te,ge,ve))if(mu(N,W,te,ye))js(N,W,te);else{var be=N,Ce=W,$e=te,it=be[Ce-2*$e],Ee=be[Ce-$e],He=be[Ce+0],et=be[Ce+$e],yt=be[Ce+2*$e],at=27*(mt=cl[1020+3*(He-Ee)+cl[1020+it-et]])+63>>7,ht=18*mt+63>>7,mt=9*mt+63>>7;be[Ce-3*$e]=Uo[255+be[Ce-3*$e]+mt],be[Ce-2*$e]=Uo[255+it+ht],be[Ce-$e]=Uo[255+Ee+at],be[Ce+0]=Uo[255+He-at],be[Ce+$e]=Uo[255+et-ht],be[Ce+2*$e]=Uo[255+yt-mt]}W+=oe}}function ol(N,W,te,oe,de,ge,ve,ye){for(ge=2*ge+1;0<de--;){if(Ha(N,W,te,ge,ve))if(mu(N,W,te,ye))js(N,W,te);else{var be=N,Ce=W,$e=te,it=be[Ce-$e],Ee=be[Ce+0],He=be[Ce+$e],et=qd[112+(4+(yt=3*(Ee-it))>>3)],yt=qd[112+(yt+3>>3)],at=et+1>>1;be[Ce-2*$e]=Uo[255+be[Ce-2*$e]+at],be[Ce-$e]=Uo[255+it+yt],be[Ce+0]=Uo[255+Ee-et],be[Ce+$e]=Uo[255+He-at]}W+=oe}}function xo(N,W,te,oe,de,ge){Va(N,W,te,1,16,oe,de,ge)}function Fl(N,W,te,oe,de,ge){Va(N,W,1,te,16,oe,de,ge)}function Rd(N,W,te,oe,de,ge){var ve;for(ve=3;0<ve;--ve)ol(N,W+=4*te,te,1,16,oe,de,ge)}function ks(N,W,te,oe,de,ge){var ve;for(ve=3;0<ve;--ve)ol(N,W+=4,1,te,16,oe,de,ge)}function Gh(N,W,te,oe,de,ge,ve,ye){Va(N,W,de,1,8,ge,ve,ye),Va(te,oe,de,1,8,ge,ve,ye)}function X(N,W,te,oe,de,ge,ve,ye){Va(N,W,1,de,8,ge,ve,ye),Va(te,oe,1,de,8,ge,ve,ye)}function ue(N,W,te,oe,de,ge,ve,ye){ol(N,W+4*de,de,1,8,ge,ve,ye),ol(te,oe+4*de,de,1,8,ge,ve,ye)}function _e(N,W,te,oe,de,ge,ve,ye){ol(N,W+4,1,de,8,ge,ve,ye),ol(te,oe+4,1,de,8,ge,ve,ye)}function Be(){this.ba=new rt,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new pe,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function Qe(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function bt(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function It(){this.ua=0,this.Wa=new ke,this.vb=new ke,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new z,this.yc=new F}function tr(){this.xb=this.a=0,this.l=new Ad,this.ca=new rt,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new $,this.Pb=0,this.wd=new $,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new It,this.ab=0,this.gc=s(4,bt),this.Oc=0}function Kt(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Ad,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function _r(N,W,te,oe,de,ge,ve){for(N=N==null?0:N[W+0],W=0;W<ve;++W)de[ge+W]=N+te[oe+W]&255,N=de[ge+W]}function Tr(N,W,te,oe,de,ge,ve){var ye;if(N==null)_r(null,null,te,oe,de,ge,ve);else for(ye=0;ye<ve;++ye)de[ge+ye]=N[W+ye]+te[oe+ye]&255}function Kr(N,W,te,oe,de,ge,ve){if(N==null)_r(null,null,te,oe,de,ge,ve);else{var ye,be=N[W+0],Ce=be,$e=be;for(ye=0;ye<ve;++ye)Ce=$e+(be=N[W+ye])-Ce,$e=te[oe+ye]+(-256&Ce?0>Ce?0:255:Ce)&255,Ce=be,de[ge+ye]=$e}}function bi(N,W,te,oe){var de=W.width,ge=W.o;if(t(N!=null&&W!=null),0>te||0>=oe||te+oe>ge)return null;if(!N.Cc){if(N.ga==null){var ve;if(N.ga=new Kt,(ve=N.ga==null)||(ve=W.width*W.o,t(N.Gb.length==0),N.Gb=a(ve),N.Uc=0,N.Gb==null?ve=0:(N.mb=N.Gb,N.nb=N.Uc,N.rc=null,ve=1),ve=!ve),!ve){ve=N.ga;var ye=N.Fa,be=N.P,Ce=N.qc,$e=N.mb,it=N.nb,Ee=be+1,He=Ce-1,et=ve.l;if(t(ye!=null&&$e!=null&&W!=null),So[0]=null,So[1]=_r,So[2]=Tr,So[3]=Kr,ve.ca=$e,ve.tb=it,ve.c=W.width,ve.i=W.height,t(0<ve.c&&0<ve.i),1>=Ce)W=0;else if(ve.$a=3&ye[be+0],ve.Z=ye[be+0]>>2&3,ve.Lc=ye[be+0]>>4&3,be=ye[be+0]>>6&3,0>ve.$a||1<ve.$a||4<=ve.Z||1<ve.Lc||be)W=0;else if(et.put=Ke,et.ac=Le,et.bc=Fe,et.ma=ve,et.width=W.width,et.height=W.height,et.Da=W.Da,et.v=W.v,et.va=W.va,et.j=W.j,et.o=W.o,ve.$a)e:{t(ve.$a==1),W=ys();t:for(;;){if(W==null){W=0;break e}if(t(ve!=null),ve.mc=W,W.c=ve.c,W.i=ve.i,W.l=ve.l,W.l.ma=ve,W.l.width=ve.c,W.l.height=ve.i,W.a=0,ee(W.m,ye,Ee,He),!zo(ve.c,ve.i,1,W,null)||(W.ab==1&&W.gc[0].hc==3&&Rn(W.s)?(ve.ic=1,ye=W.c*W.i,W.Ta=null,W.Ua=0,W.V=a(ye),W.Ba=0,W.V==null?(W.a=1,W=0):W=1):(ve.ic=0,W=$a(W,ve.c)),!W))break t;W=1;break e}ve.mc=null,W=0}else W=He>=ve.c*ve.i;ve=!W}if(ve)return null;N.ga.Lc!=1?N.Ga=0:oe=ge-te}t(N.ga!=null),t(te+oe<=ge);e:{if(W=(ye=N.ga).c,ge=ye.l.o,ye.$a==0){if(Ee=N.rc,He=N.Vc,et=N.Fa,be=N.P+1+te*W,Ce=N.mb,$e=N.nb+te*W,t(be<=N.P+N.qc),ye.Z!=0)for(t(So[ye.Z]!=null),ve=0;ve<oe;++ve)So[ye.Z](Ee,He,et,be,Ce,$e,W),Ee=Ce,He=$e,$e+=W,be+=W;else for(ve=0;ve<oe;++ve)n(Ce,$e,et,be,W),Ee=Ce,He=$e,$e+=W,be+=W;N.rc=Ee,N.Vc=He}else{if(t(ye.mc!=null),W=te+oe,t((ve=ye.mc)!=null),t(W<=ve.i),ve.C>=W)W=1;else if(ye.ic||Jn(),ye.ic){ye=ve.V,Ee=ve.Ba,He=ve.c;var yt=ve.i,at=(et=1,be=ve.$/He,Ce=ve.$%He,$e=ve.m,it=ve.s,ve.$),ht=He*yt,mt=He*W,jt=it.wc,Et=at<mt?fr(it,Ce,be):null;t(at<=ht),t(W<=yt),t(Rn(it));t:for(;;){for(;!$e.h&&at<mt;){if(Ce&jt||(Et=fr(it,Ce,be)),t(Et!=null),G($e),256>(yt=Tt(Et.G[0],Et.H[0],$e)))ye[Ee+at]=yt,++at,++Ce>=He&&(Ce=0,++be<=W&&!(be%16)&&Ln(ve,be));else{if(!(280>yt)){et=0;break t}yt=xt(yt-256,$e);var sr,Yt=Tt(Et.G[4],Et.H[4],$e);if(G($e),!(at>=(Yt=dt(He,Yt=xt(Yt,$e)))&&ht-at>=yt)){et=0;break t}for(sr=0;sr<yt;++sr)ye[Ee+at+sr]=ye[Ee+at+sr-Yt];for(at+=yt,Ce+=yt;Ce>=He;)Ce-=He,++be<=W&&!(be%16)&&Ln(ve,be);at<mt&&Ce&jt&&(Et=fr(it,Ce,be))}t($e.h==Y($e))}Ln(ve,be>W?W:be);break t}!et||$e.h&&at<ht?(et=0,ve.a=$e.h?5:3):ve.$=at,W=et}else W=vo(ve,ve.V,ve.Ba,ve.c,ve.i,W,xa);if(!W){oe=0;break e}}te+oe>=ge&&(N.Cc=1),oe=1}if(!oe)return null;if(N.Cc&&((oe=N.ga)!=null&&(oe.mc=null),N.ga=null,0<N.Ga))return alert("todo:WebPDequantizeLevels"),null}return N.nb+te*de}function jn(N,W,te,oe,de,ge){for(;0<de--;){var ve,ye=N,be=W+(te?1:0),Ce=N,$e=W+(te?0:3);for(ve=0;ve<oe;++ve){var it=Ce[$e+4*ve];it!=255&&(it*=32897,ye[be+4*ve+0]=ye[be+4*ve+0]*it>>23,ye[be+4*ve+1]=ye[be+4*ve+1]*it>>23,ye[be+4*ve+2]=ye[be+4*ve+2]*it>>23)}W+=ge}}function dn(N,W,te,oe,de){for(;0<oe--;){var ge;for(ge=0;ge<te;++ge){var ve=N[W+2*ge+0],ye=15&(Ce=N[W+2*ge+1]),be=4369*ye,Ce=(240&Ce|Ce>>4)*be>>16;N[W+2*ge+0]=(240&ve|ve>>4)*be>>16&240|(15&ve|ve<<4)*be>>16>>4&15,N[W+2*ge+1]=240&Ce|ye}W+=de}}function Fn(N,W,te,oe,de,ge,ve,ye){var be,Ce,$e=255;for(Ce=0;Ce<de;++Ce){for(be=0;be<oe;++be){var it=N[W+be];ge[ve+4*be]=it,$e&=it}W+=te,ve+=ye}return $e!=255}function Zn(N,W,te,oe,de){var ge;for(ge=0;ge<de;++ge)te[oe+ge]=N[W+ge]>>8}function Jn(){Pu=jn,Fv=dn,op=Fn,Mv=Zn}function bo(N,W,te){R[N]=function(oe,de,ge,ve,ye,be,Ce,$e,it,Ee,He,et,yt,at,ht,mt,jt){var Et,sr=jt-1>>1,Yt=ye[be+0]|Ce[$e+0]<<16,Pr=it[Ee+0]|He[et+0]<<16;t(oe!=null);var Jt=3*Yt+Pr+131074>>2;for(W(oe[de+0],255&Jt,Jt>>16,yt,at),ge!=null&&(Jt=3*Pr+Yt+131074>>2,W(ge[ve+0],255&Jt,Jt>>16,ht,mt)),Et=1;Et<=sr;++Et){var Br=ye[be+Et]|Ce[$e+Et]<<16,ai=it[Ee+Et]|He[et+Et]<<16,Or=Yt+Br+Pr+ai+524296,Gt=Or+2*(Br+Pr)>>3;Jt=Gt+Yt>>1,Yt=(Or=Or+2*(Yt+ai)>>3)+Br>>1,W(oe[de+2*Et-1],255&Jt,Jt>>16,yt,at+(2*Et-1)*te),W(oe[de+2*Et-0],255&Yt,Yt>>16,yt,at+(2*Et-0)*te),ge!=null&&(Jt=Or+Pr>>1,Yt=Gt+ai>>1,W(ge[ve+2*Et-1],255&Jt,Jt>>16,ht,mt+(2*Et-1)*te),W(ge[ve+2*Et+0],255&Yt,Yt>>16,ht,mt+(2*Et+0)*te)),Yt=Br,Pr=ai}1&jt||(Jt=3*Yt+Pr+131074>>2,W(oe[de+jt-1],255&Jt,Jt>>16,yt,at+(jt-1)*te),ge!=null&&(Jt=3*Pr+Yt+131074>>2,W(ge[ve+jt-1],255&Jt,Jt>>16,ht,mt+(jt-1)*te)))}}function _s(){ea[Zh]=qS,ea[Pc]=Oc,ea[Rb]=$S,ea[ap]=Vd,ea[sp]=Ru,ea[Cn]=fp,ea[Jh]=Vv,ea[$d]=Oc,ea[Ou]=Vd,ea[lp]=Ru,ea[cp]=fp}function ep(N){return N&-16384?0>N?0:255:N>>Ic}function xu(N,W){return ep((19077*N>>8)+(26149*W>>8)-14234)}function bu(N,W,te){return ep((19077*N>>8)-(6419*W>>8)-(13320*te>>8)+8708)}function Ml(N,W){return ep((19077*N>>8)+(33050*W>>8)-17685)}function wu(N,W,te,oe,de){oe[de+0]=xu(N,te),oe[de+1]=bu(N,W,te),oe[de+2]=Ml(N,W)}function Ld(N,W,te,oe,de){oe[de+0]=Ml(N,W),oe[de+1]=bu(N,W,te),oe[de+2]=xu(N,te)}function Fd(N,W,te,oe,de){var ge=bu(N,W,te);W=ge<<3&224|Ml(N,W)>>3,oe[de+0]=248&xu(N,te)|ge>>5,oe[de+1]=W}function wo(N,W,te,oe,de){var ge=240&Ml(N,W)|15;oe[de+0]=240&xu(N,te)|bu(N,W,te)>>4,oe[de+1]=ge}function Su(N,W,te,oe,de){oe[de+0]=255,wu(N,W,te,oe,de+1)}function ju(N,W,te,oe,de){Ld(N,W,te,oe,de),oe[de+3]=255}function tp(N,W,te,oe,de){wu(N,W,te,oe,de),oe[de+3]=255}function Ya(N,W,te){R[N]=function(oe,de,ge,ve,ye,be,Ce,$e,it){for(var Ee=$e+(-2&it)*te;$e!=Ee;)W(oe[de+0],ge[ve+0],ye[be+0],Ce,$e),W(oe[de+1],ge[ve+0],ye[be+0],Ce,$e+te),de+=2,++ve,++be,$e+=2*te;1&it&&W(oe[de+0],ge[ve+0],ye[be+0],Ce,$e)}}function Ni(N,W,te){return te==0?N==0?W==0?6:5:W==0?4:0:te}function Kh(N,W,te,oe,de){switch(N>>>30){case 3:Dl(W,te,oe,de,0);break;case 2:Hi(W,te,oe,de);break;case 1:no(W,te,oe,de)}}function ku(N,W){var te,oe,de=W.M,ge=W.Nb,ve=N.oc,ye=N.pc+40,be=N.oc,Ce=N.pc+584,$e=N.oc,it=N.pc+600;for(te=0;16>te;++te)ve[ye+32*te-1]=129;for(te=0;8>te;++te)be[Ce+32*te-1]=129,$e[it+32*te-1]=129;for(0<de?ve[ye-1-32]=be[Ce-1-32]=$e[it-1-32]=129:(o(ve,ye-32-1,127,21),o(be,Ce-32-1,127,9),o($e,it-32-1,127,9)),oe=0;oe<N.za;++oe){var Ee=W.ya[W.aa+oe];if(0<oe){for(te=-1;16>te;++te)n(ve,ye+32*te-4,ve,ye+32*te+12,4);for(te=-1;8>te;++te)n(be,Ce+32*te-4,be,Ce+32*te+4,4),n($e,it+32*te-4,$e,it+32*te+4,4)}var He=N.Gd,et=N.Hd+oe,yt=Ee.ad,at=Ee.Hc;if(0<de&&(n(ve,ye-32,He[et].y,0,16),n(be,Ce-32,He[et].f,0,8),n($e,it-32,He[et].ea,0,8)),Ee.Za){var ht=ve,mt=ye-32+16;for(0<de&&(oe>=N.za-1?o(ht,mt,He[et].y[15],4):n(ht,mt,He[et+1].y,0,4)),te=0;4>te;te++)ht[mt+128+te]=ht[mt+256+te]=ht[mt+384+te]=ht[mt+0+te];for(te=0;16>te;++te,at<<=2)ht=ve,mt=ye+Yv[te],Za[Ee.Ob[te]](ht,mt),Kh(at,yt,16*+te,ht,mt)}else if(ht=Ni(oe,de,Ee.Ob[0]),Ho[ht](ve,ye),at!=0)for(te=0;16>te;++te,at<<=2)Kh(at,yt,16*+te,ve,ye+Yv[te]);for(te=Ee.Gc,ht=Ni(oe,de,Ee.Dd),Jo[ht](be,Ce),Jo[ht]($e,it),at=yt,ht=be,mt=Ce,255&(Ee=0|te)&&(170&Ee?sl(at,256,ht,mt):Es(at,256,ht,mt)),Ee=$e,at=it,255&(te>>=8)&&(170&te?sl(yt,320,Ee,at):Es(yt,320,Ee,at)),de<N.Ub-1&&(n(He[et].y,0,ve,ye+480,16),n(He[et].f,0,be,Ce+224,8),n(He[et].ea,0,$e,it+224,8)),te=8*ge*N.B,He=N.sa,et=N.ta+16*oe+16*ge*N.R,yt=N.qa,Ee=N.ra+8*oe+te,at=N.Ha,ht=N.Ia+8*oe+te,te=0;16>te;++te)n(He,et+te*N.R,ve,ye+32*te,16);for(te=0;8>te;++te)n(yt,Ee+te*N.B,be,Ce+32*te,8),n(at,ht+te*N.B,$e,it+32*te,8)}}function rp(N,W,te,oe,de,ge,ve,ye,be){var Ce=[0],$e=[0],it=0,Ee=be!=null?be.kd:0,He=be??new Qe;if(N==null||12>te)return 7;He.data=N,He.w=W,He.ha=te,W=[W],te=[te],He.gb=[He.gb];e:{var et=W,yt=te,at=He.gb;if(t(N!=null),t(yt!=null),t(at!=null),at[0]=0,12<=yt[0]&&!r(N,et[0],"RIFF")){if(r(N,et[0]+8,"WEBP")){at=3;break e}var ht=we(N,et[0]+4);if(12>ht||4294967286<ht){at=3;break e}if(Ee&&ht>yt[0]-8){at=7;break e}at[0]=ht,et[0]+=12,yt[0]-=12}at=0}if(at!=0)return at;for(ht=0<He.gb[0],te=te[0];;){e:{var mt=N;yt=W,at=te;var jt=Ce,Et=$e,sr=et=[0];if((Jt=it=[it])[0]=0,8>at[0])at=7;else{if(!r(mt,yt[0],"VP8X")){if(we(mt,yt[0]+4)!=10){at=3;break e}if(18>at[0]){at=7;break e}var Yt=we(mt,yt[0]+8),Pr=1+Oe(mt,yt[0]+12);if(2147483648<=Pr*(mt=1+Oe(mt,yt[0]+15))){at=3;break e}sr!=null&&(sr[0]=Yt),jt!=null&&(jt[0]=Pr),Et!=null&&(Et[0]=mt),yt[0]+=18,at[0]-=18,Jt[0]=1}at=0}}if(it=it[0],et=et[0],at!=0)return at;if(yt=!!(2&et),!ht&&it)return 3;if(ge!=null&&(ge[0]=!!(16&et)),ve!=null&&(ve[0]=yt),ye!=null&&(ye[0]=0),ve=Ce[0],et=$e[0],it&&yt&&be==null){at=0;break}if(4>te){at=7;break}if(ht&&it||!ht&&!it&&!r(N,W[0],"ALPH")){te=[te],He.na=[He.na],He.P=[He.P],He.Sa=[He.Sa];e:{Yt=N,at=W,ht=te;var Jt=He.gb;jt=He.na,Et=He.P,sr=He.Sa,Pr=22,t(Yt!=null),t(ht!=null),mt=at[0];var Br=ht[0];for(t(jt!=null),t(sr!=null),jt[0]=null,Et[0]=null,sr[0]=0;;){if(at[0]=mt,ht[0]=Br,8>Br){at=7;break e}var ai=we(Yt,mt+4);if(4294967286<ai){at=3;break e}var Or=8+ai+1&-2;if(Pr+=Or,0<Jt&&Pr>Jt){at=3;break e}if(!r(Yt,mt,"VP8 ")||!r(Yt,mt,"VP8L")){at=0;break e}if(Br[0]<Or){at=7;break e}r(Yt,mt,"ALPH")||(jt[0]=Yt,Et[0]=mt+8,sr[0]=ai),mt+=Or,Br-=Or}}if(te=te[0],He.na=He.na[0],He.P=He.P[0],He.Sa=He.Sa[0],at!=0)break}te=[te],He.Ja=[He.Ja],He.xa=[He.xa];e:if(Jt=N,at=W,ht=te,jt=He.gb[0],Et=He.Ja,sr=He.xa,Yt=at[0],mt=!r(Jt,Yt,"VP8 "),Pr=!r(Jt,Yt,"VP8L"),t(Jt!=null),t(ht!=null),t(Et!=null),t(sr!=null),8>ht[0])at=7;else{if(mt||Pr){if(Jt=we(Jt,Yt+4),12<=jt&&Jt>jt-12){at=3;break e}if(Ee&&Jt>ht[0]-8){at=7;break e}Et[0]=Jt,at[0]+=8,ht[0]-=8,sr[0]=Pr}else sr[0]=5<=ht[0]&&Jt[Yt+0]==47&&!(Jt[Yt+4]>>5),Et[0]=ht[0];at=0}if(te=te[0],He.Ja=He.Ja[0],He.xa=He.xa[0],W=W[0],at!=0)break;if(4294967286<He.Ja)return 3;if(ye==null||yt||(ye[0]=He.xa?2:1),ve=[ve],et=[et],He.xa){if(5>te){at=7;break}ye=ve,Ee=et,yt=ge,N==null||5>te?N=0:5<=te&&N[W+0]==47&&!(N[W+4]>>5)?(ht=[0],Jt=[0],jt=[0],ee(Et=new $,N,W,te),Ve(Et,ht,Jt,jt)?(ye!=null&&(ye[0]=ht[0]),Ee!=null&&(Ee[0]=Jt[0]),yt!=null&&(yt[0]=jt[0]),N=1):N=0):N=0}else{if(10>te){at=7;break}ye=et,N==null||10>te||!du(N,W+3,te-3)?N=0:(Ee=N[W+0]|N[W+1]<<8|N[W+2]<<16,yt=16383&(N[W+7]<<8|N[W+6]),N=16383&(N[W+9]<<8|N[W+8]),1&Ee||3<(Ee>>1&7)||!(Ee>>4&1)||Ee>>5>=He.Ja||!yt||!N?N=0:(ve&&(ve[0]=yt),ye&&(ye[0]=N),N=1))}if(!N||(ve=ve[0],et=et[0],it&&(Ce[0]!=ve||$e[0]!=et)))return 3;be!=null&&(be[0]=He,be.offset=W-be.w,t(4294967286>W-be.w),t(be.offset==be.ha-te));break}return at==0||at==7&&it&&be==null?(ge!=null&&(ge[0]|=He.na!=null&&0<He.na.length),oe!=null&&(oe[0]=ve),de!=null&&(de[0]=et),0):at}function ja(N,W,te){var oe=W.width,de=W.height,ge=0,ve=0,ye=oe,be=de;if(W.Da=N!=null&&0<N.Da,W.Da&&(ye=N.cd,be=N.bd,ge=N.v,ve=N.j,11>te||(ge&=-2,ve&=-2),0>ge||0>ve||0>=ye||0>=be||ge+ye>oe||ve+be>de))return 0;if(W.v=ge,W.j=ve,W.va=ge+ye,W.o=ve+be,W.U=ye,W.T=be,W.da=N!=null&&0<N.da,W.da){if(!se(ye,be,te=[N.ib],ge=[N.hb]))return 0;W.ib=te[0],W.hb=ge[0]}return W.ob=N!=null&&N.ob,W.Kb=N==null||!N.Sd,W.da&&(W.ob=W.ib<3*oe/4&&W.hb<3*de/4,W.Kb=0),1}function _c(N){if(N==null)return 2;if(11>N.S){var W=N.f.RGBA;W.fb+=(N.height-1)*W.A,W.A=-W.A}else W=N.f.kb,N=N.height,W.O+=(N-1)*W.fa,W.fa=-W.fa,W.N+=(N-1>>1)*W.Ab,W.Ab=-W.Ab,W.W+=(N-1>>1)*W.Db,W.Db=-W.Db,W.F!=null&&(W.J+=(N-1)*W.lb,W.lb=-W.lb);return 0}function Md(N,W,te,oe){if(oe==null||0>=N||0>=W)return 2;if(te!=null){if(te.Da){var de=te.cd,ge=te.bd,ve=-2&te.v,ye=-2&te.j;if(0>ve||0>ye||0>=de||0>=ge||ve+de>N||ye+ge>W)return 2;N=de,W=ge}if(te.da){if(!se(N,W,de=[te.ib],ge=[te.hb]))return 2;N=de[0],W=ge[0]}}oe.width=N,oe.height=W;e:{var be=oe.width,Ce=oe.height;if(N=oe.S,0>=be||0>=Ce||!(N>=Zh&&13>N))N=2;else{if(0>=oe.Rd&&oe.sd==null){ve=ge=de=W=0;var $e=(ye=be*pp[N])*Ce;if(11>N||(ge=(Ce+1)/2*(W=(be+1)/2),N==12&&(ve=(de=be)*Ce)),(Ce=a($e+2*ge+ve))==null){N=1;break e}oe.sd=Ce,11>N?((be=oe.f.RGBA).eb=Ce,be.fb=0,be.A=ye,be.size=$e):((be=oe.f.kb).y=Ce,be.O=0,be.fa=ye,be.Fd=$e,be.f=Ce,be.N=0+$e,be.Ab=W,be.Cd=ge,be.ea=Ce,be.W=0+$e+ge,be.Db=W,be.Ed=ge,N==12&&(be.F=Ce,be.J=0+$e+2*ge),be.Tc=ve,be.lb=de)}if(W=1,de=oe.S,ge=oe.width,ve=oe.height,de>=Zh&&13>de)if(11>de)N=oe.f.RGBA,W&=(ye=Math.abs(N.A))*(ve-1)+ge<=N.size,W&=ye>=ge*pp[de],W&=N.eb!=null;else{N=oe.f.kb,ye=(ge+1)/2,$e=(ve+1)/2,be=Math.abs(N.fa),Ce=Math.abs(N.Ab);var it=Math.abs(N.Db),Ee=Math.abs(N.lb),He=Ee*(ve-1)+ge;W&=be*(ve-1)+ge<=N.Fd,W&=Ce*($e-1)+ye<=N.Cd,W=(W&=it*($e-1)+ye<=N.Ed)&be>=ge&Ce>=ye&it>=ye,W&=N.y!=null,W&=N.f!=null,W&=N.ea!=null,de==12&&(W&=Ee>=ge,W&=He<=N.Tc,W&=N.F!=null)}else W=0;N=W?0:2}}return N!=0||te!=null&&te.fd&&(N=_c(oe)),N}var Cs=64,_u=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],np=24,qo=32,$o=8,Cu=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];ce("Predictor0","PredictorAdd0"),R.Predictor0=function(){return 4278190080},R.Predictor1=function(N){return N},R.Predictor2=function(N,W,te){return W[te+0]},R.Predictor3=function(N,W,te){return W[te+1]},R.Predictor4=function(N,W,te){return W[te-1]},R.Predictor5=function(N,W,te){return qe(qe(N,W[te+1]),W[te+0])},R.Predictor6=function(N,W,te){return qe(N,W[te-1])},R.Predictor7=function(N,W,te){return qe(N,W[te+0])},R.Predictor8=function(N,W,te){return qe(W[te-1],W[te+0])},R.Predictor9=function(N,W,te){return qe(W[te+0],W[te+1])},R.Predictor10=function(N,W,te){return qe(qe(N,W[te-1]),qe(W[te+0],W[te+1]))},R.Predictor11=function(N,W,te){var oe=W[te+0];return 0>=vt(oe>>24&255,N>>24&255,(W=W[te-1])>>24&255)+vt(oe>>16&255,N>>16&255,W>>16&255)+vt(oe>>8&255,N>>8&255,W>>8&255)+vt(255&oe,255&N,255&W)?oe:N},R.Predictor12=function(N,W,te){var oe=W[te+0];return(Ne((N>>24&255)+(oe>>24&255)-((W=W[te-1])>>24&255))<<24|Ne((N>>16&255)+(oe>>16&255)-(W>>16&255))<<16|Ne((N>>8&255)+(oe>>8&255)-(W>>8&255))<<8|Ne((255&N)+(255&oe)-(255&W)))>>>0},R.Predictor13=function(N,W,te){var oe=W[te-1];return(Je((N=qe(N,W[te+0]))>>24&255,oe>>24&255)<<24|Je(N>>16&255,oe>>16&255)<<16|Je(N>>8&255,oe>>8&255)<<8|Je(255&N,255&oe))>>>0};var Ga=R.PredictorAdd0;R.PredictorAdd1=Ge,ce("Predictor2","PredictorAdd2"),ce("Predictor3","PredictorAdd3"),ce("Predictor4","PredictorAdd4"),ce("Predictor5","PredictorAdd5"),ce("Predictor6","PredictorAdd6"),ce("Predictor7","PredictorAdd7"),ce("Predictor8","PredictorAdd8"),ce("Predictor9","PredictorAdd9"),ce("Predictor10","PredictorAdd10"),ce("Predictor11","PredictorAdd11"),ce("Predictor12","PredictorAdd12"),ce("Predictor13","PredictorAdd13");var Ka=R.PredictorAdd2;Te("ColorIndexInverseTransform","MapARGB","32b",function(N){return N>>8&255},function(N){return N}),Te("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(N){return N},function(N){return N>>8&255});var Dd,al=R.ColorIndexInverseTransform,wi=R.MapARGB,Qh=R.VP8LColorIndexInverseTransformAlpha,Qa=R.MapAlpha,ka=R.VP8LPredictorsAdd=[];ka.length=16,(R.VP8LPredictors=[]).length=16,(R.VP8LPredictorsAdd_C=[]).length=16,(R.VP8LPredictors_C=[]).length=16;var Cc,zd,Bd,Wd,Eu,Au,Ec,Dl,Hi,sl,no,Es,kn,_n,ei,Ri,zl,ll,Ac,Tc,Xh,Lv,ip,Tu,Pu,Fv,op,Mv,Dv=a(511),zv=a(2041),Bv=a(225),Wv=a(767),qv=0,cl=zv,qd=Bv,Uo=Wv,Xa=Dv,Zh=0,Pc=1,Rb=2,ap=3,sp=4,Cn=5,Jh=6,$d=7,Ou=8,lp=9,cp=10,up=[2,3,7],eg=[3,3,11],Iu=[280,256,256,256,40],Lb=[0,1,1,1,0],DS=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],zS=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Fb=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],tg=8,Ud=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],dp=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],Nu=null,$v=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],Uv=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Mb=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Db=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],BS=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],WS=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],Hv=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Ho=[],Za=[],Jo=[],ul=1,Hd=2,So=[],ea=[];bo("UpsampleRgbLinePair",wu,3),bo("UpsampleBgrLinePair",Ld,3),bo("UpsampleRgbaLinePair",tp,4),bo("UpsampleBgraLinePair",ju,4),bo("UpsampleArgbLinePair",Su,4),bo("UpsampleRgba4444LinePair",wo,2),bo("UpsampleRgb565LinePair",Fd,2);var qS=R.UpsampleRgbLinePair,$S=R.UpsampleBgrLinePair,Oc=R.UpsampleRgbaLinePair,Vd=R.UpsampleBgraLinePair,Ru=R.UpsampleArgbLinePair,fp=R.UpsampleRgba4444LinePair,Vv=R.UpsampleRgb565LinePair,Bl=16,As=1<<Bl-1,fn=-227,mn=482,Ic=6,io=0,ta=a(256),Lu=a(256),Yd=a(256),ra=a(256),rg=a(mn-fn),zb=a(mn-fn);Ya("YuvToRgbRow",wu,3),Ya("YuvToBgrRow",Ld,3),Ya("YuvToRgbaRow",tp,4),Ya("YuvToBgraRow",ju,4),Ya("YuvToArgbRow",Su,4),Ya("YuvToRgba4444Row",wo,2),Ya("YuvToRgb565Row",Fd,2);var Yv=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Fu=[0,2,8],Bb=[8,7,6,4,4,2,2,2,1,1,1,1],Wl=1;this.WebPDecodeRGBA=function(N,W,te,oe,de){var ge=Pc,ve=new Be,ye=new rt;ve.ba=ye,ye.S=ge,ye.width=[ye.width],ye.height=[ye.height];var be=ye.width,Ce=ye.height,$e=new Ze;if($e==null||N==null)var it=2;else t($e!=null),it=rp(N,W,te,$e.width,$e.height,$e.Pd,$e.Qd,$e.format,null);if(it!=0?be=0:(be!=null&&(be[0]=$e.width[0]),Ce!=null&&(Ce[0]=$e.height[0]),be=1),be){ye.width=ye.width[0],ye.height=ye.height[0],oe!=null&&(oe[0]=ye.width),de!=null&&(de[0]=ye.height);e:{if(oe=new Ad,(de=new Qe).data=N,de.w=W,de.ha=te,de.kd=1,W=[0],t(de!=null),((N=rp(de.data,de.w,de.ha,null,null,null,W,null,de))==0||N==7)&&W[0]&&(N=4),(W=N)==0){if(t(ve!=null),oe.data=de.data,oe.w=de.w+de.offset,oe.ha=de.ha-de.offset,oe.put=Ke,oe.ac=Le,oe.bc=Fe,oe.ma=ve,de.xa){if((N=ys())==null){ve=1;break e}if((function(Ee,He){var et=[0],yt=[0],at=[0];t:for(;;){if(Ee==null)return 0;if(He==null)return Ee.a=2,0;if(Ee.l=He,Ee.a=0,ee(Ee.m,He.data,He.w,He.ha),!Ve(Ee.m,et,yt,at)){Ee.a=3;break t}if(Ee.xb=Hd,He.width=et[0],He.height=yt[0],!zo(et[0],yt[0],1,Ee,null))break t;return 1}return t(Ee.a!=0),0})(N,oe)){if(oe=(W=Md(oe.width,oe.height,ve.Oa,ve.ba))==0){t:{oe=N;r:for(;;){if(oe==null){oe=0;break t}if(t(oe.s.yc!=null),t(oe.s.Ya!=null),t(0<oe.s.Wb),t((te=oe.l)!=null),t((de=te.ma)!=null),oe.xb!=0){if(oe.ca=de.ba,oe.tb=de.tb,t(oe.ca!=null),!ja(de.Oa,te,ap)){oe.a=2;break r}if(!$a(oe,te.width)||te.da)break r;if((te.da||gt(oe.ca.S))&&Jn(),11>oe.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),oe.ca.f.kb.F!=null&&Jn()),oe.Pb&&0<oe.s.ua&&oe.s.vb.X==null&&!ie(oe.s.vb,oe.s.Wa.Xa)){oe.a=1;break r}oe.xb=0}if(!vo(oe,oe.V,oe.Ba,oe.c,oe.i,te.o,Qr))break r;de.Dc=oe.Ma,oe=1;break t}t(oe.a!=0),oe=0}oe=!oe}oe&&(W=N.a)}else W=N.a}else{if((N=new Tv)==null){ve=1;break e}if(N.Fa=de.na,N.P=de.P,N.qc=de.Sa,wa(N,oe)){if((W=Md(oe.width,oe.height,ve.Oa,ve.ba))==0){if(N.Aa=0,te=ve.Oa,t((de=N)!=null),te!=null){if(0<(be=0>(be=te.Md)?0:100<be?255:255*be/100)){for(Ce=$e=0;4>Ce;++Ce)12>(it=de.pb[Ce]).lc&&(it.ia=be*Bb[0>it.lc?0:it.lc]>>3),$e|=it.ia;$e&&(alert("todo:VP8InitRandom"),de.ia=1)}de.Ga=te.Id,100<de.Ga?de.Ga=100:0>de.Ga&&(de.Ga=0)}(function(Ee,He){if(Ee==null)return 0;if(He==null)return xi(Ee,2,"NULL VP8Io parameter in VP8Decode().");if(!Ee.cb&&!wa(Ee,He))return 0;if(t(Ee.cb),He.ac==null||He.ac(He)){He.ob&&(Ee.L=0);var et=Fu[Ee.L];if(Ee.L==2?(Ee.yb=0,Ee.zb=0):(Ee.yb=He.v-et>>4,Ee.zb=He.j-et>>4,0>Ee.yb&&(Ee.yb=0),0>Ee.zb&&(Ee.zb=0)),Ee.Va=He.o+15+et>>4,Ee.Hb=He.va+15+et>>4,Ee.Hb>Ee.za&&(Ee.Hb=Ee.za),Ee.Va>Ee.Ub&&(Ee.Va=Ee.Ub),0<Ee.L){var yt=Ee.ed;for(et=0;4>et;++et){var at;if(Ee.Qa.Cb){var ht=Ee.Qa.Lb[et];Ee.Qa.Fb||(ht+=yt.Tb)}else ht=yt.Tb;for(at=0;1>=at;++at){var mt=Ee.gd[et][at],jt=ht;if(yt.Pc&&(jt+=yt.vd[0],at&&(jt+=yt.od[0])),0<(jt=0>jt?0:63<jt?63:jt)){var Et=jt;0<yt.wb&&(Et=4<yt.wb?Et>>2:Et>>1)>9-yt.wb&&(Et=9-yt.wb),1>Et&&(Et=1),mt.dd=Et,mt.tc=2*jt+Et,mt.ld=40<=jt?2:15<=jt?1:0}else mt.tc=0;mt.La=at}}}et=0}else xi(Ee,6,"Frame setup failed"),et=Ee.a;if(et=et==0){if(et){Ee.$c=0,0<Ee.Aa||(Ee.Ic=Wl);t:{et=Ee.Ic,yt=4*(Et=Ee.za);var sr=32*Et,Yt=Et+1,Pr=0<Ee.L?Et*(0<Ee.Aa?2:1):0,Jt=(Ee.Aa==2?2:1)*Et;if((mt=yt+832+(at=3*(16*et+Fu[Ee.L])/2*sr)+(ht=Ee.Fa!=null&&0<Ee.Fa.length?Ee.Kc.c*Ee.Kc.i:0))!=mt)et=0;else{if(mt>Ee.Vb){if(Ee.Vb=0,Ee.Ec=a(mt),Ee.Fc=0,Ee.Ec==null){et=xi(Ee,1,"no memory during frame initialization.");break t}Ee.Vb=mt}mt=Ee.Ec,jt=Ee.Fc,Ee.Ac=mt,Ee.Bc=jt,jt+=yt,Ee.Gd=s(sr,ba),Ee.Hd=0,Ee.rb=s(Yt+1,oi),Ee.sb=1,Ee.wa=Pr?s(Pr,yo):null,Ee.Y=0,Ee.D.Nb=0,Ee.D.wa=Ee.wa,Ee.D.Y=Ee.Y,0<Ee.Aa&&(Ee.D.Y+=Et),t(!0),Ee.oc=mt,Ee.pc=jt,jt+=832,Ee.ya=s(Jt,Ed),Ee.aa=0,Ee.D.ya=Ee.ya,Ee.D.aa=Ee.aa,Ee.Aa==2&&(Ee.D.aa+=Et),Ee.R=16*Et,Ee.B=8*Et,Et=(sr=Fu[Ee.L])*Ee.R,sr=sr/2*Ee.B,Ee.sa=mt,Ee.ta=jt+Et,Ee.qa=Ee.sa,Ee.ra=Ee.ta+16*et*Ee.R+sr,Ee.Ha=Ee.qa,Ee.Ia=Ee.ra+8*et*Ee.B+sr,Ee.$c=0,jt+=at,Ee.mb=ht?mt:null,Ee.nb=ht?jt:null,t(jt+ht<=Ee.Fc+Ee.Vb),bc(Ee),o(Ee.Ac,Ee.Bc,0,yt),et=1}}if(et){if(He.ka=0,He.y=Ee.sa,He.O=Ee.ta,He.f=Ee.qa,He.N=Ee.ra,He.ea=Ee.Ha,He.Vd=Ee.Ia,He.fa=Ee.R,He.Rc=Ee.B,He.F=null,He.J=0,!qv){for(et=-255;255>=et;++et)Dv[255+et]=0>et?-et:et;for(et=-1020;1020>=et;++et)zv[1020+et]=-128>et?-128:127<et?127:et;for(et=-112;112>=et;++et)Bv[112+et]=-16>et?-16:15<et?15:et;for(et=-255;510>=et;++et)Wv[255+et]=0>et?0:255<et?255:et;qv=1}Ec=Zf,Dl=fu,sl=Pv,no=Xf,Es=Fr,Hi=Pd,kn=xo,_n=Fl,ei=Gh,Ri=X,zl=Rd,ll=ks,Ac=ue,Tc=_e,Xh=jc,Lv=kc,ip=vu,Tu=yu,Za[0]=Vh,Za[1]=wc,Za[2]=rl,Za[3]=Ov,Za[4]=hu,Za[5]=nl,Za[6]=Iv,Za[7]=Ua,Za[8]=Nv,Za[9]=Yh,Ho[0]=ws,Ho[1]=Uh,Ho[2]=Hh,Ho[3]=Jf,Ho[4]=Bo,Ho[5]=tl,Ho[6]=Ss,Jo[0]=Id,Jo[1]=Od,Jo[2]=il,Jo[3]=Ll,Jo[4]=Rv,Jo[5]=Nd,Jo[6]=gu,et=1}else et=0}et&&(et=(function(Br,ai){for(Br.M=0;Br.M<Br.Va;++Br.M){var Or,Gt=Br.Jc[Br.M&Br.Xb],qt=Br.m,di=Br;for(Or=0;Or<di.za;++Or){var br=qt,Mr=di,In=Mr.Ac,Vi=Mr.Bc+4*Or,Si=Mr.zc,ti=Mr.ya[Mr.aa+Or];if(Mr.Qa.Bb?ti.$b=ae(br,Mr.Pa.jb[0])?2+ae(br,Mr.Pa.jb[2]):ae(br,Mr.Pa.jb[1]):ti.$b=0,Mr.kc&&(ti.Ad=ae(br,Mr.Bd)),ti.Za=!ae(br,145)+0,ti.Za){var Li=ti.Ob,Yi=0;for(Mr=0;4>Mr;++Mr){var qn,Hr=Si[0+Mr];for(qn=0;4>qn;++qn){Hr=BS[In[Vi+qn]][Hr];for(var en=Mb[ae(br,Hr[0])];0<en;)en=Mb[2*en+ae(br,Hr[en])];Hr=-en,In[Vi+qn]=Hr}n(Li,Yi,In,Vi,4),Yi+=4,Si[0+Mr]=Hr}}else Hr=ae(br,156)?ae(br,128)?1:3:ae(br,163)?2:0,ti.Ob[0]=Hr,o(In,Vi,Hr,4),o(Si,0,Hr,4);ti.Dd=ae(br,142)?ae(br,114)?ae(br,183)?1:3:2:0}if(di.m.Ka)return xi(Br,7,"Premature end-of-partition0 encountered.");for(;Br.ja<Br.za;++Br.ja){if(di=Gt,br=(qt=Br).rb[qt.sb-1],In=qt.rb[qt.sb+qt.ja],Or=qt.ya[qt.aa+qt.ja],Vi=qt.kc?Or.Ad:0)br.la=In.la=0,Or.Za||(br.Na=In.Na=0),Or.Hc=0,Or.Gc=0,Or.ia=0;else{var $n,tn;if(br=In,In=di,Vi=qt.Pa.Xc,Si=qt.ya[qt.aa+qt.ja],ti=qt.pb[Si.$b],Mr=Si.ad,Li=0,Yi=qt.rb[qt.sb-1],Hr=qn=0,o(Mr,Li,0,384),Si.Za)var si=0,li=Vi[3];else{en=a(16);var En=br.Na+Yi.Na;if(En=Nu(In,Vi[1],En,ti.Eb,0,en,0),br.Na=Yi.Na=(0<En)+0,1<En)Ec(en,0,Mr,Li);else{var jo=en[0]+3>>3;for(en=0;256>en;en+=16)Mr[Li+en]=jo}si=1,li=Vi[0]}var vn=15&br.la,An=15&Yi.la;for(en=0;4>en;++en){var ji=1&An;for(jo=tn=0;4>jo;++jo)vn=vn>>1|(ji=(En=Nu(In,li,En=ji+(1&vn),ti.Sc,si,Mr,Li))>si)<<7,tn=tn<<2|(3<En?3:1<En?2:Mr[Li+0]!=0),Li+=16;vn>>=4,An=An>>1|ji<<7,qn=(qn<<8|tn)>>>0}for(li=vn,si=An>>4,$n=0;4>$n;$n+=2){for(tn=0,vn=br.la>>4+$n,An=Yi.la>>4+$n,en=0;2>en;++en){for(ji=1&An,jo=0;2>jo;++jo)En=ji+(1&vn),vn=vn>>1|(ji=0<(En=Nu(In,Vi[2],En,ti.Qc,0,Mr,Li)))<<3,tn=tn<<2|(3<En?3:1<En?2:Mr[Li+0]!=0),Li+=16;vn>>=2,An=An>>1|ji<<5}Hr|=tn<<4*$n,li|=vn<<4<<$n,si|=(240&An)<<$n}br.la=li,Yi.la=si,Si.Hc=qn,Si.Gc=Hr,Si.ia=43690&Hr?0:ti.ia,Vi=!(qn|Hr)}if(0<qt.L&&(qt.wa[qt.Y+qt.ja]=qt.gd[Or.$b][Or.Za],qt.wa[qt.Y+qt.ja].La|=!Vi),di.Ka)return xi(Br,7,"Premature end-of-file encountered.")}if(bc(Br),qt=ai,di=1,Or=(Gt=Br).D,br=0<Gt.L&&Gt.M>=Gt.zb&&Gt.M<=Gt.Va,Gt.Aa==0)t:{if(Or.M=Gt.M,Or.uc=br,ku(Gt,Or),di=1,Or=(tn=Gt.D).Nb,br=(Hr=Fu[Gt.L])*Gt.R,In=Hr/2*Gt.B,en=16*Or*Gt.R,jo=8*Or*Gt.B,Vi=Gt.sa,Si=Gt.ta-br+en,ti=Gt.qa,Mr=Gt.ra-In+jo,Li=Gt.Ha,Yi=Gt.Ia-In+jo,An=(vn=tn.M)==0,qn=vn>=Gt.Va-1,Gt.Aa==2&&ku(Gt,tn),tn.uc)for(ji=(En=Gt).D.M,t(En.D.uc),tn=En.yb;tn<En.Hb;++tn){si=tn,li=ji;var oo=(na=(hi=En).D).Nb;$n=hi.R;var na=na.wa[na.Y+si],fi=hi.sa,pi=hi.ta+16*oo*$n+16*si,ko=na.dd,Tn=na.tc;if(Tn!=0)if(t(3<=Tn),hi.L==1)0<si&&Lv(fi,pi,$n,Tn+4),na.La&&Tu(fi,pi,$n,Tn),0<li&&Xh(fi,pi,$n,Tn+4),na.La&&ip(fi,pi,$n,Tn);else{var _o=hi.B,Ja=hi.qa,Ts=hi.ra+8*oo*_o+8*si,Gi=hi.Ha,hi=hi.Ia+8*oo*_o+8*si;oo=na.ld,0<si&&(_n(fi,pi,$n,Tn+4,ko,oo),Ri(Ja,Ts,Gi,hi,_o,Tn+4,ko,oo)),na.La&&(ll(fi,pi,$n,Tn,ko,oo),Tc(Ja,Ts,Gi,hi,_o,Tn,ko,oo)),0<li&&(kn(fi,pi,$n,Tn+4,ko,oo),ei(Ja,Ts,Gi,hi,_o,Tn+4,ko,oo)),na.La&&(zl(fi,pi,$n,Tn,ko,oo),Ac(Ja,Ts,Gi,hi,_o,Tn,ko,oo))}}if(Gt.ia&&alert("todo:DitherRow"),qt.put!=null){if(tn=16*vn,vn=16*(vn+1),An?(qt.y=Gt.sa,qt.O=Gt.ta+en,qt.f=Gt.qa,qt.N=Gt.ra+jo,qt.ea=Gt.Ha,qt.W=Gt.Ia+jo):(tn-=Hr,qt.y=Vi,qt.O=Si,qt.f=ti,qt.N=Mr,qt.ea=Li,qt.W=Yi),qn||(vn-=Hr),vn>qt.o&&(vn=qt.o),qt.F=null,qt.J=null,Gt.Fa!=null&&0<Gt.Fa.length&&tn<vn&&(qt.J=bi(Gt,qt,tn,vn-tn),qt.F=Gt.mb,qt.F==null&&qt.F.length==0)){di=xi(Gt,3,"Could not decode alpha data.");break t}tn<qt.j&&(Hr=qt.j-tn,tn=qt.j,t(!(1&Hr)),qt.O+=Gt.R*Hr,qt.N+=Gt.B*(Hr>>1),qt.W+=Gt.B*(Hr>>1),qt.F!=null&&(qt.J+=qt.width*Hr)),tn<vn&&(qt.O+=qt.v,qt.N+=qt.v>>1,qt.W+=qt.v>>1,qt.F!=null&&(qt.J+=qt.v),qt.ka=tn-qt.j,qt.U=qt.va-qt.v,qt.T=vn-tn,di=qt.put(qt))}Or+1!=Gt.Ic||qn||(n(Gt.sa,Gt.ta-br,Vi,Si+16*Gt.R,br),n(Gt.qa,Gt.ra-In,ti,Mr+8*Gt.B,In),n(Gt.Ha,Gt.Ia-In,Li,Yi+8*Gt.B,In))}if(!di)return xi(Br,6,"Output aborted.")}return 1})(Ee,He)),He.bc!=null&&He.bc(He),et&=1}return et?(Ee.cb=0,et):0})(N,oe)||(W=N.a)}}else W=N.a}W==0&&ve.Oa!=null&&ve.Oa.fd&&(W=_c(ve.ba))}ve=W}ge=ve!=0?null:11>ge?ye.f.RGBA.eb:ye.f.kb.y}else ge=null;return ge};var pp=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function u(R,I){for(var E="",A=0;A<4;A++)E+=String.fromCharCode(R[I++]);return E}function d(R,I){return R[I+0]|R[I+1]<<8}function f(R,I){return(R[I+0]|R[I+1]<<8|R[I+2]<<16)>>>0}function h(R,I){return(R[I+0]|R[I+1]<<8|R[I+2]<<16|R[I+3]<<24)>>>0}new c;var p=[0],y=[0],m=[],x=new c,b=e,w=(function(R,I){var E={},A=0,F=!1,L=0,z=0;if(E.frames=[],!(function(M,$){for(var q=0;q<4;q++)if(M[$+q]!="RIFF".charCodeAt(q))return!0;return!1})(R,I)){for(h(R,I+=4),I+=8;I<R.length;){var V=u(R,I),Q=h(R,I+=4);I+=4;var U=Q+(1&Q);switch(V){case"VP8 ":case"VP8L":E.frames[A]===void 0&&(E.frames[A]={}),(B=E.frames[A]).src_off=F?z:I-8,B.src_size=L+Q+8,A++,F&&(F=!1,L=0,z=0);break;case"VP8X":(B=E.header={}).feature_flags=R[I];var ee=I+4;B.canvas_width=1+f(R,ee),ee+=3,B.canvas_height=1+f(R,ee),ee+=3;break;case"ALPH":F=!0,L=U+8,z=I-8;break;case"ANIM":(B=E.header).bgcolor=h(R,I),ee=I+4,B.loop_count=d(R,ee),ee+=2;break;case"ANMF":var H,B;(B=E.frames[A]={}).offset_x=2*f(R,I),I+=3,B.offset_y=2*f(R,I),I+=3,B.width=1+f(R,I),I+=3,B.height=1+f(R,I),I+=3,B.duration=f(R,I),I+=3,H=R[I++],B.dispose=1&H,B.blend=H>>1&1}V!="ANMF"&&(I+=U)}return E}})(b,0);w.response=b,w.rgbaoutput=!0,w.dataurl=!1;var k=w.header?w.header:null,S=w.frames?w.frames:null;if(k){k.loop_counter=k.loop_count,p=[k.canvas_height],y=[k.canvas_width];for(var _=0;_<S.length&&S[_].blend!=0;_++);}var P=S[0],O=x.WebPDecodeRGBA(b,P.src_off,P.src_size,y,p);P.rgba=O,P.imgwidth=y[0],P.imgheight=p[0];for(var T=0;T<y[0]*p[0]*4;T++)m[T]=O[T];return this.width=y,this.height=p,this.data=m,this}/** ====================================================================
|
||
* @license
|
||
* jsPDF XMP metadata plugin
|
||
* Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining
|
||
* a copy of this software and associated documentation files (the
|
||
* "Software"), to deal in the Software without restriction, including
|
||
* without limitation the rights to use, copy, modify, merge, publish,
|
||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||
* permit persons to whom the Software is furnished to do so, subject to
|
||
* the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be
|
||
* included in all copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||
* ====================================================================
|
||
*/function zOe(){var e,t=this.internal.__metadata__.metadata,r=unescape(encodeURIComponent(t));e=this.internal.__metadata__.rawXml?r:'<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceUri+'"><jspdf:metadata>'+r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")+"</jspdf:metadata></rdf:Description></rdf:RDF></x:xmpmeta>",this.internal.__metadata__.metadataObjectNumber=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+e.length+" >>"),this.internal.write("stream"),this.internal.write(e),this.internal.write("endstream"),this.internal.write("endobj")}function BOe(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write("/Metadata "+this.internal.__metadata__.metadataObjectNumber+" 0 R")}(function(e){var t,r,n,o,a,s,l,c,u,d=function(M){return M=M||{},this.isStrokeTransparent=M.isStrokeTransparent||!1,this.strokeOpacity=M.strokeOpacity||1,this.strokeStyle=M.strokeStyle||"#000000",this.fillStyle=M.fillStyle||"#000000",this.isFillTransparent=M.isFillTransparent||!1,this.fillOpacity=M.fillOpacity||1,this.font=M.font||"10px sans-serif",this.textBaseline=M.textBaseline||"alphabetic",this.textAlign=M.textAlign||"left",this.lineWidth=M.lineWidth||1,this.lineJoin=M.lineJoin||"miter",this.lineCap=M.lineCap||"butt",this.path=M.path||[],this.transform=M.transform!==void 0?M.transform.clone():new c,this.globalCompositeOperation=M.globalCompositeOperation||"normal",this.globalAlpha=M.globalAlpha||1,this.clip_path=M.clip_path||[],this.currentPoint=M.currentPoint||new s,this.miterLimit=M.miterLimit||10,this.lastPoint=M.lastPoint||new s,this.lineDashOffset=M.lineDashOffset||0,this.lineDash=M.lineDash||[],this.margin=M.margin||[0,0,0,0],this.prevPageLastElemOffset=M.prevPageLastElemOffset||0,this.ignoreClearRect=typeof M.ignoreClearRect!="boolean"||M.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new f(this),t=this.internal.f2,r=this.internal.getCoordinateString,n=this.internal.getVerticalCoordinateString,o=this.internal.getHorizontalCoordinate,a=this.internal.getVerticalCoordinate,s=this.internal.Point,l=this.internal.Rectangle,c=this.internal.Matrix,u=new d}]);var f=function(M){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var $=M;Object.defineProperty(this,"pdf",{get:function(){return $}});var q=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return q},set:function(ie){q=!!ie}});var Y=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return Y},set:function(ie){Y=!!ie}});var K=0;Object.defineProperty(this,"posX",{get:function(){return K},set:function(ie){isNaN(ie)||(K=ie)}});var G=0;Object.defineProperty(this,"posY",{get:function(){return G},set:function(ie){isNaN(ie)||(G=ie)}}),Object.defineProperty(this,"margin",{get:function(){return u.margin},set:function(ie){var Me;typeof ie=="number"?Me=[ie,ie,ie,ie]:((Me=new Array(4))[0]=ie[0],Me[1]=ie.length>=2?ie[1]:Me[0],Me[2]=ie.length>=3?ie[2]:Me[0],Me[3]=ie.length>=4?ie[3]:Me[1]),u.margin=Me}});var re=!1;Object.defineProperty(this,"autoPaging",{get:function(){return re},set:function(ie){re=ie}});var J=0;Object.defineProperty(this,"lastBreak",{get:function(){return J},set:function(ie){J=ie}});var ae=[];Object.defineProperty(this,"pageBreaks",{get:function(){return ae},set:function(ie){ae=ie}}),Object.defineProperty(this,"ctx",{get:function(){return u},set:function(ie){ie instanceof d&&(u=ie)}}),Object.defineProperty(this,"path",{get:function(){return u.path},set:function(ie){u.path=ie}});var le=[];Object.defineProperty(this,"ctxStack",{get:function(){return le},set:function(ie){le=ie}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(ie){var Me;Me=h(ie),this.ctx.fillStyle=Me.style,this.ctx.isFillTransparent=Me.a===0,this.ctx.fillOpacity=Me.a,this.pdf.setFillColor(Me.r,Me.g,Me.b,{a:Me.a}),this.pdf.setTextColor(Me.r,Me.g,Me.b,{a:Me.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(ie){var Me=h(ie);this.ctx.strokeStyle=Me.style,this.ctx.isStrokeTransparent=Me.a===0,this.ctx.strokeOpacity=Me.a,Me.a===0?this.pdf.setDrawColor(255,255,255):(Me.a,this.pdf.setDrawColor(Me.r,Me.g,Me.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(ie){["butt","round","square"].indexOf(ie)!==-1&&(this.ctx.lineCap=ie,this.pdf.setLineCap(ie))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(ie){isNaN(ie)||(this.ctx.lineWidth=ie,this.pdf.setLineWidth(ie))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(ie){["bevel","round","miter"].indexOf(ie)!==-1&&(this.ctx.lineJoin=ie,this.pdf.setLineJoin(ie))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(ie){isNaN(ie)||(this.ctx.miterLimit=ie,this.pdf.setMiterLimit(ie))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(ie){this.ctx.textBaseline=ie}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(ie){["right","end","center","left","start"].indexOf(ie)!==-1&&(this.ctx.textAlign=ie)}});var me=null,Oe=null,we=null;Object.defineProperty(this,"fontFaces",{get:function(){return we},set:function(ie){me=null,Oe=null,we=ie}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(ie){var Me;if(this.ctx.font=ie,(Me=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(ie))!==null){var ke=Me[1];Me[2];var se=Me[3],fe=Me[4];Me[5];var Ie=Me[6],ce=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(fe)[2];fe=Math.floor(ce==="px"?parseFloat(fe)*this.pdf.internal.scaleFactor:ce==="em"?parseFloat(fe)*this.pdf.getFontSize():parseFloat(fe)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(fe);var je=(function(Te){var wt,ft,Pt=[],At=Te.trim();if(At==="")return P3;if(At in fW)return[fW[At]];for(;At!=="";){switch(ft=null,wt=(At=hW(At)).charAt(0)){case'"':case"'":ft=NOe(At.substring(1),wt);break;default:ft=ROe(At)}if(ft===null||(Pt.push(ft[0]),(At=hW(ft[1]))!==""&&At.charAt(0)!==","))return P3;At=At.replace(/^,/,"")}return Pt})(Ie);if(this.fontFaces){var qe=(function(Te,wt){var ft=Te.getFontList(),Pt=JSON.stringify(ft);if(me===null||Oe!==Pt){var At=(function(Ht){var Se=[];return Object.keys(Ht).forEach(function(ct){Ht[ct].forEach(function(gt){var We=null;switch(gt){case"bold":We={family:ct,weight:"bold"};break;case"italic":We={family:ct,style:"italic"};break;case"bolditalic":We={family:ct,weight:"bold",style:"italic"};break;case"":case"normal":We={family:ct}}We!==null&&(We.ref={name:ct,style:gt},Se.push(We))})}),Se})(ft);me=(function(Ht){for(var Se={},ct=0;ct<Ht.length;++ct){var gt=T3(Ht[ct]),We=gt.family,Pe=gt.stretch,rt=gt.style,Ze=gt.weight;Se[We]=Se[We]||{},Se[We][Pe]=Se[We][Pe]||{},Se[We][Pe][rt]=Se[We][Pe][rt]||{},Se[We][Pe][rt][Ze]=gt}return Se})(At.concat(wt)),Oe=Pt}return me})(this.pdf,this.fontFaces),Ne=je.map(function(Te){return{family:Te,stretch:"normal",weight:se,style:ke}}),Je=(function(Te,wt,ft){for(var Pt=(ft=ft||{}).defaultFontFamily||"times",At=Object.assign({},IOe,ft.genericFontFamilies||{}),Ht=null,Se=null,ct=0;ct<wt.length;++ct)if(At[(Ht=T3(wt[ct])).family]&&(Ht.family=At[Ht.family]),Te.hasOwnProperty(Ht.family)){Se=Te[Ht.family];break}if(!(Se=Se||Te[Pt]))throw new Error("Could not find a font-family for the rule '"+pW(Ht)+"' and default family '"+Pt+"'.");if(Se=(function(gt,We){if(We[gt])return We[gt];var Pe=x6[gt],rt=Pe<=x6.normal?-1:1,Ze=dW(We,TX,Pe,rt);if(!Ze)throw new Error("Could not find a matching font-stretch value for "+gt);return Ze})(Ht.stretch,Se),Se=(function(gt,We){if(We[gt])return We[gt];for(var Pe=AX[gt],rt=0;rt<Pe.length;++rt)if(We[Pe[rt]])return We[Pe[rt]];throw new Error("Could not find a matching font-style for "+gt)})(Ht.style,Se),!(Se=(function(gt,We){if(We[gt])return We[gt];if(gt===400&&We[500])return We[500];if(gt===500&&We[400])return We[400];var Pe=OOe[gt],rt=dW(We,PX,Pe,gt<400?-1:1);if(!rt)throw new Error("Could not find a matching font-weight for value "+gt);return rt})(Ht.weight,Se)))throw new Error("Failed to resolve a font for the rule '"+pW(Ht)+"'.");return Se})(qe,Ne);this.pdf.setFont(Je.ref.name,Je.ref.style)}else{var vt="";(se==="bold"||parseInt(se,10)>=700||ke==="bold")&&(vt="bold"),ke==="italic"&&(vt+="italic"),vt.length===0&&(vt="normal");for(var Ge="",Ot={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},nt=0;nt<je.length;nt++){if(this.pdf.internal.getFont(je[nt],vt,{noFallback:!0,disableWarning:!0})!==void 0){Ge=je[nt];break}if(vt==="bolditalic"&&this.pdf.internal.getFont(je[nt],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Ge=je[nt],vt="bold";else if(this.pdf.internal.getFont(je[nt],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Ge=je[nt],vt="normal";break}}if(Ge===""){for(var Ae=0;Ae<je.length;Ae++)if(Ot[je[Ae]]){Ge=Ot[je[Ae]];break}}Ge=Ge===""?"Times":Ge,this.pdf.setFont(Ge,vt)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(ie){this.ctx.globalCompositeOperation=ie}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(ie){this.ctx.globalAlpha=ie}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(ie){this.ctx.lineDashOffset=ie,B.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(ie){this.ctx.lineDash=ie,B.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(ie){this.ctx.ignoreClearRect=!!ie}})};f.prototype.setLineDash=function(M){this.lineDash=M},f.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},f.prototype.fill=function(){S.call(this,"fill",!1)},f.prototype.stroke=function(){S.call(this,"stroke",!1)},f.prototype.beginPath=function(){this.path=[{type:"begin"}]},f.prototype.moveTo=function(M,$){if(isNaN(M)||isNaN($))throw Dn.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var q=this.ctx.transform.applyToPoint(new s(M,$));this.path.push({type:"mt",x:q.x,y:q.y}),this.ctx.lastPoint=new s(M,$)},f.prototype.closePath=function(){var M=new s(0,0),$=0;for($=this.path.length-1;$!==-1;$--)if(this.path[$].type==="begin"&&On(this.path[$+1])==="object"&&typeof this.path[$+1].x=="number"){M=new s(this.path[$+1].x,this.path[$+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new s(M.x,M.y)},f.prototype.lineTo=function(M,$){if(isNaN(M)||isNaN($))throw Dn.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var q=this.ctx.transform.applyToPoint(new s(M,$));this.path.push({type:"lt",x:q.x,y:q.y}),this.ctx.lastPoint=new s(q.x,q.y)},f.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),S.call(this,null,!0)},f.prototype.quadraticCurveTo=function(M,$,q,Y){if(isNaN(q)||isNaN(Y)||isNaN(M)||isNaN($))throw Dn.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var K=this.ctx.transform.applyToPoint(new s(q,Y)),G=this.ctx.transform.applyToPoint(new s(M,$));this.path.push({type:"qct",x1:G.x,y1:G.y,x:K.x,y:K.y}),this.ctx.lastPoint=new s(K.x,K.y)},f.prototype.bezierCurveTo=function(M,$,q,Y,K,G){if(isNaN(K)||isNaN(G)||isNaN(M)||isNaN($)||isNaN(q)||isNaN(Y))throw Dn.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var re=this.ctx.transform.applyToPoint(new s(K,G)),J=this.ctx.transform.applyToPoint(new s(M,$)),ae=this.ctx.transform.applyToPoint(new s(q,Y));this.path.push({type:"bct",x1:J.x,y1:J.y,x2:ae.x,y2:ae.y,x:re.x,y:re.y}),this.ctx.lastPoint=new s(re.x,re.y)},f.prototype.arc=function(M,$,q,Y,K,G){if(isNaN(M)||isNaN($)||isNaN(q)||isNaN(Y)||isNaN(K))throw Dn.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(G=!!G,!this.ctx.transform.isIdentity){var re=this.ctx.transform.applyToPoint(new s(M,$));M=re.x,$=re.y;var J=this.ctx.transform.applyToPoint(new s(0,q)),ae=this.ctx.transform.applyToPoint(new s(0,0));q=Math.sqrt(Math.pow(J.x-ae.x,2)+Math.pow(J.y-ae.y,2))}Math.abs(K-Y)>=2*Math.PI&&(Y=0,K=2*Math.PI),this.path.push({type:"arc",x:M,y:$,radius:q,startAngle:Y,endAngle:K,counterclockwise:G})},f.prototype.arcTo=function(M,$,q,Y,K){throw new Error("arcTo not implemented.")},f.prototype.rect=function(M,$,q,Y){if(isNaN(M)||isNaN($)||isNaN(q)||isNaN(Y))throw Dn.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(M,$),this.lineTo(M+q,$),this.lineTo(M+q,$+Y),this.lineTo(M,$+Y),this.lineTo(M,$),this.lineTo(M+q,$),this.lineTo(M,$)},f.prototype.fillRect=function(M,$,q,Y){if(isNaN(M)||isNaN($)||isNaN(q)||isNaN(Y))throw Dn.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!p.call(this)){var K={};this.lineCap!=="butt"&&(K.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(K.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(M,$,q,Y),this.fill(),K.hasOwnProperty("lineCap")&&(this.lineCap=K.lineCap),K.hasOwnProperty("lineJoin")&&(this.lineJoin=K.lineJoin)}},f.prototype.strokeRect=function(M,$,q,Y){if(isNaN(M)||isNaN($)||isNaN(q)||isNaN(Y))throw Dn.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");y.call(this)||(this.beginPath(),this.rect(M,$,q,Y),this.stroke())},f.prototype.clearRect=function(M,$,q,Y){if(isNaN(M)||isNaN($)||isNaN(q)||isNaN(Y))throw Dn.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(M,$,q,Y))},f.prototype.save=function(M){M=typeof M!="boolean"||M;for(var $=this.pdf.internal.getCurrentPageInfo().pageNumber,q=0;q<this.pdf.internal.getNumberOfPages();q++)this.pdf.setPage(q+1),this.pdf.internal.out("q");if(this.pdf.setPage($),M){this.ctx.fontSize=this.pdf.internal.getFontSize();var Y=new d(this.ctx);this.ctxStack.push(this.ctx),this.ctx=Y}},f.prototype.restore=function(M){M=typeof M!="boolean"||M;for(var $=this.pdf.internal.getCurrentPageInfo().pageNumber,q=0;q<this.pdf.internal.getNumberOfPages();q++)this.pdf.setPage(q+1),this.pdf.internal.out("Q");this.pdf.setPage($),M&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},f.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var h=function(M){var $,q,Y,K;if(M.isCanvasGradient===!0&&(M=M.getColor()),!M)return{r:0,g:0,b:0,a:0,style:M};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(M))$=0,q=0,Y=0,K=0;else{var G=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(M);if(G!==null)$=parseInt(G[1]),q=parseInt(G[2]),Y=parseInt(G[3]),K=1;else if((G=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(M))!==null)$=parseInt(G[1]),q=parseInt(G[2]),Y=parseInt(G[3]),K=parseFloat(G[4]);else{if(K=1,typeof M=="string"&&M.charAt(0)!=="#"){var re=new wX(M);M=re.ok?re.toHex():"#000000"}M.length===4?($=M.substring(1,2),$+=$,q=M.substring(2,3),q+=q,Y=M.substring(3,4),Y+=Y):($=M.substring(1,3),q=M.substring(3,5),Y=M.substring(5,7)),$=parseInt($,16),q=parseInt(q,16),Y=parseInt(Y,16)}}return{r:$,g:q,b:Y,a:K,style:M}},p=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},y=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};f.prototype.fillText=function(M,$,q,Y){if(isNaN($)||isNaN(q)||typeof M!="string")throw Dn.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(Y=isNaN(Y)?void 0:Y,!p.call(this)){var K=U(this.ctx.transform.rotation),G=this.ctx.transform.scaleX;A.call(this,{text:M,x:$,y:q,scale:G,angle:K,align:this.textAlign,maxWidth:Y})}},f.prototype.strokeText=function(M,$,q,Y){if(isNaN($)||isNaN(q)||typeof M!="string")throw Dn.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!y.call(this)){Y=isNaN(Y)?void 0:Y;var K=U(this.ctx.transform.rotation),G=this.ctx.transform.scaleX;A.call(this,{text:M,x:$,y:q,scale:G,renderingMode:"stroke",angle:K,align:this.textAlign,maxWidth:Y})}},f.prototype.measureText=function(M){if(typeof M!="string")throw Dn.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var $=this.pdf,q=this.pdf.internal.scaleFactor,Y=$.internal.getFontSize(),K=$.getStringUnitWidth(M)*Y/$.internal.scaleFactor;return new function(G){var re=(G=G||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return re}}),this}({width:K*=Math.round(96*q/72*1e4)/1e4})},f.prototype.scale=function(M,$){if(isNaN(M)||isNaN($))throw Dn.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var q=new c(M,0,0,$,0,0);this.ctx.transform=this.ctx.transform.multiply(q)},f.prototype.rotate=function(M){if(isNaN(M))throw Dn.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var $=new c(Math.cos(M),Math.sin(M),-Math.sin(M),Math.cos(M),0,0);this.ctx.transform=this.ctx.transform.multiply($)},f.prototype.translate=function(M,$){if(isNaN(M)||isNaN($))throw Dn.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var q=new c(1,0,0,1,M,$);this.ctx.transform=this.ctx.transform.multiply(q)},f.prototype.transform=function(M,$,q,Y,K,G){if(isNaN(M)||isNaN($)||isNaN(q)||isNaN(Y)||isNaN(K)||isNaN(G))throw Dn.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var re=new c(M,$,q,Y,K,G);this.ctx.transform=this.ctx.transform.multiply(re)},f.prototype.setTransform=function(M,$,q,Y,K,G){M=isNaN(M)?1:M,$=isNaN($)?0:$,q=isNaN(q)?0:q,Y=isNaN(Y)?1:Y,K=isNaN(K)?0:K,G=isNaN(G)?0:G,this.ctx.transform=new c(M,$,q,Y,K,G)};var m=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};f.prototype.drawImage=function(M,$,q,Y,K,G,re,J,ae){var le=this.pdf.getImageProperties(M),me=1,Oe=1,we=1,ie=1;Y!==void 0&&J!==void 0&&(we=J/Y,ie=ae/K,me=le.width/Y*J/Y,Oe=le.height/K*ae/K),G===void 0&&(G=$,re=q,$=0,q=0),Y!==void 0&&J===void 0&&(J=Y,ae=K),Y===void 0&&J===void 0&&(J=le.width,ae=le.height);var Me=this.ctx.transform.decompose(),ke=U(Me.rotate.shx),se=new c,fe=(se=(se=(se=se.multiply(Me.translate)).multiply(Me.skew)).multiply(Me.scale)).applyToRectangle(new l(G-$*we,re-q*ie,Y*me,K*Oe));if(this.autoPaging){for(var Ie,ce=x.call(this,fe),je=[],qe=0;qe<ce.length;qe+=1)je.indexOf(ce[qe])===-1&&je.push(ce[qe]);k(je);for(var Ne=je[0],Je=je[je.length-1],vt=Ne;vt<Je+1;vt++){this.pdf.setPage(vt);var Ge=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ot=vt===1?this.posY+this.margin[0]:this.margin[0],nt=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ae=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],Te=vt===1?0:nt+(vt-2)*Ae;if(this.ctx.clip_path.length!==0){var wt=this.path;Ie=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=w(Ie,this.posX+this.margin[3],-Te+Ot+this.ctx.prevPageLastElemOffset),_.call(this,"fill",!0),this.path=wt}var ft=JSON.parse(JSON.stringify(fe));ft=w([ft],this.posX+this.margin[3],-Te+Ot+this.ctx.prevPageLastElemOffset)[0];var Pt=(vt>Ne||vt<Je)&&m.call(this);Pt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Ge,Ae,null).clip().discardPath()),this.pdf.addImage(M,"JPEG",ft.x,ft.y,ft.w,ft.h,null,null,ke),Pt&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(M,"JPEG",fe.x,fe.y,fe.w,fe.h,null,null,ke)};var x=function(M,$,q){var Y=[];$=$||this.pdf.internal.pageSize.width,q=q||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var K=this.posY+this.ctx.prevPageLastElemOffset;switch(M.type){default:case"mt":case"lt":Y.push(Math.floor((M.y+K)/q)+1);break;case"arc":Y.push(Math.floor((M.y+K-M.radius)/q)+1),Y.push(Math.floor((M.y+K+M.radius)/q)+1);break;case"qct":var G=ee(this.ctx.lastPoint.x,this.ctx.lastPoint.y,M.x1,M.y1,M.x,M.y);Y.push(Math.floor((G.y+K)/q)+1),Y.push(Math.floor((G.y+G.h+K)/q)+1);break;case"bct":var re=H(this.ctx.lastPoint.x,this.ctx.lastPoint.y,M.x1,M.y1,M.x2,M.y2,M.x,M.y);Y.push(Math.floor((re.y+K)/q)+1),Y.push(Math.floor((re.y+re.h+K)/q)+1);break;case"rect":Y.push(Math.floor((M.y+K)/q)+1),Y.push(Math.floor((M.y+M.h+K)/q)+1)}for(var J=0;J<Y.length;J+=1)for(;this.pdf.internal.getNumberOfPages()<Y[J];)b.call(this);return Y},b=function(){var M=this.fillStyle,$=this.strokeStyle,q=this.font,Y=this.lineCap,K=this.lineWidth,G=this.lineJoin;this.pdf.addPage(),this.fillStyle=M,this.strokeStyle=$,this.font=q,this.lineCap=Y,this.lineWidth=K,this.lineJoin=G},w=function(M,$,q){for(var Y=0;Y<M.length;Y++)switch(M[Y].type){case"bct":M[Y].x2+=$,M[Y].y2+=q;case"qct":M[Y].x1+=$,M[Y].y1+=q;default:M[Y].x+=$,M[Y].y+=q}return M},k=function(M){return M.sort(function($,q){return $-q})},S=function(M,$){var q=this.fillStyle,Y=this.strokeStyle,K=this.lineCap,G=this.lineWidth,re=Math.abs(G*this.ctx.transform.scaleX),J=this.lineJoin;if(this.autoPaging){for(var ae,le,me=JSON.parse(JSON.stringify(this.path)),Oe=JSON.parse(JSON.stringify(this.path)),we=[],ie=0;ie<Oe.length;ie++)if(Oe[ie].x!==void 0)for(var Me=x.call(this,Oe[ie]),ke=0;ke<Me.length;ke+=1)we.indexOf(Me[ke])===-1&&we.push(Me[ke]);for(var se=0;se<we.length;se++)for(;this.pdf.internal.getNumberOfPages()<we[se];)b.call(this);k(we);for(var fe=we[0],Ie=we[we.length-1],ce=fe;ce<Ie+1;ce++){this.pdf.setPage(ce),this.fillStyle=q,this.strokeStyle=Y,this.lineCap=K,this.lineWidth=re,this.lineJoin=J;var je=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],qe=ce===1?this.posY+this.margin[0]:this.margin[0],Ne=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Je=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],vt=ce===1?0:Ne+(ce-2)*Je;if(this.ctx.clip_path.length!==0){var Ge=this.path;ae=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=w(ae,this.posX+this.margin[3],-vt+qe+this.ctx.prevPageLastElemOffset),_.call(this,M,!0),this.path=Ge}if(le=JSON.parse(JSON.stringify(me)),this.path=w(le,this.posX+this.margin[3],-vt+qe+this.ctx.prevPageLastElemOffset),$===!1||ce===0){var Ot=(ce>fe||ce<Ie)&&m.call(this);Ot&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],je,Je,null).clip().discardPath()),_.call(this,M,$),Ot&&this.pdf.restoreGraphicsState()}this.lineWidth=G}this.path=me}else this.lineWidth=re,_.call(this,M,$),this.lineWidth=G},_=function(M,$){if((M!=="stroke"||$||!y.call(this))&&(M==="stroke"||$||!p.call(this))){for(var q,Y,K=[],G=this.path,re=0;re<G.length;re++){var J=G[re];switch(J.type){case"begin":K.push({begin:!0});break;case"close":K.push({close:!0});break;case"mt":K.push({start:J,deltas:[],abs:[]});break;case"lt":var ae=K.length;if(G[re-1]&&!isNaN(G[re-1].x)&&(q=[J.x-G[re-1].x,J.y-G[re-1].y],ae>0)){for(;ae>=0;ae--)if(K[ae-1].close!==!0&&K[ae-1].begin!==!0){K[ae-1].deltas.push(q),K[ae-1].abs.push(J);break}}break;case"bct":q=[J.x1-G[re-1].x,J.y1-G[re-1].y,J.x2-G[re-1].x,J.y2-G[re-1].y,J.x-G[re-1].x,J.y-G[re-1].y],K[K.length-1].deltas.push(q);break;case"qct":var le=G[re-1].x+2/3*(J.x1-G[re-1].x),me=G[re-1].y+2/3*(J.y1-G[re-1].y),Oe=J.x+2/3*(J.x1-J.x),we=J.y+2/3*(J.y1-J.y),ie=J.x,Me=J.y;q=[le-G[re-1].x,me-G[re-1].y,Oe-G[re-1].x,we-G[re-1].y,ie-G[re-1].x,Me-G[re-1].y],K[K.length-1].deltas.push(q);break;case"arc":K.push({deltas:[],abs:[],arc:!0}),Array.isArray(K[K.length-1].abs)&&K[K.length-1].abs.push(J)}}Y=$?null:M==="stroke"?"stroke":"fill";for(var ke=!1,se=0;se<K.length;se++)if(K[se].arc)for(var fe=K[se].abs,Ie=0;Ie<fe.length;Ie++){var ce=fe[Ie];ce.type==="arc"?T.call(this,ce.x,ce.y,ce.radius,ce.startAngle,ce.endAngle,ce.counterclockwise,void 0,$,!ke):F.call(this,ce.x,ce.y),ke=!0}else if(K[se].close===!0)this.pdf.internal.out("h"),ke=!1;else if(K[se].begin!==!0){var je=K[se].start.x,qe=K[se].start.y;L.call(this,K[se].deltas,je,qe),ke=!0}Y&&R.call(this,Y),$&&I.call(this)}},P=function(M){var $=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,q=$*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return M-q;case"top":return M+$-q;case"hanging":return M+$-2*q;case"middle":return M+$/2-q;default:return M}},O=function(M){return M+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};f.prototype.createLinearGradient=function(){var M=function(){};return M.colorStops=[],M.addColorStop=function($,q){this.colorStops.push([$,q])},M.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},M.isCanvasGradient=!0,M},f.prototype.createPattern=function(){return this.createLinearGradient()},f.prototype.createRadialGradient=function(){return this.createLinearGradient()};var T=function(M,$,q,Y,K,G,re,J,ae){for(var le=V.call(this,q,Y,K,G),me=0;me<le.length;me++){var Oe=le[me];me===0&&(ae?E.call(this,Oe.x1+M,Oe.y1+$):F.call(this,Oe.x1+M,Oe.y1+$)),z.call(this,M,$,Oe.x2,Oe.y2,Oe.x3,Oe.y3,Oe.x4,Oe.y4)}J?I.call(this):R.call(this,re)},R=function(M){switch(M){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},I=function(){this.pdf.clip(),this.pdf.discardPath()},E=function(M,$){this.pdf.internal.out(r(M)+" "+n($)+" m")},A=function(M){var $;switch(M.align){case"right":case"end":$="right";break;case"center":$="center";break;default:$="left"}var q,Y,K,G=this.pdf.getTextDimensions(M.text),re=P.call(this,M.y),J=O.call(this,re)-G.h,ae=this.ctx.transform.applyToPoint(new s(M.x,re));if(this.autoPaging){var le=this.ctx.transform.decompose(),me=new c;me=(me=(me=me.multiply(le.translate)).multiply(le.skew)).multiply(le.scale);for(var Oe=this.ctx.transform.applyToRectangle(new l(M.x,re,G.w,G.h)),we=me.applyToRectangle(new l(M.x,J,G.w,G.h)),ie=x.call(this,we),Me=[],ke=0;ke<ie.length;ke+=1)Me.indexOf(ie[ke])===-1&&Me.push(ie[ke]);k(Me);for(var se=Me[0],fe=Me[Me.length-1],Ie=se;Ie<fe+1;Ie++){this.pdf.setPage(Ie);var ce=Ie===1?this.posY+this.margin[0]:this.margin[0],je=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],qe=this.pdf.internal.pageSize.height-this.margin[2],Ne=qe-this.margin[0],Je=this.pdf.internal.pageSize.width-this.margin[1],vt=Je-this.margin[3],Ge=Ie===1?0:je+(Ie-2)*Ne;if(this.ctx.clip_path.length!==0){var Ot=this.path;q=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=w(q,this.posX+this.margin[3],-1*Ge+ce),_.call(this,"fill",!0),this.path=Ot}var nt=w([JSON.parse(JSON.stringify(we))],this.posX+this.margin[3],-Ge+ce+this.ctx.prevPageLastElemOffset)[0];M.scale>=.01&&(Y=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Y*M.scale),K=this.lineWidth,this.lineWidth=K*M.scale);var Ae=this.autoPaging!=="text";if(Ae||nt.y+nt.h<=qe){if(Ae||nt.y>=ce&&nt.x<=Je){var Te=Ae?M.text:this.pdf.splitTextToSize(M.text,M.maxWidth||Je-nt.x)[0],wt=w([JSON.parse(JSON.stringify(Oe))],this.posX+this.margin[3],-Ge+ce+this.ctx.prevPageLastElemOffset)[0],ft=Ae&&(Ie>se||Ie<fe)&&m.call(this);ft&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],vt,Ne,null).clip().discardPath()),this.pdf.text(Te,wt.x,wt.y,{angle:M.angle,align:$,renderingMode:M.renderingMode}),ft&&this.pdf.restoreGraphicsState()}}else nt.y<qe&&(this.ctx.prevPageLastElemOffset+=qe-nt.y);M.scale>=.01&&(this.pdf.setFontSize(Y),this.lineWidth=K)}}else M.scale>=.01&&(Y=this.pdf.internal.getFontSize(),this.pdf.setFontSize(Y*M.scale),K=this.lineWidth,this.lineWidth=K*M.scale),this.pdf.text(M.text,ae.x+this.posX,ae.y+this.posY,{angle:M.angle,align:$,renderingMode:M.renderingMode,maxWidth:M.maxWidth}),M.scale>=.01&&(this.pdf.setFontSize(Y),this.lineWidth=K)},F=function(M,$,q,Y){q=q||0,Y=Y||0,this.pdf.internal.out(r(M+q)+" "+n($+Y)+" l")},L=function(M,$,q){return this.pdf.lines(M,$,q,null,null)},z=function(M,$,q,Y,K,G,re,J){this.pdf.internal.out([t(o(q+M)),t(a(Y+$)),t(o(K+M)),t(a(G+$)),t(o(re+M)),t(a(J+$)),"c"].join(" "))},V=function(M,$,q,Y){for(var K=2*Math.PI,G=Math.PI/2;$>q;)$-=K;var re=Math.abs(q-$);re<K&&Y&&(re=K-re);for(var J=[],ae=Y?-1:1,le=$;re>1e-5;){var me=le+ae*Math.min(re,G);J.push(Q.call(this,M,le,me)),re-=Math.abs(me-le),le=me}return J},Q=function(M,$,q){var Y=(q-$)/2,K=M*Math.cos(Y),G=M*Math.sin(Y),re=K,J=-G,ae=re*re+J*J,le=ae+re*K+J*G,me=4/3*(Math.sqrt(2*ae*le)-le)/(re*G-J*K),Oe=re-me*J,we=J+me*re,ie=Oe,Me=-we,ke=Y+$,se=Math.cos(ke),fe=Math.sin(ke);return{x1:M*Math.cos($),y1:M*Math.sin($),x2:Oe*se-we*fe,y2:Oe*fe+we*se,x3:ie*se-Me*fe,y3:ie*fe+Me*se,x4:M*Math.cos(q),y4:M*Math.sin(q)}},U=function(M){return 180*M/Math.PI},ee=function(M,$,q,Y,K,G){var re=M+.5*(q-M),J=$+.5*(Y-$),ae=K+.5*(q-K),le=G+.5*(Y-G),me=Math.min(M,K,re,ae),Oe=Math.max(M,K,re,ae),we=Math.min($,G,J,le),ie=Math.max($,G,J,le);return new l(me,we,Oe-me,ie-we)},H=function(M,$,q,Y,K,G,re,J){var ae,le,me,Oe,we,ie,Me,ke,se,fe,Ie,ce,je,qe,Ne=q-M,Je=Y-$,vt=K-q,Ge=G-Y,Ot=re-K,nt=J-G;for(le=0;le<41;le++)se=(Me=(me=M+(ae=le/40)*Ne)+ae*((we=q+ae*vt)-me))+ae*(we+ae*(K+ae*Ot-we)-Me),fe=(ke=(Oe=$+ae*Je)+ae*((ie=Y+ae*Ge)-Oe))+ae*(ie+ae*(G+ae*nt-ie)-ke),le==0?(Ie=se,ce=fe,je=se,qe=fe):(Ie=Math.min(Ie,se),ce=Math.min(ce,fe),je=Math.max(je,se),qe=Math.max(qe,fe));return new l(Math.round(Ie),Math.round(ce),Math.round(je-Ie),Math.round(qe-ce))},B=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var M,$,q=(M=this.ctx.lineDash,$=this.ctx.lineDashOffset,JSON.stringify({lineDash:M,lineDashOffset:$}));this.prevLineDash!==q&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=q)}}})(dr.API),(function(e){var t=function(s){var l,c,u,d,f,h,p,y,m,x;for(c=[],u=0,d=(s+=l="\0\0\0\0".slice(s.length%4||4)).length;d>u;u+=4)(f=(s.charCodeAt(u)<<24)+(s.charCodeAt(u+1)<<16)+(s.charCodeAt(u+2)<<8)+s.charCodeAt(u+3))!==0?(h=(f=((f=((f=((f=(f-(x=f%85))/85)-(m=f%85))/85)-(y=f%85))/85)-(p=f%85))/85)%85,c.push(h+33,p+33,y+33,m+33,x+33)):c.push(122);return(function(b,w){for(var k=w;k>0;k--)b.pop()})(c,l.length),String.fromCharCode.apply(String,c)+"~>"},r=function(s){var l,c,u,d,f,h=String,p="length",y=255,m="charCodeAt",x="slice",b="replace";for(s[x](-2),s=s[x](0,-2)[b](/\s/g,"")[b]("z","!!!!!"),u=[],d=0,f=(s+=l="uuuuu"[x](s[p]%5||5))[p];f>d;d+=5)c=52200625*(s[m](d)-33)+614125*(s[m](d+1)-33)+7225*(s[m](d+2)-33)+85*(s[m](d+3)-33)+(s[m](d+4)-33),u.push(y&c>>24,y&c>>16,y&c>>8,y&c);return(function(w,k){for(var S=k;S>0;S--)w.pop()})(u,l[p]),h.fromCharCode.apply(h,u)},n=function(s){return s.split("").map(function(l){return("0"+l.charCodeAt().toString(16)).slice(-2)}).join("")+">"},o=function(s){var l=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((s=s.replace(/\s/g,"")).indexOf(">")!==-1&&(s=s.substr(0,s.indexOf(">"))),s.length%2&&(s+="0"),l.test(s)===!1)return"";for(var c="",u=0;u<s.length;u+=2)c+=String.fromCharCode("0x"+(s[u]+s[u+1]));return c},a=function(s){for(var l=new Uint8Array(s.length),c=s.length;c--;)l[c]=s.charCodeAt(c);return(l=f6(l)).reduce(function(u,d){return u+String.fromCharCode(d)},"")};e.processDataByFilters=function(s,l){var c=0,u=s||"",d=[];for(typeof(l=l||[])=="string"&&(l=[l]),c=0;c<l.length;c+=1)switch(l[c]){case"ASCII85Decode":case"/ASCII85Decode":u=r(u),d.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":u=t(u),d.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":u=o(u),d.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":u=n(u),d.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":u=a(u),d.push("/FlateDecode");break;default:throw new Error('The filter: "'+l[c]+'" is not implemented')}return{data:u,reverseChain:d.reverse().join(" ")}}})(dr.API),(function(e){e.loadFile=function(t,r,n){return(function(o,a,s){a=a!==!1,s=typeof s=="function"?s:function(){};var l=void 0;try{l=(function(c,u,d){var f=new XMLHttpRequest,h=0,p=function(y){var m=y.length,x=[],b=String.fromCharCode;for(h=0;h<m;h+=1)x.push(b(255&y.charCodeAt(h)));return x.join("")};if(f.open("GET",c,!u),f.overrideMimeType("text/plain; charset=x-user-defined"),u===!1&&(f.onload=function(){f.status===200?d(p(this.responseText)):d(void 0)}),f.send(null),u&&f.status===200)return p(f.responseText)})(o,a,s)}catch{}return l})(t,r,n)},e.allowFsRead=void 0,e.loadImageFile=e.loadFile})(dr.API),(function(e){function t(){return(Er.html2canvas?Promise.resolve(Er.html2canvas):d3(()=>import("./html2canvas.esm-QH1iLAAe.js"),[])).catch(function(l){return Promise.reject(new Error("Could not load html2canvas: "+l))}).then(function(l){return l.default?l.default:l})}function r(){return(Er.DOMPurify?Promise.resolve(Er.DOMPurify):d3(()=>import("./purify.es-B5CD4DQe.js"),[])).catch(function(l){return Promise.reject(new Error("Could not load dompurify: "+l))}).then(function(l){return l.default?l.default:l})}var n=function(l){var c=On(l);return c==="undefined"?"undefined":c==="string"||l instanceof String?"string":c==="number"||l instanceof Number?"number":c==="function"||l instanceof Function?"function":l&&l.constructor===Array?"array":l&&l.nodeType===1?"element":c==="object"?"object":"unknown"},o=function(l,c){var u=document.createElement(l);for(var d in c.className&&(u.className=c.className),c.innerHTML&&c.dompurify&&(u.innerHTML=c.dompurify.sanitize(c.innerHTML)),c.style)u.style[d]=c.style[d];return u},a=function l(c,u){for(var d=c.nodeType===3?document.createTextNode(c.nodeValue):c.cloneNode(!1),f=c.firstChild;f;f=f.nextSibling)u!==!0&&f.nodeType===1&&f.nodeName==="SCRIPT"||d.appendChild(l(f,u));return c.nodeType===1&&(c.nodeName==="CANVAS"?(d.width=c.width,d.height=c.height,d.getContext("2d").drawImage(c,0,0)):c.nodeName!=="TEXTAREA"&&c.nodeName!=="SELECT"||(d.value=c.value),d.addEventListener("load",function(){d.scrollTop=c.scrollTop,d.scrollLeft=c.scrollLeft},!0)),d},s=function l(c){var u=Object.assign(l.convert(Promise.resolve()),JSON.parse(JSON.stringify(l.template))),d=l.convert(Promise.resolve(),u);return(d=d.setProgress(1,l,1,[l])).set(c)};(s.prototype=Object.create(Promise.prototype)).constructor=s,s.convert=function(l,c){return l.__proto__=c||s.prototype,l},s.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},s.prototype.from=function(l,c){return this.then(function(){switch(c=c||(function(u){switch(n(u)){case"string":return"string";case"element":return u.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}})(l),c){case"string":return this.then(r).then(function(u){return this.set({src:o("div",{innerHTML:l,dompurify:u})})});case"element":return this.set({src:l});case"canvas":return this.set({canvas:l});case"img":return this.set({img:l});default:return this.error("Unknown source type.")}})},s.prototype.to=function(l){switch(l){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},s.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var l={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},c=a(this.prop.src,this.opt.html2canvas.javascriptEnabled);c.tagName==="BODY"&&(l.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=o("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=o("div",{className:"html2pdf__container",style:l}),this.prop.container.appendChild(c),this.prop.container.firstChild.appendChild(o("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},s.prototype.toCanvas=function(){var l=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(l).then(t).then(function(c){var u=Object.assign({},this.opt.html2canvas);return delete u.onrendered,c(this.prop.container,u)}).then(function(c){(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},s.prototype.toContext2d=function(){var l=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(l).then(t).then(function(c){var u=this.opt.jsPDF,d=this.opt.fontFaces,f=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,h=Object.assign({async:!0,allowTaint:!0,scale:f,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete h.onrendered,u.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,u.context2d.posX=this.opt.x,u.context2d.posY=this.opt.y,u.context2d.margin=this.opt.margin,u.context2d.fontFaces=d,d)for(var p=0;p<d.length;++p){var y=d[p],m=y.src.find(function(x){return x.format==="truetype"});m&&u.addFont(m.url,y.ref.name,y.ref.style)}return h.windowHeight=h.windowHeight||0,h.windowHeight=h.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):h.windowHeight,u.context2d.save(!0),c(this.prop.container,h)}).then(function(c){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},s.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var l=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=l})},s.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},s.prototype.output=function(l,c,u){return(u=u||"pdf").toLowerCase()==="img"||u.toLowerCase()==="image"?this.outputImg(l,c):this.outputPdf(l,c)},s.prototype.outputPdf=function(l,c){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(l,c)})},s.prototype.outputImg=function(l){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(l){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+l+'" is not supported.'}})},s.prototype.save=function(l){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(l?{filename:l}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},s.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},s.prototype.set=function(l){if(n(l)!=="object")return this;var c=Object.keys(l||{}).map(function(u){if(u in s.template.prop)return function(){this.prop[u]=l[u]};switch(u){case"margin":return this.setMargin.bind(this,l.margin);case"jsPDF":return function(){return this.opt.jsPDF=l.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,l.pageSize);default:return function(){this.opt[u]=l[u]}}},this);return this.then(function(){return this.thenList(c)})},s.prototype.get=function(l,c){return this.then(function(){var u=l in s.template.prop?this.prop[l]:this.opt[l];return c?c(u):u})},s.prototype.setMargin=function(l){return this.then(function(){switch(n(l)){case"number":l=[l,l,l,l];case"array":if(l.length===2&&(l=[l[0],l[1],l[0],l[1]]),l.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=l}).then(this.setPageSize)},s.prototype.setPageSize=function(l){function c(u,d){return Math.floor(u*d/72*96)}return this.then(function(){(l=l||dr.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(l.inner={width:l.width-this.opt.margin[1]-this.opt.margin[3],height:l.height-this.opt.margin[0]-this.opt.margin[2]},l.inner.px={width:c(l.inner.width,l.k),height:c(l.inner.height,l.k)},l.inner.ratio=l.inner.height/l.inner.width),this.prop.pageSize=l})},s.prototype.setProgress=function(l,c,u,d){return l!=null&&(this.progress.val=l),c!=null&&(this.progress.state=c),u!=null&&(this.progress.n=u),d!=null&&(this.progress.stack=d),this.progress.ratio=this.progress.val/this.progress.state,this},s.prototype.updateProgress=function(l,c,u,d){return this.setProgress(l?this.progress.val+l:null,c||null,u?this.progress.n+u:null,d?this.progress.stack.concat(d):null)},s.prototype.then=function(l,c){var u=this;return this.thenCore(l,c,function(d,f){return u.updateProgress(null,null,1,[d]),Promise.prototype.then.call(this,function(h){return u.updateProgress(null,d),h}).then(d,f).then(function(h){return u.updateProgress(1),h})})},s.prototype.thenCore=function(l,c,u){u=u||Promise.prototype.then;var d=this;l&&(l=l.bind(d)),c&&(c=c.bind(d));var f=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?d:s.convert(Object.assign({},d),Promise.prototype),h=u.call(f,l,c);return s.convert(h,d.__proto__)},s.prototype.thenExternal=function(l,c){return Promise.prototype.then.call(this,l,c)},s.prototype.thenList=function(l){var c=this;return l.forEach(function(u){c=c.thenCore(u)}),c},s.prototype.catch=function(l){l&&(l=l.bind(this));var c=Promise.prototype.catch.call(this,l);return s.convert(c,this)},s.prototype.catchExternal=function(l){return Promise.prototype.catch.call(this,l)},s.prototype.error=function(l){return this.then(function(){throw new Error(l)})},s.prototype.using=s.prototype.set,s.prototype.saveAs=s.prototype.save,s.prototype.export=s.prototype.output,s.prototype.run=s.prototype.then,dr.getPageSize=function(l,c,u){if(On(l)==="object"){var d=l;l=d.orientation,c=d.unit||c,u=d.format||u}c=c||"mm",u=u||"a4",l=(""+(l||"P")).toLowerCase();var f,h=(""+u).toLowerCase(),p={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(c){case"pt":f=1;break;case"mm":f=72/25.4;break;case"cm":f=72/2.54;break;case"in":f=72;break;case"px":f=.75;break;case"pc":case"em":f=12;break;case"ex":f=6;break;default:throw"Invalid unit: "+c}var y,m=0,x=0;if(p.hasOwnProperty(h))m=p[h][1]/f,x=p[h][0]/f;else try{m=u[1],x=u[0]}catch{throw new Error("Invalid format: "+u)}if(l==="p"||l==="portrait")l="p",x>m&&(y=x,x=m,m=y);else{if(l!=="l"&&l!=="landscape")throw"Invalid orientation: "+l;l="l",m>x&&(y=x,x=m,m=y)}return{width:x,height:m,unit:c,k:f,orientation:l}},e.html=function(l,c){(c=c||{}).callback=c.callback||function(){},c.html2canvas=c.html2canvas||{},c.html2canvas.canvas=c.html2canvas.canvas||this.canvas,c.jsPDF=c.jsPDF||this,c.fontFaces=c.fontFaces?c.fontFaces.map(T3):null;var u=new s(c);return c.worker?u:u.from(l).doCallback()}})(dr.API),dr.API.addJS=function(e){var t,r,n=(function(o){for(var a="",s=0;s<o.length;s++){var l=o[s];if(l==="("||l===")"){for(var c=0,u=s-1;u>=0&&o[u]==="\\";u--)c++;a+=c%2==0?"\\"+l:l}else a+=l}return a})(e);return this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(t+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),r=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+n+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){t!==void 0&&r!==void 0&&this.internal.out("/Names <</JavaScript "+t+" 0 R>>")}),this},(function(e){var t;e.events.push(["postPutResources",function(){var r=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var o=r.outline.render().split(/\r\n/),a=0;a<o.length;a++){var s=o[a],l=n.exec(s);if(l!=null){var c=l[1];r.internal.newObjectDeferredBegin(c,!1)}r.internal.write(s)}if(this.outline.createNamedDestinations){var u=this.internal.pages.length,d=[];for(a=0;a<u;a++){var f=r.internal.newObject();d.push(f);var h=r.internal.getPageInfo(a+1);r.internal.write("<< /D["+h.objId+" 0 R /XYZ null null null]>> endobj")}var p=r.internal.newObject();for(r.internal.write("<< /Names [ "),a=0;a<d.length;a++)r.internal.write("(page_"+(a+1)+")"+d[a]+" 0 R");r.internal.write(" ] >>","endobj"),t=r.internal.newObject(),r.internal.write("<< /Dests "+p+" 0 R"),r.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){var r=this;r.outline.root.children.length>0&&(r.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&r.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var r=this;r.outline={createNamedDestinations:!1,root:{children:[]}},r.outline.add=function(n,o,a){var s={title:o,options:a,children:[]};return n==null&&(n=this.root),n.children.push(s),s},r.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=r,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},r.outline.genIds_r=function(n){n.id=r.internal.newObjectDeferred();for(var o=0;o<n.children.length;o++)this.genIds_r(n.children[o])},r.outline.renderRoot=function(n){this.objStart(n),this.line("/Type /Outlines"),n.children.length>0&&(this.line("/First "+this.makeRef(n.children[0])),this.line("/Last "+this.makeRef(n.children[n.children.length-1]))),this.line("/Count "+this.count_r({count:0},n)),this.objEnd()},r.outline.renderItems=function(n){for(var o=this.ctx.pdf.internal.getVerticalCoordinateString,a=0;a<n.children.length;a++){var s=n.children[a];this.objStart(s),this.line("/Title "+this.makeString(s.title)),this.line("/Parent "+this.makeRef(n)),a>0&&this.line("/Prev "+this.makeRef(n.children[a-1])),a<n.children.length-1&&this.line("/Next "+this.makeRef(n.children[a+1])),s.children.length>0&&(this.line("/First "+this.makeRef(s.children[0])),this.line("/Last "+this.makeRef(s.children[s.children.length-1])));var l=this.count=this.count_r({count:0},s);if(l>0&&this.line("/Count "+l),s.options&&s.options.pageNumber){var c=r.internal.getPageInfo(s.options.pageNumber);this.line("/Dest ["+c.objId+" 0 R /XYZ 0 "+o(0)+" 0]")}this.objEnd()}for(var u=0;u<n.children.length;u++)this.renderItems(n.children[u])},r.outline.line=function(n){this.ctx.val+=n+`\r
|
||
`},r.outline.makeRef=function(n){return n.id+" 0 R"},r.outline.makeString=function(n){return"("+r.internal.pdfEscape(n)+")"},r.outline.objStart=function(n){this.ctx.val+=`\r
|
||
`+n.id+` 0 obj\r
|
||
<<\r
|
||
`},r.outline.objEnd=function(){this.ctx.val+=`>> \r
|
||
endobj\r
|
||
`},r.outline.count_r=function(n,o){for(var a=0;a<o.children.length;a++)n.count++,this.count_r(n,o.children[a]);return n.count}}])})(dr.API),(function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(r,n,o,a,s,l){var c,u=this.decode.DCT_DECODE,d=null;if(typeof r=="string"||this.__addimage__.isArrayBuffer(r)||this.__addimage__.isArrayBufferView(r)){switch(r=s||r,r=this.__addimage__.isArrayBuffer(r)?new Uint8Array(r):r,c=(function(f){for(var h,p=256*f.charCodeAt(4)+f.charCodeAt(5),y=f.length,m={width:0,height:0,numcomponents:1},x=4;x<y;x+=2){if(x+=p,t.indexOf(f.charCodeAt(x+1))!==-1){h=256*f.charCodeAt(x+5)+f.charCodeAt(x+6),m={width:256*f.charCodeAt(x+7)+f.charCodeAt(x+8),height:h,numcomponents:f.charCodeAt(x+9)};break}p=256*f.charCodeAt(x+2)+f.charCodeAt(x+3)}return m})(r=this.__addimage__.isArrayBufferView(r)?this.__addimage__.arrayBufferToBinaryString(r):r),c.numcomponents){case 1:l=this.color_spaces.DEVICE_GRAY;break;case 4:l=this.color_spaces.DEVICE_CMYK;break;case 3:l=this.color_spaces.DEVICE_RGB}d={data:r,width:c.width,height:c.height,colorSpace:l,bitsPerComponent:8,filter:u,index:n,alias:o}}return d}})(dr.API),dr.API.processPNG=function(e,t,r,n){if(this.__addimage__.isArrayBuffer(e)&&(e=new Uint8Array(e)),this.__addimage__.isArrayBufferView(e)){var o,a=vOe(e,{checkCrc:!0}),s=a.width,l=a.height,c=a.channels,u=a.palette,d=a.depth;o=u&&c===1?(function(T){for(var R=T.width,I=T.height,E=T.data,A=T.palette,F=T.depth,L=!1,z=[],V=[],Q=void 0,U=!1,ee=0,H=0;H<A.length;H++){var B=b9(A[H],4),M=B[0],$=B[1],q=B[2],Y=B[3];z.push(M,$,q),Y!=null&&(Y===0?(ee++,V.length<1&&V.push(H)):Y<255&&(U=!0))}if(U||ee>1){L=!0,V=void 0;var K=R*I;Q=new Uint8Array(K);for(var G=new DataView(E.buffer),re=0;re<K;re++){var J=O3(G,re,F),ae=b9(A[J],4)[3];Q[re]=ae}}else ee===0&&(V=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:L?8:void 0,colorBytes:E,alphaBytes:Q,needSMask:L,palette:z,mask:V}})(a):c===2||c===4?(function(T){for(var R=T.data,I=T.width,E=T.height,A=T.channels,F=T.depth,L=A===2?"DeviceGray":"DeviceRGB",z=A-1,V=I*E,Q=z,U=V*Q,ee=1*V,H=Math.ceil(U*F/8),B=Math.ceil(ee*F/8),M=new Uint8Array(H),$=new Uint8Array(B),q=new DataView(R.buffer),Y=new DataView(M.buffer),K=new DataView($.buffer),G=!1,re=0;re<V;re++){for(var J=re*A,ae=0;ae<Q;ae++)jW(Y,O3(q,J+ae,F),re*Q+ae,F);var le=O3(q,J+Q,F);le<(1<<F)-1&&(G=!0),jW(K,le,1*re,F)}return{colorSpace:L,colorsPerPixel:z,sMaskBitsPerComponent:G?F:void 0,colorBytes:M,alphaBytes:$,needSMask:G}})(a):(function(T){var R=T.data,I=T.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:I,colorsPerPixel:I==="DeviceGray"?1:3,colorBytes:R instanceof Uint16Array?(function(E){for(var A=E.length,F=new Uint8Array(2*A),L=new DataView(F.buffer,F.byteOffset,F.byteLength),z=0;z<A;z++)L.setUint16(2*z,E[z],!1);return F})(R):R,needSMask:!1}})(a);var f,h,p,y=o,m=y.colorSpace,x=y.colorsPerPixel,b=y.sMaskBitsPerComponent,w=y.colorBytes,k=y.alphaBytes,S=y.needSMask,_=y.palette,P=y.mask,O=null;return n!==dr.API.image_compression.NONE&&typeof f6=="function"?(O=(function(T){var R;switch(T){case dr.API.image_compression.FAST:R=11;break;case dr.API.image_compression.MEDIUM:R=13;break;case dr.API.image_compression.SLOW:R=14;break;default:R=12}return R})(n),f=this.decode.FLATE_DECODE,h="/Predictor ".concat(O," /Colors ").concat(x," /BitsPerComponent ").concat(d," /Columns ").concat(s),e=yW(w,Math.ceil(s*x*d/8),x,d,n),S&&(p=yW(k,Math.ceil(s*b/8),1,b,n))):(f=void 0,h=void 0,e=w,S&&(p=k)),(this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e))&&(e=this.__addimage__.arrayBufferToBinaryString(e)),(p&&this.__addimage__.isArrayBuffer(p)||this.__addimage__.isArrayBufferView(p))&&(p=this.__addimage__.arrayBufferToBinaryString(p)),{alias:r,data:e,index:t,filter:f,decodeParameters:h,transparency:P,palette:_,sMask:p,predictor:O,width:s,height:l,bitsPerComponent:d,sMaskBitsPerComponent:b,colorSpace:m}}},(function(e){e.processGIF89A=function(t,r,n,o){var a=new DOe(t),s=a.width,l=a.height,c=[];a.decodeAndBlitFrameRGBA(0,c);var u={data:c,width:s,height:l},d=new I3(100).encode(u,100);return e.processJPEG.call(this,d,r,n,o)},e.processGIF87A=e.processGIF89A})(dr.API),Xl.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){var r=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:o,green:n,blue:r,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Xl.prototype.parseBGR=function(){this.pos=this.offset;var e="bit"+this.bitPP,t=this.width*this.height*4;if(t>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");this.data=new Uint8Array(t);try{this[e]()}catch(r){Dn.log("bit decode error:"+r)}},Xl.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),r=t%4;for(e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,o=0;o<t;o++)for(var a=this.datav.getUint8(this.pos++,!0),s=n*this.width*4+8*o*4,l=0;l<8&&8*o+l<this.width;l++){var c=this.palette[a>>7-l&1];this.data[s+4*l]=c.blue,this.data[s+4*l+1]=c.green,this.data[s+4*l+2]=c.red,this.data[s+4*l+3]=255}r!==0&&(this.pos+=4-r)}},Xl.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,o=0;o<e;o++){var a=this.datav.getUint8(this.pos++,!0),s=n*this.width*4+2*o*4,l=a>>4,c=15&a,u=this.palette[l];if(this.data[s]=u.blue,this.data[s+1]=u.green,this.data[s+2]=u.red,this.data[s+3]=255,2*o+1>=this.width)break;u=this.palette[c],this.data[s+4]=u.blue,this.data[s+4+1]=u.green,this.data[s+4+2]=u.red,this.data[s+4+3]=255}t!==0&&(this.pos+=4-t)}},Xl.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var o=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+4*n;if(o<this.palette.length){var s=this.palette[o];this.data[a]=s.red,this.data[a+1]=s.green,this.data[a+2]=s.blue,this.data[a+3]=255}else this.data[a]=255,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}e!==0&&(this.pos+=4-e)}},Xl.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,o=0;o<this.width;o++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(a&t)/t*255|0,l=(a>>5&t)/t*255|0,c=(a>>10&t)/t*255|0,u=a>>15?255:0,d=n*this.width*4+4*o;this.data[d]=c,this.data[d+1]=l,this.data[d+2]=s,this.data[d+3]=u}this.pos+=e}},Xl.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),r=parseInt("111111",2),n=this.height-1;n>=0;n--){for(var o=this.bottom_up?n:this.height-1-n,a=0;a<this.width;a++){var s=this.datav.getUint16(this.pos,!0);this.pos+=2;var l=(s&t)/t*255|0,c=(s>>5&r)/r*255|0,u=(s>>11)/t*255|0,d=o*this.width*4+4*a;this.data[d]=u,this.data[d+1]=c,this.data[d+2]=l,this.data[d+3]=255}this.pos+=e}},Xl.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=t*this.width*4+4*r;this.data[s]=a,this.data[s+1]=o,this.data[s+2]=n,this.data[s+3]=255}this.pos+=this.width%4}},Xl.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),l=t*this.width*4+4*r;this.data[l]=a,this.data[l+1]=o,this.data[l+2]=n,this.data[l+3]=s}},Xl.prototype.getData=function(){return this.data},(function(e){e.processBMP=function(t,r,n,o){var a=new Xl(t,!1),s=a.width,l=a.height,c={data:a.getData(),width:s,height:l},u=new I3(100).encode(c,100);return e.processJPEG.call(this,u,r,n,o)}})(dr.API),_W.prototype.getData=function(){return this.data},(function(e){e.processWEBP=function(t,r,n,o){var a=new _W(t),s=a.width,l=a.height,c={data:a.getData(),width:s,height:l},u=new I3(100).encode(c,100);return e.processJPEG.call(this,u,r,n,o)}})(dr.API),dr.API.processRGBA=function(e,t,r){for(var n=e.data,o=n.length,a=new Uint8Array(o/4*3),s=new Uint8Array(o/4),l=0,c=0,u=0;u<o;u+=4){var d=n[u],f=n[u+1],h=n[u+2],p=n[u+3];a[l++]=d,a[l++]=f,a[l++]=h,s[c++]=p}var y=this.__addimage__.arrayBufferToBinaryString(a);return{alpha:this.__addimage__.arrayBufferToBinaryString(s),data:y,index:t,alias:r,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},dr.API.setLanguage=function(e){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[e]!==void 0&&(this.internal.languageSettings.languageCode=e,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},Rg=dr.API,u0=Rg.getCharWidthsArray=function(e,t){var r,n,o=(t=t||{}).font||this.internal.getFont(),a=t.fontSize||this.internal.getFontSize(),s=t.charSpace||this.internal.getCharSpace(),l=t.widths?t.widths:o.metadata.Unicode.widths,c=l.fof?l.fof:1,u=t.kerning?t.kerning:o.metadata.Unicode.kerning,d=u.fof?u.fof:1,f=t.doKerning!==!1,h=0,p=e.length,y=0,m=l[0]||c,x=[];for(r=0;r<p;r++)n=e.charCodeAt(r),typeof o.metadata.widthOfString=="function"?x.push((o.metadata.widthOfGlyph(o.metadata.characterToGlyph(n))+s*(1e3/a)||0)/1e3):(h=f&&On(u[n])==="object"&&!isNaN(parseInt(u[n][y],10))?u[n][y]/d:0,x.push((l[n]||m)/c+h)),y=n;return x},gW=Rg.getStringUnitWidth=function(e,t){var r=(t=t||{}).fontSize||this.internal.getFontSize(),n=t.font||this.internal.getFont(),o=t.charSpace||this.internal.getCharSpace();return Rg.processArabic&&(e=Rg.processArabic(e)),typeof n.metadata.widthOfString=="function"?n.metadata.widthOfString(e,r,o)/r:u0.apply(this,arguments).reduce(function(a,s){return a+s},0)},mW=function(e,t,r,n){for(var o=[],a=0,s=e.length,l=0;a!==s&&l+t[a]<r;)l+=t[a],a++;o.push(e.slice(0,a));var c=a;for(l=0;a!==s;)l+t[a]>n&&(o.push(e.slice(c,a)),l=0,c=a),l+=t[a],a++;return c!==a&&o.push(e.slice(c,a)),o},vW=function(e,t,r){r||(r={});var n,o,a,s,l,c,u,d=[],f=[d],h=r.textIndent||0,p=0,y=0,m=e.split(" "),x=u0.apply(this,[" ",r])[0];if(c=r.lineIndent===-1?m[0].length+2:r.lineIndent||0){var b=Array(c).join(" "),w=[];m.map(function(S){(S=S.split(/\s*\n/)).length>1?w=w.concat(S.map(function(_,P){return(P&&_.length?`
|
||
`:"")+_})):w.push(S[0])}),m=w,c=gW.apply(this,[b,r])}for(a=0,s=m.length;a<s;a++){var k=0;if(n=m[a],c&&n[0]==`
|
||
`&&(n=n.substr(1),k=1),h+p+(y=(o=u0.apply(this,[n,r])).reduce(function(S,_){return S+_},0))>t||k){if(y>t){for(l=mW.apply(this,[n,o,t-(h+p),t]),d.push(l.shift()),d=[l.pop()];l.length;)f.push([l.shift()]);y=o.slice(n.length-(d[0]?d[0].length:0)).reduce(function(S,_){return S+_},0)}else d=[n];f.push(d),h=y+c,p=x}else d.push(n),h+=p+y,p=x}return u=c?function(S,_){return(_?b:"")+S.join(" ")}:function(S){return S.join(" ")},f.map(u)},Rg.splitTextToSize=function(e,t,r){var n,o=(r=r||{}).fontSize||this.internal.getFontSize(),a=(function(d){if(d.widths&&d.kerning)return{widths:d.widths,kerning:d.kerning};var f=this.internal.getFont(d.fontName,d.fontStyle),h="Unicode";return f.metadata[h]?{widths:f.metadata[h].widths||{0:1},kerning:f.metadata[h].kerning||{}}:{font:f.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,r);n=Array.isArray(e)?e:String(e).split(/\r?\n/);var s=1*this.internal.scaleFactor*t/o;a.textIndent=r.textIndent?1*r.textIndent*this.internal.scaleFactor/o:0,a.lineIndent=r.lineIndent;var l,c,u=[];for(l=0,c=n.length;l<c;l++)u=u.concat(vW.apply(this,[n[l],s,a]));return u},(function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="0123456789abcdef",r="klmnopqrstuvwxyz",n={},o={},a=0;a<16;a++)n[r[a]]=t[a],o[t[a]]=r[a];var s=function(h){return"0x"+parseInt(h,10).toString(16)},l=e.__fontmetrics__.compress=function(h){var p,y,m,x,b=["{"];for(var w in h){if(p=h[w],isNaN(parseInt(w,10))?y="'"+w+"'":(w=parseInt(w,10),y=(y=s(w).slice(2)).slice(0,-1)+o[y.slice(-1)]),typeof p=="number")p<0?(m=s(p).slice(3),x="-"):(m=s(p).slice(2),x=""),m=x+m.slice(0,-1)+o[m.slice(-1)];else{if(On(p)!=="object")throw new Error("Don't know what to do with value type "+On(p)+".");m=l(p)}b.push(y+m)}return b.push("}"),b.join("")},c=e.__fontmetrics__.uncompress=function(h){if(typeof h!="string")throw new Error("Invalid argument passed to uncompress.");for(var p,y,m,x,b={},w=1,k=b,S=[],_="",P="",O=h.length-1,T=1;T<O;T+=1)(x=h[T])=="'"?p?(m=p.join(""),p=void 0):p=[]:p?p.push(x):x=="{"?(S.push([k,m]),k={},m=void 0):x=="}"?((y=S.pop())[0][y[1]]=k,m=void 0,k=y[0]):x=="-"?w=-1:m===void 0?n.hasOwnProperty(x)?(_+=n[x],m=parseInt(_,16)*w,w=1,_=""):_+=x:n.hasOwnProperty(x)?(P+=n[x],k[m]=parseInt(P,16)*w,w=1,m=void 0,P=""):P+=x;return b},u={codePages:["WinAnsiEncoding"],WinAnsiEncoding:c("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},d={Unicode:{Courier:u,"Courier-Bold":u,"Courier-BoldOblique":u,"Courier-Oblique":u,Helvetica:u,"Helvetica-Bold":u,"Helvetica-BoldOblique":u,"Helvetica-Oblique":u,"Times-Roman":u,"Times-Bold":u,"Times-BoldItalic":u,"Times-Italic":u}},f={Unicode:{"Courier-Oblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":c("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":c("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":c("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:c("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:c("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":c("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:c("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":c("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":c("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":c("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(h){var p=h.font,y=f.Unicode[p.postScriptName];y&&(p.metadata.Unicode={},p.metadata.Unicode.widths=y.widths,p.metadata.Unicode.kerning=y.kerning);var m=d.Unicode[p.postScriptName];m&&(p.metadata.Unicode.encoding=m,p.encoding=m.codePages[0])}])})(dr.API),(function(e){var t=function(r){for(var n=r.length,o=new Uint8Array(n),a=0;a<n;a++)o[a]=r.charCodeAt(a);return o};e.API.events.push(["addFont",function(r){var n=void 0,o=r.font,a=r.instance;if(!o.isStandardFont){if(a===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+o.postScriptName+"').");if(typeof(n=a.existsFileInVFS(o.postScriptName)===!1?a.loadFile(o.postScriptName):a.getFileFromVFS(o.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+o.postScriptName+"').");(function(s,l){l=/^\x00\x01\x00\x00/.test(l)?t(l):t(j0(l)),s.metadata=e.API.TTFFont.open(l),s.metadata.Unicode=s.metadata.Unicode||{encoding:{},kerning:{},widths:[]},s.metadata.glyIdsUsed=[0]})(o,n)}}])})(dr),dr.API.addSvgAsImage=function(e,t,r,n,o,a,s,l){if(isNaN(t)||isNaN(r))throw Dn.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(n)||isNaN(o))throw Dn.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var c=document.createElement("canvas");c.width=n,c.height=o;var u=c.getContext("2d");u.fillStyle="#fff",u.fillRect(0,0,c.width,c.height);var d={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},f=this;return(Er.canvg?Promise.resolve(Er.canvg):d3(()=>import("./index.es-BUUHHqJX.js"),[])).catch(function(h){return Promise.reject(new Error("Could not load canvg: "+h))}).then(function(h){return h.default?h.default:h}).then(function(h){return h.fromString(u,e,d)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(h){return h.render(d)}).then(function(){f.addImage(c.toDataURL("image/jpeg",1),t,r,n,o,s,l)})},dr.API.putTotalPages=function(e){var t,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),r=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var o=0;o<this.internal.pages[n].length;o++)this.internal.pages[n][o]=this.internal.pages[n][o].replace(t,r);return this},dr.API.viewerPreferences=function(e,t){var r;e=e||{},t=t||!1;var n,o,a,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},l=Object.keys(s),c=[],u=0,d=0,f=0;function h(y,m){var x,b=!1;for(x=0;x<y.length;x+=1)y[x]===m&&(b=!0);return b}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),r=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var p=l.length;for(f=0;f<p;f+=1)r[l[f]].value=r[l[f]].defaultValue,r[l[f]].explicitSet=!1}if(On(e)==="object"){for(o in e)if(a=e[o],h(l,o)&&a!==void 0){if(r[o].type==="boolean"&&typeof a=="boolean")r[o].value=a;else if(r[o].type==="name"&&h(r[o].valueSet,a))r[o].value=a;else if(r[o].type==="integer"&&Number.isInteger(a))r[o].value=a;else if(r[o].type==="array"){for(u=0;u<a.length;u+=1)if(n=!0,a[u].length===1&&typeof a[u][0]=="number")c.push(String(a[u]-1));else if(a[u].length>1){for(d=0;d<a[u].length;d+=1)typeof a[u][d]!="number"&&(n=!1);n===!0&&c.push([a[u][0]-1,a[u][1]-1].join(" "))}r[o].value="["+c.join(" ")+"]"}else r[o].value=r[o].defaultValue;r[o].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var y,m=[];for(y in r)r[y].explicitSet===!0&&(r[y].type==="name"?m.push("/"+y+" /"+r[y].value):m.push("/"+y+" "+r[y].value));m.length!==0&&this.internal.write(`/ViewerPreferences
|
||
<<
|
||
`+m.join(`
|
||
`)+`
|
||
>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=r,this},dr.API.addMetadata=function(e,t){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:e,namespaceUri:t??"http://jspdf.default.namespaceuri/",rawXml:typeof t=="boolean"&&t},this.internal.events.subscribe("putCatalog",BOe),this.internal.events.subscribe("postPutResources",zOe)),this},(function(e){var t=e.API,r=t.pdfEscape16=function(a,s){for(var l,c=s.metadata.Unicode.widths,u=["","0","00","000","0000"],d=[""],f=0,h=a.length;f<h;++f){if(l=s.metadata.characterToGlyph(a.charCodeAt(f)),s.metadata.glyIdsUsed.push(l),s.metadata.toUnicode[l]=a.charCodeAt(f),c.indexOf(l)==-1&&(c.push(l),c.push([parseInt(s.metadata.widthOfGlyph(l),10)])),l=="0")return d.join("");l=l.toString(16),d.push(u[4-l.length],l)}return d.join("")},n=function(a){var s,l,c,u,d,f,h;for(d=`/CIDInit /ProcSet findresource begin
|
||
12 dict begin
|
||
begincmap
|
||
/CIDSystemInfo <<
|
||
/Registry (Adobe)
|
||
/Ordering (UCS)
|
||
/Supplement 0
|
||
>> def
|
||
/CMapName /Adobe-Identity-UCS def
|
||
/CMapType 2 def
|
||
1 begincodespacerange
|
||
<0000><ffff>
|
||
endcodespacerange`,c=[],f=0,h=(l=Object.keys(a).sort(function(p,y){return p-y})).length;f<h;f++)s=l[f],c.length>=100&&(d+=`
|
||
`+c.length+` beginbfchar
|
||
`+c.join(`
|
||
`)+`
|
||
endbfchar`,c=[]),a[s]!==void 0&&a[s]!==null&&typeof a[s].toString=="function"&&(u=("0000"+a[s].toString(16)).slice(-4),s=("0000"+(+s).toString(16)).slice(-4),c.push("<"+s+"><"+u+">"));return c.length&&(d+=`
|
||
`+c.length+` beginbfchar
|
||
`+c.join(`
|
||
`)+`
|
||
endbfchar
|
||
`),d+`endcmap
|
||
CMapName currentdict /CMap defineresource pop
|
||
end
|
||
end`};t.events.push(["putFont",function(a){(function(s){var l=s.font,c=s.out,u=s.newObject,d=s.putStream;if(l.metadata instanceof e.API.TTFFont&&l.encoding==="Identity-H"){for(var f=l.metadata.Unicode.widths,h=l.metadata.subset.encode(l.metadata.glyIdsUsed,1),p="",y=0;y<h.length;y++)p+=String.fromCharCode(h[y]);var m=u();d({data:p,addLength1:!0,objectId:m}),c("endobj");var x=u();d({data:n(l.metadata.toUnicode),addLength1:!0,objectId:x}),c("endobj");var b=u();c("<<"),c("/Type /FontDescriptor"),c("/FontName /"+zg(l.fontName)),c("/FontFile2 "+m+" 0 R"),c("/FontBBox "+e.API.PDFObject.convert(l.metadata.bbox)),c("/Flags "+l.metadata.flags),c("/StemV "+l.metadata.stemV),c("/ItalicAngle "+l.metadata.italicAngle),c("/Ascent "+l.metadata.ascender),c("/Descent "+l.metadata.decender),c("/CapHeight "+l.metadata.capHeight),c(">>"),c("endobj");var w=u();c("<<"),c("/Type /Font"),c("/BaseFont /"+zg(l.fontName)),c("/FontDescriptor "+b+" 0 R"),c("/W "+e.API.PDFObject.convert(f)),c("/CIDToGIDMap /Identity"),c("/DW 1000"),c("/Subtype /CIDFontType2"),c("/CIDSystemInfo"),c("<<"),c("/Supplement 0"),c("/Registry (Adobe)"),c("/Ordering ("+l.encoding+")"),c(">>"),c(">>"),c("endobj"),l.objectNumber=u(),c("<<"),c("/Type /Font"),c("/Subtype /Type0"),c("/ToUnicode "+x+" 0 R"),c("/BaseFont /"+zg(l.fontName)),c("/Encoding /"+l.encoding),c("/DescendantFonts ["+w+" 0 R]"),c(">>"),c("endobj"),l.isAlreadyPutted=!0}})(a)}]),t.events.push(["putFont",function(a){(function(s){var l=s.font,c=s.out,u=s.newObject,d=s.putStream;if(l.metadata instanceof e.API.TTFFont&&l.encoding==="WinAnsiEncoding"){for(var f=l.metadata.rawData,h="",p=0;p<f.length;p++)h+=String.fromCharCode(f[p]);var y=u();d({data:h,addLength1:!0,objectId:y}),c("endobj");var m=u();d({data:n(l.metadata.toUnicode),addLength1:!0,objectId:m}),c("endobj");var x=u();c("<<"),c("/Descent "+l.metadata.decender),c("/CapHeight "+l.metadata.capHeight),c("/StemV "+l.metadata.stemV),c("/Type /FontDescriptor"),c("/FontFile2 "+y+" 0 R"),c("/Flags 96"),c("/FontBBox "+e.API.PDFObject.convert(l.metadata.bbox)),c("/FontName /"+zg(l.fontName)),c("/ItalicAngle "+l.metadata.italicAngle),c("/Ascent "+l.metadata.ascender),c(">>"),c("endobj"),l.objectNumber=u();for(var b=0;b<l.metadata.hmtx.widths.length;b++)l.metadata.hmtx.widths[b]=parseInt(l.metadata.hmtx.widths[b]*(1e3/l.metadata.head.unitsPerEm));c("<</Subtype/TrueType/Type/Font/ToUnicode "+m+" 0 R/BaseFont/"+zg(l.fontName)+"/FontDescriptor "+x+" 0 R/Encoding/"+l.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(l.metadata.hmtx.widths)+">>"),c("endobj"),l.isAlreadyPutted=!0}})(a)}]);var o=function(a){var s,l=a.text||"",c=a.x,u=a.y,d=a.options||{},f=a.mutex||{},h=f.pdfEscape,p=f.activeFontKey,y=f.fonts,m=p,x="",b=0,w="",k=y[m].encoding;if(y[m].encoding!=="Identity-H")return{text:l,x:c,y:u,options:d,mutex:f};for(w=l,m=p,Array.isArray(l)&&(w=l[0]),b=0;b<w.length;b+=1)y[m].metadata.hasOwnProperty("cmap")&&(s=y[m].metadata.cmap.unicode.codeMap[w[b].charCodeAt(0)]),s||w[b].charCodeAt(0)<256&&y[m].metadata.hasOwnProperty("Unicode")?x+=w[b]:x+="";var S="";return parseInt(m.slice(1))<14||k==="WinAnsiEncoding"?S=h(x,m).split("").map(function(_){return _.charCodeAt(0).toString(16)}).join(""):k==="Identity-H"&&(S=r(x,y[m])),f.isHex=!0,{text:S,x:c,y:u,options:d,mutex:f}};t.events.push(["postProcessText",function(a){var s=a.text||"",l=[],c={text:s,x:a.x,y:a.y,options:a.options,mutex:a.mutex};if(Array.isArray(s)){var u=0;for(u=0;u<s.length;u+=1)Array.isArray(s[u])&&s[u].length===3?l.push([o(Object.assign({},c,{text:s[u][0]})).text,s[u][1],s[u][2]]):l.push(o(Object.assign({},c,{text:s[u]})).text);a.text=l}else a.text=o(Object.assign({},c,{text:s})).text}])})(dr),(function(e){var t=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(r){return t.call(this),this.internal.vFS[r]!==void 0},e.addFileToVFS=function(r,n){return t.call(this),this.internal.vFS[r]=n,this},e.getFileFromVFS=function(r){return t.call(this),this.internal.vFS[r]!==void 0?this.internal.vFS[r]:null}})(dr.API),(function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(n){var o,a,s,l,c,u,d,f=t,h=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],p=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],y={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},m={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},x=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],b=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),w=!1,k=0;this.__bidiEngine__={};var S=function(E){var A=E.charCodeAt(),F=A>>8,L=m[F];return L!==void 0?f[256*L+(255&A)]:F===252||F===253?"AL":b.test(F)?"L":F===8?"R":"N"},_=function(E){for(var A,F=0;F<E.length;F++){if((A=S(E.charAt(F)))==="L")return!1;if(A==="R")return!0}return!1},P=function(E,A,F,L){var z,V,Q,U,ee=A[L];switch(ee){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":w=!1;break;case"N":case"AN":break;case"EN":w&&(ee="AN");break;case"AL":w=!0,ee="R";break;case"WS":case"BN":ee="N";break;case"CS":L<1||L+1>=A.length||(z=F[L-1])!=="EN"&&z!=="AN"||(V=A[L+1])!=="EN"&&V!=="AN"?ee="N":w&&(V="AN"),ee=V===z?V:"N";break;case"ES":ee=(z=L>0?F[L-1]:"B")==="EN"&&L+1<A.length&&A[L+1]==="EN"?"EN":"N";break;case"ET":if(L>0&&F[L-1]==="EN"){ee="EN";break}if(w){ee="N";break}for(Q=L+1,U=A.length;Q<U&&A[Q]==="ET";)Q++;ee=Q<U&&A[Q]==="EN"?"EN":"N";break;case"NSM":if(s&&!l){for(U=A.length,Q=L+1;Q<U&&A[Q]==="NSM";)Q++;if(Q<U){var H=E[L],B=H>=1425&&H<=2303||H===64286;if(z=A[Q],B&&(z==="R"||z==="AL")){ee="R";break}}}ee=L<1||(z=A[L-1])==="B"?"N":F[L-1];break;case"B":w=!1,o=!0,ee=k;break;case"S":a=!0,ee="N"}return ee},O=function(E,A,F){var L=E.split("");return F&&T(L,F,{hiLevel:k}),L.reverse(),A&&A.reverse(),L.join("")},T=function(E,A,F){var L,z,V,Q,U,ee=-1,H=E.length,B=0,M=[],$=k?p:h,q=[];for(w=!1,o=!1,a=!1,z=0;z<H;z++)q[z]=S(E[z]);for(V=0;V<H;V++){if(U=B,M[V]=P(E,q,M,V),L=240&(B=$[U][y[M[V]]]),B&=15,A[V]=Q=$[B][5],L>0)if(L===16){for(z=ee;z<V;z++)A[z]=1;ee=-1}else ee=-1;if($[B][6])ee===-1&&(ee=V);else if(ee>-1){for(z=ee;z<V;z++)A[z]=Q;ee=-1}q[V]==="B"&&(A[V]=0),F.hiLevel|=Q}a&&(function(Y,K,G){for(var re=0;re<G;re++)if(Y[re]==="S"){K[re]=k;for(var J=re-1;J>=0&&Y[J]==="WS";J--)K[J]=k}})(q,A,H)},R=function(E,A,F,L,z){if(!(z.hiLevel<E)){if(E===1&&k===1&&!o)return A.reverse(),void(F&&F.reverse());for(var V,Q,U,ee,H=A.length,B=0;B<H;){if(L[B]>=E){for(U=B+1;U<H&&L[U]>=E;)U++;for(ee=B,Q=U-1;ee<Q;ee++,Q--)V=A[ee],A[ee]=A[Q],A[Q]=V,F&&(V=F[ee],F[ee]=F[Q],F[Q]=V);B=U}B++}}},I=function(E,A,F){var L=E.split(""),z={hiLevel:k};return F||(F=[]),T(L,F,z),(function(V,Q,U){if(U.hiLevel!==0&&d)for(var ee,H=0;H<V.length;H++)Q[H]===1&&(ee=x.indexOf(V[H]))>=0&&(V[H]=x[ee+1])})(L,F,z),R(2,L,A,F,z),R(1,L,A,F,z),L.join("")};return this.__bidiEngine__.doBidiReorder=function(E,A,F){if((function(z,V){if(V)for(var Q=0;Q<z.length;Q++)V[Q]=Q;l===void 0&&(l=_(z)),u===void 0&&(u=_(z))})(E,A),s||!c||u)if(s&&c&&l^u)k=l?1:0,E=O(E,A,F);else if(!s&&c&&u)k=l?1:0,E=I(E,A,F),E=O(E,A);else if(!s||l||c||u){if(s&&!c&&l^u)E=O(E,A),l?(k=0,E=I(E,A,F)):(k=1,E=I(E,A,F),E=O(E,A));else if(s&&l&&!c&&u)k=1,E=I(E,A,F),E=O(E,A);else if(!s&&!c&&l^u){var L=d;l?(k=1,E=I(E,A,F),k=0,d=!1,E=I(E,A,F),d=L):(k=0,E=I(E,A,F),E=O(E,A),k=1,d=!1,E=I(E,A,F),d=L,E=O(E,A))}}else k=0,E=I(E,A,F);else k=l?1:0,E=I(E,A,F);return E},this.__bidiEngine__.setOptions=function(E){E&&(s=E.isInputVisual,c=E.isOutputVisual,l=E.isInputRtl,u=E.isOutputRtl,d=E.isSymmetricSwapping)},this.__bidiEngine__.setOptions(n),this.__bidiEngine__};var t=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],r=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(n){var o=n.text;n.x,n.y;var a=n.options||{};n.mutex,a.lang;var s=[];if(a.isInputVisual=typeof a.isInputVisual!="boolean"||a.isInputVisual,r.setOptions(a),Object.prototype.toString.call(o)==="[object Array]"){var l=0;for(s=[],l=0;l<o.length;l+=1)Object.prototype.toString.call(o[l])==="[object Array]"?s.push([r.doBidiReorder(o[l][0]),o[l][1],o[l][2]]):s.push([r.doBidiReorder(o[l])]);n.text=s}else n.text=r.doBidiReorder(o);r.setOptions({isInputVisual:!0})}])})(dr),dr.API.TTFFont=(function(){function e(t){var r;if(this.rawData=t,r=this.contents=new qf(t),this.contents.pos=4,r.readString(4)==="ttcf")throw new Error("TTCF not supported.");r.pos=0,this.parse(),this.subset=new tIe(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new WOe(this.contents),this.head=new $Oe(this),this.name=new GOe(this),this.cmap=new IX(this),this.toUnicode={},this.hhea=new UOe(this),this.maxp=new KOe(this),this.hmtx=new QOe(this),this.post=new VOe(this),this.os2=new HOe(this),this.loca=new eIe(this),this.glyf=new XOe(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var t,r,n,o,a;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var s,l,c,u;for(u=[],s=0,l=(c=this.bbox).length;s<l;s++)t=c[s],u.push(Math.round(t*this.scaleFactor));return u}).call(this),this.stemV=0,this.post.exists?(n=255&(o=this.post.italic_angle),32768&(r=o>>16)&&(r=-(1+(65535^r))),this.italicAngle=+(r+"."+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(a=this.familyClass)===1||a===2||a===3||a===4||a===5||a===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(t){var r;return((r=this.cmap.unicode)!=null?r.codeMap[t]:void 0)||0},e.prototype.widthOfGlyph=function(t){var r;return r=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*r},e.prototype.widthOfString=function(t,r,n){var o,a,s,l;for(s=0,a=0,l=(t=""+t).length;0<=l?a<l:a>l;a=0<=l?++a:--a)o=t.charCodeAt(a),s+=this.widthOfGlyph(this.characterToGlyph(o))+n*(1e3/r)||0;return s*(r/1e3)},e.prototype.lineHeight=function(t,r){var n;return r==null&&(r=!1),n=r?this.lineGap:0,(this.ascender+n-this.decender)/1e3*t},e})();var yc,qf=(function(){function e(t){this.data=t??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(t){return this.data[this.pos++]=t},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=2147483648?t-4294967296:t},e.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},e.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},e.prototype.readString=function(t){var r,n;for(n=[],r=0;0<=t?r<t:r>t;r=0<=t?++r:--r)n[r]=String.fromCharCode(this.readByte());return n.join("")},e.prototype.writeString=function(t){var r,n,o;for(o=[],r=0,n=t.length;0<=n?r<n:r>n;r=0<=n?++r:--r)o.push(this.writeByte(t.charCodeAt(r)));return o},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(t){return this.writeInt16(t)},e.prototype.readLongLong=function(){var t,r,n,o,a,s,l,c;return t=this.readByte(),r=this.readByte(),n=this.readByte(),o=this.readByte(),a=this.readByte(),s=this.readByte(),l=this.readByte(),c=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^r)+1099511627776*(255^n)+4294967296*(255^o)+16777216*(255^a)+65536*(255^s)+256*(255^l)+(255^c)+1):72057594037927940*t+281474976710656*r+1099511627776*n+4294967296*o+16777216*a+65536*s+256*l+c},e.prototype.writeLongLong=function(t){var r,n;return r=Math.floor(t/4294967296),n=4294967295&t,this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(t){return this.writeInt32(t)},e.prototype.read=function(t){var r,n;for(r=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)r.push(this.readByte());return r},e.prototype.write=function(t){var r,n,o,a;for(a=[],n=0,o=t.length;n<o;n++)r=t[n],a.push(this.writeByte(r));return a},e})(),WOe=(function(){var e;function t(r){var n,o,a;for(this.scalarType=r.readInt(),this.tableCount=r.readShort(),this.searchRange=r.readShort(),this.entrySelector=r.readShort(),this.rangeShift=r.readShort(),this.tables={},o=0,a=this.tableCount;0<=a?o<a:o>a;o=0<=a?++o:--o)n={tag:r.readString(4),checksum:r.readInt(),offset:r.readInt(),length:r.readInt()},this.tables[n.tag]=n}return t.prototype.encode=function(r){var n,o,a,s,l,c,u,d,f,h,p,y,m;for(m in p=Object.keys(r).length,c=Math.log(2),f=16*Math.floor(Math.log(p)/c),s=Math.floor(f/c),d=16*p-f,(o=new qf).writeInt(this.scalarType),o.writeShort(p),o.writeShort(f),o.writeShort(s),o.writeShort(d),a=16*p,u=o.pos+a,l=null,y=[],r)for(h=r[m],o.writeString(m),o.writeInt(e(h)),o.writeInt(u),o.writeInt(h.length),y=y.concat(h),m==="head"&&(l=u),u+=h.length;u%4;)y.push(0),u++;return o.write(y),n=2981146554-e(o.data),o.pos=l+8,o.writeUInt32(n),o.data},e=function(r){var n,o,a,s;for(r=NX.call(r);r.length%4;)r.push(0);for(a=new qf(r),o=0,n=0,s=r.length;n<s;n=n+=4)o+=a.readUInt32();return 4294967295&o},t})(),qOe={}.hasOwnProperty,cu=function(e,t){for(var r in t)qOe.call(t,r)&&(e[r]=t[r]);function n(){this.constructor=e}return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e};yc=(function(){function e(t){var r;this.file=t,r=this.file.directory.tables[this.tag],this.exists=!!r,r&&(this.offset=r.offset,this.length=r.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e})();var $Oe=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return cu(e,yc),e.prototype.tag="head",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},e.prototype.encode=function(t){var r;return(r=new qf).writeInt(this.version),r.writeInt(this.revision),r.writeInt(this.checkSumAdjustment),r.writeInt(this.magicNumber),r.writeShort(this.flags),r.writeShort(this.unitsPerEm),r.writeLongLong(this.created),r.writeLongLong(this.modified),r.writeShort(this.xMin),r.writeShort(this.yMin),r.writeShort(this.xMax),r.writeShort(this.yMax),r.writeShort(this.macStyle),r.writeShort(this.lowestRecPPEM),r.writeShort(this.fontDirectionHint),r.writeShort(t),r.writeShort(this.glyphDataFormat),r.data},e})(),CW=(function(){function e(t,r){var n,o,a,s,l,c,u,d,f,h,p,y,m,x,b,w,k;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=r+t.readInt(),f=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(c=0;c<256;++c)this.codeMap[c]=t.readByte();break;case 4:for(p=t.readUInt16(),h=p/2,t.pos+=6,a=(function(){var S,_;for(_=[],c=S=0;0<=h?S<h:S>h;c=0<=h?++S:--S)_.push(t.readUInt16());return _})(),t.pos+=2,m=(function(){var S,_;for(_=[],c=S=0;0<=h?S<h:S>h;c=0<=h?++S:--S)_.push(t.readUInt16());return _})(),u=(function(){var S,_;for(_=[],c=S=0;0<=h?S<h:S>h;c=0<=h?++S:--S)_.push(t.readUInt16());return _})(),d=(function(){var S,_;for(_=[],c=S=0;0<=h?S<h:S>h;c=0<=h?++S:--S)_.push(t.readUInt16());return _})(),o=(this.length-t.pos+this.offset)/2,l=(function(){var S,_;for(_=[],c=S=0;0<=o?S<o:S>o;c=0<=o?++S:--S)_.push(t.readUInt16());return _})(),c=b=0,k=a.length;b<k;c=++b)for(x=a[c],n=w=y=m[c];y<=x?w<=x:w>=x;n=y<=x?++w:--w)d[c]===0?s=n+u[c]:(s=l[d[c]/2+(n-y)-(h-c)]||0)!==0&&(s+=u[c]),this.codeMap[n]=65535&s}t.pos=f}return e.encode=function(t,r){var n,o,a,s,l,c,u,d,f,h,p,y,m,x,b,w,k,S,_,P,O,T,R,I,E,A,F,L,z,V,Q,U,ee,H,B,M,$,q,Y,K,G,re,J,ae,le,me;switch(L=new qf,s=Object.keys(t).sort(function(Oe,we){return Oe-we}),r){case"macroman":for(m=0,x=(function(){var Oe=[];for(y=0;y<256;++y)Oe.push(0);return Oe})(),w={0:0},a={},z=0,ee=s.length;z<ee;z++)w[J=t[o=s[z]]]==null&&(w[J]=++m),a[o]={old:t[o],new:w[t[o]]},x[o]=w[t[o]];return L.writeUInt16(1),L.writeUInt16(0),L.writeUInt32(12),L.writeUInt16(0),L.writeUInt16(262),L.writeUInt16(0),L.write(x),{charMap:a,subtable:L.data,maxGlyphID:m+1};case"unicode":for(A=[],f=[],k=0,w={},n={},b=u=null,V=0,H=s.length;V<H;V++)w[_=t[o=s[V]]]==null&&(w[_]=++k),n[o]={old:_,new:w[_]},l=w[_]-o,b!=null&&l===u||(b&&f.push(b),A.push(o),u=l),b=o;for(b&&f.push(b),f.push(65535),A.push(65535),I=2*(R=A.length),T=2*Math.pow(Math.log(R)/Math.LN2,2),h=Math.log(T/2)/Math.LN2,O=2*R-T,c=[],P=[],p=[],y=Q=0,B=A.length;Q<B;y=++Q){if(E=A[y],d=f[y],E===65535){c.push(0),P.push(0);break}if(E-(F=n[E].new)>=32768)for(c.push(0),P.push(2*(p.length+R-y)),o=U=E;E<=d?U<=d:U>=d;o=E<=d?++U:--U)p.push(n[o].new);else c.push(F-E),P.push(0)}for(L.writeUInt16(3),L.writeUInt16(1),L.writeUInt32(12),L.writeUInt16(4),L.writeUInt16(16+8*R+2*p.length),L.writeUInt16(0),L.writeUInt16(I),L.writeUInt16(T),L.writeUInt16(h),L.writeUInt16(O),G=0,M=f.length;G<M;G++)o=f[G],L.writeUInt16(o);for(L.writeUInt16(0),re=0,$=A.length;re<$;re++)o=A[re],L.writeUInt16(o);for(ae=0,q=c.length;ae<q;ae++)l=c[ae],L.writeUInt16(l);for(le=0,Y=P.length;le<Y;le++)S=P[le],L.writeUInt16(S);for(me=0,K=p.length;me<K;me++)m=p[me],L.writeUInt16(m);return{charMap:n,subtable:L.data,maxGlyphID:k+1}}},e})(),IX=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return cu(e,yc),e.prototype.tag="cmap",e.prototype.parse=function(t){var r,n,o;for(t.pos=this.offset,this.version=t.readUInt16(),o=t.readUInt16(),this.tables=[],this.unicode=null,n=0;0<=o?n<o:n>o;n=0<=o?++n:--n)r=new CW(t,this.offset),this.tables.push(r),r.isUnicode&&this.unicode==null&&(this.unicode=r);return!0},e.encode=function(t,r){var n,o;return r==null&&(r="macroman"),n=CW.encode(t,r),(o=new qf).writeUInt16(0),o.writeUInt16(1),n.table=o.data.concat(n.subtable),n},e})(),UOe=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return cu(e,yc),e.prototype.tag="hhea",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},e})(),HOe=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return cu(e,yc),e.prototype.tag="OS/2",e.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=(function(){var r,n;for(n=[],r=0;r<10;++r)n.push(t.readByte());return n})(),this.charRange=(function(){var r,n;for(n=[],r=0;r<4;++r)n.push(t.readInt());return n})(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=(function(){var r,n;for(n=[],r=0;r<2;r=++r)n.push(t.readInt());return n})(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},e})(),VOe=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return cu(e,yc),e.prototype.tag="post",e.prototype.parse=function(t){var r,n,o;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:case 196608:break;case 131072:var a;for(n=t.readUInt16(),this.glyphNameIndex=[],a=0;0<=n?a<n:a>n;a=0<=n?++a:--a)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],o=[];t.pos<this.offset+this.length;)r=t.readByte(),o.push(this.names.push(t.readString(r)));return o;case 151552:return n=t.readUInt16(),this.offsets=t.read(n);case 262144:return this.map=(function(){var s,l,c;for(c=[],a=s=0,l=this.file.maxp.numGlyphs;0<=l?s<l:s>l;a=0<=l?++s:--s)c.push(t.readUInt32());return c}).call(this)}},e})(),YOe=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},GOe=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return cu(e,yc),e.prototype.tag="name",e.prototype.parse=function(t){var r,n,o,a,s,l,c,u,d,f,h;for(t.pos=this.offset,t.readShort(),r=t.readShort(),l=t.readShort(),n=[],a=0;0<=r?a<r:a>r;a=0<=r?++a:--a)n.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+l+t.readShort()});for(c={},a=d=0,f=n.length;d<f;a=++d)o=n[a],t.pos=o.offset,u=t.readString(o.length),s=new YOe(u,o),c[h=o.nameID]==null&&(c[h]=[]),c[o.nameID].push(s);this.strings=c,this.copyright=c[0],this.fontFamily=c[1],this.fontSubfamily=c[2],this.uniqueSubfamily=c[3],this.fontName=c[4],this.version=c[5];try{this.postscriptName=c[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=c[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=c[7],this.manufacturer=c[8],this.designer=c[9],this.description=c[10],this.vendorUrl=c[11],this.designerUrl=c[12],this.license=c[13],this.licenseUrl=c[14],this.preferredFamily=c[15],this.preferredSubfamily=c[17],this.compatibleFull=c[18],this.sampleText=c[19]},e})(),KOe=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return cu(e,yc),e.prototype.tag="maxp",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},e})(),QOe=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return cu(e,yc),e.prototype.tag="hmtx",e.prototype.parse=function(t){var r,n,o,a,s,l,c;for(t.pos=this.offset,this.metrics=[],r=0,l=this.file.hhea.numberOfMetrics;0<=l?r<l:r>l;r=0<=l?++r:--r)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(o=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=(function(){var u,d;for(d=[],r=u=0;0<=o?u<o:u>o;r=0<=o?++u:--u)d.push(t.readInt16());return d})(),this.widths=(function(){var u,d,f,h;for(h=[],u=0,d=(f=this.metrics).length;u<d;u++)a=f[u],h.push(a.advance);return h}).call(this),n=this.widths[this.widths.length-1],c=[],r=s=0;0<=o?s<o:s>o;r=0<=o?++s:--s)c.push(this.widths.push(n));return c},e.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},e})(),NX=[].slice,XOe=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return cu(e,yc),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(t){var r,n,o,a,s,l,c,u,d,f;return t in this.cache?this.cache[t]:(a=this.file.loca,r=this.file.contents,n=a.indexOf(t),(o=a.lengthOf(t))===0?this.cache[t]=null:(r.pos=this.offset+n,s=(l=new qf(r.read(o))).readShort(),u=l.readShort(),f=l.readShort(),c=l.readShort(),d=l.readShort(),this.cache[t]=s===-1?new JOe(l,u,f,c,d):new ZOe(l,s,u,f,c,d),this.cache[t]))},e.prototype.encode=function(t,r,n){var o,a,s,l,c;for(s=[],a=[],l=0,c=r.length;l<c;l++)o=t[r[l]],a.push(s.length),o&&(s=s.concat(o.encode(n)));return a.push(s.length),{table:s,offsets:a}},e})(),ZOe=(function(){function e(t,r,n,o,a,s){this.raw=t,this.numberOfContours=r,this.xMin=n,this.yMin=o,this.xMax=a,this.yMax=s,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e})(),JOe=(function(){function e(t,r,n,o,a){var s,l;for(this.raw=t,this.xMin=r,this.yMin=n,this.xMax=o,this.yMax=a,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],s=this.raw;l=s.readShort(),this.glyphOffsets.push(s.pos),this.glyphIDs.push(s.readUInt16()),32&l;)s.pos+=1&l?4:2,128&l?s.pos+=8:64&l?s.pos+=4:8&l&&(s.pos+=2)}return e.prototype.encode=function(){var t,r,n;for(r=new qf(NX.call(this.raw.data)),t=0,n=this.glyphIDs.length;t<n;++t)r.pos=this.glyphOffsets[t];return r.data},e})(),eIe=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return cu(e,yc),e.prototype.tag="loca",e.prototype.parse=function(t){var r,n;return t.pos=this.offset,r=this.file.head.indexToLocFormat,this.offsets=r===0?(function(){var o,a;for(a=[],n=0,o=this.length;n<o;n+=2)a.push(2*t.readUInt16());return a}).call(this):(function(){var o,a;for(a=[],n=0,o=this.length;n<o;n+=4)a.push(t.readUInt32());return a}).call(this)},e.prototype.indexOf=function(t){return this.offsets[t]},e.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},e.prototype.encode=function(t,r){for(var n=new Uint32Array(this.offsets.length),o=0,a=0,s=0;s<n.length;++s)if(n[s]=o,a<r.length&&r[a]==s){++a,n[s]=o;var l=this.offsets[s],c=this.offsets[s+1]-l;c>0&&(o+=c)}for(var u=new Array(4*n.length),d=0;d<n.length;++d)u[4*d+3]=255&n[d],u[4*d+2]=(65280&n[d])>>8,u[4*d+1]=(16711680&n[d])>>16,u[4*d]=(4278190080&n[d])>>24;return u},e})(),tIe=(function(){function e(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var t,r,n,o,a;for(r in o=this.font.cmap.tables[0].codeMap,t={},a=this.subset)n=a[r],t[r]=o[n];return t},e.prototype.glyphsFor=function(t){var r,n,o,a,s,l,c;for(o={},s=0,l=t.length;s<l;s++)o[a=t[s]]=this.font.glyf.glyphFor(a);for(a in r=[],o)(n=o[a])!=null&&n.compound&&r.push.apply(r,n.glyphIDs);if(r.length>0)for(a in c=this.glyphsFor(r))n=c[a],o[a]=n;return o},e.prototype.encode=function(t,r){var n,o,a,s,l,c,u,d,f,h,p,y,m,x,b;for(o in n=IX.encode(this.generateCmap(),"unicode"),s=this.glyphsFor(t),p={0:0},b=n.charMap)p[(c=b[o]).old]=c.new;for(y in h=n.maxGlyphID,s)y in p||(p[y]=h++);return d=(function(w){var k,S;for(k in S={},w)S[w[k]]=k;return S})(p),f=Object.keys(d).sort(function(w,k){return w-k}),m=(function(){var w,k,S;for(S=[],w=0,k=f.length;w<k;w++)l=f[w],S.push(d[l]);return S})(),a=this.font.glyf.encode(s,m,p),u=this.font.loca.encode(a.offsets,m),x={cmap:this.font.cmap.raw(),glyf:a.table,loca:u,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(r)},this.font.os2.exists&&(x["OS/2"]=this.font.os2.raw()),this.font.directory.encode(x)},e})();dr.API.PDFObject=(function(){var e;function t(){}return e=function(r,n){return(Array(n+1).join("0")+r).slice(-n)},t.convert=function(r){var n,o,a,s;if(Array.isArray(r))return"["+(function(){var l,c,u;for(u=[],l=0,c=r.length;l<c;l++)n=r[l],u.push(t.convert(n));return u})().join(" ")+"]";if(typeof r=="string")return"/"+r;if(r!=null&&r.isString)return"("+r+")";if(r instanceof Date)return"(D:"+e(r.getUTCFullYear(),4)+e(r.getUTCMonth(),2)+e(r.getUTCDate(),2)+e(r.getUTCHours(),2)+e(r.getUTCMinutes(),2)+e(r.getUTCSeconds(),2)+"Z)";if({}.toString.call(r)==="[object Object]"){for(o in a=["<<"],r)s=r[o],a.push("/"+o+" "+t.convert(s));return a.push(">>"),a.join(`
|
||
`)}return""+r},t})();async function RX(e,t){const r=new dr({orientation:"portrait",unit:"mm",format:"a4"});await r.html(e,{margin:[6,6,6,6],autoPaging:"slice",html2canvas:{scale:.22,useCORS:!0,logging:!1,backgroundColor:"#ffffff"},width:190,windowWidth:680});const n=t.endsWith(".pdf")?t:`${t}.pdf`;r.save(n)}function rIe({ctx:e,onClose:t}){const r=j.useRef(null),[n,o]=j.useState(!1),[a,s]=j.useState(null),l=e.content.layoutId||"tpl1",c=WQ(e),u=(e.templateName||"brochure").replace(/[^a-z0-9-_]+/gi,"-").replace(/^-|-$/g,"")||"brochure",d=async()=>{if(!(!r.current||n)){s(null),o(!0);try{await RX(r.current,`${u}.pdf`)}catch(f){s(f instanceof Error?f.message:"PDF export failed")}finally{o(!1)}}};return i.jsx(i.Fragment,{children:i.jsx("div",{role:"presentation",onClick:t,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:300,display:"flex",alignItems:"center",justifyContent:"center",padding:20},children:i.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"brochure-preview-title",onClick:f=>f.stopPropagation(),style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"min(900px, 100%)",maxHeight:"90vh",display:"flex",flexDirection:"column",boxShadow:"var(--elevation-sm)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid var(--border)",flexShrink:0},children:[i.jsxs("div",{children:[i.jsx("h3",{id:"brochure-preview-title",style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"0 0 4px"},children:"Brochure Preview"}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:[c.eventName," • ",nPe(l)]}),a?i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",margin:"6px 0 0"},children:a}):null]}),i.jsxs("div",{style:{display:"flex",gap:8},children:[i.jsxs("button",{type:"button",disabled:n,onClick:()=>void d(),style:{display:"flex",alignItems:"center",gap:6,padding:"7px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:n?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",opacity:n?.75:1},children:[i.jsx(Al,{size:14})," ",n?"Generating…":"Download PDF"]}),i.jsx("button",{type:"button",onClick:t,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,borderRadius:"var(--radius-button)",borderWidth:1,borderStyle:"solid",borderColor:"var(--border)",background:"var(--card)",cursor:"pointer",color:"var(--muted)"},children:i.jsx(er,{size:16})})]})]}),i.jsx("div",{style:{flex:1,overflowY:"auto",padding:20,background:"#F8FAFC"},children:i.jsx("div",{ref:r,style:{maxWidth:680,margin:"0 auto",background:"#fff",boxShadow:"0 4px 20px rgba(0,0,0,0.1)"},children:i.jsx(qQ,{templateId:l,data:c})})})]})})})}async function nIe(e,t,r){const n=document.createElement("div");n.setAttribute("data-brochure-pdf-export","1"),n.style.cssText="position:fixed;left:-12000px;top:0;width:680px;background:#fff;z-index:-1;pointer-events:none;",document.body.appendChild(n);const o=YW.createRoot(n);o.render(i.jsx("div",{style:{width:680,background:"#fff"},children:i.jsx(qQ,{templateId:e,data:t})})),await new Promise(a=>requestAnimationFrame(()=>requestAnimationFrame(()=>a()))),await new Promise(a=>setTimeout(a,450));try{const a=n.firstElementChild;if(!a)throw new Error("Brochure render failed");await RX(a,r)}finally{o.unmount(),n.remove()}}const N3=["header","banner","countdown","about","agenda","speakers","register_links","sponsors"],LX=[{id:"header",label:"Navigation header",desc:"Top nav with event name and links."},{id:"banner",label:"Hero / banner",desc:"Full-width headline and CTAs."},{id:"countdown",label:"Countdown strip",desc:"Countdown to event start."},{id:"gallery",label:"Gallery",desc:"Image grid strip."},{id:"about",label:"About",desc:"Headline, bullets, and CTA."},{id:"contact_form",label:"Contact form",desc:"Visitor message form."},{id:"agenda",label:"Schedule",desc:"Sessions from your event (timeline layout)."},{id:"register_links",label:"Registration block",desc:"Register CTAs."},{id:"speakers",label:"Speakers",desc:"Speaker cards from linked sessions."},{id:"tickets",label:"Tickets / pricing",desc:"Pricing tiers (demo-style cards)."},{id:"venue",label:"Venue",desc:"Venue copy and map embed."},{id:"sponsors",label:"Sponsors",desc:"Sponsor row and partner CTA."},{id:"faq",label:"FAQ",desc:"Accordion questions."},{id:"cta",label:"Call to action",desc:"Highlighted CTA band."},{id:"footer",label:"Footer (optional)",desc:"Extra footer row (shell already has EventBuzz footer)."},{id:"custom_html",label:"Custom HTML",desc:"Rich text / HTML block."}],iIe=Object.fromEntries(LX.map(e=>[e.id,e])),oIe=[{id:"violet",label:"Violet",primary:"#5c6ac4",accent:"#00c2d1"},{id:"ocean",label:"Ocean",primary:"#0e7490",accent:"#22d3ee"},{id:"forest",label:"Forest",primary:"#15803d",accent:"#84cc16"},{id:"ember",label:"Ember",primary:"#c2410c",accent:"#fbbf24"}],Lg=["Montserrat + Roboto","Inter + Noto Sans","Playfair + Source Sans","Poppins + Open Sans","Raleway + Lato"],aIe=[{label:"Draft (not published to URL)",value:"Draft"},{label:"Live (public site enabled)",value:"Live"}];function EW(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function sIe(e){return e==null?"":typeof e=="object"&&e&&"_id"in e?String(e._id):String(e)}function lIe({onClose:e,onSuccess:t,initialEventId:r}){var nt;const{user:n}=Ur(),o=zn(n),[a,s]=j.useState(!1),[l,c]=j.useState(null),[u,d]=j.useState(0),[f,h]=j.useState(null),[p,y]=j.useState(!1),m=j.useRef(null),[x,b]=j.useState(!1),[w,k]=j.useState(null),S=4,_=mc(S),[P,O]=j.useState([]),[T,R]=j.useState({event:"",templateName:"",slug:"",description:"",layoutTemplate:"conference",micrositeSections:[...N3],primaryColor:"#5c6ac4",accentColor:"#00c2d1",fontPair:Lg[0],status:"Draft",customDomain:"",passwordProtect:!1,password:"",seoTitle:"",seoDescription:"",registrationFormId:"",sourcePageId:""}),[I,E]=j.useState([]),[A,F]=j.useState(null),[L,z]=j.useState(!1),[V,Q]=j.useState([]),[U,ee]=j.useState([]),[H,B]=j.useState(!1),[M,$]=j.useState(!1),[q,Y]=j.useState(null),[K,G]=j.useState(null),[re,J]=j.useState(null),[ae,le]=j.useState(null),me=j.useRef(T.micrositeSections);me.current=T.micrositeSections;const Oe=j.useRef(null),we=j.useMemo(()=>{const Ae=T.micrositeSections.map(ft=>iIe[ft]).filter(Boolean),Te=new Set(T.micrositeSections),wt=LX.filter(ft=>!Te.has(ft.id));return[...Ae,...wt]},[T.micrositeSections]),ie=(Ae,Te)=>R(wt=>({...wt,[Ae]:Te}));j.useEffect(()=>()=>{var Ae;(Ae=Oe.current)==null||Ae.call(Oe),Oe.current=null},[]);const Me=j.useCallback((Ae,Te)=>{var rt;if(Ae.pointerType==="mouse"&&Ae.button!==0||!me.current.includes(Te))return;(rt=Oe.current)==null||rt.call(Oe),Oe.current=null,Ae.preventDefault(),Ae.stopPropagation();const wt=Ae.currentTarget,ft=Ae.pointerId;let Pt=null,At=!1;le(Te);try{wt.setPointerCapture(ft)}catch{}const Ht={capture:!0},Se=Ze=>{!Ze||Ze===Te||R(pe=>{const xe=[...pe.micrositeSections];if(!xe.includes(Te)||!xe.includes(Ze))return pe;const De=xe.indexOf(Te),tt=xe.indexOf(Ze);if(De<0||tt<0)return pe;const Le=[...xe];return Le.splice(De,1),Le.splice(tt,0,Te),{...pe,micrositeSections:Le}})},ct=Ze=>{var tt;if(Ze.pointerId!==ft)return;const pe=document.elementFromPoint(Ze.clientX,Ze.clientY),xe=(tt=pe==null?void 0:pe.closest)==null?void 0:tt.call(pe,"[data-microsite-section-id]"),De=xe==null?void 0:xe.getAttribute("data-microsite-section-id");De&&me.current.includes(De)&&(Pt=De)};let gt;const We=Ze=>{Ze.pointerId===ft&>(!0)},Pe=Ze=>{Ze.pointerId===ft&>(!0)};gt=Ze=>{if(!At){At=!0,document.removeEventListener("pointermove",ct,Ht),document.removeEventListener("pointerup",We,Ht),document.removeEventListener("pointercancel",We,Ht),wt.removeEventListener("lostpointercapture",Pe),Oe.current=null,le(null);try{wt.releasePointerCapture(ft)}catch{}Ze&&Se(Pt)}},Oe.current=()=>gt(!1),document.addEventListener("pointermove",ct,Ht),document.addEventListener("pointerup",We,Ht),document.addEventListener("pointercancel",We,Ht),wt.addEventListener("lostpointercapture",Pe)},[]);j.useEffect(()=>{r&&R(Ae=>({...Ae,event:r}))},[r]),j.useEffect(()=>{o&&zr.list({limit:100,organization:o}).then(Ae=>{var Te;(Te=Ae.data)!=null&&Te.events&&(O(Ae.data.events),R(wt=>{var ft;return{...wt,event:wt.event||r||((ft=Ae.data.events[0])==null?void 0:ft._id)||""}}))})},[o,r]);const ke=j.useCallback(Ae=>{const Te=Ae.sourcePageId,wt=Te==null?"":typeof Te=="object"&&Te&&"_id"in Te?String(Te._id):String(Te);R(ft=>{var Pt,At;return{...ft,templateName:Ae.name??"",slug:Ae.publishFolder??"",description:Ae.description??"",layoutTemplate:"conference",micrositeSections:Ae.micrositeSections&&Ae.micrositeSections.length>0?[...Ae.micrositeSections]:[...N3],status:Ae.enabled?"Live":"Draft",seoTitle:Ae.title??"",primaryColor:((Pt=Ae.primaryColor)==null?void 0:Pt.trim())||"#5c6ac4",accentColor:((At=Ae.accentColor)==null?void 0:At.trim())||"#00c2d1",fontPair:Ae.fontPair&&Lg.includes(Ae.fontPair)?Ae.fontPair:Lg[0],registrationFormId:Ae.registrationFormId!=null?String(Ae.registrationFormId):"",seoDescription:Ae.seoDescription??"",sourcePageId:wt}})},[]),se=j.useCallback(Ae=>{R(Te=>{var wt,ft;return{...Te,templateName:"Default",slug:Ae.folder??Te.slug,description:Ae.description??"",layoutTemplate:"conference",micrositeSections:Ae.micrositeSections&&Ae.micrositeSections.length>0?[...Ae.micrositeSections]:[...N3],status:Ae.enabled?"Live":"Draft",seoTitle:Ae.title??"",primaryColor:((wt=Ae.primaryColor)==null?void 0:wt.trim())||"#5c6ac4",accentColor:((ft=Ae.accentColor)==null?void 0:ft.trim())||"#00c2d1",fontPair:Ae.fontPair&&Lg.includes(Ae.fontPair)?Ae.fontPair:Lg[0],registrationFormId:Ae.registrationFormId??"",seoDescription:Ae.seoDescription??"",sourcePageId:""}})},[]);j.useEffect(()=>{if(!T.event){E([]),F(null),Q([]);return}let Ae=!1;return(async()=>{var Pt;z(!0);const[Te,wt]=await Promise.all([ua.list(T.event),Wc.list(T.event)]);if(Ae)return;if(z(!1),Q(((Pt=wt.data)==null?void 0:Pt.pages)??[]),Te.error||!Te.data){E([]),F(null);const At=await Uc.get(T.event);if(Ae||At.error||!At.data)return;se(At.data);return}const ft=Te.data;if(E(ft),ft.length===0){F(null);const At=await Uc.get(T.event);if(Ae||At.error||!At.data)return;se(At.data);return}F(ft[0]._id),ke(ft[0])})(),()=>{Ae=!0}},[T.event,se,ke]),j.useEffect(()=>{if(!T.event){ee([]);return}Ma.listForEvent(T.event).then(Ae=>ee(Ae.filter(Te=>Te.type==="registration"))).catch(()=>ee([]))},[T.event]);const fe=((nt=P.find(Ae=>Ae._id===T.event))==null?void 0:nt.name)??"",Ie=()=>({publishFolder:T.slug.trim(),name:T.templateName.trim()||void 0,description:T.description||void 0,title:T.seoTitle.trim()||void 0,layoutTemplate:"conference",micrositeSections:T.micrositeSections,enabled:T.status==="Live",primaryColor:T.primaryColor||void 0,accentColor:T.accentColor||void 0,fontPair:T.fontPair||void 0,registrationFormId:T.registrationFormId.trim()||void 0,seoDescription:T.seoDescription.trim()||void 0,sourcePageId:T.sourcePageId.trim()||null}),ce=async()=>{if(Y(null),!T.event)return Y("Select an event."),!1;if(!T.slug.trim())return Y("URL slug is required."),!1;if(B(!0),A){const Te=await ua.update(T.event,A,Ie());return B(!1),Te.error?(Y(Te.error),!1):(Te.data&&(E(wt=>wt.map(ft=>ft._id===Te.data._id?{...ft,...Te.data}:ft)),ke(Te.data)),t==null||t(),!0)}const Ae=await ua.create(T.event,{...Ie(),publishFolder:T.slug.trim(),name:T.templateName.trim()||"Default"});return B(!1),Ae.error?(Y(Ae.error),!1):(Ae.data&&(E(Te=>[...Te,Ae.data]),F(Ae.data._id),ke(Ae.data)),t==null||t(),!0)},je=async()=>{await ce()},qe=async()=>{var wt;if(G(null),!T.event){G("Select an event.");return}if(!T.slug.trim()){G("Set a URL slug before publishing.");return}if(!A){G("Save the microsite as a template first, then publish.");return}$(!0);const Ae=await ua.update(T.event,A,Ie());if(Ae.error){$(!1),G(Ae.error);return}const Te=await ua.publish(T.event,A);if($(!1),Te.error){G(Te.error);return}(wt=Te.data)!=null&&wt.publicUrl&&J(Te.data.publicUrl),t==null||t()},Ne=async()=>{var Te;if(!T.event)return;if(!A){h("Create or select a microsite template and save it before opening the visual builder.");return}h(null),y(!0);let Ae=null;try{const wt=await ua.get(T.event,A);if(wt.error||!wt.data){y(!1),h(wt.error||"Could not load this microsite template.");return}let ft=[];try{ft=((Te=(await Wc.list(T.event)).data)==null?void 0:Te.pages)??[]}catch{ft=[]}const Pt=sIe(wt.data.sourcePageId),At=T.sourcePageId.trim();if(ft.length===0)Ae=null;else{const Ht=Se=>Se&&ft.some(ct=>ct._id===Se)?(Ae=Se,!0):!1;if(!Ht(At)&&!Ht(Pt)){const Se=ft.find(ct=>ct.type==="home")??ft[0];Ae=(Se==null?void 0:Se._id)??null}}}catch{y(!1),h("Could not load pages or microsite. Check your connection and try again.");return}y(!1),c(Ae??""),d(wt=>wt+1),k(null),s(!0)},Je=()=>{s(!1),c(null),k(null),b(!1)},vt=async()=>{var Ae;if(k(null),!T.event||!T.slug.trim()||!A){k("Select an event, save a microsite template, and set a URL slug.");return}b(!0);try{const Te=await mw(m.current),wt=await ua.update(T.event,A,{micrositeHtml:Te});if(wt.error)throw new Error(wt.error);const ft=await ua.publish(T.event,A,{targets:"draft"});if(ft.error)throw new Error(ft.error);(Ae=ft.data)!=null&&Ae.publicUrl&&J(ft.data.publicUrl),t==null||t()}catch(Te){k(Te instanceof Error?Te.message:"Could not save or publish draft.")}finally{b(!1)}},Ge=async()=>{var Ae;if(k(null),!T.event||!T.slug.trim()||!A){k("Select an event, save a microsite template, and set a URL slug.");return}b(!0);try{const Te=await mw(m.current),wt=await ua.update(T.event,A,{micrositeHtml:Te});if(wt.error)throw new Error(wt.error);const ft=await ua.publish(T.event,A,{targets:"both"});if(ft.error)throw new Error(ft.error);(Ae=ft.data)!=null&&Ae.publicUrl&&J(ft.data.publicUrl),t==null||t()}catch(Te){k(Te instanceof Error?Te.message:"Could not publish.")}finally{b(!1)}},Ot=(Ae,Te)=>{if(Te){if(T.micrositeSections.includes(Ae))return;ie("micrositeSections",[...T.micrositeSections,Ae])}else ie("micrositeSections",T.micrositeSections.filter(wt=>wt!==Ae))};return i.jsxs(i.Fragment,{children:[i.jsxs(Zo,{onClose:e,title:"Configure event microsite",breadcrumb:"Design · Microsite Templates",description:"Set URL slug, layout shell, sections, and publish static HTML to your web host.",completedCount:_.done.size,totalSections:S,ctaLabel:"Save microsite",ctaDisabled:H||!T.event||!T.slug.trim(),onCtaClick:je,children:[q&&i.jsx("div",{style:{padding:"8px 12px",borderRadius:"var(--radius-button)",background:"#fef2f2",color:"#b91c1c",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",marginBottom:"8px"},children:q}),i.jsxs($r,{n:1,title:"Event & URL",subtitle:"Associate an event and public folder slug",open:_.open===1,completed:_.done.has(1),onToggle:()=>_.toggle(1),onSave:async()=>{await ce()&&_.advance(1)},nextDisabled:H,nextLabel:"Save & next",children:[i.jsx(Zi,{cols:2,children:i.jsxs(lt,{span2:!1,children:[i.jsx(pt,{text:"Event",required:!0}),i.jsx(an,{children:i.jsxs("select",{style:Nr,value:T.event,onChange:Ae=>ie("event",Ae.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"Select event…"}),P.map(Ae=>i.jsx("option",{value:Ae._id,children:Ae.name},Ae._id))]})}),fe&&i.jsx(Qt,{text:`Editing: ${fe}`})]})}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Microsite template"}),i.jsx(an,{children:i.jsxs("select",{style:Nr,disabled:!T.event||L,value:A??"__new__",onChange:Ae=>{const Te=Ae.target.value;if(Te==="__new__"){F(null);const ft=P.find(Pt=>Pt._id===T.event);R(Pt=>({...Pt,templateName:"",slug:ft?EW(ft.name):Pt.slug,sourcePageId:""}));return}F(Te);const wt=I.find(ft=>ft._id===Te);wt&&ke(wt)},onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"__new__",children:"+ New template…"}),I.map(Ae=>i.jsxs("option",{value:Ae._id,children:[(Ae.name||Ae.publishFolder||"Untitled").trim(),Ae.publishFolder?` · /${Ae.publishFolder}`:""]},Ae._id))]})}),L?i.jsx(Qt,{text:"Loading templates…"}):i.jsx(Qt,{text:"Each template has its own URL slug and static output folder."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Template label"}),i.jsx("input",{style:$t,placeholder:"e.g. Main site, Sponsor landing",value:T.templateName,onChange:Ae=>ie("templateName",Ae.target.value),onFocus:kt,onBlur:_t}),i.jsx(Qt,{text:"Admin use only; not shown on the public site."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Section source page"}),i.jsx(an,{children:i.jsxs("select",{style:Nr,value:T.sourcePageId,onChange:Ae=>ie("sourcePageId",Ae.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"Default (Home or first page)"}),V.map(Ae=>i.jsxs("option",{value:Ae._id,children:[Ae.title," (",Ae.type,")"]},Ae._id))]})}),i.jsx(Qt,{text:"Website Builder page whose sections drive generated blocks for publish and preview."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"URL slug",required:!0}),i.jsxs("div",{style:{display:"flex",alignItems:"center",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",overflow:"hidden",background:"var(--input-background)"},children:[i.jsx("span",{style:{padding:"8px 10px",background:"var(--secondary)",borderRight:"1px solid var(--border)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",whiteSpace:"nowrap"},children:"https://web.eventbuzz.live/"}),i.jsx("input",{style:{...$t,border:"none",borderRadius:0},placeholder:"your-event-2026",value:T.slug,onChange:Ae=>ie("slug",EW(Ae.target.value)),onFocus:kt,onBlur:_t})]}),i.jsx(Qt,{text:"Slug becomes the folder name for the published site."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Description (LLM / generation brief)"}),i.jsx("textarea",{style:{...$t,resize:"vertical",minHeight:"80px"},placeholder:"Describe the event and microsite goals for future AI-generated customisation…",value:T.description,onChange:Ae=>ie("description",Ae.target.value),onFocus:kt,onBlur:_t})]})]}),i.jsxs($r,{n:2,title:"Layout & sections",subtitle:"Conference template sections and order",open:_.open===2,completed:_.done.has(2),onToggle:()=>_.toggle(2),onSave:async()=>{await ce()&&_.advance(2)},nextDisabled:H,nextLabel:"Save & next",children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Color preset"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 8px",fontFamily:"var(--font-noto-sans)"},children:"Conference microsite only. Presets set Primary and Accent; you can fine-tune them under Branding. Published CSS uses those colours plus your font pairing."}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"8px"},children:oIe.map(Ae=>{const Te=T.primaryColor===Ae.primary&&T.accentColor===Ae.accent;return i.jsxs("button",{type:"button",onClick:()=>{ie("primaryColor",Ae.primary),ie("accentColor",Ae.accent)},style:{borderRadius:"var(--radius-button)",border:`2px solid ${Te?"var(--primary)":"var(--border)"}`,overflow:"hidden",cursor:"pointer",background:"none",padding:0,transition:"border-color .12s"},children:[i.jsx("div",{style:{height:"36px",background:`linear-gradient(135deg, ${Ae.primary} 0%, ${Ae.accent} 100%)`}}),i.jsx("p",{style:{margin:"5px 0",fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:Te?"var(--primary)":"var(--muted)"},children:Ae.label})]},Ae.id)})})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Sections"}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 8px",fontFamily:"var(--font-noto-sans)"},children:["If you have a ",i.jsx("strong",{children:"Home"})," page in Website Builder with sections, publish uses that page's sections and order (and your edits). Otherwise these checkboxes define what goes out. Included sections are listed first; drag the grip to reorder."]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:we.map(Ae=>{const Te=T.micrositeSections.includes(Ae.id),wt=T.micrositeSections.indexOf(Ae.id),ft=ae===Ae.id;return i.jsxs("div",{"data-microsite-section-id":Ae.id,style:{display:"flex",alignItems:"center",gap:"10px",padding:"9px 12px",borderRadius:"var(--radius-button)",border:`1px solid ${Te?"var(--primary)":"var(--border)"}`,background:Te?"var(--accent)":"var(--card)",transition:"opacity .12s, border-color .12s",opacity:ft?.55:1},children:[i.jsx("input",{type:"checkbox",checked:Te,onChange:Pt=>Ot(Ae.id,Pt.target.checked),style:{width:"18px",height:"18px",cursor:"pointer",accentColor:"var(--primary)",flexShrink:0},"aria-label":`Include ${Ae.label}`}),i.jsx("button",{type:"button",disabled:!Te,onPointerDown:Te?Pt=>Me(Pt,Ae.id):void 0,title:Te?"Drag to reorder":void 0,"aria-label":Te?`Reorder section ${Ae.label}`:"Enable section to reorder",style:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,touchAction:"none",userSelect:"none",cursor:Te?ft?"grabbing":"grab":"default",padding:"6px",minWidth:"36px",minHeight:"36px",borderRadius:"4px",border:"none",background:"transparent",color:"var(--muted)",opacity:Te?1:.35},children:i.jsx(sv,{size:16,"aria-hidden":!0})}),i.jsxs("div",{style:{flex:1},children:[i.jsxs("p",{style:{margin:0,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)"},children:[Ae.label,Te&&i.jsxs("span",{style:{marginLeft:"8px",fontSize:"10px",fontWeight:"normal",color:"var(--muted)"},children:["Order ",wt+1]})]}),i.jsx("p",{style:{margin:"1px 0 0",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:Ae.desc})]})]},Ae.id)})}),i.jsx(Qt,{text:`Publish order: ${T.micrositeSections.length} section${T.micrositeSections.length!==1?"s":""} (saved checklist). Matching blocks on the section source page (or Home) supply custom content; others use event defaults.`})]})]}),i.jsxs($r,{n:3,title:"Branding",subtitle:"Colours and fonts used for the Conference layout published microsite",open:_.open===3,completed:_.done.has(3),onToggle:()=>_.toggle(3),onSave:async()=>{await ce()&&_.advance(3)},nextDisabled:H,nextLabel:"Save & next",children:[i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Primary colour"}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 10px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)"},children:[i.jsx("input",{type:"color",value:T.primaryColor,onChange:Ae=>ie("primaryColor",Ae.target.value),style:{width:"24px",height:"24px",border:"none",background:"none",cursor:"pointer",padding:0}}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:T.primaryColor})]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Accent colour"}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 10px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)"},children:[i.jsx("input",{type:"color",value:T.accentColor,onChange:Ae=>ie("accentColor",Ae.target.value),style:{width:"24px",height:"24px",border:"none",background:"none",cursor:"pointer",padding:0}}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:T.accentColor})]})]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Font pairing"}),i.jsx(an,{children:i.jsx("select",{style:Nr,value:T.fontPair,onChange:Ae=>ie("fontPair",Ae.target.value),onFocus:kt,onBlur:_t,children:Lg.map(Ae=>i.jsx("option",{value:Ae,children:Ae},Ae))})})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Registration form"}),i.jsx(an,{children:i.jsxs("select",{style:Nr,value:T.registrationFormId,onChange:Ae=>ie("registrationFormId",Ae.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"None (use #register on page)"}),U.map(Ae=>i.jsx("option",{value:Ae._id,children:Ae.name},Ae._id))]})}),i.jsx(Qt,{text:"Register links use MICROSITE_REGISTRATION_URL_TEMPLATE on the server with {eventId} and {formId} when a form is selected."})]}),i.jsx(Qt,{text:"Static site uses the conference shell, conference-layout.css, conference-static.css, and inline theme variables."})]}),i.jsxs($r,{n:4,title:"Publishing",subtitle:"Enable site and write static files",open:_.open===4,completed:_.done.has(4),onToggle:()=>_.toggle(4),onSave:async()=>{await ce()&&_.advance(4)},nextDisabled:H,nextLabel:"Save microsite",children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Status",required:!0}),i.jsx(go,{name:"msStatus",value:T.status,onChange:Ae=>ie("status",Ae),options:aIe}),i.jsx(Qt,{text:"Draft writes files to {slug}_draft; Live writes to {slug}. The event’s canonical slug is unchanged."})]}),i.jsx(ev,{text:"SEO"}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Page title (HTML <title>)"}),i.jsx("input",{style:$t,placeholder:"e.g. NAPCON 2026",value:T.seoTitle,onChange:Ae=>ie("seoTitle",Ae.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"SEO description (meta)"}),i.jsx("textarea",{style:{...$t,resize:"vertical",minHeight:"64px"},placeholder:"Search snippet for published index.html.",value:T.seoDescription,onChange:Ae=>ie("seoDescription",Ae.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Visual editor"}),i.jsxs("button",{type:"button",disabled:!T.event||p,onClick:()=>void Ne(),style:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"10px 18px",borderRadius:"var(--radius-button)",background:"var(--secondary)",color:"var(--foreground)",border:"1px solid var(--border)",cursor:!T.event||p?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",opacity:!T.event||p?.5:1},children:[i.jsx(Z3,{size:18})," ",p?"Opening…":"Edit page with Microsite Builder"]}),f&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--destructive)",margin:"8px 0 0"},children:f}),i.jsx(Qt,{text:"Opens the GrapesJS Microsite Builder full screen on top of this panel (same event: Home page, or first page if there is no Home)."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Custom domain (optional)"}),i.jsx("input",{style:$t,placeholder:"e.g. conference.example.com",value:T.customDomain,onChange:Ae=>ie("customDomain",Ae.target.value),onFocus:kt,onBlur:_t}),i.jsx(Qt,{text:"DNS setup is separate from this publish step."})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{margin:0,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)"},children:"Password protection"}),i.jsx("p",{style:{margin:"2px 0 0",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Not applied to static export yet."})]}),i.jsx(cIe,{value:T.passwordProtect,onChange:Ae=>ie("passwordProtect",Ae)})]}),T.passwordProtect&&i.jsxs(lt,{children:[i.jsx(pt,{text:"Access password",required:!0}),i.jsx("input",{type:"password",style:$t,placeholder:"Set password…",value:T.password,onChange:Ae=>ie("password",Ae.target.value),onFocus:kt,onBlur:_t})]}),K&&i.jsx("div",{style:{padding:"8px 12px",borderRadius:"var(--radius-button)",background:"#fef2f2",color:"#b91c1c",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",marginBottom:"8px"},children:K}),re&&i.jsxs("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",marginTop:0},children:["Last published:"," ",i.jsx("a",{href:re,target:"_blank",rel:"noopener noreferrer",children:re})]}),i.jsx("button",{type:"button",disabled:M||!T.event||!T.slug.trim(),onClick:()=>void qe(),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"10px 18px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:M?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",marginTop:"8px"},children:M?"Publishing…":"Publish microsite"}),i.jsx(Qt,{text:"Saves settings first, then writes to MICROSITE_STATIC_ROOT. Set MICROSITE_REGISTRATION_URL_TEMPLATE for registration form links."})]})]}),a&&A&&i.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Microsite visual editor",style:{position:"fixed",inset:0,zIndex:1e3,background:"var(--background)",display:"flex",flexDirection:"column"},children:[i.jsxs("div",{style:{flexShrink:0,borderBottom:"1px solid var(--border)",background:"var(--card)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:"12px 16px",flexWrap:"wrap"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[i.jsxs("button",{type:"button",disabled:x||!T.slug.trim(),onClick:()=>void vt(),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",color:"var(--foreground)",cursor:x||!T.slug.trim()?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",opacity:x?.75:1},children:[i.jsx(Nw,{size:16,"aria-hidden":!0})," ",x?"Working…":"Save (draft site)"]}),i.jsxs("button",{type:"button",disabled:x||!T.slug.trim(),onClick:()=>void Ge(),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 14px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",cursor:x||!T.slug.trim()?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",opacity:x?.75:1},children:[i.jsx(Aq,{size:16,"aria-hidden":!0})," Publish"]})]}),i.jsxs("button",{type:"button",onClick:Je,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",color:"var(--foreground)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",flexShrink:0},children:[i.jsx(er,{size:16})," Close builder"]})]}),w?i.jsx("p",{style:{margin:0,padding:"0 16px 12px",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--destructive)"},children:w}):null]}),i.jsx("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:i.jsx(CQ,{ref:m,pageId:l??"",eventId:T.event,micrositeId:A??void 0,variant:"fullscreen",mountNonce:u})})]})]})}function cIe({value:e,onChange:t}){return i.jsx("button",{type:"button",onClick:()=>t(!e),style:{width:"36px",height:"20px",borderRadius:"99px",border:"none",cursor:"pointer",flexShrink:0,background:e?"var(--primary)":"var(--border)",position:"relative",transition:"background .2s"},children:i.jsx("span",{style:{position:"absolute",top:"3px",left:e?"19px":"3px",width:"14px",height:"14px",borderRadius:"50%",background:"#fff",transition:"left .2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}})})}const uIe=[{id:"a6",label:"A6 (105 × 148 mm)"},{id:"a7",label:"A7 (74 × 105 mm)"},{id:"4x3in",label:"4 × 3 in"},{id:"4x6in",label:"4 × 6 in"},{id:"custom",label:"Custom (mm)"}],dIe=[{id:"name",icon:i.jsx(ym,{size:13}),label:"Full name"},{id:"title",icon:i.jsx(Hee,{size:13}),label:"Title / role"},{id:"org",icon:i.jsx(nb,{size:13}),label:"Organisation"},{id:"badge_type",icon:i.jsx(Oi,{size:13}),label:"Badge type tag"},{id:"qr",icon:i.jsx(lv,{size:13}),label:"QR code"},{id:"photo",icon:i.jsx(ym,{size:13}),label:"Photo (faculty)"}];function fIe({onClose:e,onSuccess:t}){const{user:r}=Ur(),n=zn(r),o=3,a=mc(o),[s,l]=j.useState([]),[c,u]=j.useState([]),[d,f]=j.useState(""),[h,p]=j.useState(""),[y,m]=j.useState("a6"),[x,b]=j.useState("105"),[w,k]=j.useState("148"),[S,_]=j.useState("portrait"),[P,O]=j.useState(!0),[T,R]=j.useState(!0),[I,E]=j.useState("all"),[A,F]=j.useState(""),[L,z]=j.useState("color"),[V,Q]=j.useState("#0B4DD1"),[U,ee]=j.useState(""),[H,B]=j.useState(["name","title","org","qr"]),[M,$]=j.useState("Attendee"),[q,Y]=j.useState("pdf"),[K,G]=j.useState(!1),[re,J]=j.useState(null),[ae,le]=j.useState(""),[me,Oe]=j.useState(!1);j.useEffect(()=>{n&&(zr.list({limit:100,organization:n}).then(ke=>{var se;(se=ke.data)!=null&&se.events&&(l(ke.data.events),p(fe=>{var Ie;return fe||((Ie=ke.data.events[0])==null?void 0:Ie._id)||""}))}),Fa.list({organization:n}).then(ke=>{var se;(se=ke.data)!=null&&se.lists&&(u(ke.data.lists),F(fe=>{var Ie;return fe||((Ie=ke.data.lists[0])==null?void 0:Ie._id)||""}))}))},[n]);const we=ke=>{B(se=>se.includes(ke)?se.filter(fe=>fe!==ke):[...se,ke])},ie=async ke=>{if(!ke||!ke.type.startsWith("image/")){le("Choose an image file.");return}Oe(!0),le("");try{const se=await Ys(ke,{eventId:"portfolio",module:"badges/backgrounds"});se.url&&(ee(se.url),z("image"))}catch(se){le(se instanceof Error?se.message:"Upload failed")}finally{Oe(!1)}},Me=async()=>{if(le(""),J(null),!n){le("No organisation context.");return}if(!d.trim()){le("Name is required.");return}if(!h){le("Select an event.");return}if(!P&&!T){le("Select Faculty and/or Participants.");return}if(T&&I==="participant_list"&&!A){le("Select a contact list.");return}if(L==="image"&&!U.trim()){le("Upload a background image or switch to solid colour.");return}if(!H.length){le("Select at least one badge field.");return}if(y==="custom"){const fe=parseFloat(x),Ie=parseFloat(w);if(!Number.isFinite(fe)||!Number.isFinite(Ie)||fe<=0||Ie<=0){le("Enter valid custom width and height (mm).");return}}const ke={name:d.trim(),organization:n,event:h,sizePreset:y,...y==="custom"?{widthMm:parseFloat(x),heightMm:parseFloat(w)}:{},orientation:S,includeFaculty:P,includeParticipants:T,participantScope:I,...T&&I==="participant_list"?{participantListId:A}:{},backgroundMode:L,backgroundImageUrl:L==="image"?U.trim():"",backgroundColor:V,fields:H,outputFormat:q,badgeTypeLabel:M.trim()||"Attendee"};G(!0);const se=await mq.create(ke);if(G(!1),se.error){le(typeof se.error=="string"?se.error:"Request failed");return}J("We have received your request. Generation runs in the background — this page will refresh with a download link when ready (usually within a few minutes)."),t==null||t(),setTimeout(()=>e(),2500)};return i.jsxs(Zo,{onClose:e,title:"Request badge export",breadcrumb:"Design · Badges",description:"Faculty = speakers linked to sessions for the selected event. A zip file is built on the server and uploaded when ready.",completedCount:a.done.size,totalSections:o,ctaLabel:"Submit request",ctaDisabled:K,onCtaClick:Me,children:[ae&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-sm)",margin:"0 16px 0 20px"},children:ae}),re&&i.jsx("p",{style:{color:"var(--foreground)",fontSize:"var(--text-sm)",margin:"0 16px 0 20px",background:"var(--accent)",padding:12,borderRadius:"var(--radius-button)",border:"1px solid var(--border)"},children:re}),i.jsxs($r,{n:1,title:"Details & recipients",subtitle:"Event, size, orientation, who appears on badges",open:a.open===1,completed:a.done.has(1),onToggle:()=>a.toggle(1),onSave:()=>a.advance(1),nextLabel:"Design",children:[i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{span2:!1,children:[i.jsx(pt,{text:"Export name",required:!0}),i.jsx("input",{style:$t,placeholder:"e.g. NAPCON 2026 — All badges",value:d,onChange:ke=>f(ke.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{span2:!1,children:[i.jsx(pt,{text:"Associated event",required:!0}),i.jsx(an,{children:i.jsxs("select",{style:Nr,value:h,onChange:ke=>p(ke.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"Select…"}),s.map(ke=>i.jsx("option",{value:ke._id,children:ke.name},ke._id))]})})]}),i.jsxs(lt,{span2:!1,children:[i.jsx(pt,{text:"Badge size",required:!0}),i.jsx(an,{children:i.jsx("select",{style:Nr,value:y,onChange:ke=>m(ke.target.value),onFocus:kt,onBlur:_t,children:uIe.map(ke=>i.jsx("option",{value:ke.id,children:ke.label},ke.id))})})]}),y==="custom"&&i.jsxs(i.Fragment,{children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Width (mm)",required:!0}),i.jsx("input",{style:$t,value:x,onChange:ke=>b(ke.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Height (mm)",required:!0}),i.jsx("input",{style:$t,value:w,onChange:ke=>k(ke.target.value),onFocus:kt,onBlur:_t})]})]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Orientation"}),i.jsx(go,{name:"bdOrientation",value:S,onChange:ke=>_(ke),options:[{label:"Portrait",value:"portrait"},{label:"Landscape",value:"landscape"}]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Include on export",required:!0}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:"var(--text-sm)",cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:P,onChange:ke=>O(ke.target.checked)}),"Faculty (speakers linked to this event's sessions)"]}),i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:"var(--text-sm)",cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:T,onChange:ke=>R(ke.target.checked)}),"Participants"]})]})]}),T&&i.jsxs(lt,{children:[i.jsx(pt,{text:"Participants"}),i.jsx(go,{name:"partScope",value:I,onChange:ke=>E(ke),options:[{label:"All registered for this event",value:"all"},{label:"Specific contact list",value:"participant_list"}]}),I==="participant_list"&&i.jsx(an,{children:i.jsxs("select",{style:{...Nr,marginTop:8},value:A,onChange:ke=>F(ke.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"Select list…"}),c.map(ke=>i.jsx("option",{value:ke._id,children:ke.name},ke._id))]})})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Badge type label (participants)"}),i.jsx("input",{style:$t,value:M,onChange:ke=>$(ke.target.value),placeholder:"Attendee",onFocus:kt,onBlur:_t}),i.jsx(Qt,{text:"Shown when “Badge type tag” is enabled; faculty use their speaker role when available."})]})]}),i.jsxs($r,{n:2,title:"Design",subtitle:"Background and fields on the badge",open:a.open===2,completed:a.done.has(2),onToggle:()=>a.toggle(2),onSave:()=>a.advance(2),nextLabel:"Output",children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Background",required:!0}),i.jsx(go,{name:"bgMode",value:L,onChange:ke=>z(ke),options:[{label:"Solid colour",value:"color"},{label:"Image",value:"image"}]})]}),L==="color"&&i.jsxs(lt,{children:[i.jsx(pt,{text:"Colour"}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[i.jsx("input",{type:"color",value:V,onChange:ke=>Q(ke.target.value),style:{width:48,height:36,border:"none",cursor:"pointer"}}),i.jsx("input",{style:{...$t,flex:1},value:V,onChange:ke=>Q(ke.target.value),onFocus:kt,onBlur:_t})]})]}),L==="image"&&i.jsxs(lt,{children:[i.jsx(pt,{text:"Background image"}),i.jsx("input",{style:$t,value:U,onChange:ke=>ee(ke.target.value),placeholder:"https://… or upload",onFocus:kt,onBlur:_t}),i.jsx("input",{type:"file",accept:"image/*",style:{marginTop:8,fontSize:"var(--text-xs)"},disabled:me,onChange:ke=>{var se;return void ie((se=ke.target.files)==null?void 0:se[0])}}),i.jsx(Qt,{text:"Must be reachable by the server when the worker runs (public HTTPS)."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Badge fields"}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:dIe.map(ke=>{const se=H.includes(ke.id);return i.jsxs("button",{type:"button",onClick:()=>we(ke.id),style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",borderRadius:"var(--radius-button)",border:`1px solid ${se?"var(--primary)":"var(--border)"}`,background:se?"var(--accent)":"var(--card)",cursor:"pointer",textAlign:"left"},children:[i.jsx("span",{style:{color:"var(--muted)"},children:ke.icon}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:ke.label})]},ke.id)})})]})]}),i.jsxs($r,{n:3,title:"Output format",subtitle:"Files are zipped after generation",open:a.open===3,completed:a.done.has(3),onToggle:()=>a.toggle(3),onSave:()=>a.advance(3),nextLabel:"Submit",children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Format",required:!0}),i.jsx(go,{name:"outFmt",value:q,onChange:ke=>Y(ke),options:[{label:"PDF (multi-page, one badge per page)",value:"pdf"},{label:"PNG (one file per person)",value:"png"},{label:"JPEG (one file per person)",value:"jpeg"}]})]}),i.jsx(Qt,{text:"Run npm run badge-batch-worker on the server so jobs complete. AWS S3/CloudFront must be configured."})]})]})}const R3=["Invitation","Save the Date","Registration Confirmation","Reminder","Post-Event Thank You","Newsletter","Custom"],My=["Inter + Noto Sans","Merriweather + Open Sans","Poppins + Lato","Georgia + Source Sans"],b6=[{id:"e1",label:"Classic",accent:"#0B4DD1"},{id:"e2",label:"Bold Hero",accent:"#1E293B"},{id:"e3",label:"Minimal",accent:"#F1F5F9"},{id:"e4",label:"Magazine",accent:"#D97706"}],AW={"Inter + Noto Sans":"system-ui, -apple-system, 'Segoe UI', sans-serif","Merriweather + Open Sans":"Georgia, 'Merriweather', serif","Poppins + Lato":"'Poppins', 'Lato', system-ui, sans-serif","Georgia + Source Sans":"Georgia, 'Source Sans Pro', sans-serif"},L3=[{type:"text",icon:i.jsx(GJ,{size:13}),label:"Text"},{type:"image",icon:i.jsx(R0,{size:13}),label:"Image"},{type:"cta",icon:i.jsx(bte,{size:13}),label:"CTA Button"},{type:"divider",icon:i.jsx(Ow,{size:13}),label:"Divider"}];let w6=0;function eh(e){const t=`blk-${++w6}`;return e==="text"?{id:t,type:"text",html:"<p><br></p>"}:e==="cta"?{id:t,type:"cta",label:"Register Now",linkKind:"custom",customUrl:""}:e==="image"?{id:t,type:"image",src:""}:{id:t,type:"divider"}}function qc(e){return String(e||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function pIe(e,t){if(e.linkKind==="custom")return String(e.customUrl||"").trim()||"#";if(e.linkKind==="form"){const r=t.forms.find(n=>n.id===e.formId);return(r==null?void 0:r.href)&&r.href.trim()||"#"}if(e.linkKind==="microsite"){const r=t.microsites.find(n=>n.id===e.micrositeId);return(r==null?void 0:r.href)&&r.href.trim()||"#"}return"#"}function TW(e,t){var c,u,d,f;const r=((c=e.primaryColor)==null?void 0:c.trim())||((u=b6.find(h=>h.id===e.layoutTemplateId))==null?void 0:u.accent)||"#0B4DD1",n=AW[e.fontPair]||AW[My[0]],o=(d=e.headerImageUrl)==null?void 0:d.trim(),a=e.blocks.map(h=>{var p,y;if(h.type==="text")return`<div style="margin:12px 0;font-size:15px;line-height:1.55;color:#334155;">${(p=h.html)!=null&&p.trim()?h.html:""}</div>`;if(h.type==="image"&&((y=h.src)!=null&&y.trim()))return`<p style="text-align:center;margin:16px 0;"><img src="${qc(h.src.trim())}" alt="" style="max-width:100%;border-radius:8px;" /></p>`;if(h.type==="cta"){const m=qc(pIe(h,t)),x=qc(h.label||"Register");return`<p style="text-align:center;margin:20px 0;"><a href="${m}" style="display:inline-block;padding:12px 24px;background:${qc(r)};color:#fff;text-decoration:none;border-radius:8px;font-weight:600;">${x}</a></p>`}return h.type==="divider"?'<hr style="border:none;border-top:1px solid #e2e8f0;margin:20px 0;" />':""}).join(`
|
||
`),s=(f=e.previewText)==null?void 0:f.trim(),l=s?`<div style="display:none;font-size:1px;color:#fff;line-height:1px;max-height:0;max-width:0;opacity:0;overflow:hidden;">${qc(s)}</div>`:"";return`<!DOCTYPE html><html><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/></head>
|
||
<body style="margin:0;padding:0;background:#f8fafc;font-family:${n};">
|
||
${l}
|
||
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="background:#f8fafc;padding:24px 12px;">
|
||
<tr><td align="center">
|
||
<table role="presentation" width="600" cellspacing="0" cellpadding="0" style="max-width:600px;background:#ffffff;border-radius:12px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,.08);">
|
||
${o?`<tr><td><img src="${qc(o)}" alt="" width="600" style="display:block;width:100%;height:auto;"/></td></tr>`:""}
|
||
<tr><td style="padding:24px 28px 8px;">
|
||
${s?`<p style="margin:0 0 8px;font-size:12px;color:#64748b;">${qc(s)}</p>`:""}
|
||
</td></tr>
|
||
<tr><td style="padding:0 28px 24px;">${a}</td></tr>
|
||
<tr><td style="padding:16px 28px 24px;border-top:1px solid #f1f5f9;">
|
||
<p style="margin:0;font-size:12px;color:#94a3b8;">${qc(e.footerText)}</p>
|
||
</td></tr>
|
||
</table>
|
||
</td></tr></table>
|
||
</body></html>`}function hIe(e){const t=e.blocks,r=typeof e.ctaUrl=="string"?e.ctaUrl:"";let n="";if(typeof e.headerText=="string"&&e.headerText.trim()&&(n=`<h1 style="margin:0 0 16px;font-size:22px;color:#0f172a;">${qc(e.headerText.trim())}</h1>`),!Array.isArray(t)||t.length===0){const s=eh("text");return[s.type==="text"?{...s,html:n+s.html}:s,eh("cta")]}const o=[];for(let s=0;s<t.length;s++){const l=t[s],c=typeof l.id=="string"?l.id:`blk-${s}-${Date.now()}`;if(l.type==="text"){let u=typeof l.html=="string"?l.html:"";!u&&typeof l.text=="string"&&(u=`<p style="margin:12px 0;font-size:15px;line-height:1.5;color:#334155;">${qc(String(l.text)).replace(/\n/g,"<br/>")}</p>`),s===0&&n&&(u=n+(u||"")),o.push({id:c,type:"text",html:u||"<p><br></p>"})}else if(l.type==="cta")o.push({id:c,type:"cta",label:String(l.label??l.text??"Register"),linkKind:["form","microsite","custom"].includes(String(l.linkKind))?l.linkKind:"custom",formId:typeof l.formId=="string"?l.formId:void 0,micrositeId:typeof l.micrositeId=="string"?l.micrositeId:void 0,customUrl:String(l.customUrl??r??"")});else if(l.type==="image"){const u=typeof l.src=="string"?l.src:String(l.text??"");o.push({id:c,type:"image",src:u})}else l.type==="divider"&&o.push({id:c,type:"divider"})}const a=o.map(s=>parseInt(String(s.id).replace(/\D/g,""),10)||0);return w6=Math.max(w6,...a,0),o.length?o:[eh("text"),eh("cta")]}function gIe({onClose:e,templateId:t,onSuccess:r}){const{user:n}=Ur(),o=zn(n),a=!!t,s=3,l=mc(s),[c,u]=j.useState([]),[d,f]=j.useState({forms:[],microsites:[]}),[h,p]=j.useState([]),[y,m]=j.useState({name:"",emailerType:R3[0],associatedEvent:"",description:"",layoutTemplateId:"e1",headerImageUrl:"",primaryColor:"#0B4DD1",fontPair:My[0],previewText:"",subjectLine:"",blocks:[eh("text"),eh("cta")],footerText:"© 2026 EventBuzz · Unsubscribe"}),[x,b]=j.useState(!1),[w,k]=j.useState(!1),[S,_]=j.useState(null),[P,O]=j.useState(!1),[T,R]=j.useState(""),[I,E]=j.useState(!1),[A,F]=j.useState(""),[L,z]=j.useState(""),[V,Q]=j.useState(""),U=j.useCallback((G,re)=>{m(J=>({...J,[G]:re}))},[]);j.useEffect(()=>{o&&(zr.list({limit:200,organization:o}).then(G=>{var re;(re=G.data)!=null&&re.events&&u(G.data.events)}),Fa.list({organization:o}).then(G=>{var re;(re=G.data)!=null&&re.lists&&p(G.data.lists)}))},[o]),j.useEffect(()=>{var re;const G=(re=y.associatedEvent)==null?void 0:re.trim();if(!G){f({forms:[],microsites:[]});return}zr.emailerLinkTargets(G).then(J=>{J.data&&f(J.data)})},[y.associatedEvent]),j.useEffect(()=>{y.associatedEvent&&!A&&F(y.associatedEvent)},[y.associatedEvent,A]),j.useEffect(()=>{t&&Hs.get(t).then(G=>{if(!G.data)return;const re=G.data,J=re.content||{},ae=hIe(J),le=re.associatedEvent,me=typeof le=="string"?le:(le==null?void 0:le._id)??"";m(Oe=>{var we;return{...Oe,name:re.name,emailerType:re.category||R3[0],associatedEvent:me,description:typeof J.description=="string"?J.description:"",layoutTemplateId:String(J.layoutTemplateId||J.templateId||"e1"),headerImageUrl:String(J.headerImageUrl||""),primaryColor:String(J.primaryColor||((we=b6.find(ie=>ie.id===J.templateId))==null?void 0:we.accent)||"#0B4DD1"),fontPair:My.includes(String(J.fontPair))?String(J.fontPair):My[0],previewText:String(J.previewText||""),subjectLine:String(J.subjectLine||J.subject||J.headerText||""),footerText:String(J.footerText||Oe.footerText),blocks:ae}})})},[t]);const ee=j.useCallback((G,re)=>{m(J=>({...J,blocks:J.blocks.map(ae=>ae.id===G?{...ae,...re}:ae)}))},[]),H=j.useCallback(G=>{m(re=>({...re,blocks:[...re.blocks,eh(G)]}))},[]),B=j.useCallback(G=>{m(re=>({...re,blocks:re.blocks.filter(J=>J.id!==G)}))},[]),M=j.useCallback(()=>{R(TW(y,d)),O(!0)},[y,d]),$=async G=>{var re;if(!(!G||!o)){k(!0);try{const J=await Ys(G,{eventId:((re=y.associatedEvent)==null?void 0:re.trim())||void 0,module:"emailer"});J.url&&U("headerImageUrl",J.url)}finally{k(!1)}}},q=async(G,re)=>{var J;if(!(!re||!o)){_(G);try{const ae=await Ys(re,{eventId:((J=y.associatedEvent)==null?void 0:J.trim())||void 0,module:"emailer"});ae.url&&ee(G,{src:ae.url})}finally{_(null)}}},Y=(G,re)=>{const J=y.blocks.find(le=>le.id===G);if(!J||J.type!=="text")return;const ae=(J.html||"")+re;ee(G,{html:ae})},K=async()=>{if(Q(""),I&&!a){if(!(A.trim()||y.associatedEvent.trim())){Q("Select an event for the draft campaign.");return}if(!L.trim()){Q("Select a contact list.");return}}b(!0);const re={html:TW(y,d),version:2,blocks:y.blocks,subjectLine:y.subjectLine,previewText:y.previewText,footerText:y.footerText,primaryColor:y.primaryColor,fontPair:y.fontPair,headerImageUrl:y.headerImageUrl,layoutTemplateId:y.layoutTemplateId,description:y.description||void 0},J={name:y.name,type:"emailer",category:y.emailerType||void 0,content:re,associatedEvent:y.associatedEvent.trim()||null},ae=a?await Hs.update(t,J):await Hs.create(J);if(b(!1),ae.error)return;const le=ae.data,me=(le==null?void 0:le._id)||t;if(I&&!a&&me){const Oe=A.trim()||y.associatedEvent.trim(),we=await co.create(Oe,{name:y.name.trim(),channel:"email",type:"broadcast",recipients:{type:"participant_list",participantList:L.trim()},content:{template:me,subject:y.subjectLine.trim(),body:""}});if(we.error){const ie=typeof we.error=="string"?we.error:"Template saved but campaign could not be created.";Q(ie),r==null||r();return}}r==null||r(),e()};return i.jsxs(i.Fragment,{children:[i.jsxs(Zo,{onClose:e,title:a?"Edit Emailer":"Create Emailer",breadcrumb:"Design · Emailers",description:"Design a branded HTML emailer and optional draft campaign.",completedCount:l.done.size,totalSections:s,ctaLabel:a?"Save changes":"Save emailer",ctaDisabled:x||!y.name.trim(),onCtaClick:K,children:[i.jsxs($r,{n:1,title:"Emailer details",subtitle:"Name, type, optional event",open:l.open===1,completed:l.done.has(1),onToggle:()=>l.toggle(1),onSave:()=>l.advance(1),nextLabel:"Design",children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Emailer name",required:!0}),i.jsx("input",{style:$t,placeholder:"e.g. NAPCON 2026 — Registration invite",value:y.name,onChange:G=>U("name",G.target.value),onFocus:kt,onBlur:_t}),i.jsx(Qt,{text:"Internal name — not shown to recipients."})]}),i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Type",required:!0}),i.jsx(an,{children:i.jsx("select",{style:Nr,value:y.emailerType,onChange:G=>U("emailerType",G.target.value),onFocus:kt,onBlur:_t,children:R3.map(G=>i.jsx("option",{value:G,children:G},G))})})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Associated event"}),i.jsx(an,{children:i.jsxs("select",{style:Nr,value:y.associatedEvent,onChange:G=>U("associatedEvent",G.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"None"}),c.map(G=>i.jsx("option",{value:G._id,children:G.name},G._id))]})}),i.jsx(Qt,{text:"Used for media uploads, form/microsite CTAs, and default campaign event."})]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Description"}),i.jsx("textarea",{style:{...$t,resize:"vertical",minHeight:"60px"},placeholder:"Optional notes (stored in template content)…",value:y.description,onChange:G=>U("description",G.target.value),onFocus:kt,onBlur:_t})]})]}),i.jsxs($r,{n:2,title:"Design",subtitle:"Layout, colour, font, header image",open:l.open===2,completed:l.done.has(2),onToggle:()=>l.toggle(2),onSave:()=>l.advance(2),nextLabel:"Content",children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Base template",required:!0}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"8px"},children:b6.map(G=>i.jsxs("button",{type:"button",onClick:()=>{U("layoutTemplateId",G.id),U("primaryColor",G.accent)},style:{borderRadius:"var(--radius-button)",border:`2px solid ${y.layoutTemplateId===G.id?"var(--primary)":"var(--border)"}`,overflow:"hidden",cursor:"pointer",background:"none",padding:0},children:[i.jsxs("div",{style:{height:"56px",background:G.accent,display:"flex",flexDirection:"column",justifyContent:"flex-end",padding:"6px"},children:[i.jsx("div",{style:{height:"4px",borderRadius:"2px",background:"rgba(255,255,255,0.5)",marginBottom:"3px"}}),i.jsx("div",{style:{height:"3px",borderRadius:"2px",background:"rgba(255,255,255,0.3)"}})]}),i.jsx("p",{style:{margin:"5px 0",fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:y.layoutTemplateId===G.id?"var(--primary)":"var(--muted)"},children:G.label})]},G.id))})]}),i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Primary colour"}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 10px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)"},children:[i.jsx("input",{type:"color",value:y.primaryColor,onChange:G=>U("primaryColor",G.target.value),style:{width:"24px",height:"24px",border:"none",background:"none",cursor:"pointer",padding:0}}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:y.primaryColor})]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Font"}),i.jsx(an,{children:i.jsx("select",{style:Nr,value:y.fontPair,onChange:G=>U("fontPair",G.target.value),onFocus:kt,onBlur:_t,children:My.map(G=>i.jsx("option",{value:G,children:G},G))})})]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Header image"}),i.jsx("input",{style:$t,placeholder:"https://…",value:y.headerImageUrl,onChange:G=>U("headerImageUrl",G.target.value),onFocus:kt,onBlur:_t}),i.jsxs("div",{style:{marginTop:8},children:[i.jsx("input",{type:"file",accept:"image/*",disabled:w||!o,onChange:G=>{var re;return void $(((re=G.target.files)==null?void 0:re[0])??null)}}),w&&i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",marginLeft:8},children:"Uploading…"})]}),i.jsx(Qt,{text:"Recommended: 600×200px. Uses org library upload."})]})]}),i.jsxs($r,{n:3,title:"Content blocks",subtitle:"Preview text, subject, body",open:l.open===3,completed:l.done.has(3),onToggle:()=>l.toggle(3),onSave:()=>l.advance(3),nextLabel:"Done",children:[i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{span2:!0,children:[i.jsx(pt,{text:"Preview text"}),i.jsx("input",{style:$t,placeholder:"Short preview shown in inbox…",value:y.previewText,onChange:G=>U("previewText",G.target.value),onFocus:kt,onBlur:_t}),i.jsx(Qt,{text:`${y.previewText.length}/90 chars`})]}),i.jsxs(lt,{span2:!0,children:[i.jsx(pt,{text:"Subject line"}),i.jsx("input",{style:$t,placeholder:"Supports {{event.name}} etc.",value:y.subjectLine,onChange:G=>U("subjectLine",G.target.value),onFocus:kt,onBlur:_t})]})]}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:10},children:yw.map(G=>i.jsx("button",{type:"button",onClick:()=>U("subjectLine",y.subjectLine+G.token),style:PW,children:G.label},G.token))}),i.jsx(S6e,{}),i.jsx(ev,{text:"Body blocks"}),!y.associatedEvent.trim()&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 8px"},children:"Select an associated event to load forms and microsites for CTA buttons."}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:y.blocks.map((G,re)=>{var J,ae;return i.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:"var(--radius-button)",overflow:"hidden",background:"var(--card)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:"var(--secondary)",borderBottom:G.type!=="divider"?"1px solid var(--border)":"transparent"},children:[i.jsx("span",{style:{color:"var(--muted)",display:"flex"},children:(J=L3.find(le=>le.type===G.type))==null?void 0:J.icon}),i.jsxs("span",{style:{flex:1,fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)"},children:[(ae=L3.find(le=>le.type===G.type))==null?void 0:ae.label," #",re+1]}),i.jsx("button",{type:"button",onClick:()=>B(G.id),style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",padding:"2px"},children:i.jsx(er,{size:12})})]}),G.type==="text"&&i.jsxs("div",{style:{padding:"10px 12px"},children:[i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:8},children:yw.map(le=>i.jsx("button",{type:"button",onClick:()=>Y(G.id,le.token),style:PW,children:le.label},le.token))}),i.jsx(BQ,{value:G.html,onChange:le=>ee(G.id,{html:le}),placeholder:"Compose…"})]}),G.type==="cta"&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:"10px 12px"},children:[i.jsx("input",{style:$t,placeholder:"Button label",value:G.label,onChange:le=>ee(G.id,{label:le.target.value}),onFocus:kt,onBlur:_t}),i.jsx(an,{children:i.jsxs("select",{style:Nr,value:G.linkKind,onChange:le=>ee(G.id,{linkKind:le.target.value,formId:void 0,micrositeId:void 0}),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"form",children:"Form"}),i.jsx("option",{value:"microsite",children:"Event microsite"}),i.jsx("option",{value:"custom",children:"Custom URL"})]})}),G.linkKind==="form"&&i.jsx(an,{children:i.jsxs("select",{style:Nr,value:G.formId||"",onChange:le=>ee(G.id,{formId:le.target.value||void 0}),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"Select form…"}),d.forms.map(le=>i.jsxs("option",{value:le.id,children:[le.name,le.href?"":" (configure registration URL)"]},le.id))]})}),G.linkKind==="microsite"&&i.jsx(an,{children:i.jsxs("select",{style:Nr,value:G.micrositeId||"",onChange:le=>ee(G.id,{micrositeId:le.target.value||void 0}),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"Select microsite…"}),d.microsites.map(le=>i.jsx("option",{value:le.id,children:le.name},le.id))]})}),G.linkKind==="custom"&&i.jsx("input",{style:$t,placeholder:"https://…",value:G.customUrl||"",onChange:le=>ee(G.id,{customUrl:le.target.value}),onFocus:kt,onBlur:_t})]}),G.type==="image"&&i.jsxs("div",{style:{padding:"10px 12px"},children:[i.jsx("input",{style:$t,placeholder:"Image URL",value:G.src,onChange:le=>ee(G.id,{src:le.target.value}),onFocus:kt,onBlur:_t}),i.jsx("div",{style:{marginTop:8},children:i.jsx("input",{type:"file",accept:"image/*",disabled:S===G.id||!o,onChange:le=>{var me;return void q(G.id,((me=le.target.files)==null?void 0:me[0])??null)}})})]}),G.type==="divider"&&i.jsx("div",{style:{padding:"10px 12px"},children:i.jsx("div",{style:{height:"1px",background:"var(--border)"}})})]},G.id)})}),i.jsx("div",{style:{display:"flex",gap:"6px",flexWrap:"wrap",marginTop:8},children:L3.map(G=>i.jsxs("button",{type:"button",onClick:()=>H(G.type),style:mIe,children:[i.jsx(wr,{size:11})," ",G.label]},G.type))}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Footer text"}),i.jsx("input",{style:$t,value:y.footerText,onChange:G=>U("footerText",G.target.value),onFocus:kt,onBlur:_t})]})]}),i.jsxs("div",{style:{padding:"16px 20px 24px",borderTop:"1px solid var(--border)",display:"flex",flexDirection:"column",gap:12},children:[V&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-sm)",margin:0},children:V}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center"},children:i.jsx("button",{type:"button",onClick:M,style:vIe,children:"Preview emailer"})}),!a&&i.jsxs(i.Fragment,{children:[i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx("input",{type:"checkbox",checked:I,onChange:G=>E(G.target.checked)}),"Create a campaign (draft)"]}),I&&i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Campaign event",required:!0}),i.jsx(an,{children:i.jsxs("select",{style:Nr,value:A,onChange:G=>F(G.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"Select…"}),c.map(G=>i.jsx("option",{value:G._id,children:G.name},G._id))]})})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Contact list",required:!0}),i.jsx(an,{children:i.jsxs("select",{style:Nr,value:L,onChange:G=>z(G.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"Select…"}),h.map(G=>i.jsx("option",{value:G._id,children:G.name},G._id))]})})]})]})]})]})]}),P&&i.jsx("div",{role:"presentation",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",zIndex:400,display:"flex",alignItems:"center",justifyContent:"center",padding:24},onClick:()=>O(!1),children:i.jsxs("div",{role:"dialog","aria-label":"Email preview",style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"100%",maxWidth:720,maxHeight:"90vh",display:"flex",flexDirection:"column",border:"1px solid var(--border)",boxShadow:"0 20px 40px rgba(0,0,0,0.2)"},onClick:G=>G.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border)"},children:[i.jsx("span",{style:{fontWeight:600},children:"Preview"}),i.jsx("button",{type:"button","aria-label":"Close",onClick:()=>O(!1),style:{background:"none",border:"none",cursor:"pointer"},children:i.jsx(er,{size:18})})]}),i.jsx("iframe",{title:"Email preview",srcDoc:T,sandbox:"allow-same-origin",style:{flex:1,minHeight:420,border:"none",width:"100%"}})]})})]})}const PW={fontSize:"10px",padding:"4px 8px",borderRadius:99,border:"1px solid var(--border)",background:"var(--secondary)",cursor:"pointer",fontFamily:"var(--font-noto-sans)"},mIe={display:"flex",alignItems:"center",gap:5,padding:"5px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},vIe={display:"inline-flex",alignItems:"center",gap:6,padding:"8px 14px",borderRadius:"var(--radius-button)",background:"var(--secondary)",color:"var(--card-foreground)",border:"1px solid var(--border)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},OW=["Brochure","Microsite Template","Badge","Emailer","Other"],IW=["None (Design Library only)","NAPCON 2026 Media Kit","Sponsor Assets","Speaker Bios & Photos"],yIe=[{label:"Private (team only)",value:"Private"},{label:"Shared (all admins)",value:"Shared"}],xIe=[{label:"Create new copy",value:"new"},{label:"Overwrite existing",value:"overwrite"}],F3=[".fig",".pdf",".pptx",".ai",".eps",".zip",".png",".jpg",".jpeg",".svg",".html"],NW={".fig":"Figma",".pdf":"PDF",".pptx":"PowerPoint",".ai":"Illustrator",".eps":"EPS",".zip":"Archive",".png":"PNG",".jpg":"JPEG",".jpeg":"JPEG",".svg":"SVG",".html":"HTML"};function bIe(e){return e<1024?e+" B":e<1048576?(e/1024).toFixed(1)+" KB":(e/1048576).toFixed(1)+" MB"}function wIe({onClose:e,defaultType:t}){var S;const{user:r}=Ur(),n=zn(r),o=3,a=mc(o),s=j.useRef(null),[l,c]=j.useState([]),[u,d]=j.useState(!1),[f,h]=j.useState([]),[p,y]=j.useState({importType:t??OW[0],name:"",event:"",collection:IW[0],tags:"",visibility:"Private",conflictMode:"new"}),m=(_,P)=>y(O=>({...O,[_]:P}));j.useEffect(()=>{n&&zr.list({limit:100,organization:n}).then(_=>{var P;(P=_.data)!=null&&P.events&&(c(_.data.events),y(O=>{var T;return{...O,event:O.event||((T=_.data.events[0])==null?void 0:T._id)||""}}))})},[n]);const x=_=>{const P=Array.from(_).map(O=>{const T="."+O.name.split(".").pop().toLowerCase(),R=F3.includes(T);return{id:Math.random().toString(36).slice(2),name:O.name,size:bIe(O.size),ext:T,progress:0,error:R?void 0:`Unsupported format: ${T}`}});if(h(O=>[...O,...P]),P.filter(O=>!O.error).forEach(O=>{let T=0;const R=setInterval(()=>{T=Math.min(100,T+Math.random()*30+10),h(I=>I.map(E=>E.id===O.id?{...E,progress:Math.round(T)}:E)),T>=100&&clearInterval(R)},180)}),P.length>0&&!p.name){const O=P[0].name.replace(/\.[^.]+$/,"").replace(/[-_]/g," ");m("name",O)}},b=_=>h(P=>P.filter(O=>O.id!==_)),w=f.filter(_=>!_.error),k=f.filter(_=>_.error);return i.jsxs(Zo,{onClose:e,title:"Import Design",breadcrumb:"Design · Import",description:"Import design files from Figma, PDF, PowerPoint, Illustrator and more.",completedCount:a.done.size,totalSections:o,ctaLabel:"Import",children:[i.jsxs($r,{n:1,title:"Upload Files",subtitle:"Drag and drop or select files to import",open:a.open===1,completed:a.done.has(1),onToggle:()=>a.toggle(1),onSave:()=>a.advance(1),nextLabel:"Import Settings",children:[i.jsxs("div",{onClick:()=>{var _;return(_=s.current)==null?void 0:_.click()},onDragOver:_=>{_.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:_=>{_.preventDefault(),d(!1),x(_.dataTransfer.files)},style:{border:`2px dashed ${u?"var(--primary)":"var(--border)"}`,borderRadius:"var(--radius-card)",background:u?"var(--accent)":"var(--secondary)",padding:"32px 20px",display:"flex",flexDirection:"column",alignItems:"center",gap:"10px",cursor:"pointer",transition:"all .15s"},children:[i.jsx("input",{ref:s,type:"file",multiple:!0,style:{display:"none"},accept:F3.join(","),onChange:_=>_.target.files&&x(_.target.files)}),i.jsx("div",{style:{width:48,height:48,borderRadius:"50%",background:"var(--card)",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx(ou,{size:22,style:{color:"var(--primary)"}})}),i.jsxs("div",{style:{textAlign:"center"},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)",margin:"0 0 4px"},children:"Drag and drop design files here"}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:["or ",i.jsx("span",{style:{color:"var(--primary)",textDecoration:"underline"},children:"select files"})]})]})]}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px"},children:F3.map(_=>i.jsx("span",{style:{padding:"2px 7px",borderRadius:"99px",border:"1px solid var(--border)",background:"var(--secondary)",fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:NW[_]},_))}),f.length>0&&i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:f.map(_=>i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 12px",background:_.error?"var(--destructive-foreground, #FEF2F2)":"var(--secondary)",borderRadius:"var(--radius-button)",border:`1px solid ${_.error?"var(--destructive)":"var(--border)"}`},children:[_.error?i.jsx(nv,{size:16,style:{color:"var(--destructive)",flexShrink:0}}):i.jsx(L6,{size:16,style:{color:"var(--primary)",flexShrink:0}}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",margin:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:_.name}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:_.error?"var(--destructive)":"var(--muted)",margin:"2px 0 0"},children:_.error??_.size}),!_.error&&_.progress<100&&i.jsx("div",{style:{height:"3px",background:"var(--border)",borderRadius:"99px",marginTop:"4px"},children:i.jsx("div",{style:{height:"100%",width:`${_.progress}%`,background:"var(--primary)",borderRadius:"99px",transition:"width .3s"}})})]}),!_.error&&_.progress===100&&i.jsx(iv,{size:14,style:{color:"#22c55e",flexShrink:0}}),i.jsx("button",{onClick:()=>b(_.id),style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",flexShrink:0},children:i.jsx(er,{size:13})})]},_.id))}),k.length>0&&i.jsx(Qt,{text:`${k.length} file${k.length!==1?"s":""} skipped — unsupported format.`})]}),i.jsxs($r,{n:2,title:"Import Settings",subtitle:"What type of asset is this and which event does it belong to?",open:a.open===2,completed:a.done.has(2),onToggle:()=>a.toggle(2),onSave:()=>a.advance(2),nextLabel:"Organise & Tags",children:[i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Import As",required:!0}),i.jsx(an,{children:i.jsx("select",{style:Nr,value:p.importType,onChange:_=>m("importType",_.target.value),onFocus:kt,onBlur:_t,children:OW.map(_=>i.jsx("option",{children:_},_))})}),i.jsx(Qt,{text:"Sets the category in your Design library."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Associated Event",required:!0}),i.jsx(an,{children:i.jsxs("select",{style:Nr,value:p.event,onChange:_=>m("event",_.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:"Select event…"}),l.map(_=>i.jsx("option",{value:_._id,children:_.name},_._id))]})})]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Display Name",required:!0}),i.jsx("input",{style:$t,placeholder:"e.g. NAPCON 2026 Official Brochure",value:p.name,onChange:_=>m("name",_.target.value),onFocus:kt,onBlur:_t}),i.jsx(Qt,{text:"Name shown in the Design library."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"If Asset Already Exists"}),i.jsx(go,{name:"importConflict",value:p.conflictMode,onChange:_=>m("conflictMode",_),options:xIe})]}),w.length>0&&i.jsxs("div",{style:{background:"var(--secondary)",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",padding:"10px 14px"},children:[i.jsx(ev,{text:"Detected Format"}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:[...new Set(w.map(_=>NW[_.ext]??_.ext))].map(_=>i.jsx(gw,{text:_},_))})]})]}),i.jsxs($r,{n:3,title:"Organise & Tags",subtitle:"Add to a collection, tag and set visibility",open:a.open===3,completed:a.done.has(3),onToggle:()=>a.toggle(3),onSave:()=>a.advance(3),nextLabel:"Import",children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Add to Collection"}),i.jsx(an,{children:i.jsx("select",{style:Nr,value:p.collection,onChange:_=>m("collection",_.target.value),onFocus:kt,onBlur:_t,children:IW.map(_=>i.jsx("option",{children:_},_))})}),i.jsx(Qt,{text:"You can add to more collections later from the Content tab."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Tags"}),i.jsx("input",{style:$t,placeholder:"e.g. brochure, 2026, print — separate with commas",value:p.tags,onChange:_=>m("tags",_.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Visibility",required:!0}),i.jsx(go,{name:"importVis",value:p.visibility,onChange:_=>m("visibility",_),options:yIe}),i.jsx(Qt,{text:"Shared assets are visible to all admins and editors."})]}),i.jsxs("div",{style:{background:"var(--secondary)",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",padding:"12px 14px"},children:[i.jsx(ev,{text:"Import Summary"}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"3px"},children:[["Files",`${w.length} file${w.length!==1?"s":""}`],["Import As",p.importType],["Event",((S=l.find(_=>_._id===p.event))==null?void 0:S.name)??"—"],["Collection",p.collection.replace("None (Design Library only)","None")],["Visibility",p.visibility]].map(([_,P])=>i.jsxs("div",{style:{display:"flex",gap:"8px"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",minWidth:"90px"},children:_}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:P})]},_))})]})]})]})}const Wh={fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"};function P8({minWidth:e,children:t}){return i.jsx("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:i.jsx("div",{style:{overflowX:"auto"},children:i.jsx("div",{style:{minWidth:e??500},children:t})})})}function RW({icon:e,title:t,description:r,cta:n,onCta:o}){return i.jsxs("div",{style:{textAlign:"center",padding:"72px 20px",border:"2px dashed var(--border)",borderRadius:"var(--radius-card)"},children:[i.jsx("div",{style:{color:"var(--border)",marginBottom:"14px",display:"flex",justifyContent:"center"},children:e}),i.jsx("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"6px"},children:t}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--muted)",marginBottom:n?"20px":"0"},children:r}),n&&o&&i.jsxs("button",{onClick:o,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 18px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:13})," ",n]})]})}const SIe={"design-brochure":"brochure","design-microsite":"microsite","design-badges":"badge","design-emailers":"emailer"},jIe={Brochure:i.jsx(R0,{size:22,style:{color:"var(--muted)"}}),"Microsite Templates":i.jsx(_q,{size:22,style:{color:"var(--muted)"}}),Badges:i.jsx(Oq,{size:22,style:{color:"var(--muted)"}}),Emailers:i.jsx(Uf,{size:22,style:{color:"var(--muted)"}})};function LW(e){if(!e)return"—";const t=new Date(e),n=new Date().getTime()-t.getTime(),o=Math.floor(n/(1440*60*1e3));return o===0?"Today":o===1?"Yesterday":o<7?`${o} days ago`:o<30?`${Math.floor(o/7)} week(s) ago`:o<365?`${Math.floor(o/30)} month(s) ago`:t.toLocaleDateString()}function kIe({subPage:e}){const{user:t}=Ur(),n=qi()==="mobile",o=e==="design-brochure"?"Brochure":e==="design-microsite"?"Microsite Templates":e==="design-badges"?"Badges":e==="design-emailers"?"Emailers":"Brochure",a=e&&SIe[e]||"brochure",s=(t==null?void 0:t.role)==="super_admin",l=a==="microsite"&&t&&["super_admin","admin","moderator"].includes(t.role),c=!!(t&&["super_admin","admin","moderator"].includes(t.role)),[u,d]=j.useState([]),[f,h]=j.useState([]),[p,y]=j.useState(!1),[m,x]=j.useState(!0),[b,w]=j.useState(null),[k,S]=j.useState([]),[_,P]=j.useState([]),[O,T]=j.useState(!1),[R,I]=j.useState(null),[E,A]=j.useState(null),[F,L]=j.useState(!1),[z,V]=j.useState(!1),[Q,U]=j.useState(!1),[ee,H]=j.useState(!1),[B,M]=j.useState(!1),[$,q]=j.useState(null),[Y,K]=j.useState(null),[G,re]=j.useState(null),[J,ae]=j.useState(null),[le,me]=j.useState(null),[Oe,we]=j.useState(null),[ie,Me]=j.useState(null),[ke,se]=j.useState(null),fe=j.useCallback(Te=>{const wt=(Te==null?void 0:Te.badgeSoftRefresh)===!0;if(a==="microsite"){x(!1),d([]),T(!0),I(null),P([]);const Pt=zn(t);if(!Pt){S([]),I(s?"Assign an organisation to your account to load events.":"Your profile has no organisation."),T(!1);return}Promise.all([zr.list({limit:100,organization:Pt}),ua.listForOrganization(Pt)]).then(([At,Ht])=>{var Se;((Se=At.data)==null?void 0:Se.events)!=null?S(At.data.events):(S([]),I(At.error||"Failed to load events")),Ht.error||!Ht.data?P([]):P(Ht.data)}).catch(()=>{S([]),P([]),I("Failed to load events")}).finally(()=>T(!1));return}if(a==="badge"){T(!1),wt?y(!0):x(!0),w(null),d([]);const Pt=zn(t);if(!Pt){h([]),w(s?"Assign an organisation to your account to load badge exports.":"Your profile has no organisation."),wt?y(!1):x(!1);return}mq.list({organization:Pt,limit:100}).then(At=>{var Ht;((Ht=At.data)==null?void 0:Ht.batches)!=null?h(At.data.batches):w(At.error||"Failed to load badge exports")}).catch(()=>w("Failed to load badge exports")).finally(()=>{wt?y(!1):x(!1)});return}T(!1),x(!0),w(null);const ft=zn(t);if(!ft){d([]),w(s?"Assign an organisation to your account (or use an org-scoped user) to load design templates.":"Your profile has no organisation."),x(!1);return}Hs.list({type:a,limit:100,organization:ft}).then(Pt=>{var At;((At=Pt.data)==null?void 0:At.templates)!=null?d(Pt.data.templates):w(Pt.error||"Failed to load templates")}).catch(()=>w("Failed to load templates")).finally(()=>x(!1))},[a,t,s]);j.useEffect(()=>{fe()},[fe]);const Ie=()=>{q(null),K(null),o==="Brochure"?L(!0):o==="Microsite Templates"?V(!0):o==="Badges"?U(!0):o==="Emailers"&&H(!0)},ce=Te=>{q(Te._id),a==="brochure"?L(!0):a==="emailer"&&H(!0)},je=Te=>{K(Te._id),V(!0)},qe=Te=>{q(null),K(null),Te==="brochure"?L(!1):Te==="microsite"?V(!1):Te==="badge"?U(!1):Te==="emailer"&&H(!1),fe()},Ne=async()=>{if(!G)return;const Te=G._id;re(null),(await Hs.remove(Te)).error||fe()},Je=async(Te,wt)=>{if(a==="brochure"){ae(Te._id),me(null);try{const ft=await Hs.get(Te._id);if(ft.error||!ft.data)throw new Error(ft.error||"Failed to load brochure");const Pt=await XTe(ft.data);if(!Pt.ok)throw new Error(Pt.error);const At=(ft.data.name||"brochure").replace(/[^a-z0-9-_]+/gi,"-").replace(/^-|-$/g,"")||"brochure";if(wt==="preview")we(Pt.ctx);else{const Ht=WQ(Pt.ctx),Se=Pt.ctx.content.layoutId||"tpl1";await nIe(Se,Ht,`${At}.pdf`)}}catch(ft){me(ft instanceof Error?ft.message:"Could not generate PDF")}finally{ae(null)}}},vt=async Te=>{se(Te._id);try{const wt=await Hs.get(Te._id);if(wt.error||!wt.data)return;const ft=wt.data.content;let Pt="";ft!=null&&typeof ft=="object"&&"html"in ft&&typeof ft.html=="string"&&(Pt=String(ft.html||"")),Pt.trim()||(Pt='<p style="font-family:system-ui,sans-serif;padding:24px;color:#64748b">No HTML saved for this template yet. Use Edit to build the emailer.</p>'),Me({html:Pt,title:wt.data.name||"Email preview"})}finally{se(null)}},Ge=o==="Brochure"?"Create Brochure":o==="Badges"?"Create Badge":o==="Emailers"?"Create Emailer":o==="Microsite Templates"?"Configure microsite":"Create Template",Ot=a==="microsite"?l:a==="badge"?c:s;function nt(Te){const wt=Te.event;return wt&&typeof wt=="object"&&"name"in wt&&wt.name||"—"}const Ae=zn(t);return i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:n?"stretch":"flex-start",flexDirection:n?"column":"row",justifyContent:"space-between",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:Wh,children:"Portfolio · Design"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:n?"var(--text-xl)":"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:o}),!m&&!b&&a!=="microsite"&&a!=="badge"&&i.jsxs("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"4px"},children:[u.length," template",u.length!==1?"s":""]}),!m&&!b&&a==="badge"&&i.jsxs("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"4px"},children:[f.length," export job",f.length!==1?"s":""]}),!O&&!R&&a==="microsite"&&i.jsxs("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"4px"},children:[k.length," event",k.length!==1?"s":""," · ",_.length," microsite template",_.length!==1?"s":""]})]}),i.jsxs("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",justifyContent:n?"stretch":"flex-end"},children:[a==="badge"&&Ae&&i.jsxs("button",{type:"button",disabled:m||p,onClick:()=>void fe({badgeSoftRefresh:!0}),style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:m||p?"wait":"pointer",opacity:m||p?.65:1,flex:n?1:"none",justifyContent:n?"center":"flex-start"},children:[i.jsx(X3,{size:13}),p?"Refreshing…":"Refresh"]}),Ot&&i.jsxs(i.Fragment,{children:[s&&o!=="Emailers"&&o!=="Badges"&&i.jsxs("button",{onClick:()=>M(!0),style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer",transition:"opacity 0.15s",flex:n?1:"none",justifyContent:n?"center":"flex-start"},onMouseEnter:Te=>{Te.currentTarget.style.opacity="0.88"},onMouseLeave:Te=>{Te.currentTarget.style.opacity="1"},children:[i.jsx(ou,{size:13})," Import"]}),(a==="microsite"?l:a==="badge"?c:s)&&i.jsxs("button",{onClick:Ie,style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",transition:"opacity 0.15s",flex:n?1:"none",justifyContent:n?"center":"flex-start"},onMouseEnter:Te=>{Te.currentTarget.style.opacity="0.88"},onMouseLeave:Te=>{Te.currentTarget.style.opacity="1"},children:[i.jsx(wr,{size:13})," ",n?o==="Brochure"?"Brochure":o==="Badges"?"Badge":o==="Emailers"?"Emailer":o==="Microsite Templates"?"Microsite":"Template":Ge]})]})]})]}),m&&a!=="microsite"&&i.jsx(fh,{message:a==="badge"?"Loading badge exports…":"Loading templates…"}),O&&a==="microsite"&&i.jsx(fh,{message:"Loading events…"}),b&&a!=="microsite"&&i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--destructive)"},children:b}),le&&a==="brochure"&&i.jsxs("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--destructive)"},children:[le," ",i.jsx("button",{type:"button",onClick:()=>me(null),style:{marginLeft:"8px",fontSize:"var(--text-xs)",textDecoration:"underline",background:"none",border:"none",cursor:"pointer",color:"inherit"},children:"Dismiss"})]}),R&&a==="microsite"&&i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--destructive)"},children:R}),!m&&!b&&a!=="microsite"&&a!=="badge"&&i.jsxs("div",{style:{display:"grid",gridTemplateColumns:n?"repeat(2, 1fr)":"repeat(auto-fill, minmax(200px, 1fr))",gap:n?"10px":"14px"},children:[u.map(Te=>i.jsxs("div",{onMouseEnter:()=>A(Te._id),onMouseLeave:()=>A(null),style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden",cursor:"pointer",boxShadow:E===Te._id?"var(--elevation-sm)":"none",transition:"box-shadow 0.15s"},children:[i.jsxs("div",{style:{height:"120px",background:"var(--secondary)",display:"flex",alignItems:"center",justifyContent:"center",borderBottom:"1px solid var(--border)",position:"relative"},children:[jIe[o],E===Te._id&&i.jsxs("div",{style:{position:"absolute",inset:0,background:"rgba(11,77,209,0.08)",display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",flexWrap:"wrap"},children:[s&&i.jsx("button",{onClick:wt=>{wt.stopPropagation(),ce(Te)},style:{padding:"5px 12px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"#fff",border:"none",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:"Edit"}),a==="brochure"?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",disabled:J===Te._id,onClick:wt=>{wt.stopPropagation(),Je(Te,"preview")},style:{padding:"5px 12px",borderRadius:"var(--radius-button)",background:"var(--card)",color:"var(--foreground)",border:"1px solid var(--border)",cursor:J===Te._id?"wait":"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",opacity:J===Te._id?.7:1},children:J===Te._id?"…":"Preview"}),i.jsxs("button",{type:"button",disabled:J===Te._id,onClick:wt=>{wt.stopPropagation(),Je(Te,"download")},style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"5px 12px",borderRadius:"var(--radius-button)",background:"var(--card)",color:"var(--foreground)",border:"1px solid var(--border)",cursor:J===Te._id?"wait":"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",opacity:J===Te._id?.7:1},children:[i.jsx(Al,{size:12})," ",J===Te._id?"…":"PDF"]})]}):a==="emailer"?i.jsx("button",{type:"button",disabled:ke===Te._id,onClick:wt=>{wt.stopPropagation(),vt(Te)},style:{padding:"5px 12px",borderRadius:"var(--radius-button)",background:"var(--card)",color:"var(--foreground)",border:"1px solid var(--border)",cursor:ke===Te._id?"wait":"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",opacity:ke===Te._id?.7:1},children:ke===Te._id?"…":"Preview"}):null,s&&i.jsx("button",{onClick:wt=>{wt.stopPropagation(),re(Te)},style:{padding:"5px 12px",borderRadius:"var(--radius-button)",background:"var(--destructive)",color:"#fff",border:"none",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:"Delete"})]})]}),i.jsxs("div",{style:{padding:"10px 12px"},children:[i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"2px"},children:Te.name}),i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"4px"},children:[i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",background:"var(--secondary)",padding:"1px 6px",borderRadius:"3px"},children:Te.category||"—"}),i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:LW(Te.updatedAt)})]})]})]},Te._id)),s&&i.jsxs("div",{onClick:Ie,style:{border:"2px dashed var(--border)",borderRadius:"var(--radius-card)",minHeight:"170px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px",cursor:"pointer",transition:"border-color 0.12s, background 0.12s"},onMouseEnter:Te=>{Te.currentTarget.style.borderColor="var(--primary)",Te.currentTarget.style.background="var(--accent)"},onMouseLeave:Te=>{Te.currentTarget.style.borderColor="var(--border)",Te.currentTarget.style.background="transparent"},children:[i.jsx(wr,{size:24,style:{color:"var(--muted)"}}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:Ge})]})]}),!m&&!b&&a==="badge"&&i.jsxs("div",{style:{display:"grid",gridTemplateColumns:n?"1fr":"repeat(auto-fill, minmax(260px, 1fr))",gap:n?"10px":"14px"},children:[f.map(Te=>i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden",padding:"14px 16px",display:"flex",flexDirection:"column",gap:"10px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx(Oq,{size:20,style:{color:"var(--muted)",flexShrink:0}}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:Te.name})]}),i.jsx("span",{style:{fontSize:"11px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:nt(Te)}),i.jsxs("span",{style:{fontSize:"11px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:["Status: ",i.jsx("strong",{style:{color:"var(--foreground)"},children:Te.status}),Te.itemCount!=null?` · ${Te.itemCount} badge${Te.itemCount!==1?"s":""}`:""]}),Te.lastError&&Te.status==="failed"&&i.jsx("span",{style:{fontSize:"10px",color:"var(--destructive)"},children:Te.lastError}),i.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginTop:"4px"},children:Te.status==="ready"&&Te.zipUrl?i.jsxs("a",{href:Te.zipUrl,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",textDecoration:"none",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(Al,{size:13})," Download zip"]}):i.jsxs("button",{type:"button",disabled:!0,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",borderRadius:"var(--radius-button)",background:"var(--secondary)",color:"var(--muted)",border:"1px solid var(--border)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"not-allowed"},children:[i.jsx(Al,{size:13})," Download zip"]})}),Te.createdAt&&i.jsxs("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:["Requested ",LW(Te.createdAt)]})]},Te._id)),c&&i.jsxs("div",{onClick:Ie,style:{border:"2px dashed var(--border)",borderRadius:"var(--radius-card)",minHeight:"170px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px",cursor:"pointer",transition:"border-color 0.12s, background 0.12s"},onMouseEnter:Te=>{Te.currentTarget.style.borderColor="var(--primary)",Te.currentTarget.style.background="var(--accent)"},onMouseLeave:Te=>{Te.currentTarget.style.borderColor="var(--border)",Te.currentTarget.style.background="transparent"},children:[i.jsx(wr,{size:24,style:{color:"var(--muted)"}}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:Ge})]})]}),!O&&!R&&a==="microsite"&&i.jsxs("div",{style:{display:"grid",gridTemplateColumns:n?"1fr":"repeat(auto-fill, minmax(240px, 1fr))",gap:n?"10px":"14px"},children:[k.map(Te=>{const wt=_.filter(ct=>String(ct.event)===String(Te._id)),ft=wt.length,Pt=wt.map(ct=>(ct.publishFolder||"").trim()).filter(Boolean),At=Pt.length===0?"—":Pt.length<=2?Pt.join(", "):`${Pt.slice(0,2).join(", ")} +${Pt.length-2}`,Ht=wt.filter(ct=>ct.enabled).length,Se=ft===0?"":Ht===ft?" · all live":Ht===0?" · all draft":` · ${Ht} live, ${ft-Ht} draft`;return i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden",padding:"14px 16px",display:"flex",flexDirection:"column",gap:"10px"},children:[i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:Te.name}),i.jsx("span",{style:{fontSize:"11px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:ft===0?"0 microsite templates":`${ft} microsite template${ft!==1?"s":""} · slug(s): ${At}${Se}`}),l&&i.jsx("button",{type:"button",onClick:()=>je(Te),style:{padding:"6px 12px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",alignSelf:"flex-start"},children:"Configure microsite"})]},Te._id)}),l&&i.jsxs("div",{onClick:Ie,style:{border:"2px dashed var(--border)",borderRadius:"var(--radius-card)",minHeight:"120px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"8px",cursor:"pointer",transition:"border-color 0.12s, background 0.12s"},onMouseEnter:Te=>{Te.currentTarget.style.borderColor="var(--primary)",Te.currentTarget.style.background="var(--accent)"},onMouseLeave:Te=>{Te.currentTarget.style.borderColor="var(--border)",Te.currentTarget.style.background="transparent"},children:[i.jsx(wr,{size:24,style:{color:"var(--muted)"}}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:Ge})]})]}),i.jsx(qh,{})]}),F&&i.jsx(KTe,{templateId:$??void 0,onClose:()=>qe("brochure"),onSuccess:fe}),Oe&&i.jsx(rIe,{ctx:Oe,onClose:()=>we(null)}),ie&&i.jsx("div",{role:"presentation",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",zIndex:400,display:"flex",alignItems:"center",justifyContent:"center",padding:24},onClick:()=>Me(null),children:i.jsxs("div",{role:"dialog","aria-label":"Email preview",style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"100%",maxWidth:720,maxHeight:"90vh",display:"flex",flexDirection:"column",border:"1px solid var(--border)",boxShadow:"0 20px 40px rgba(0,0,0,0.2)"},onClick:Te=>Te.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border)"},children:[i.jsx("span",{style:{fontWeight:600,fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)"},children:ie.title}),i.jsx("button",{type:"button","aria-label":"Close",onClick:()=>Me(null),style:{background:"none",border:"none",cursor:"pointer",color:"var(--foreground)"},children:i.jsx(er,{size:18})})]}),i.jsx("iframe",{title:"Email preview",srcDoc:ie.html,sandbox:"allow-same-origin",style:{flex:1,minHeight:420,border:"none",width:"100%"}})]})}),z&&i.jsx(lIe,{initialEventId:Y??void 0,onClose:()=>qe("microsite"),onSuccess:fe}),Q&&i.jsx(fIe,{onClose:()=>qe("badge"),onSuccess:fe}),ee&&i.jsx(gIe,{templateId:$??void 0,onClose:()=>qe("emailer"),onSuccess:fe}),B&&i.jsx(wIe,{onClose:()=>M(!1),defaultType:o==="Brochure"?"Brochure":o==="Microsite Templates"?"Microsite Template":o==="Badges"?"Badge":o==="Emailers"?"Emailer":"Other"}),G&&i.jsx(cb,{title:"Delete template?",message:`Delete "${G.name}"? This cannot be undone.`,confirmLabel:"Delete",onConfirm:Ne,onCancel:()=>re(null),variant:"danger"})]})}const jw=["#2563eb","#16a34a","#d97706","#7c3aed","#0891b2","#be185d","#0d9488","#b45309"];function _Ie(e){let t=0;for(let r=0;r<e.length;r++)t+=e.charCodeAt(r);return jw[t%jw.length]}function CIe(){const{user:e}=Ur(),{selectedEventId:t}=eo(),[r,n]=j.useState([]),[o,a]=j.useState(!0),[s,l]=j.useState(null),[c,u]=j.useState(""),[d,f]=j.useState(null),[h,p]=j.useState(!1),[y,m]=j.useState(!1),[x,b]=j.useState(null),[w,k]=j.useState(null),S=(e==null?void 0:e.role)==="super_admin",_=e!=null&&e.organization&&typeof e.organization=="object"&&"_id"in e.organization?String(e.organization._id):e!=null&&e.organization?String(e.organization):void 0,P=j.useCallback(()=>{if(a(!0),l(null),!_){l(S?"Your profile has no organisation — assign one in settings or add ?organization= to the API. Faculty list is scoped by organisation.":"Your profile has no organisation."),n([]),a(!1);return}Ef.list({limit:200,organization:_}).then(E=>{var A;((A=E.data)==null?void 0:A.speakers)!=null?n(E.data.speakers):l(E.error??"Failed to load speakers")}).catch(()=>l("Failed to load speakers")).finally(()=>a(!1))},[S,_]);j.useEffect(()=>{P()},[P]);const O=r.filter(E=>{const A=`${E.firstName} ${E.lastName}`.toLowerCase(),F=(E.title??"").toLowerCase(),L=(E.organizationName??"").toLowerCase(),z=c.toLowerCase();return!z||A.includes(z)||F.includes(z)||L.includes(z)}),T=E=>{b(E._id),m(!0)},R=()=>{b(null),m(!1),P()},I=async()=>{if(!w)return;const E=w._id;k(null),(await Ef.remove(E)).error||P()};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[i.jsxs("div",{children:[i.jsx("p",{style:Wh,children:"Portfolio"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:"Faculty & Speakers"}),!o&&!s&&i.jsxs("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"4px"},children:[r.length," speaker",r.length!==1?"s":""," across all events"]})]}),S&&i.jsxs("button",{onClick:()=>{b(null),m(!0)},style:{display:"flex",alignItems:"center",gap:"5px",padding:"8px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:13})," Add Speaker"]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"0 10px",height:"36px",maxWidth:"320px",background:"var(--card)",border:`1px solid ${h?"var(--ring)":"var(--border)"}`,borderRadius:"var(--radius-button)",transition:"border-color 0.12s"},children:[i.jsx(Pi,{size:13,style:{color:"var(--muted)",flexShrink:0}}),i.jsx("input",{value:c,onChange:E=>u(E.target.value),placeholder:"Search speakers…",onFocus:()=>p(!0),onBlur:()=>p(!1),style:{flex:1,background:"transparent",border:"none",outline:"none",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)"}}),c&&i.jsx("button",{onClick:()=>u(""),style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",padding:0},children:i.jsx(er,{size:12})})]}),o&&i.jsx(fh,{message:"Loading speakers…"}),s&&i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--destructive)"},children:s}),!o&&!s&&i.jsxs(P8,{children:[i.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr 80px 60px",padding:"8px 16px",background:"var(--secondary)",borderBottom:"1px solid var(--border)"},children:["Speaker","Title","Organisation","Sessions",""].map(E=>i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:E},E))}),O.map(E=>{var z;const A=`${E.firstName} ${E.lastName}`.trim()||"—",F=((z=E.sessions)==null?void 0:z.length)??0,L=A.split(/\s+/).map(V=>V[0]).join("").slice(0,2).toUpperCase()||"?";return i.jsxs("div",{onMouseEnter:()=>f(E._id),onMouseLeave:()=>f(null),style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr 80px 60px",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border)",background:d===E._id?"var(--secondary)":"var(--card)",transition:"background 0.12s"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[i.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"50%",background:_Ie(E._id),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:i.jsx("span",{style:{color:"#fff",fontSize:"10px",fontFamily:"var(--font-inter)",fontWeight:"600"},children:L})}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:A})]}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:E.title??"—"}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:E.organizationName??"—"}),i.jsxs("span",{style:{display:"inline-flex",width:"fit-content",padding:"2px 8px",borderRadius:"999px",background:"var(--accent)",color:"var(--primary)",fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600"},children:[F," ",F===1?"session":"sessions"]}),i.jsx("div",{style:{display:"flex",gap:"4px",opacity:d===E._id?1:.3,transition:"opacity 0.15s"},children:S&&i.jsxs(i.Fragment,{children:[i.jsx("button",{title:"Edit speaker",onClick:()=>T(E),style:{width:"26px",height:"26px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",cursor:"pointer"},onMouseEnter:V=>{V.currentTarget.style.borderColor="var(--primary)",V.currentTarget.style.color="var(--primary)"},onMouseLeave:V=>{V.currentTarget.style.borderColor="var(--border)",V.currentTarget.style.color="var(--muted)"},children:i.jsx(Ii,{size:11})}),i.jsx("button",{title:"Delete speaker",onClick:()=>k(E),style:{width:"26px",height:"26px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",cursor:"pointer"},onMouseEnter:V=>{V.currentTarget.style.borderColor="var(--destructive)",V.currentTarget.style.color="var(--destructive)"},onMouseLeave:V=>{V.currentTarget.style.borderColor="var(--border)",V.currentTarget.style.color="var(--muted)"},children:i.jsx(gn,{size:11})})]})})]},E._id)}),O.length===0&&i.jsxs("div",{style:{padding:"48px 20px",textAlign:"center"},children:[i.jsx(Pi,{size:24,style:{color:"var(--border)",margin:"0 auto 10px"}}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"4px"},children:"No speakers found"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"14px"},children:c?`No results for "${c}". Try a different name or title.`:"Add a speaker to get started."}),c&&i.jsxs("button",{onClick:()=>u(""),style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"5px 14px",borderRadius:"var(--radius-button)",background:"var(--secondary)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",color:"var(--card-foreground)",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(er,{size:11})," Clear search"]})]})]}),i.jsx(qh,{}),y&&i.jsx(q6e,{speakerId:x??void 0,eventId:t,onClose:R,onSuccess:P}),w&&i.jsx(cb,{title:"Delete speaker?",message:`Remove "${w.firstName} ${w.lastName}"? This cannot be undone.`,confirmLabel:"Delete",onConfirm:I,onCancel:()=>k(null),variant:"danger"})]})}function FW(e){const r={VIP:{bg:"#fef3c7",color:"#92400e"},Speaker:{bg:"var(--accent)",color:"var(--accent-foreground)"},Sponsor:{bg:"#dcfce7",color:"#15803d"},Press:{bg:"#f3e8ff",color:"#6b21a8"},Virtual:{bg:"#e0f2fe",color:"#075985"},Workshop:{bg:"#ffedd5",color:"#c2410c"}}[e];if(r)return r;let n=0;for(let a=0;a<e.length;a++)n=e.charCodeAt(a)+((n<<5)-n);const o=Math.abs(n)%360;return{bg:`hsl(${o}, 42%, 93%)`,color:`hsl(${o}, 55%, 30%)`}}function EIe(e){const t=[e.firstName,e.lastName].filter(Boolean).join(" ").trim()||"—",r=e.status,n=r==null||r===""?"—":r==="cancelled"?"Cancelled":r==="checked_in"?"Checked In":r==="confirmed"?"Confirmed":"Pending",o=e.event,a=(o==null?void 0:o.name)??"—",s=String(e._id);return{rowKey:s,id:s,name:t,email:e.email??"",tags:e.tags??[],eventName:a,status:n}}function AIe(e){return e.split(/[,;\n]+/).map(t=>t.trim()).filter(Boolean)}function TIe(){const{user:e}=Ur(),t=zn(e),r=(e==null?void 0:e.role)==="super_admin",{setActiveNav:n}=eo(),[o,a]=j.useState([]),[s,l]=j.useState(0),[c,u]=j.useState(1),[d]=j.useState(50),[f,h]=j.useState(""),[p,y]=j.useState(""),[m,x]=j.useState(null),[b,w]=j.useState(null),[k,S]=j.useState(!1),[_,P]=j.useState(!0),[O,T]=j.useState(!1),[R,I]=j.useState(!1),[E,A]=j.useState(!1),[F,L]=j.useState(null),[z,V]=j.useState(0),[Q,U]=j.useState([]),[ee,H]=j.useState([]),[B,M]=j.useState(!1),[$,q]=j.useState(!1),[Y,K]=j.useState(null),[G,re]=j.useState(null),[J,ae]=j.useState(null),[le,me]=j.useState(""),[Oe,we]=j.useState(""),[ie,Me]=j.useState(""),[ke,se]=j.useState([]),[fe,Ie]=j.useState(()=>new Set),[ce,je]=j.useState([]),[qe,Ne]=j.useState(""),Je=j.useRef(null),vt=j.useRef(void 0);j.useEffect(()=>(vt.current=setTimeout(()=>y(f.trim()),300),()=>{vt.current&&clearTimeout(vt.current)}),[f]),j.useEffect(()=>{u(1)},[p,m]),j.useEffect(()=>{M(!1)},[p,m]),j.useEffect(()=>{ee.length===0&&M(!1)},[ee.length]),j.useEffect(()=>{if(!t){U([]);return}Ei.listDistinctTags({organization:t}).then(Pe=>{var rt,Ze;(Ze=(rt=Pe.data)==null?void 0:rt.tags)!=null&&Ze.length&&U(Pe.data.tags)})},[t,z]),j.useEffect(()=>{const Pe=Je.current;if(!Pe||o.length===0)return;const rt=o.map(pe=>pe.id),Ze=rt.filter(pe=>ee.includes(pe)).length;Pe.indeterminate=Ze>0&&Ze<rt.length,Pe.checked=Ze===rt.length&&rt.length>0},[o,ee]),j.useEffect(()=>{if(!t){a([]),l(0),P(!1);return}P(!0),Ei.listAll({organization:t,page:c,limit:d,q:p||void 0,tag:m??void 0}).then(Pe=>{var rt;P(!1),(rt=Pe.data)!=null&&rt.participants&&(a(Pe.data.participants.map(EIe)),l(Pe.data.total??0))}).catch(()=>P(!1))},[t,c,d,p,m,z]);const Ge=()=>{h(""),y(""),x(null),u(1)},Ot=async()=>{R||(I(!0),t&&(await Ei.downloadExportAll({organization:t,q:p||void 0,tag:m??void 0}),I(!1)))},nt=Pe=>{M(!1),H(rt=>rt.includes(Pe)?rt.filter(Ze=>Ze!==Pe):[...rt,Pe])},Ae=()=>{M(!1);const Pe=o.map(rt=>rt.id);H(rt=>{const Ze=new Set(rt);return Pe.length>0&&Pe.every(xe=>Ze.has(xe))?Pe.forEach(xe=>Ze.delete(xe)):Pe.forEach(xe=>Ze.add(xe)),[...Ze]})},Te=async()=>{var Ze,pe;if(q(!0),!t){L(r?"Organisation required for this action.":"Your profile has no organisation."),M(!1),q(!1);return}const Pe=await Ei.matchingIds({organization:t,q:p||void 0,tag:m??void 0});if(q(!1),Pe.error){L(Pe.error),M(!1);return}const rt=((Ze=Pe.data)==null?void 0:Ze.ids)??[];(pe=Pe.data)!=null&&pe.capped&&L(`Note: only the first ${rt.length} matching people are selected (limit). Refine filters if needed.`),H(rt),M(rt.length>0)},wt=()=>{M(!1),H([])},ft=async Pe=>{var rt,Ze;if(me(""),we(""),Me(""),Ne(""),Ie(new Set),Pe==="assignEvents"){if(!t){L(r?"Organisation required to load events.":"Your profile has no organisation.");return}const pe=await zr.list({limit:400,organization:t});(rt=pe.data)!=null&&rt.events&&se(pe.data.events)}if(Pe==="addToList"){if(!t){L(r?"Organisation required to load lists.":"Your profile has no organisation.");return}const xe=(((Ze=(await Fa.list({organization:t})).data)==null?void 0:Ze.lists)??[]).filter(De=>De.type==="fixed");je(xe),xe[0]&&Ne(xe[0]._id)}ae(Pe)},Pt=Pe=>{Ie(rt=>{const Ze=new Set(rt);return Ze.has(Pe)?Ze.delete(Pe):Ze.add(Pe),Ze})},At=async Pe=>{var pe;const rt=AIe(le);if(!rt.length)return;q(!0);const Ze=await Ei.bulk({action:Pe,participantIds:ee,tags:rt});q(!1),Ze.error?L(Ze.error):(L(`${Pe==="add_tags"?"Added":"Removed"} tags for ${((pe=Ze.data)==null?void 0:pe.updated)??0} participant(s).`),ae(null),H([]),V(xe=>xe+1))},Ht=async()=>{var Ze;const Pe=[...fe];if(!Pe.length)return;q(!0);const rt=await Ei.bulk({action:"assign_events",participantIds:ee,eventIds:Pe});q(!1),rt.error?L(rt.error):(L(`Assigned ${ee.length} people to event(s). ${((Ze=rt.data)==null?void 0:Ze.membershipsAdded)??0} new membership(s).`),ae(null),H([]),V(pe=>pe+1))},Se=async()=>{const Pe=Oe.trim();if(!Pe)return;q(!0);const rt=await Fa.create({name:Pe,description:ie.trim(),type:"fixed",visibility:"private",autoUpdate:!1,participantIds:ee});q(!1),rt.error?L(rt.error):(L(`Custom list “${Pe}” created with ${ee.length} member(s).`),ae(null),H([]),V(Ze=>Ze+1))},ct=async()=>{var rt;if(!qe)return;q(!0);const Pe=await Ei.bulk({action:"add_to_fixed_list",participantIds:ee,listId:qe});q(!1),Pe.error?L(Pe.error):(L(`Added ${((rt=Pe.data)==null?void 0:rt.updated)??0} people to the list.`),ae(null),H([]),V(Ze=>Ze+1))},gt=async()=>{var rt;q(!0);const Pe=await Ei.bulk({action:"delete",participantIds:ee});q(!1),Pe.error?L(Pe.error):(L(`Deleted ${((rt=Pe.data)==null?void 0:rt.deleted)??0} participant(s).`),H([]),V(Ze=>Ze+1))},We=async()=>{if(!G)return;const{id:Pe,name:rt}=G;re(null);const Ze=await Ei.deleteOne(Pe);if(Ze.error){L(Ze.error);return}L(`Removed ${rt}.`),M(!1),H(pe=>pe.filter(xe=>xe!==Pe)),V(pe=>pe+1)};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[F&&i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:"10px 14px",borderRadius:"var(--radius-button)",background:"var(--secondary)",border:"1px solid var(--border)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx("span",{children:F}),i.jsx("button",{type:"button",onClick:()=>L(null),style:{background:"none",border:"none",cursor:"pointer"},children:i.jsx(er,{size:16})})]}),i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:Wh,children:"Portfolio"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:"Participants"}),i.jsxs("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"4px"},children:[s," in your organization (Including people not yet assigned to an event) · Page ",c," of ",Math.max(1,Math.ceil(s/d))]})]}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:[i.jsxs("button",{type:"button",disabled:R,onClick:Ot,style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:R?"wait":"pointer",opacity:R?.7:1},children:[i.jsx(Al,{size:13})," ",R?"Exporting…":"Export"]}),i.jsxs("button",{type:"button",onClick:()=>{L(null),A(!0)},style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:[i.jsx(ou,{size:13})," Import"]}),i.jsx("button",{type:"button",onClick:()=>n("participant-lists"),style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:"Custom lists"}),i.jsxs("button",{type:"button",onClick:()=>T(!0),style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:13})," Create Custom List"]})]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[!_&&s>0&&i.jsxs("label",{style:{display:"inline-flex",alignItems:"center",gap:"8px",flexShrink:0,cursor:$?"wait":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",userSelect:"none"},children:[i.jsx("input",{type:"checkbox",checked:B,disabled:$,onChange:Pe=>{Pe.target.checked?Te():wt()},style:{width:"16px",height:"16px",cursor:$?"wait":"pointer",accentColor:"var(--primary)"}}),i.jsxs("span",{children:["Select all matching filters (",s,")"]})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"7px",padding:"0 10px",height:"34px",background:"var(--card)",border:`1px solid ${k?"var(--ring)":"var(--border)"}`,borderRadius:"var(--radius-button)",maxWidth:"280px",flex:"1 1 200px",transition:"border-color 0.12s"},children:[i.jsx(Pi,{size:12,style:{color:"var(--muted)",flexShrink:0}}),i.jsx("input",{value:f,onChange:Pe=>h(Pe.target.value),placeholder:"Search participants…",onFocus:()=>S(!0),onBlur:()=>S(!1),style:{flex:1,background:"transparent",border:"none",outline:"none",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)"}}),f&&i.jsx("button",{type:"button",onClick:()=>h(""),style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",padding:0},children:i.jsx(er,{size:11})})]}),i.jsxs("div",{style:{display:"flex",gap:"5px",flexWrap:"wrap",alignItems:"center"},children:[Q.length===0?i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"No tags yet — add tags when editing or importing."}):Q.map(Pe=>{const rt=FW(Pe),Ze=m===Pe;return i.jsx("button",{type:"button",onClick:()=>x(Ze?null:Pe),style:{padding:"3px 10px",borderRadius:"999px",border:`1px solid ${Ze?rt.color:"var(--border)"}`,background:Ze?rt.bg:"transparent",color:Ze?rt.color:"var(--muted)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:Ze?"var(--font-weight-medium)":"var(--font-weight-normal)",cursor:"pointer",transition:"all 0.12s"},children:Pe},Pe)}),m&&i.jsxs("button",{type:"button",onClick:()=>x(null),style:{display:"flex",alignItems:"center",gap:"4px",padding:"3px 10px",borderRadius:"999px",border:"1px solid var(--border)",background:"transparent",color:"var(--muted)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:[i.jsx(er,{size:10})," Clear"]})]})]}),ee.length>0&&i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px",padding:"12px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)"},children:[i.jsxs("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:[ee.length," selected"]}),i.jsx("button",{type:"button",disabled:$,onClick:()=>ft("addTags"),style:{padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:$?"wait":"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:"Add tags"}),i.jsx("button",{type:"button",disabled:$,onClick:()=>ft("removeTags"),style:{padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:$?"wait":"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:"Remove tags"}),i.jsx("button",{type:"button",disabled:$,onClick:()=>ft("assignEvents"),style:{padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:$?"wait":"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:"Assign to event(s)"}),i.jsx("button",{type:"button",disabled:$,onClick:()=>ft("newList"),style:{padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:$?"wait":"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:"New custom list"}),i.jsx("button",{type:"button",disabled:$,onClick:()=>ft("addToList"),style:{padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:$?"wait":"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:"Add to list"}),i.jsx("button",{type:"button",disabled:$,onClick:()=>{window.confirm(`Delete ${ee.length} participant(s) permanently?`)&>()},style:{padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--destructive)",background:"transparent",color:"var(--destructive)",cursor:$?"wait":"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:"Delete selected"}),i.jsx("button",{type:"button",onClick:wt,style:{marginLeft:"auto",padding:"6px 12px",borderRadius:"var(--radius-button)",border:"none",background:"transparent",color:"var(--muted)",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:"Clear selection"})]}),i.jsxs(P8,{minWidth:720,children:[i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"38px 1.1fr 1.35fr minmax(100px,1fr) 1fr 92px",padding:"8px 16px",background:"var(--secondary)",borderBottom:"1px solid var(--border)",alignItems:"center"},children:[i.jsx("input",{ref:Je,type:"checkbox",title:"Select visible rows",onChange:Ae,style:{width:"16px",height:"16px",cursor:"pointer"}}),i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase"},children:"Name"}),i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase"},children:"Email"}),i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase"},children:"Tags"}),i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase"},children:"Event"}),i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase"},children:"Actions"})]}),_?i.jsx("div",{style:{padding:"40px",textAlign:"center",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Loading…"}):o.length===0?i.jsxs("div",{style:{padding:"40px",textAlign:"center"},children:[i.jsx(Pi,{size:22,style:{color:"var(--border)",margin:"0 auto 10px"}}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"4px"},children:"No participants found"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"14px"},children:p||m?"Try adjusting your filters or import participants.":"No one in your organization yet. Import a CSV or add people from an event."}),(p||m)&&i.jsxs("button",{type:"button",onClick:Ge,style:{display:"inline-flex",alignItems:"center",gap:"5px",padding:"5px 14px",borderRadius:"var(--radius-button)",background:"var(--secondary)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",color:"var(--card-foreground)",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(er,{size:11})," Clear filters"]})]}):o.map(Pe=>i.jsxs("div",{onMouseEnter:()=>w(Pe.rowKey),onMouseLeave:()=>w(null),style:{display:"grid",gridTemplateColumns:"38px 1.1fr 1.35fr minmax(100px,1fr) 1fr 92px",alignItems:"center",padding:"11px 16px",borderBottom:"1px solid var(--border)",background:b===Pe.rowKey?"var(--secondary)":"var(--card)",transition:"background 0.12s"},children:[i.jsx("input",{type:"checkbox",checked:ee.includes(Pe.id),onChange:()=>nt(Pe.id),style:{width:"16px",height:"16px",cursor:"pointer"}}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",minWidth:0},children:[i.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:i.jsx("span",{style:{color:"#fff",fontSize:"9px",fontFamily:"var(--font-inter)",fontWeight:"600"},children:(Pe.name.slice(0,2)||"?").toUpperCase()})}),i.jsxs("div",{style:{minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:Pe.name}),i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:Pe.status==="—"||Pe.status==="Cancelled"?"var(--muted)":"#15803d"},children:Pe.status})]})]}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Pe.email}),i.jsxs("div",{style:{display:"flex",gap:"3px",flexWrap:"wrap"},children:[Pe.tags.map(rt=>{const Ze=FW(rt);return i.jsx("span",{style:{padding:"1px 6px",borderRadius:"999px",background:Ze.bg,color:Ze.color,fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600"},children:rt},rt)}),Pe.tags.length===0&&i.jsx("span",{style:{fontSize:"10px",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"—"})]}),i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Pe.eventName}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"flex-end"},children:[i.jsx("button",{type:"button",title:"Edit",onClick:()=>K(Pe.id),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",cursor:"pointer"},children:i.jsx(Ii,{size:13})}),i.jsx("button",{type:"button",title:"Delete",onClick:()=>re({id:Pe.id,name:Pe.name}),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--destructive)",cursor:"pointer"},children:i.jsx(gn,{size:13})})]})]},Pe.rowKey))]}),!_&&s>d&&i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",padding:"8px 0"},children:[i.jsxs("button",{type:"button",disabled:c<=1,onClick:()=>u(Pe=>Math.max(1,Pe-1)),style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:c<=1?"not-allowed":"pointer",opacity:c<=1?.5:1,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(Nf,{size:16})," Previous"]}),i.jsxs("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[c," / ",Math.max(1,Math.ceil(s/d))]}),i.jsxs("button",{type:"button",disabled:c>=Math.ceil(s/d),onClick:()=>u(Pe=>Pe+1),style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:c>=Math.ceil(s/d)?"not-allowed":"pointer",opacity:c>=Math.ceil(s/d)?.5:1,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:["Next ",i.jsx(va,{size:16})]})]}),Y&&i.jsx(Y6e,{participantId:Y,onClose:()=>K(null),onSaved:()=>{V(Pe=>Pe+1),t&&Ei.listDistinctTags({organization:t}).then(Pe=>{var rt,Ze;(Ze=(rt=Pe.data)==null?void 0:rt.tags)!=null&&Ze.length&&U(Pe.data.tags)})}}),G&&i.jsx(cb,{title:"Delete participant?",message:`Remove ${G.name} from your organization? This cannot be undone.`,confirmLabel:"Delete",onConfirm:()=>void We(),onCancel:()=>re(null),variant:"danger"}),(J==="addTags"||J==="removeTags")&&i.jsx("div",{role:"dialog","aria-modal":"true",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",zIndex:205,display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>!$&&ae(null),children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",padding:"20px",width:"min(400px, 92vw)",boxShadow:"var(--shadow-xl)"},onClick:Pe=>Pe.stopPropagation(),children:[i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",margin:"0 0 8px"},children:J==="addTags"?"Add tags":"Remove tags"}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 12px",fontFamily:"var(--font-noto-sans)"},children:["Apply to ",ee.length," selected (comma-separated)."]}),i.jsx("input",{value:le,onChange:Pe=>me(Pe.target.value),placeholder:"e.g. VIP, Sponsor",style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",fontSize:"var(--text-sm)",boxSizing:"border-box",marginBottom:"14px"}}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"},children:[i.jsx("button",{type:"button",disabled:$,onClick:()=>ae(null),style:{padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",fontSize:"var(--text-sm)"},children:"Cancel"}),i.jsx("button",{type:"button",disabled:$,onClick:()=>void At(J==="addTags"?"add_tags":"remove_tags"),style:{padding:"7px 14px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",cursor:"pointer",fontSize:"var(--text-sm)"},children:"Apply"})]})]})}),J==="assignEvents"&&i.jsx("div",{role:"dialog","aria-modal":"true",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",zIndex:205,display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>!$&&ae(null),children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",padding:"20px",width:"min(440px, 92vw)",maxHeight:"80vh",overflow:"auto",boxShadow:"var(--shadow-xl)"},onClick:Pe=>Pe.stopPropagation(),children:[i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",margin:"0 0 8px"},children:"Assign to event(s)"}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 12px",fontFamily:"var(--font-noto-sans)"},children:[ee.length," people · adds pending membership where missing."]}),i.jsx("div",{style:{maxHeight:"240px",overflowY:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",padding:"8px"},children:ke.map(Pe=>i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 4px",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx("input",{type:"checkbox",checked:fe.has(Pe._id),onChange:()=>Pt(Pe._id)}),Pe.name]},Pe._id))}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"14px"},children:[i.jsx("button",{type:"button",disabled:$,onClick:()=>ae(null),style:{padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",fontSize:"var(--text-sm)"},children:"Cancel"}),i.jsx("button",{type:"button",disabled:$||fe.size===0,onClick:()=>void Ht(),style:{padding:"7px 14px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",cursor:"pointer",fontSize:"var(--text-sm)"},children:"Assign"})]})]})}),J==="newList"&&i.jsx("div",{role:"dialog","aria-modal":"true",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",zIndex:205,display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>!$&&ae(null),children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",padding:"20px",width:"min(400px, 92vw)",boxShadow:"var(--shadow-xl)"},onClick:Pe=>Pe.stopPropagation(),children:[i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",margin:"0 0 8px"},children:"New custom list"}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 12px",fontFamily:"var(--font-noto-sans)"},children:["Fixed list with ",ee.length," selected people."]}),i.jsx("input",{value:Oe,onChange:Pe=>we(Pe.target.value),placeholder:"List name",style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",marginBottom:"8px",boxSizing:"border-box",fontSize:"var(--text-sm)"}}),i.jsx("textarea",{value:ie,onChange:Pe=>Me(Pe.target.value),placeholder:"Description (optional)",rows:3,style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",marginBottom:"14px",boxSizing:"border-box",fontSize:"var(--text-sm)",resize:"vertical"}}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"},children:[i.jsx("button",{type:"button",disabled:$,onClick:()=>ae(null),style:{padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",fontSize:"var(--text-sm)"},children:"Cancel"}),i.jsx("button",{type:"button",disabled:$||!Oe.trim(),onClick:()=>void Se(),style:{padding:"7px 14px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",cursor:"pointer",fontSize:"var(--text-sm)"},children:"Create"})]})]})}),J==="addToList"&&i.jsx("div",{role:"dialog","aria-modal":"true",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",zIndex:205,display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>!$&&ae(null),children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",padding:"20px",width:"min(400px, 92vw)",boxShadow:"var(--shadow-xl)"},onClick:Pe=>Pe.stopPropagation(),children:[i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",margin:"0 0 8px"},children:"Add to existing list"}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 12px",fontFamily:"var(--font-noto-sans)"},children:["Append ",ee.length," people to a fixed list."]}),ce.length===0?i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)"},children:"No fixed lists yet. Create one first."}):i.jsx("select",{value:qe,onChange:Pe=>Ne(Pe.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",marginBottom:"14px",fontSize:"var(--text-sm)"},children:ce.map(Pe=>i.jsx("option",{value:Pe._id,children:Pe.name},Pe._id))}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px"},children:[i.jsx("button",{type:"button",disabled:$,onClick:()=>ae(null),style:{padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",fontSize:"var(--text-sm)"},children:"Cancel"}),i.jsx("button",{type:"button",disabled:$||ce.length===0||!qe,onClick:()=>void ct(),style:{padding:"7px 14px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",cursor:"pointer",fontSize:"var(--text-sm)"},children:"Add"})]})]})}),i.jsx(qh,{}),E&&i.jsx(H6e,{onClose:()=>A(!1),onSuccess:Pe=>{L(Pe),V(rt=>rt+1)}}),O&&i.jsx(OQ,{onClose:()=>T(!1),onCreated:()=>V(Pe=>Pe+1)})]})}function PIe(e){if(e==null||e==="")return"—";const t=String(e).toLowerCase();return t==="cancelled"||t==="canceled"?"Cancelled":t==="checked_in"?"Checked In":t==="confirmed"?"Confirmed":t==="pending"?"Pending":String(e)}function OIe(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function IIe(){const{user:e}=Ur(),t=zn(e),{setActiveNav:r}=eo(),[n,o]=j.useState([]),[a,s]=j.useState(!0),[l,c]=j.useState(!1),[u,d]=j.useState(null),[f,h]=j.useState(null),[p,y]=j.useState(null),[m,x]=j.useState([]),[b,w]=j.useState(!1),[k,S]=j.useState(1),[_,P]=j.useState(0),O=50,[T,R]=j.useState(null),[I,E]=j.useState(""),[A,F]=j.useState(""),[L,z]=j.useState("Private"),[V,Q]=j.useState(!1),[U,ee]=j.useState(null),[H,B]=j.useState(null),[M,$]=j.useState(null),q=j.useCallback(()=>{if(s(!0),!t){o([]),s(!1);return}Fa.list({organization:t}).then(ae=>{var le;s(!1),(le=ae.data)!=null&&le.lists&&o(ae.data.lists)}).catch(()=>s(!1))},[t]);j.useEffect(()=>{q()},[q]),j.useEffect(()=>{if(!p){x([]),P(0),S(1);return}if(!t){x([]),P(0);return}w(!0),Fa.members(p._id,{organization:t,page:k,limit:O}).then(ae=>{var le,me;w(!1),(le=ae.data)!=null&&le.members&&x(ae.data.members),P(((me=ae.data)==null?void 0:me.total)??0)}).catch(()=>w(!1))},[p==null?void 0:p._id,k,t]);const Y=Math.max(1,Math.ceil(_/O)),K=ae=>{if(ae.type==="rule_based"){$(null),d(ae),c(!0);return}ee(null),R(ae),E(ae.name),F(ae.description??""),z(ae.visibility==="shared"?"Shared":"Private")},G=()=>{R(null),ee(null)},re=async()=>{if(!T||!I.trim()){ee("Name is required.");return}Q(!0),ee(null);const ae={name:I.trim(),description:A.trim(),visibility:L==="Shared"?"shared":"private"},le=await Fa.update(T._id,ae);if(Q(!1),le.error){ee(le.error);return}$(`Updated “${I.trim()}”.`),G(),q(),(p==null?void 0:p._id)===T._id&&le.data&&y(le.data)},J=async()=>{if(!H)return;const{id:ae,name:le}=H;B(null);const me=await Fa.remove(ae);if(me.error){$(me.error);return}$(`Deleted “${le}”.`),(p==null?void 0:p._id)===ae&&y(null),q()};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[M&&i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:"10px 14px",borderRadius:"var(--radius-button)",background:"var(--secondary)",border:"1px solid var(--border)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx("span",{children:M}),i.jsx("button",{type:"button",onClick:()=>$(null),style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)"},children:i.jsx(er,{size:16})})]}),i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:Wh,children:"Portfolio"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:"Participant lists"}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"4px"},children:"Fixed lists and rule-based lists. Open a list to see who is included."})]}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:[i.jsx("button",{type:"button",onClick:()=>{$(null),r("all-participants")},style:{padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"All participants"}),i.jsxs("button",{type:"button",onClick:()=>{$(null),d(null),c(!0)},style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:13})," Create Custom List"]})]})]}),i.jsxs(P8,{minWidth:780,children:[i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"minmax(160px,1.4fr) 110px 88px 100px minmax(260px,1fr)",padding:"10px 16px",background:"var(--secondary)",borderBottom:"1px solid var(--border)",alignItems:"center",gap:"8px"},children:[i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase"},children:"List"}),i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase"},children:"Type"}),i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase"},children:"Visibility"}),i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase"},children:"Updated"}),i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase",textAlign:"right"},children:"Actions"})]}),a?i.jsx("div",{style:{padding:"40px",textAlign:"center",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"Loading…"}):n.length===0?i.jsxs("div",{style:{padding:"48px 20px",textAlign:"center"},children:[i.jsx(vi,{size:28,style:{color:"var(--border)",margin:"0 auto 12px"}}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"6px"},children:"No lists yet"}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"16px"},children:"Create a custom list from here or from All participants."}),i.jsxs("button",{type:"button",onClick:()=>{d(null),c(!0)},style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 18px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:14})," Create Custom List"]})]}):n.map(ae=>i.jsxs("div",{onMouseEnter:()=>h(ae._id),onMouseLeave:()=>h(null),style:{display:"grid",gridTemplateColumns:"minmax(160px,1.4fr) 110px 88px 100px minmax(260px,1fr)",padding:"12px 16px",borderBottom:"1px solid var(--border)",alignItems:"center",gap:"8px",background:f===ae._id?"var(--secondary)":"var(--card)",transition:"background 0.12s"},children:[i.jsxs("div",{style:{minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:ae.name}),ae.description?i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"4px 0 0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ae.description}):null]}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:ae.type==="rule_based"?"Rule-based":"Fixed"}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:ae.visibility==="shared"?"Shared":"Private"}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:OIe(ae.updatedAt)}),i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"6px",flexWrap:"wrap"},children:[i.jsxs("button",{type:"button",onClick:()=>{S(1),y(ae)},style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"5px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--primary)",background:"transparent",color:"var(--primary)",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(vi,{size:12})," View participants"]}),i.jsx("button",{type:"button",title:"Edit list",onClick:()=>K(ae),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",cursor:"pointer"},children:i.jsx(Ii,{size:13})}),i.jsx("button",{type:"button",title:"Delete list",onClick:()=>B({id:ae._id,name:ae.name}),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"30px",height:"30px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--destructive)",cursor:"pointer"},children:i.jsx(gn,{size:13})})]})]},ae._id))]}),p&&i.jsxs(i.Fragment,{children:[i.jsx("div",{onClick:()=>y(null),style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.50)",zIndex:200}}),i.jsxs("div",{style:{position:"fixed",top:0,right:0,height:"100%",width:"min(520px,100vw)",background:"var(--card)",zIndex:201,display:"flex",flexDirection:"column",boxShadow:"-4px 0 40px rgba(0,0,0,0.20)"},children:[i.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)",flexShrink:0,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px"},children:[i.jsxs("div",{style:{minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"0 0 4px"},children:"Participants in list"}),i.jsx("h2",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:p.name}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"6px 0 0"},children:[p.type==="rule_based"?"Rule-based":"Fixed"," · ",_," ",_===1?"person":"people"]})]}),i.jsx("button",{type:"button",onClick:()=>y(null),title:"Close",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"28px",height:"28px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",color:"var(--muted)"},children:i.jsx(er,{size:14})})]}),i.jsxs("div",{style:{flex:1,overflowY:"auto"},children:[b?i.jsx("p",{style:{padding:"24px",fontSize:"var(--text-sm)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"Loading…"}):i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx("thead",{children:i.jsx("tr",{style:{background:"var(--secondary)",borderBottom:"1px solid var(--border)"},children:["Name","Email","Organization","Status"].map(ae=>i.jsx("th",{style:{textAlign:"left",padding:"10px 14px",fontWeight:"600",color:"var(--muted)",fontSize:"10px",textTransform:"uppercase"},children:ae},ae))})}),i.jsx("tbody",{children:m.map((ae,le)=>i.jsxs("tr",{style:{borderBottom:"1px solid var(--border)"},children:[i.jsx("td",{style:{padding:"10px 14px"},children:ae.name}),i.jsx("td",{style:{padding:"10px 14px",color:"var(--muted)",wordBreak:"break-word"},children:ae.email||"—"}),i.jsx("td",{style:{padding:"10px 14px",color:"var(--muted)"},children:ae.organization||"—"}),i.jsx("td",{style:{padding:"10px 14px"},children:PIe(ae.status)})]},`${ae.participantId??"s"}-${le}`))})]}),!b&&m.length===0&&i.jsx("p",{style:{padding:"20px",color:"var(--muted)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"No participants in this list."})]}),p&&!b&&_>O&&i.jsxs("div",{style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",gap:"12px",padding:"14px 16px",borderTop:"1px solid var(--border)"},children:[i.jsxs("button",{type:"button",disabled:k<=1,onClick:()=>S(ae=>Math.max(1,ae-1)),style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:k<=1?"not-allowed":"pointer",opacity:k<=1?.5:1,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(Nf,{size:16})," Previous"]}),i.jsxs("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[k," / ",Y," · ",_," total"]}),i.jsxs("button",{type:"button",disabled:k>=Y,onClick:()=>S(ae=>ae+1),style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:k>=Y?"not-allowed":"pointer",opacity:k>=Y?.5:1,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:["Next ",i.jsx(va,{size:16})]})]})]})]}),T&&i.jsx("div",{role:"dialog","aria-modal":"true",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",zIndex:210,display:"flex",alignItems:"center",justifyContent:"center",padding:"16px"},onClick:G,children:i.jsxs("div",{style:{width:"100%",maxWidth:"420px",background:"var(--card)",borderRadius:"var(--radius-card)",border:"1px solid var(--border)",boxShadow:"var(--shadow-xl)",padding:"22px"},onClick:ae=>ae.stopPropagation(),children:[i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-lg)",fontWeight:"var(--font-weight-medium)",margin:"0 0 16px",color:"var(--foreground)"},children:"Edit list"}),U&&i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--destructive)",fontFamily:"var(--font-noto-sans)",margin:"0 0 12px"},children:U}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Name",required:!0}),i.jsx("input",{style:$t,value:I,onChange:ae=>E(ae.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Description"}),i.jsx("textarea",{style:{...$t,resize:"vertical",minHeight:"72px"},value:A,onChange:ae=>F(ae.target.value),onFocus:kt,onBlur:_t})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Visibility",required:!0}),i.jsx(go,{name:"plEditVis",value:L,onChange:ae=>z(ae),options:[{label:"Private",value:"Private"},{label:"Shared",value:"Shared"}]})]})]}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"10px",marginTop:"22px",paddingTop:"16px",borderTop:"1px solid var(--border)"},children:[i.jsx("button",{type:"button",onClick:G,disabled:V,style:{padding:"7px 16px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:V?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"Cancel"}),i.jsx("button",{type:"button",onClick:()=>void re(),disabled:V,style:{padding:"7px 16px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",cursor:V?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:V?"Saving…":"Save"})]})]})}),H&&i.jsx(cb,{title:"Delete list",message:`Delete “${H.name}”? Participants in your database are not removed—only this list is deleted.`,confirmLabel:"Delete",variant:"danger",onConfirm:()=>void J(),onCancel:()=>B(null)}),l&&i.jsx(OQ,{editList:u,onClose:()=>{c(!1),d(null)},onCreated:()=>{q(),$("Custom list created.")},onSaved:ae=>{q(),$(`Updated “${ae.name}”.`),(p==null?void 0:p._id)===ae._id&&y(ae)}},(u==null?void 0:u._id)??"new-list-panel"),i.jsx(qh,{})]})}function NIe(e){return e==="feedback"?"Feedback":e==="registration"?"Registration":e==="other"||e==="survey"||e==="custom"?"Other":e}function MW(e){var r;const t=e.event;return!t||typeof t=="string"?"—":((r=t.name)==null?void 0:r.trim())||"—"}function RIe(e){if(Array.isArray(e))return e.map(t=>{if(!t||typeof t!="object")return t;const{_id:r,__v:n,...o}=t;return o})}function LIe(e){if(!e||typeof e!="object")return e;const{_id:t,__v:r,...n}=e;return n}function FIe({subPage:e}){const{user:t}=Ur(),r=zn(t),n=!!r||(t==null?void 0:t.role)==="super_admin",o=e==="forms-feedback"?"Feedback":e==="forms-registration"?"Registration":e==="forms-other"?"Other":null,[a,s]=j.useState([]),[l,c]=j.useState(!1),[u,d]=j.useState(null),[f,h]=j.useState(!1),[p,y]=j.useState(!1),[m,x]=j.useState(!1),[b,w]=j.useState(null),[k,S]=j.useState(null),[_,P]=j.useState(null),[O,T]=j.useState(null),[R,I]=j.useState(null),[E,A]=j.useState(null),F=q=>`${window.location.origin.replace(/\/$/,"")}/form/${q}`,L="Public form link copied to clipboard.",z=q=>{const Y=F(q);navigator.clipboard.writeText(Y).then(()=>{A(q),T(L),window.setTimeout(()=>{A(null),T(K=>K===L?null:K)},4e3)}).catch(()=>{T("Could not copy to clipboard. Check browser permissions or copy the link manually.")})},V=j.useCallback(async()=>{if(!n){s([]);return}if(!r){s([]);return}c(!0);try{const q=await Ma.list({organization:r});s(q)}catch{s([])}finally{c(!1)}},[n,r]);j.useEffect(()=>{V()},[V]);const Q=o==="Feedback"?a.filter(q=>q.type==="feedback"):o==="Registration"?a.filter(q=>q.type==="registration"):o==="Other"?a.filter(q=>q.type==="other"||q.type==="survey"||q.type==="custom"):a,U=()=>{w(null),o==="Registration"?y(!0):o==="Other"?x(!0):h(!0)},ee=q=>{w(q);const Y=a.find(K=>K._id===q);(Y==null?void 0:Y.type)==="registration"?y(!0):(Y==null?void 0:Y.type)==="other"||(Y==null?void 0:Y.type)==="survey"||(Y==null?void 0:Y.type)==="custom"?x(!0):h(!0)},H=()=>{V(),h(!1),y(!1),x(!1),w(null),T("Form saved.")},B=async()=>{if(!k)return;const q=k._id,Y=k.name;P(q);try{await Ma.remove(q),S(null),T(`Deleted “${Y}”.`),await V()}catch{T("Could not delete the form. Try again.")}finally{P(null)}},M=async q=>{P(q._id),T(null);try{const Y=await Ma.get(q._id),K=Y.event?typeof Y.event=="string"?Y.event:Y.event._id:null;if(!K){T("This form has no event. Edit it to attach an event, then duplicate.");return}const G=(Y.name||"Form").trim(),re=G.toLowerCase().endsWith(" (copy)")?`${G} (2)`:`${G} (Copy)`;await Ma.create({name:re,type:Y.type,description:Y.description??"",fields:RIe(Y.fields),settings:LIe(Y.settings),event:String(K)}),T(`Duplicated as “${re}”.`),await V()}catch(Y){const K=Y instanceof Error?Y.message:"Could not duplicate the form. Try again.";T(K)}finally{P(null)}},$=e==="forms-add"?"Add New Form":o??"All Forms";return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[i.jsxs("div",{children:[i.jsx("p",{style:Wh,children:"Portfolio · Forms & Workflow"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:$})]}),n?i.jsxs("button",{onClick:U,style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:13})," Create Form"]}):null]}),O?i.jsx("p",{role:"status","aria-live":"polite",style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)",margin:0,padding:"10px 14px",borderRadius:"var(--radius-card)",background:O===L?"#dcfce7":"var(--secondary)",border:O===L?"1px solid #86efac":"1px solid var(--border)"},children:O}):null,n?e==="forms-add"?i.jsx("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"32px"},children:i.jsx(RW,{icon:i.jsx(lh,{size:40}),title:"Form Builder",description:"Drag and drop fields to build your custom form. Choose from registration, feedback, other forms, and more.",cta:"Start Building",onCta:()=>{}})}):i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:[i.jsx("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1.2fr) minmax(0, 1fr) 100px 90px 80px minmax(200px, 1.1fr)",padding:"8px 16px",background:"var(--secondary)",borderBottom:"1px solid var(--border)",gap:"6px"},children:["Form Name","Event","Type","Submissions","Status",""].map(q=>i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:q},q))}),l?i.jsx("div",{style:{padding:"24px",color:"var(--muted)",fontSize:"var(--text-sm)"},children:"Loading forms…"}):Q.map(q=>{var re;const Y=((re=q.settings)==null?void 0:re.isActive)!==!1?"Active":"Draft",K=Y==="Active"?{bg:"#dcfce7",color:"#15803d"}:Y==="Draft"?{bg:"var(--secondary)",color:"var(--muted)"}:{bg:"#f1f5f9",color:"#475569"},G=q._id;return i.jsxs("div",{onMouseEnter:()=>d(G),onMouseLeave:()=>d(null),style:{display:"grid",gridTemplateColumns:"minmax(0, 1.2fr) minmax(0, 1fr) 100px 90px 80px minmax(200px, 1.1fr)",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border)",background:u===G?"var(--secondary)":"var(--card)",transition:"background 0.12s",gap:"6px"},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:q.name,children:q.name}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:MW(q),children:MW(q)}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:NIe(q.type)}),i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-sm)",color:"var(--foreground)"},children:(q.submissionCount??0).toLocaleString()}),i.jsx("span",{style:{display:"inline-flex",width:"fit-content",padding:"2px 8px",borderRadius:"999px",background:K.bg,color:K.color,fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600"},children:Y}),i.jsxs("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",justifyContent:"flex-end"},children:[i.jsx("button",{type:"button",title:E===G?"Copied to clipboard":"Copy public form link",onClick:()=>z(G),disabled:_===G,style:{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:E===G?"#dcfce7":"var(--card)",color:E===G?"#15803d":"var(--muted)",cursor:_===G?"not-allowed":"pointer",opacity:_===G?.6:1},onMouseEnter:J=>{E!==G&&(J.currentTarget.style.borderColor="var(--primary)",J.currentTarget.style.color="var(--primary)")},onMouseLeave:J=>{E!==G&&(J.currentTarget.style.borderColor="var(--border)",J.currentTarget.style.color="var(--muted)")},children:E===G?i.jsx(Oi,{size:12,strokeWidth:3}):i.jsx(Q3,{size:12})}),i.jsx("button",{type:"button",title:"Submissions",onClick:()=>I(q),disabled:_===G,style:{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",cursor:_===G?"not-allowed":"pointer",opacity:_===G?.6:1},onMouseEnter:J=>{J.currentTarget.style.borderColor="var(--primary)",J.currentTarget.style.color="var(--primary)"},onMouseLeave:J=>{J.currentTarget.style.borderColor="var(--border)",J.currentTarget.style.color="var(--muted)"},children:i.jsx(sb,{size:12})}),i.jsx("button",{type:"button",title:"Edit",onClick:()=>ee(G),disabled:_===G,style:{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",cursor:_===G?"not-allowed":"pointer",opacity:_===G?.6:1},onMouseEnter:J=>{J.currentTarget.style.borderColor="var(--primary)",J.currentTarget.style.color="var(--primary)"},onMouseLeave:J=>{J.currentTarget.style.borderColor="var(--border)",J.currentTarget.style.color="var(--muted)"},children:i.jsx(Ii,{size:12})}),i.jsx("button",{type:"button",title:"Duplicate",onClick:()=>void M(q),disabled:_===G,style:{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",cursor:_===G?"not-allowed":"pointer",opacity:_===G?.6:1},onMouseEnter:J=>{J.currentTarget.style.borderColor="var(--primary)",J.currentTarget.style.color="var(--primary)"},onMouseLeave:J=>{J.currentTarget.style.borderColor="var(--border)",J.currentTarget.style.color="var(--muted)"},children:i.jsx(iu,{size:12})}),i.jsx("button",{type:"button",title:"Delete",onClick:()=>{T(null),S(q)},disabled:_===G,style:{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--destructive)",cursor:_===G?"not-allowed":"pointer",opacity:_===G?.6:1},onMouseEnter:J=>{J.currentTarget.style.borderColor="var(--destructive)",J.currentTarget.style.color="var(--destructive)"},onMouseLeave:J=>{J.currentTarget.style.borderColor="var(--border)",J.currentTarget.style.color="var(--destructive)"},children:i.jsx(gn,{size:12})})]})]},G)})]}):i.jsx("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"32px"},children:i.jsx(RW,{icon:i.jsx(lh,{size:40}),title:"Organization required",description:"Forms are managed at the organization level. Your account needs to be linked to an organization."})}),k?i.jsx(cb,{title:"Delete form",message:`Delete “${k.name}”? Submissions stored for this form will no longer be linked to a form definition.`,confirmLabel:"Delete",variant:"danger",onConfirm:()=>void B(),onCancel:()=>S(null)}):null,i.jsx(qh,{}),f&&n&&i.jsx(o3,{formId:b??void 0,mode:"feedback",onClose:()=>{h(!1),w(null)},onSuccess:H}),p&&n&&i.jsx(o3,{formId:b??void 0,mode:"registration",onClose:()=>{y(!1),w(null)},onSuccess:H}),m&&n&&i.jsx(o3,{formId:b??void 0,mode:"other",onClose:()=>{x(!1),w(null)},onSuccess:H}),R?i.jsx(cTe,{formId:R._id,formName:R.name,onClose:()=>I(null)}):null]})}function MIe(e){return e==null||Number.isNaN(e)?"—":e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function DIe(e){const t=e.type;return t==="image"?"Image":t==="pdf"?"PDF":t==="video"?"Video":"Other"}function DW(e){if(!e)return"—";try{return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}catch{return"—"}}function zIe({subPage:e}){const{user:t}=Ur(),r=zn(t),n=!!r||(t==null?void 0:t.role)==="super_admin",o=e==="content-collections",[a,s]=j.useState(null),[l,c]=j.useState(!1),[u,d]=j.useState(!1),[f,h]=j.useState(null),[p,y]=j.useState([]),[m,x]=j.useState([]),[b,w]=j.useState(!1),k=j.useCallback(async()=>{if(n){if(!r){y([]);return}w(!0);try{const{media:P}=await vq({limit:400,organization:r});y(P)}catch{y([])}finally{w(!1)}}},[n,r]),S=j.useCallback(async()=>{if(n){if(!r){x([]);return}w(!0);try{const P=await I0.list({organization:r});x(P)}catch{x([])}finally{w(!1)}}},[n,r]);j.useEffect(()=>{o?S():k()},[o,S,k]);const _=()=>{o?S():k()};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[i.jsxs("div",{children:[i.jsx("p",{style:Wh,children:"Portfolio · Content"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:o?"Collections":"Library"})]}),n&&i.jsx("div",{style:{display:"flex",gap:"8px"},children:i.jsxs("button",{type:"button",onClick:()=>{o?(h(null),d(!0)):c(!0)},style:{display:"flex",alignItems:"center",gap:"5px",padding:"7px 14px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",transition:"opacity 0.15s"},onMouseEnter:P=>{P.currentTarget.style.opacity="0.88"},onMouseLeave:P=>{P.currentTarget.style.opacity="1"},children:[i.jsx(wr,{size:13})," ",o?"New Collection":"Add Files"]})})]}),n?i.jsx("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:b?i.jsx("div",{style:{padding:"20px",color:"var(--muted)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"Loading…"}):o?i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 80px 100px 56px",padding:"8px 16px",background:"var(--secondary)",borderBottom:"1px solid var(--border)"},children:["Collection","Items","Created",""].map(P=>i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:P},P))}),m.length===0?i.jsx("div",{style:{padding:"24px",textAlign:"center",color:"var(--muted)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"No collections yet."}):m.map(P=>{var O;return i.jsxs("div",{onMouseEnter:()=>s(P._id),onMouseLeave:()=>s(null),style:{display:"grid",gridTemplateColumns:"1fr 80px 100px 56px",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border)",background:a===P._id?"var(--secondary)":"var(--card)",transition:"background 0.12s",cursor:"default"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[i.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"var(--radius-button)",background:"var(--accent)",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx(N0,{size:14,style:{color:"var(--primary)"}})}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:P.name})]}),i.jsx("span",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-sm)",color:"var(--foreground)"},children:((O=P.contentIds)==null?void 0:O.length)??0}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:DW(P.createdAt)}),i.jsx("div",{style:{display:"flex",justifyContent:"flex-end",opacity:a===P._id?1:0,transition:"opacity 0.15s"},children:i.jsx("button",{type:"button",title:"Edit collection",onClick:T=>{T.stopPropagation(),h(P),d(!0)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",color:"var(--muted)"},onMouseEnter:T=>{T.currentTarget.style.borderColor="var(--primary)",T.currentTarget.style.color="var(--primary)"},onMouseLeave:T=>{T.currentTarget.style.borderColor="var(--border)",T.currentTarget.style.color="var(--muted)"},children:i.jsx(Ii,{size:14})})})]},P._id)})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 80px 80px 80px 50px",padding:"8px 16px",background:"var(--secondary)",borderBottom:"1px solid var(--border)"},children:["File","Type","Size","Added",""].map(P=>i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:P},P))}),p.length===0?i.jsx("div",{style:{padding:"24px",textAlign:"center",color:"var(--muted)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"No files yet. Use Add Files to upload."}):p.map(P=>i.jsxs("div",{onMouseEnter:()=>s(P._id),onMouseLeave:()=>s(null),style:{display:"grid",gridTemplateColumns:"1fr 80px 80px 80px 50px",alignItems:"center",padding:"11px 16px",borderBottom:"1px solid var(--border)",background:a===P._id?"var(--secondary)":"var(--card)",transition:"background 0.12s"},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--foreground)"},children:P.name}),i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",background:"var(--secondary)",padding:"1px 6px",borderRadius:"3px",width:"fit-content"},children:DIe(P)}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:MIe(P.size)}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:DW(P.createdAt)}),i.jsx("div",{style:{opacity:a===P._id?1:0,transition:"opacity 0.15s"},children:P.url&&i.jsx("a",{href:P.url,target:"_blank",rel:"noopener noreferrer",title:"Open / download",style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex"},onClick:O=>O.stopPropagation(),children:i.jsx(Al,{size:13})})})]},P._id))]})}):i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:"Associate your account with an organization to manage content."}),i.jsx(qh,{})]}),l&&n&&i.jsx(fTe,{onClose:()=>c(!1),onSuccess:()=>{_(),c(!1)}}),u&&n&&i.jsx(bTe,{editing:f,onClose:()=>{d(!1),h(null)},onSuccess:()=>{_(),d(!1),h(null)}},f?`edit-${f._id}`:"create")]})}function BIe({subPage:e}){return e==="messaging-email"?i.jsx(u9,{}):e==="messaging-whatsapp"?i.jsx(RTe,{}):i.jsx(u9,{})}const WIe={super_admin:"Super Admin",admin:"Admin",moderator:"Moderator",viewer:"Viewer"},qIe={super_admin:{bg:"#fef3c7",color:"#92400e"},admin:{bg:"var(--accent)",color:"var(--accent-foreground)"},moderator:{bg:"#dcfce7",color:"#15803d"},viewer:{bg:"var(--secondary)",color:"var(--muted)"}};function FX(e){var t;return e.firstName||e.lastName?[e.firstName,e.lastName].filter(Boolean).join(" ").trim():((t=e.email)==null?void 0:t.split("@")[0])??"User"}function $Ie(e){return FX(e).slice(0,2).toUpperCase()||"?"}function UIe(){const[e,t]=j.useState([]),[r,n]=j.useState(!0),[o,a]=j.useState(null),[s,l]=j.useState(!1),[c,u]=j.useState(null),d=j.useCallback(async()=>{var f;n(!0);try{const h=await nx.list();t(((f=h.data)==null?void 0:f.users)??[])}catch{t([])}finally{n(!1)}},[]);return j.useEffect(()=>{d()},[d]),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},children:[i.jsxs("div",{children:[i.jsx("p",{style:Wh,children:"Portfolio"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:"User Management"}),i.jsxs("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"4px"},children:[e.length," users across the platform"]})]}),i.jsxs("button",{onClick:()=>{u(null),l(!0)},style:{display:"flex",alignItems:"center",gap:"5px",padding:"8px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:13})," Invite User"]})]}),i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:[i.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1.6fr 120px 80px 60px",padding:"8px 16px",background:"var(--secondary)",borderBottom:"1px solid var(--border)"},children:["User","Email","Role","Events",""].map(f=>i.jsx("span",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.05em"},children:f},f))}),r?i.jsx("div",{style:{padding:"24px",color:"var(--muted)",fontSize:"var(--text-sm)"},children:"Loading users…"}):e.map((f,h)=>{const p=qIe[f.role]??{bg:"var(--secondary)",color:"var(--muted)"},y=jw[h%jw.length],m=f.role==="super_admin"||f.role==="admin"?"All":"—";return i.jsxs("div",{onMouseEnter:()=>a(f._id),onMouseLeave:()=>a(null),style:{display:"grid",gridTemplateColumns:"1fr 1.6fr 120px 80px 60px",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--border)",background:o===f._id?"var(--secondary)":"var(--card)",transition:"background 0.12s"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[i.jsx("div",{style:{width:"30px",height:"30px",borderRadius:"50%",background:y,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:i.jsx("span",{style:{color:"#fff",fontSize:"10px",fontFamily:"var(--font-inter)",fontWeight:"600"},children:$Ie(f)})}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:FX(f)})]}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:f.email}),i.jsx("span",{style:{display:"inline-flex",width:"fit-content",padding:"2px 8px",borderRadius:"999px",background:p.bg,color:p.color,fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600"},children:WIe[f.role]??f.role}),i.jsx("span",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--foreground)"},children:m}),i.jsx("div",{style:{display:"flex",gap:"4px",opacity:o===f._id?1:0,transition:"opacity 0.15s"},children:i.jsx("button",{type:"button",onClick:()=>{u(f),l(!0)},style:{width:"26px",height:"26px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--muted)",cursor:"pointer"},onMouseEnter:x=>{x.currentTarget.style.borderColor="var(--primary)",x.currentTarget.style.color="var(--primary)"},onMouseLeave:x=>{x.currentTarget.style.borderColor="var(--border)",x.currentTarget.style.color="var(--muted)"},children:i.jsx(Ii,{size:11})})})]},f._id)})]}),i.jsx(qh,{}),s&&i.jsx(FTe,{editUser:c,onClose:()=>{l(!1),u(null)},onSuccess:d})]})}function qh(){return i.jsx("div",{style:{paddingTop:"8px",borderTop:"1px solid var(--border)",textAlign:"center"},children:i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"© 2026 Stratawiz Technologies Pvt Ltd · EventBuzz"})})}const HIe=[{id:"razorpay",label:"Razorpay"},{id:"payu",label:"PayU"},{id:"ccavenue",label:"CCAvenue"},{id:"cashfree",label:"Cashfree"},{id:"stripe",label:"Stripe"},{id:"paytm",label:"Paytm"}],Fs={width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",outline:"none",boxSizing:"border-box"};function d0({active:e,children:t,onClick:r}){return i.jsx("button",{type:"button",onClick:r,style:{padding:"8px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:e?"var(--accent)":"var(--card)",color:e?"var(--primary)":"var(--card-foreground)",fontSize:"var(--text-sm)",cursor:"pointer",fontFamily:"var(--font-noto-sans)"},children:t})}function VIe(){const{user:e}=Ur(),t=(e==null?void 0:e.role)==="super_admin",[r,n]=j.useState("checkout"),[o,a]=j.useState(null),[s,l]=j.useState(null),[c,u]=j.useState([]),[d,f]=j.useState(0),[h,p]=j.useState(1),[y,m]=j.useState(""),[x,b]=j.useState(!0),[w,k]=j.useState(""),[S,_]=j.useState("razorpay"),[P,O]=j.useState(""),[T,R]=j.useState(""),[I,E]=j.useState(""),[A,F]=j.useState(""),[L,z]=j.useState(""),[V,Q]=j.useState(""),[U,ee]=j.useState(""),H=j.useCallback(async()=>{const re=await Bu.getOrgProfile();re.data?(a(re.data),ee(re.data.platformCommissionBps??"")):a(null)},[]),B=j.useCallback(async()=>{if(!t)return;const re=await Bu.getPlatformConfig();re.data&&l(re.data)},[t]),M=j.useCallback(async()=>{const re=await Bu.listTransactions({q:y||void 0,page:h,limit:20});re.data&&(u(re.data.transactions),f(re.data.total))},[y,h]);j.useEffect(()=>{let re=!1;return(async()=>{b(!0),k("");try{await H(),t&&await B()}catch{re||k("Failed to load payment settings")}finally{re||b(!1)}})(),()=>{re=!0}},[H,B,t]),j.useEffect(()=>{r==="ledger"&&M()},[r,M]),j.useEffect(()=>{r==="platform"&&t&&!s&&B()},[r,t,s,B]);const $=async()=>{if(!t||!o)return;k("");const re=await Bu.updateOrgProfile({checkoutMode:o.checkoutMode,platformCommissionBps:U===""?null:Number(U),defaultCurrency:o.defaultCurrency,taxRate:o.taxRate,taxType:o.taxType||""});if(re.error){k(re.error);return}re.data&&a(re.data)},q=async()=>{if(!t)return;k("");const re=await Bu.updatePlatformConfig({enabled:s==null?void 0:s.enabled,testMode:s==null?void 0:s.testMode,defaultCommissionBps:s==null?void 0:s.defaultCommissionBps,razorpayKeyId:A||void 0,razorpayKeySecret:L||void 0,webhookSecret:V||void 0});if(re.error){k(re.error);return}re.data&&l(re.data),F(""),z(""),Q("")},Y=async()=>{var ae;if(!t)return;k("");const re=S==="razorpay"?{keyId:T.trim(),keySecret:I.trim()}:{},J=await Bu.addGateway({provider:S,label:P||S,credentials:re,isPrimary:((ae=o==null?void 0:o.gateways)==null?void 0:ae.length)===0});if(J.error){k(J.error);return}J.data&&a(J.data),R(""),E(""),O("")},K=async re=>{if(!t)return;const J=await Bu.patchGateway(re,{isPrimary:!0});J.data&&a(J.data)},G=async re=>{if(!t||!confirm("Remove this gateway?"))return;const J=await Bu.deleteGateway(re);J.data&&a(J.data)};return e?x?i.jsx("p",{style:{color:"var(--muted)"},children:"Loading…"}):!o&&!t?i.jsx("p",{style:{color:"var(--muted)"},children:"No organisation linked to your account."}):i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"18px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"4px"},children:"Portfolio"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",margin:0},children:"Payment Settings"}),i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",marginTop:"6px"},children:"Platform Razorpay with commission, or your own gateways. Bookings use the active configuration."})]}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px"},children:[i.jsx(d0,{active:r==="checkout",onClick:()=>n("checkout"),children:"Checkout"}),i.jsx(d0,{active:r==="gateways",onClick:()=>n("gateways"),children:"Gateways"}),i.jsx(d0,{active:r==="ledger",onClick:()=>n("ledger"),children:"Transactions"}),t&&i.jsx(d0,{active:r==="platform",onClick:()=>n("platform"),children:"Platform Razorpay"})]}),w&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-sm)",margin:0},children:w}),r==="checkout"&&!o&&t&&i.jsx("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"20px"},children:i.jsxs("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",margin:0},children:["Organisation checkout settings need an account linked to an organisation. You can still configure ",i.jsx("strong",{children:"Platform Razorpay"})," for all orgs using platform checkout."]})}),r==="checkout"&&o&&i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"20px"},children:[i.jsx("h3",{style:{fontSize:"var(--text-sm)",margin:"0 0 12px"},children:"Checkout mode"}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"12px"},children:[i.jsx("strong",{children:"Platform"}),": charges use EventBuzz Razorpay; commission (basis points) is added to the ticket subtotal. ",i.jsx("strong",{children:"Custom"}),": your primary active gateway (Razorpay fully supported; others coming soon)."]}),i.jsxs("select",{disabled:!t,style:{...Fs,maxWidth:"280px",marginBottom:"12px"},value:o.checkoutMode,onChange:re=>a({...o,checkoutMode:re.target.value}),children:[i.jsx("option",{value:"platform_razorpay",children:"Platform Razorpay (+ commission)"}),i.jsx("option",{value:"custom",children:"My gateways"})]}),i.jsxs("div",{style:{marginBottom:"12px"},children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Commission override (basis points, 200 = 2%). Blank = platform default."}),i.jsx("input",{disabled:!t,type:"number",style:{...Fs,maxWidth:"200px",marginTop:"4px"},value:U,onChange:re=>ee(re.target.value===""?"":Number(re.target.value))})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px",marginBottom:"12px"},children:[i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Default currency"}),i.jsx("input",{disabled:!t,style:{...Fs,marginTop:"4px"},value:o.defaultCurrency,onChange:re=>a({...o,defaultCurrency:re.target.value})})]}),i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Tax type"}),i.jsx("input",{disabled:!t,style:{...Fs,marginTop:"4px"},value:o.taxType||"",onChange:re=>a({...o,taxType:re.target.value})})]})]}),t&&i.jsx("button",{type:"button",onClick:()=>void $(),style:{padding:"8px 16px",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",borderRadius:"var(--radius-button)",cursor:"pointer"},children:"Save checkout settings"}),!t&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Only super administrators can change checkout settings."})]}),r==="gateways"&&!o&&t&&i.jsx("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"20px"},children:i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",margin:0},children:"Add an organisation to your account to manage custom payment gateways."})}),r==="gateways"&&o&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"20px"},children:[i.jsx("h3",{style:{fontSize:"var(--text-sm)",margin:"0 0 12px"},children:"Configured gateways"}),o.gateways.length===0?i.jsx("p",{style:{color:"var(--muted)",fontSize:"var(--text-sm)"},children:"No custom gateways yet."}):i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:o.gateways.map(re=>i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)"},children:[i.jsxs("div",{children:[i.jsx("strong",{style:{fontSize:"var(--text-sm)"},children:re.label||re.provider}),i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",marginLeft:"8px"},children:re.provider}),re.isPrimary&&i.jsx("span",{style:{fontSize:"10px",marginLeft:"8px",padding:"2px 6px",background:"var(--accent)",borderRadius:"4px"},children:"Primary"}),re.credentialsPublic&&re.credentialsPublic.keyId&&i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"4px 0 0"},children:["Key: ",re.credentialsPublic.keyId]})]}),t&&i.jsxs("div",{style:{display:"flex",gap:"6px"},children:[!re.isPrimary&&i.jsx("button",{type:"button",onClick:()=>void K(re._id),style:{fontSize:"var(--text-xs)",padding:"6px 10px",cursor:"pointer"},children:"Set primary"}),i.jsx("button",{type:"button",onClick:()=>void G(re._id),style:{color:"var(--destructive)",background:"none",border:"none",cursor:"pointer"},children:i.jsx(gn,{size:16})})]})]},re._id))})]}),t&&i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"20px"},children:[i.jsx("h3",{style:{fontSize:"var(--text-sm)",margin:"0 0 12px"},children:"Add gateway"}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px",maxWidth:"520px"},children:[i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Provider"}),i.jsx("select",{style:{...Fs,marginTop:"4px"},value:S,onChange:re=>_(re.target.value),children:HIe.map(re=>i.jsx("option",{value:re.id,children:re.label},re.id))})]}),i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Label"}),i.jsx("input",{style:{...Fs,marginTop:"4px"},value:P,onChange:re=>O(re.target.value),placeholder:"Display name"})]})]}),S==="razorpay"&&i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px",marginTop:"12px",maxWidth:"520px"},children:[i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Key ID"}),i.jsx("input",{style:{...Fs,marginTop:"4px"},value:T,onChange:re=>R(re.target.value)})]}),i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Key secret"}),i.jsx("input",{type:"password",style:{...Fs,marginTop:"4px"},value:I,onChange:re=>E(re.target.value)})]})]}),S!=="razorpay"&&i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",marginTop:"12px"},children:["Gateway setup for ",S," is a stub until SDK wiring is complete. Razorpay is supported for live orders."]}),i.jsxs("button",{type:"button",onClick:()=>void Y(),style:{marginTop:"14px",display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 16px",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",borderRadius:"var(--radius-button)",cursor:"pointer"},children:[i.jsx(wr,{size:14})," Add"]})]})]}),r==="ledger"&&i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"20px"},children:[i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"10px",alignItems:"center",marginBottom:"14px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",flex:"1 1 200px"},children:[i.jsx(Pi,{size:16,style:{color:"var(--muted)"}}),i.jsx("input",{style:Fs,placeholder:"Search order / payment id",value:y,onChange:re=>m(re.target.value),onKeyDown:re=>{re.key==="Enter"&&(p(1),M())}})]}),i.jsx("button",{type:"button",onClick:()=>{p(1),M()},style:{padding:"8px 14px",cursor:"pointer",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)"},children:"Search"}),i.jsxs("button",{type:"button",onClick:()=>void Bu.downloadTransactionsCsv({q:y}),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 14px",cursor:"pointer",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)"},children:[i.jsx(Al,{size:14})," Export CSV"]})]}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"8px"},children:["Amounts in smallest currency unit (e.g. paise). ",d," total."]}),i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--text-xs)"},children:[i.jsx("thead",{children:i.jsx("tr",{style:{textAlign:"left",borderBottom:"1px solid var(--border)"},children:["Date","Status","Gross","Commission","Net","Gateway","Event","Participant","Order","Payment"].map(re=>i.jsx("th",{style:{padding:"8px 6px",color:"var(--muted)",fontWeight:600},children:re},re))})}),i.jsx("tbody",{children:c.map(re=>{var J,ae;return i.jsxs("tr",{style:{borderBottom:"1px solid var(--border)"},children:[i.jsx("td",{style:{padding:"8px 6px"},children:re.createdAt?new Date(re.createdAt).toLocaleString():"—"}),i.jsx("td",{style:{padding:"8px 6px"},children:re.status}),i.jsx("td",{style:{padding:"8px 6px"},children:re.amountGross}),i.jsx("td",{style:{padding:"8px 6px"},children:re.commissionAmount}),i.jsx("td",{style:{padding:"8px 6px"},children:re.amountNet}),i.jsx("td",{style:{padding:"8px 6px"},children:re.gatewayProvider}),i.jsx("td",{style:{padding:"8px 6px"},children:typeof re.event=="object"&&((J=re.event)!=null&&J.name)?re.event.name:"—"}),i.jsx("td",{style:{padding:"8px 6px"},children:typeof re.participant=="object"&&((ae=re.participant)!=null&&ae.email)?re.participant.email:"—"}),i.jsx("td",{style:{padding:"8px 6px",fontFamily:"monospace",fontSize:"10px"},children:re.externalOrderId||"—"}),i.jsx("td",{style:{padding:"8px 6px",fontFamily:"monospace",fontSize:"10px"},children:re.externalPaymentId||"—"})]},re._id)})})]})}),d>20&&i.jsxs("div",{style:{display:"flex",gap:"8px",marginTop:"12px"},children:[i.jsx("button",{type:"button",disabled:h<=1,onClick:()=>p(re=>Math.max(1,re-1)),style:{padding:"6px 12px",cursor:"pointer"},children:"Previous"}),i.jsxs("span",{style:{fontSize:"var(--text-sm)"},children:["Page ",h]}),i.jsx("button",{type:"button",disabled:h*20>=d,onClick:()=>p(re=>re+1),style:{padding:"6px 12px",cursor:"pointer"},children:"Next"})]})]}),r==="platform"&&t&&!s&&i.jsx("p",{style:{color:"var(--muted)",fontSize:"var(--text-sm)"},children:"Could not load platform payment configuration. Try again or check your session."}),r==="platform"&&t&&s&&i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"20px"},children:[i.jsxs("h3",{style:{fontSize:"var(--text-sm)",margin:"0 0 8px",display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx(ov,{size:16})," System-wide Razorpay"]}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"14px"},children:["Used when organisations choose platform checkout. Masked key: ",s.razorpayKeyIdMasked||"—"," · Webhook: ",s.webhookConfigured?"configured":"not set"]}),i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"8px"},children:[i.jsx("input",{type:"checkbox",checked:s.enabled,onChange:re=>l({...s,enabled:re.target.checked})})," Enabled"]}),i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},children:[i.jsx("input",{type:"checkbox",checked:s.testMode,onChange:re=>l({...s,testMode:re.target.checked})})," Test mode"]}),i.jsxs("div",{style:{marginBottom:"12px"},children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Default commission (bps)"}),i.jsx("input",{type:"number",style:{...Fs,maxWidth:"200px",marginTop:"4px"},value:s.defaultCommissionBps,onChange:re=>l({...s,defaultCommissionBps:Number(re.target.value)})})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px",maxWidth:"560px"},children:[i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Key ID (update)"}),i.jsx("input",{style:{...Fs,marginTop:"4px"},value:A,onChange:re=>F(re.target.value),placeholder:"rzp_…"})]}),i.jsxs("div",{children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Key secret"}),i.jsx("input",{type:"password",style:{...Fs,marginTop:"4px"},value:L,onChange:re=>z(re.target.value)})]}),i.jsxs("div",{style:{gridColumn:"1 / -1"},children:[i.jsx("label",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Webhook secret"}),i.jsx("input",{type:"password",style:{...Fs,marginTop:"4px"},value:V,onChange:re=>Q(re.target.value)})]})]}),i.jsx("button",{type:"button",onClick:()=>void q(),style:{marginTop:"14px",padding:"8px 16px",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",borderRadius:"var(--radius-button)",cursor:"pointer"},children:"Save platform config"})]}),i.jsx("div",{style:{paddingTop:"8px",borderTop:"1px solid var(--border)",textAlign:"center"},children:i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Public checkout: POST /api/public/events/:eventId/payment/create-order"})})]}):i.jsx("p",{style:{color:"var(--muted)"},children:"Sign in to manage payments."})}const YIe=["participants","event_website","customise_event_website","custom_domain","invites_rsvp","registration_forms_with_custom_fields","custom_registration_workflow","email_confirmation_reminders","email_outreach_campaigns","custom_badge_and_print_file_creation","whatsapp_confirmation_reminders","bring_your_wa_number","custom_template_for_wa_messaging","agenda_builder","multi_track_agenda","speaker_management","abstract_management","ticketing_free_and_paid","collect_payment_using_your_upi_qr","payment_gateway_integration"],GIe=["qna_with_moderation","live_polls","multiple_quiz_modes","word_cloud","custom_theme","ai_summarization","ai_engagement_insights","content_management","ratings_for_sessions_and_speakers","feedback_forms_and_surveys","gamification","push_notifications"],MX=[{title:"MANAGE",keys:YIe},{title:"ENGAGE",keys:GIe}],sn={width:"100%",padding:"8px 12px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",background:"var(--input-background)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",outline:"none",boxSizing:"border-box"},wn=e=>{e.currentTarget.style.borderColor="var(--primary)",e.currentTarget.style.boxShadow="0 0 0 2px rgba(11,77,209,.10)"},Sn=e=>{e.currentTarget.style.borderColor="var(--border)",e.currentTarget.style.boxShadow="none"};function Zr({text:e,required:t}){return i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--card-foreground)",marginBottom:"5px"},children:[t&&i.jsx("span",{style:{color:"var(--destructive)",marginRight:"3px"},children:"*"}),e]})}function kw({text:e}){return i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"4px 0 0"},children:e})}function Jr({children:e}){return i.jsx("div",{style:{display:"flex",flexDirection:"column"},children:e})}function rb({children:e}){return i.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px"},children:e})}function Tl({children:e,title:t,subtitle:r,action:n}){return i.jsxs("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:[i.jsxs("div",{style:{padding:"16px 20px",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:t}),r&&i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"3px 0 0"},children:r})]}),n]}),i.jsx("div",{style:{padding:"20px"},children:e})]})}function lc({onSave:e,disabled:t}){const[r,n]=j.useState(!1),[o,a]=j.useState(""),[s,l]=j.useState(!1),c=async()=>{a(""),l(!0);try{await e(),n(!0),setTimeout(()=>n(!1),2e3)}catch(u){a(u instanceof Error?u.message:"Save failed")}finally{l(!1)}};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"6px"},children:[o&&i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)"},children:o}),i.jsx("button",{type:"button",disabled:t||s,onClick:()=>void c(),style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 16px",borderRadius:"var(--radius-button)",background:r?"#22c55e":"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:t||s?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",opacity:t||s?.6:1,transition:"background .2s"},children:r?i.jsxs(i.Fragment,{children:[i.jsx(Oi,{size:13})," Saved!"]}):i.jsxs(i.Fragment,{children:[i.jsx(Nw,{size:13})," ",s?"Saving…":"Save Changes"]})})]})}function $c({value:e,onChange:t,label:r}){return i.jsxs("label",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer",padding:"10px 0",borderBottom:"1px solid var(--border)"},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:r}),i.jsx("div",{onClick:()=>t(!e),style:{width:"36px",height:"20px",borderRadius:"99px",background:e?"var(--primary)":"var(--border)",position:"relative",transition:"background .2s",flexShrink:0,cursor:"pointer"},children:i.jsx("div",{style:{position:"absolute",top:"3px",left:e?"19px":"3px",width:"14px",height:"14px",borderRadius:"50%",background:"#fff",transition:"left .2s"}})})]})}const KIe=[{value:"en-IN",label:"English (India)"},{value:"en-US",label:"English (US)"},{value:"hi",label:"Hindi"},{value:"mr",label:"Marathi"}],QIe=[{id:"org",label:"Organisation",icon:i.jsx(nb,{size:15}),superOnly:!1},{id:"profile",label:"My Profile",icon:i.jsx(ym,{size:15}),superOnly:!1},{id:"notifications",label:"Notifications",icon:i.jsx(I6,{size:15}),superOnly:!1},{id:"email",label:"Email delivery",icon:i.jsx(Uf,{size:15}),superOnly:!1},{id:"whatsapp",label:"WhatsApp Cloud",icon:i.jsx(Zs,{size:15}),superOnly:!1},{id:"integrations",label:"Integrations",icon:i.jsx(Cq,{size:15}),superOnly:!0},{id:"security",label:"Security & Privacy",icon:i.jsx(id,{size:15}),superOnly:!1},{id:"billing",label:"Billing",icon:i.jsx(ov,{size:15}),superOnly:!1}];function zW(){return{emailRegistration:!0,emailFeedback:!0,emailPayment:!0,emailSummary:!1,pushRegistration:!0,pushSession:!0,pushMessage:!1,digestFrequency:"Daily"}}function XIe({canEdit:e}){const[t,r]=j.useState(!0),[n,o]=j.useState(null),[a,s]=j.useState(!1),l=j.useCallback(async()=>{r(!0);try{const y=await ls.get();o(y)}catch{o(null)}finally{r(!1)}},[]);j.useEffect(()=>{l()},[l]);const c=y=>{o(m=>m&&{...m,...y})},u=async()=>{if(!n||!e)return;const y=await ls.update({name:n.name,description:n.description,email:n.email,phone:n.phone,website:n.website,address:n.address,logo:n.logo,timezone:n.timezone,dateFormat:n.dateFormat,language:n.language});o(y)},d=async()=>{if(!n||!e)return;const y=await ls.update({timezone:n.timezone,dateFormat:n.dateFormat,language:n.language});o(y)},f=async y=>{if(!(!y||!e||!n)){s(!0);try{const m=await Ys(y,{eventId:"portfolio",module:"org/logo"});if(m!=null&&m.url){const x=await ls.update({logo:m.url});o(x)}}finally{s(!1)}}};if(t)return i.jsx("p",{style:{color:"var(--muted)",fontSize:"var(--text-sm)"},children:"Loading organisation…"});if(!n)return i.jsx("p",{style:{color:"var(--muted)",fontSize:"var(--text-sm)"},children:"No organisation linked to your account."});const h=(n.name||"O").charAt(0).toUpperCase(),p=!e;return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsx(Tl,{title:"Organisation Profile",subtitle:"Basic information about your organisation",action:e?i.jsx(lc,{onSave:u}):void 0,children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Organisation Logo"}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"14px"},children:[n.logo?i.jsx("img",{src:n.logo,alt:"",style:{width:56,height:56,borderRadius:"var(--radius-card)",objectFit:"cover",border:"1px solid var(--border)"}}):i.jsx("div",{style:{width:"56px",height:"56px",borderRadius:"var(--radius-card)",background:"var(--accent)",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-inter)",fontWeight:"700",fontSize:"18px",color:"var(--primary)",flexShrink:0},children:h}),i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"6px",padding:"6px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:p||a?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",opacity:p?.5:1},children:[i.jsx(ou,{size:13})," ",a?"Uploading…":"Upload Logo",i.jsx("input",{type:"file",accept:"image/*",disabled:p||a,style:{display:"none"},onChange:y=>{var m;return void f((m=y.target.files)==null?void 0:m[0])}})]})]})]}),i.jsxs(rb,{children:[i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Organisation Name",required:!0}),i.jsx("input",{style:sn,value:n.name??"",readOnly:p,onChange:y=>c({name:y.target.value}),onFocus:wn,onBlur:Sn})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Contact Email",required:!0}),i.jsx("input",{type:"email",style:sn,value:n.email??"",readOnly:p,onChange:y=>c({email:y.target.value}),onFocus:wn,onBlur:Sn})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Phone Number"}),i.jsx("input",{type:"tel",style:sn,value:n.phone??"",readOnly:p,onChange:y=>c({phone:y.target.value}),onFocus:wn,onBlur:Sn})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Website"}),i.jsx("input",{style:sn,value:n.website??"",readOnly:p,onChange:y=>c({website:y.target.value}),onFocus:wn,onBlur:Sn})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Address"}),i.jsx("input",{style:sn,value:n.address??"",readOnly:p,onChange:y=>c({address:y.target.value}),onFocus:wn,onBlur:Sn})]})]}),!e&&i.jsx(kw,{text:"Only super administrators can edit organisation settings."})]})}),i.jsx(Tl,{title:"Regional Settings",subtitle:"Configure timezone, date format, and language",action:e?i.jsx(lc,{onSave:d}):void 0,children:i.jsxs(rb,{children:[i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Timezone"}),i.jsx("select",{style:{...sn,cursor:p?"default":"pointer",appearance:"none",paddingRight:"32px"},disabled:p,value:n.timezone??"Asia/Kolkata",onChange:y=>c({timezone:y.target.value}),onFocus:wn,onBlur:Sn,children:["Asia/Kolkata","Asia/Dubai","UTC","US/Eastern","Europe/London"].map(y=>i.jsx("option",{value:y,children:y},y))})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Date Format"}),i.jsx("select",{style:{...sn,cursor:p?"default":"pointer",appearance:"none",paddingRight:"32px"},disabled:p,value:n.dateFormat??"DD/MM/YYYY",onChange:y=>c({dateFormat:y.target.value}),onFocus:wn,onBlur:Sn,children:["DD/MM/YYYY","MM/DD/YYYY","YYYY-MM-DD"].map(y=>i.jsx("option",{value:y,children:y},y))})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Language"}),i.jsx("select",{style:{...sn,cursor:p?"default":"pointer",appearance:"none",paddingRight:"32px"},disabled:p,value:n.language??"en-IN",onChange:y=>c({language:y.target.value}),onFocus:wn,onBlur:Sn,children:KIe.map(y=>i.jsx("option",{value:y.value,children:y.label},y.value))})]})]})})]})}function ZIe({user:e,refreshUser:t}){const[r,n]=j.useState(e.firstName??""),[o,a]=j.useState(e.lastName??""),[s,l]=j.useState(e.phone??""),[c,u]=j.useState(e.bio??""),[d,f]=j.useState(!1),[h,p]=j.useState(""),[y,m]=j.useState(""),[x,b]=j.useState("");j.useEffect(()=>{n(e.firstName??""),a(e.lastName??""),l(e.phone??""),u(e.bio??"")},[e._id,e.firstName,e.lastName,e.phone,e.bio]);const w=[e.firstName,e.lastName].filter(Boolean).map(_=>_.charAt(0)).join("").slice(0,2).toUpperCase()||"U",k=async()=>{const _=await Ia.updateMe({firstName:r,lastName:o,phone:s,bio:c});if(_.error)throw new Error(_.error);await t()},S=async()=>{if(y!==x)throw new Error("New passwords do not match");if(y.length<8)throw new Error("New password must be at least 8 characters");const _=await Ia.changePassword(h,y);if(_.error)throw new Error(_.error);p(""),m(""),b("")};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs(Tl,{title:"Personal Information",subtitle:"Your profile details visible to the team",action:i.jsx(lc,{onSave:k}),children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"14px",marginBottom:"18px"},children:[i.jsx("div",{style:{width:"56px",height:"56px",borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontFamily:"var(--font-inter)",fontWeight:"700",fontSize:"18px",flexShrink:0},children:e.profileImage?i.jsx("img",{src:e.profileImage,alt:"",style:{width:56,height:56,borderRadius:"50%",objectFit:"cover"}}):w}),i.jsx(kw,{text:"Profile photo upload can be added to /auth/me with profileImage URL later."})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[i.jsxs(rb,{children:[i.jsxs(Jr,{children:[i.jsx(Zr,{text:"First Name",required:!0}),i.jsx("input",{style:sn,value:r,onChange:_=>n(_.target.value),onFocus:wn,onBlur:Sn})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Last Name",required:!0}),i.jsx("input",{style:sn,value:o,onChange:_=>a(_.target.value),onFocus:wn,onBlur:Sn})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Email",required:!0}),i.jsx("input",{type:"email",style:{...sn,background:"var(--secondary)",color:"var(--muted)"},value:e.email,readOnly:!0})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Phone"}),i.jsx("input",{type:"tel",style:sn,value:s,onChange:_=>l(_.target.value),onFocus:wn,onBlur:Sn})]})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Role"}),i.jsx("input",{style:{...sn,background:"var(--secondary)",color:"var(--muted)"},value:e.role,readOnly:!0})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Bio"}),i.jsx("textarea",{style:{...sn,resize:"vertical",minHeight:"72px"},placeholder:"Short bio visible to your team…",value:c,onChange:_=>u(_.target.value),onFocus:wn,onBlur:Sn})]})]})]}),i.jsx(Tl,{title:"Change Password",subtitle:"Update your account password",children:i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Current Password"}),i.jsxs("div",{style:{position:"relative"},children:[i.jsx("input",{type:d?"text":"password",style:{...sn,paddingRight:"40px"},placeholder:"Enter current password",value:h,onChange:_=>p(_.target.value),onFocus:wn,onBlur:Sn}),i.jsx("button",{type:"button",onClick:()=>f(_=>!_),style:{position:"absolute",right:10,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex"},children:d?i.jsx(R6,{size:14}):i.jsx(Ah,{size:14})})]})]}),i.jsxs(rb,{children:[i.jsxs(Jr,{children:[i.jsx(Zr,{text:"New Password"}),i.jsx("input",{type:"password",style:sn,placeholder:"Min. 8 characters",value:y,onChange:_=>m(_.target.value),onFocus:wn,onBlur:Sn})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Confirm Password"}),i.jsx("input",{type:"password",style:sn,placeholder:"Repeat new password",value:x,onChange:_=>b(_.target.value),onFocus:wn,onBlur:Sn})]})]}),i.jsx(lc,{onSave:S})]})})]})}function JIe({user:e,refreshUser:t}){const r={...zW(),...e.notificationSettings},[n,o]=j.useState(r);j.useEffect(()=>{o({...zW(),...e.notificationSettings})},[e._id,e.notificationSettings]);const a=c=>{const u=n[c];typeof u=="boolean"&&o(d=>({...d,[c]:!u}))},s=async()=>{const c=await Ia.updateMe({notificationSettings:n});if(c.error)throw new Error(c.error);await t()},l=n.digestFrequency??"Daily";return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs(Tl,{title:"Email Notifications",subtitle:"Choose which events trigger an email to you",action:i.jsx(lc,{onSave:s}),children:[i.jsx($c,{value:!!n.emailRegistration,onChange:()=>a("emailRegistration"),label:"New registration received"}),i.jsx($c,{value:!!n.emailFeedback,onChange:()=>a("emailFeedback"),label:"New feedback submission"}),i.jsx($c,{value:!!n.emailPayment,onChange:()=>a("emailPayment"),label:"Payment received or failed"}),i.jsx($c,{value:!!n.emailSummary,onChange:()=>a("emailSummary"),label:"Daily event summary report"})]}),i.jsxs(Tl,{title:"In-App Notifications",subtitle:"Push notifications within the platform",action:i.jsx(lc,{onSave:s}),children:[i.jsx($c,{value:!!n.pushRegistration,onChange:()=>a("pushRegistration"),label:"New attendee registration"}),i.jsx($c,{value:!!n.pushSession,onChange:()=>a("pushSession"),label:"Session status changes"}),i.jsx($c,{value:!!n.pushMessage,onChange:()=>a("pushMessage"),label:"New messages and replies"})]}),i.jsx(Tl,{title:"Digest Settings",subtitle:"How often to receive summary reports",action:i.jsx(lc,{onSave:s}),children:i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Report Frequency"}),i.jsx("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:["None","Daily","Weekly","Monthly"].map(c=>i.jsx("button",{type:"button",onClick:()=>o(u=>({...u,digestFrequency:c})),style:{padding:"6px 16px",borderRadius:"var(--radius-button)",border:`1px solid ${l===c?"var(--primary)":"var(--border)"}`,background:l===c?"var(--accent)":"transparent",color:l===c?"var(--primary)":"var(--muted)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",transition:"all .12s"},children:c},c))})]})})]})}function eNe(){return i.jsxs("div",{style:{padding:"48px 24px",textAlign:"center",background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)"},children:[i.jsx(Cq,{size:32,style:{color:"var(--muted)",marginBottom:"12px"}}),i.jsx("p",{style:{fontSize:"var(--text-lg)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"0 0 8px"},children:"Coming soon"}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0,maxWidth:"400px",marginLeft:"auto",marginRight:"auto"},children:"Third-party integrations will be available here in a future release."})]})}function tNe({user:e,refreshUser:t,isSuperAdmin:r}){var Q;const[n,o]=j.useState(""),[a,s]=j.useState(""),[l,c]=j.useState(""),[u,d]=j.useState(""),[f,h]=j.useState(""),[p,y]=j.useState(""),[m,x]=j.useState(!1),[b,w]=j.useState(""),[k,S]=j.useState(""),[_,P]=j.useState(null),[O,T]=j.useState(!1);j.useEffect(()=>{if(!n){P(null),T(!1);return}let U=!1;return T(!1),Mw.toDataURL(n,{width:220,margin:2,errorCorrectionLevel:"M",color:{dark:"#111111",light:"#ffffff"}}).then(ee=>{U||P(ee)}).catch(()=>{U||(P(null),T(!0))}),()=>{U=!0}},[n]);const R=async()=>{if(a)try{await navigator.clipboard.writeText(a.replace(/\s/g,""))}catch{}},I=a?((Q=a.replace(/\s/g,"").toUpperCase().match(/.{1,4}/g))==null?void 0:Q.join(" "))??a:"",E=async()=>{const U=await Ia.setup2fa();if(U.error||!U.data)throw new Error(U.error??"Setup failed");o(U.data.otpauthUrl),s(U.data.manualEntryKey)},A=async()=>{const U=await Ia.verify2faSetup(l);if(U.error)throw new Error(U.error);o(""),s(""),c(""),await t()},F=async()=>{const U=await Ia.disable2fa(u,f||void 0);if(U.error)throw new Error(U.error);d(""),h(""),await t()},L=async()=>{y("");try{await JO.create({type:"data_export",message:"Data export requested from Settings"})}catch(U){y(U instanceof Error?U.message:"Failed")}},z=async()=>{if(k.trim().toUpperCase()!=="DELETE")throw new Error("Type DELETE to confirm this request.");await JO.create({type:"account_deletion",message:b.trim()||"Account deletion requested from Settings",metadata:{source:"settings"}}),x(!1),w(""),S("")},V=()=>{x(!1),w(""),S("")};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs(Tl,{title:"Two-Factor Authentication",subtitle:"Google Authenticator (TOTP). Sign-in will ask for a code when this is enabled.",action:e.twoFactorEnabled?i.jsx(lc,{onSave:F}):void 0,children:[!e.twoFactorEnabled&&i.jsx(i.Fragment,{children:n?i.jsxs("div",{style:{marginTop:"14px",display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsxs("p",{style:{fontSize:"var(--text-sm)",color:"var(--card-foreground)",margin:0},children:["Open Google Authenticator (or another TOTP app), choose ",i.jsx("strong",{children:"Add account"})," → ",i.jsx("strong",{children:"Scan a QR code"}),", then enter the code the app shows below."]}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"flex-start",gap:"20px"},children:[i.jsx("div",{style:{padding:"12px",background:"#fff",borderRadius:"var(--radius-card)",border:"1px solid var(--border)"},children:_?i.jsx("img",{src:_,alt:"QR code for two-factor setup",width:220,height:220,style:{display:"block"}}):O?i.jsx("div",{style:{width:220,height:220,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"var(--text-xs)",color:"var(--muted)",textAlign:"center",padding:"12px"},children:"Could not render QR. Use the manual key below."}):i.jsx("div",{style:{width:220,height:220,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Generating QR…"})}),i.jsxs("div",{style:{flex:"1 1 200px",minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontWeight:"var(--font-weight-medium)",color:"var(--muted)",margin:"0 0 6px"},children:"Can’t scan the code?"}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",color:"var(--card-foreground)",margin:"0 0 8px"},children:["In your app, choose ",i.jsx("strong",{children:"Enter a setup key"})," and type this secret (spaces optional):"]}),a?i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[i.jsx("code",{style:{fontSize:"13px",letterSpacing:"0.04em",wordBreak:"break-all",background:"var(--secondary)",padding:"10px 12px",borderRadius:"var(--radius-button)",fontFamily:"ui-monospace, monospace",flex:"1 1 160px"},children:I}),i.jsxs("button",{type:"button",onClick:()=>void R(),title:"Copy secret",style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",fontSize:"var(--text-xs)",color:"var(--card-foreground)"},children:[i.jsx(iu,{size:14})," Copy"]})]}):i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"No manual key returned — try generating setup again."})]})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"6-digit code"}),i.jsx("input",{style:sn,value:l,onChange:U=>c(U.target.value),placeholder:"000000",onFocus:wn,onBlur:Sn})]}),i.jsx(lc,{onSave:A,disabled:l.length<6})]}):i.jsxs("div",{style:{marginTop:"10px"},children:[i.jsx(kw,{text:"Generate a secret to show a QR code. Scan it with your authenticator app, then enter the 6-digit code below to verify."}),i.jsx("button",{type:"button",onClick:()=>void E().catch(U=>alert(U instanceof Error?U.message:"Error")),style:{marginTop:"10px",padding:"8px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:"pointer",fontSize:"var(--text-sm)"},children:"Generate setup"})]})}),e.twoFactorEnabled&&i.jsxs("div",{style:{marginTop:"14px",display:"flex",flexDirection:"column",gap:"10px"},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--card-foreground)",margin:0},children:"Two-factor authentication is enabled."}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Current password"}),i.jsx("input",{type:"password",style:sn,value:u,onChange:U=>d(U.target.value),onFocus:wn,onBlur:Sn})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Authenticator code"}),i.jsx("input",{style:sn,value:f,onChange:U=>h(U.target.value),onFocus:wn,onBlur:Sn})]}),i.jsx(kw,{text:"Save Changes above to disable 2FA."})]})]}),r&&i.jsxs(Tl,{title:"Data & Privacy",subtitle:"Requests are stored for administrator review",children:[p&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-xs)"},children:p}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[i.jsxs("button",{type:"button",onClick:()=>void L(),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer"},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:"Download My Data (request)"}),i.jsx(va,{size:14,style:{color:"var(--muted)"}})]}),i.jsxs("button",{type:"button",onClick:()=>x(!0),style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 14px",borderRadius:"var(--radius-button)",border:"1px solid rgba(163,17,19,0.3)",background:"rgba(163,17,19,0.04)",cursor:"pointer"},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--destructive)"},children:"Delete Account (request)"}),i.jsx(va,{size:14,style:{color:"var(--destructive)"}})]})]})]}),m&&i.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"delete-request-title",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.4)",zIndex:110,display:"flex",alignItems:"center",justifyContent:"center"},onClick:V,children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"400px",maxWidth:"92vw",padding:"20px",boxShadow:"var(--shadow-xl)"},onClick:U=>U.stopPropagation(),children:[i.jsx("p",{id:"delete-request-title",style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"0 0 8px"},children:"Request account deletion"}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",margin:"0 0 12px"},children:"This submits a request for administrator review. It does not immediately delete your account."}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Reason (optional)"}),i.jsx("textarea",{style:{...sn,width:"100%",minHeight:"72px",boxSizing:"border-box"},placeholder:"Why are you requesting deletion?",value:b,onChange:U=>w(U.target.value),onFocus:wn,onBlur:Sn})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Type DELETE to confirm",required:!0}),i.jsx("input",{style:{...sn,width:"100%",boxSizing:"border-box"},autoComplete:"off",value:k,onChange:U=>S(U.target.value),onFocus:wn,onBlur:Sn})]}),i.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"16px"},children:[i.jsx("button",{type:"button",onClick:V,style:{padding:"6px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",cursor:"pointer"},children:"Cancel"}),i.jsx("button",{type:"button",onClick:()=>void z().catch(U=>alert(U instanceof Error?U.message:"Error")),style:{padding:"6px 14px",borderRadius:"var(--radius-button)",border:"none",background:"var(--destructive)",color:"#fff",fontSize:"var(--text-sm)",fontWeight:"var(--font-weight-medium)",cursor:"pointer"},children:"Submit request"})]})]})})]})}function rNe(e,t,r){var a,s,l,c,u;const n="var(--primary)",o="var(--muted)";if(t==="participants"){const d=(a=e.defaultLimits)==null?void 0:a.maxParticipants;return{kind:"text",text:d==null?"Unlimited":Number(d).toLocaleString("en-IN"),color:n}}if(t==="event_website"){const d=(s=e.featureValues)==null?void 0:s.event_website,f=(l=r==null?void 0:r.options)==null?void 0:l.find(p=>p.value===d),h=(f==null?void 0:f.label)??d??"—";return h==="—"?{kind:"text",text:h,color:o}:{kind:"text",text:h,color:n}}if(t==="email_outreach_campaigns"){const d=(u=(c=e.featureValues)==null?void 0:c.email_outreach_campaigns)==null?void 0:u.maxEmails;return{kind:"text",text:d==null?"Unlimited":`Up to ${Number(d).toLocaleString("en-IN")} emails`,color:n}}return{kind:"boolean",included:e.featureKeys.includes(t)}}function nNe({org:e,plans:t,featureMetaList:r,refreshOrg:n,user:o}){const s=(e.subscription??{plan:"free"}).plan??"free",l=o.role==="super_admin"||o.role==="admin",[c,u]=j.useState([]),[d,f]=j.useState(!1),[h,p]=j.useState(null),[y,m]=j.useState(!1),[x,b]=j.useState(null),[w,k]=j.useState(""),[S,_]=j.useState(!1),P=j.useMemo(()=>{var I;return((I=t.find(E=>E.id===s))==null?void 0:I.tierIndex)??0},[t,s]),O=j.useMemo(()=>new Map(r.map(I=>[I.key,I])),[r]);j.useEffect(()=>{l&&(f(!0),Ku.listInvoices().then(I=>u(I.invoices)).catch(()=>u([])).finally(()=>f(!1)))},[l,e._id]);const T=async I=>{if(l&&I.id!==s){if(I.id==="free"||!I.pricing||I.pricing.amount==null||I.pricing.amount<=0){window.alert("Use Upgrade only for paid plans.");return}p(I.id);try{await P6();const E=await Ku.checkoutOrder(I.id),A=window.Razorpay;await new Promise((L,z)=>{let V=!1;const Q=new A({key:E.keyId,amount:E.amount,currency:E.currency,order_id:E.orderId,name:"EventBuzz",description:`Subscription: ${I.name}`,handler:U=>{V=!0,Ku.checkoutVerify({orderId:U.razorpay_order_id,paymentId:U.razorpay_payment_id,signature:U.razorpay_signature}).then(()=>{L()}).catch(ee=>{z(ee instanceof Error?ee:new Error("Verification failed"))})},modal:{ondismiss:()=>{V||L()}},theme:{color:"#0B4DD1"},prefill:o.email?{email:o.email}:void 0});Q.on("payment.failed",U=>{var ee;z(new Error(((ee=U.error)==null?void 0:ee.description)||"Payment failed"))}),Q.open()}),await n({cacheBust:!0}),window.dispatchEvent(new CustomEvent(oE));const F=await Ku.listInvoices();u(F.invoices)}catch(E){const A=E instanceof Error?E.message:"Upgrade failed";A&&window.alert(A)}finally{p(null)}}},R=async()=>{if(!(!x||w.trim().length<10)){_(!0);try{await Ku.contactSalesRequest({targetPlanId:x.id,requirements:w.trim()}),window.alert("Thank you. Our team will reach out shortly."),b(null),k("")}catch(I){window.alert(I instanceof Error?I.message:"Failed to send your request.")}finally{_(!1)}}};return l?i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{children:[i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"space-between",gap:"12px",marginBottom:"12px"},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:"Plans"}),i.jsx("button",{type:"button",onClick:()=>m(!0),disabled:t.length===0,style:{padding:"8px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",color:"var(--foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:600,cursor:t.length===0?"not-allowed":"pointer",opacity:t.length===0?.5:1},children:"Compare plans"})]}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"12px"},children:t.map(I=>{var U;const E=I.id===s,A=!!((U=I.pricing)!=null&&U.contactSales),F=I.tierIndex??0,L=!E&&F<P,z=!E&&!A&&I.id!=="free"&&I.pricing&&I.pricing.amount!=null&&I.pricing.amount>0&&F>P,V=!E&&!L&&A,Q={display:"block",width:"100%",marginTop:"10px",padding:"6px 0",borderRadius:"var(--radius-button)",border:"1px solid var(--primary)",background:"transparent",color:"var(--primary)",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"};return i.jsxs("div",{style:{background:"var(--card)",border:`2px solid ${E?"var(--primary)":"var(--border)"}`,borderRadius:"var(--radius-card)",padding:"16px",position:"relative"},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"8px"},children:I.name}),I.tagline?i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--foreground)",margin:"0 0 8px",whiteSpace:"pre-line",lineHeight:1.45},children:I.tagline}):null,I.pricing?i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",margin:"0 0 8px"},children:I.pricing.contactSales?"Contact sales":I.pricing.amount===0?`${I.pricing.currency} 0`:I.pricing.amount==null?"—":`${I.pricing.currency} ${Number(I.pricing.amount).toLocaleString("en-IN")} / ${I.pricing.interval}`}):null,i.jsx("p",{style:{fontSize:"10px",color:"var(--muted)",margin:"0 0 12px"},children:I.id}),E?i.jsx("button",{type:"button",disabled:!0,style:{...Q,border:"none",background:"var(--primary)",color:"var(--primary-foreground)",cursor:"default"},children:"Current plan"}):L?i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"10px 0 0",lineHeight:1.45},children:"Your subscription is on a higher tier — upgrade isn't needed for this plan."}):V?i.jsx("button",{type:"button",onClick:()=>{b(I),k("")},style:Q,children:"Contact sales"}):z?i.jsx("button",{type:"button",disabled:h!==null,onClick:()=>void T(I),style:{...Q,cursor:h?"default":"pointer",opacity:h===I.id?.7:1},children:h===I.id?"Processing…":"Upgrade"}):null]},I.id)})})]}),x&&i.jsx("div",{role:"presentation",style:{position:"fixed",inset:0,zIndex:410,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",boxSizing:"border-box"},onClick:()=>!S&&b(null),children:i.jsxs("div",{role:"dialog","aria-labelledby":"contact-sales-title",style:{width:"min(100%, 480px)",background:"var(--card)",borderRadius:"var(--radius-card)",border:"1px solid var(--border)",padding:"20px",boxShadow:"var(--elevation-sm)"},onClick:I=>I.stopPropagation(),children:[i.jsxs("h2",{id:"contact-sales-title",style:{margin:"0 0 8px",fontSize:"var(--text-lg)",fontFamily:"var(--font-inter)",fontWeight:600},children:["Contact sales — ",x.name]}),i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",margin:"0 0 16px"},children:"Tell us what you need (volume, integrations, SLA, etc.). We'll email the EventBuzz platform team."}),i.jsx("label",{style:{display:"block",fontSize:"var(--text-sm)",fontWeight:600,marginBottom:"8px",color:"var(--foreground)"},children:"Requirements"}),i.jsx("textarea",{value:w,onChange:I=>k(I.target.value),rows:6,placeholder:"Minimum 10 characters…",style:{width:"100%",boxSizing:"border-box",padding:"10px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--input-background)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",resize:"vertical",marginBottom:"16px"}}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"10px",justifyContent:"flex-end"},children:[i.jsx("button",{type:"button",disabled:S,onClick:()=>b(null),style:{padding:"8px 16px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",cursor:S?"not-allowed":"pointer",fontSize:"var(--text-sm)"},children:"Cancel"}),i.jsx("button",{type:"button",disabled:S||w.trim().length<10,onClick:()=>void R(),style:{padding:"8px 16px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",cursor:S||w.trim().length<10?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontWeight:600,opacity:w.trim().length<10?.6:1},children:S?"Sending…":"Send request"})]})]})}),y&&t.length>0&&i.jsx("div",{role:"presentation",style:{position:"fixed",inset:0,zIndex:400,background:"rgba(0,0,0,0.55)",display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",boxSizing:"border-box"},onClick:()=>m(!1),children:i.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"compare-plans-title",style:{width:"min(100%, 1200px)",height:"min(100vh - 32px, 900px)",maxHeight:"calc(100vh - 32px)",background:"var(--card)",borderRadius:"var(--radius-card)",border:"1px solid var(--border)",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:"0 25px 50px rgba(0,0,0,0.25)"},onClick:I=>I.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",padding:"16px 20px",borderBottom:"1px solid var(--border)",flexShrink:0},children:[i.jsx("h2",{id:"compare-plans-title",style:{margin:0,fontSize:"var(--text-lg)",fontFamily:"var(--font-inter)",fontWeight:600},children:"Compare plans"}),i.jsx("button",{type:"button",onClick:()=>m(!1),style:{padding:"8px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",cursor:"pointer",fontSize:"var(--text-sm)"},children:"Close"})]}),i.jsx("div",{style:{flex:1,overflow:"auto",padding:"0 12px 16px"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"separate",borderSpacing:0,fontSize:"var(--text-xs)",minWidth:Math.max(480,t.length*100+200)},children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{style:{position:"sticky",left:0,zIndex:2,background:"var(--card)",textAlign:"left",padding:"10px 12px",borderBottom:"2px solid var(--border)",borderRight:"1px solid var(--border)",minWidth:"200px",fontFamily:"var(--font-inter)",fontWeight:600},children:"Feature"}),t.map(I=>i.jsxs("th",{style:{padding:"10px 8px",borderBottom:"2px solid var(--border)",textAlign:"center",minWidth:"96px",fontFamily:"var(--font-inter)",fontWeight:600,color:I.id===s?"var(--primary)":"var(--foreground)",background:I.id===s?"var(--accent)":"var(--card)"},children:[I.name,I.id===s?i.jsx("span",{style:{display:"block",fontSize:"10px",fontWeight:500,opacity:.85},children:"Current"}):null]},I.id))]})}),i.jsx("tbody",{children:MX.map(({title:I,keys:E})=>i.jsxs(ze.Fragment,{children:[i.jsx("tr",{children:i.jsx("td",{colSpan:t.length+1,style:{padding:"12px 8px 6px",fontSize:"11px",fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--primary)",background:"var(--secondary)",borderBottom:"1px solid var(--border)"},children:I})}),E.map(A=>{const F=O.get(A),L=(F==null?void 0:F.label)??A;return i.jsxs("tr",{children:[i.jsx("td",{style:{position:"sticky",left:0,zIndex:1,background:"var(--card)",padding:"8px 12px",borderBottom:"1px solid var(--border)",borderRight:"1px solid var(--border)",color:"var(--primary)",verticalAlign:"top"},children:L}),t.map(z=>{const V=rNe(z,A,F);return i.jsx("td",{style:{padding:"8px 8px",borderBottom:"1px solid var(--border)",textAlign:"center",verticalAlign:"middle",fontFamily:"var(--font-noto-sans)"},children:V.kind==="boolean"?i.jsx("span",{role:"img","aria-label":V.included?"Included":"Not included",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",color:V.included?"var(--success-fg)":"var(--destructive)"},children:V.included?i.jsx(Oi,{size:18,strokeWidth:2.5,"aria-hidden":!0}):i.jsx(er,{size:18,strokeWidth:2.5,"aria-hidden":!0})}):i.jsx("span",{style:{color:V.color,fontWeight:600},children:V.text})},`${z.id}-${A}`)})]},A)})]},I))})]})})]})}),i.jsx(Tl,{title:"Invoices",subtitle:"Paid receipts — SaaS subscription and manual UPI enablement (Razorpay)",children:d?i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",margin:0},children:"Loading…"}):c.length===0?i.jsx("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",margin:0},children:"No invoices yet."}):i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--text-xs)"},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{textAlign:"left",borderBottom:"1px solid var(--border)"},children:[i.jsx("th",{style:{padding:"8px 6px"},children:"Date"}),i.jsx("th",{style:{padding:"8px 6px"},children:"Description"}),i.jsx("th",{style:{padding:"8px 6px"},children:"Amount"}),i.jsx("th",{style:{padding:"8px 6px"}})]})}),i.jsx("tbody",{children:c.map(I=>i.jsxs("tr",{style:{borderBottom:"1px solid var(--border)"},children:[i.jsx("td",{style:{padding:"8px 6px",color:"var(--foreground)"},children:new Date(I.createdAt).toLocaleString()}),i.jsx("td",{style:{padding:"8px 6px"},children:I.invoiceLabel??I.planId}),i.jsxs("td",{style:{padding:"8px 6px"},children:[I.currency," ",Number(I.amountMajor).toLocaleString("en-IN",{minimumFractionDigits:2})]}),i.jsx("td",{style:{padding:"8px 6px"},children:i.jsx("button",{type:"button",onClick:()=>void Ku.downloadInvoice(I.id).catch(E=>alert(E instanceof Error?E.message:"Download failed")),style:{padding:"4px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--primary)",background:"transparent",color:"var(--primary)",cursor:"pointer",fontSize:"var(--text-xs)"},children:"Download"})})]},I.id))})]})})})]}):i.jsxs("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",margin:0},children:["Only organisation ",i.jsx("strong",{children:"super administrators"})," and ",i.jsx("strong",{children:"administrators"})," can manage plans and billing. Ask an admin to upgrade or view invoices."]})}function iNe(){const{user:e}=Ur(),t=(e==null?void 0:e.role)==="super_admin"||(e==null?void 0:e.role)==="admin",[r,n]=j.useState(!0),[o,a]=j.useState(!1),[s,l]=j.useState(""),[c,u]=j.useState(587),[d,f]=j.useState(!1),[h,p]=j.useState(""),[y,m]=j.useState(""),[x,b]=j.useState(!1),[w,k]=j.useState(""),[S,_]=j.useState(""),[P,O]=j.useState(""),[T,R]=j.useState(""),[I,E]=j.useState(""),A=j.useCallback(async()=>{n(!0),E("");try{const z=await ls.getEmailSettings();if(z.error)throw new Error(z.error);const V=z.data;V&&(a(V.enabled),l(V.host),u(V.port||587),f(V.secure),p(V.user||""),b(V.hasPassword),k(V.fromName||""),_(V.fromAddress||""))}catch(z){E(z instanceof Error?z.message:"Failed to load")}finally{n(!1)}},[]);j.useEffect(()=>{A()},[A]);const F=async()=>{R(""),E("");try{const z=await ls.updateEmailSettings({enabled:o,host:s,port:c,secure:d,user:h,password:y||void 0,fromName:w,fromAddress:S});if(z.error)throw new Error(z.error);m(""),R("Saved."),await A()}catch(z){E(z instanceof Error?z.message:"Save failed")}},L=async()=>{R(""),E("");try{const z=await ls.testEmailSettings(P.trim());if(z.error)throw new Error(z.error);R("Test email sent.")}catch(z){E(z instanceof Error?z.message:"Test failed")}};return t?r?i.jsx("p",{style:{color:"var(--muted)"},children:"Loading…"}):i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px",maxWidth:520},children:i.jsxs(Tl,{title:"SMTP (bring your own)",subtitle:"Campaign and system emails use this server when enabled. Password is stored encrypted on the server.",children:[I&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-sm)",margin:0},children:I}),T&&i.jsx("p",{style:{color:"#15803d",fontSize:"var(--text-sm)",margin:0},children:T}),i.jsx($c,{value:o,onChange:a,label:"Use custom SMTP"}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"SMTP host"}),i.jsx("input",{style:sn,value:s,onChange:z=>l(z.target.value),placeholder:"smtp.example.com",onFocus:wn,onBlur:Sn})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Port"}),i.jsx("input",{style:sn,type:"number",value:c,onChange:z=>u(parseInt(z.target.value,10)||587),onFocus:wn,onBlur:Sn})]}),i.jsx($c,{value:d,onChange:f,label:"Use SSL/TLS (e.g. port 465)"}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Username"}),i.jsx("input",{style:sn,value:h,onChange:z=>p(z.target.value),onFocus:wn,onBlur:Sn})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:x?"Password (leave blank to keep existing)":"Password"}),i.jsx("input",{style:sn,type:"password",value:y,onChange:z=>m(z.target.value),autoComplete:"new-password",onFocus:wn,onBlur:Sn})]}),i.jsxs(rb,{children:[i.jsxs(Jr,{children:[i.jsx(Zr,{text:"From name"}),i.jsx("input",{style:sn,value:w,onChange:z=>k(z.target.value),onFocus:wn,onBlur:Sn})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"From email",required:!0}),i.jsx("input",{style:sn,value:S,onChange:z=>_(z.target.value),placeholder:"hello@yourdomain.com",onFocus:wn,onBlur:Sn})]})]}),i.jsx(lc,{onSave:F,disabled:o&&(!s.trim()||!S.trim())}),i.jsx(aNe,{}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Send test email to"}),i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[i.jsx("input",{style:{...sn,flex:1},value:P,onChange:z=>O(z.target.value),placeholder:"you@example.com",onFocus:wn,onBlur:Sn}),i.jsx("button",{type:"button",onClick:()=>void L(),disabled:!P.trim(),style:{padding:"8px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",cursor:P.trim()?"pointer":"not-allowed",fontSize:"var(--text-sm)",whiteSpace:"nowrap"},children:"Send test"})]})]})]})}):i.jsx("p",{style:{color:"var(--muted)",fontSize:"var(--text-sm)"},children:"Only administrators can change email delivery settings."})}function oNe(){const{user:e}=Ur(),t=(e==null?void 0:e.role)==="super_admin"||(e==null?void 0:e.role)==="admin",[r,n]=j.useState(!0),[o,a]=j.useState(!1),[s,l]=j.useState(""),[c,u]=j.useState(""),[d,f]=j.useState(""),[h,p]=j.useState(!1),[y,m]=j.useState(""),[x,b]=j.useState(""),w=j.useCallback(async()=>{n(!0),b("");try{const S=await ls.getWhatsAppSettings();if(S.error)throw new Error(S.error);const _=S.data;_&&(a(_.enabled),l(_.wabaId||""),u(_.phoneNumberId||""),p(_.hasAccessToken))}catch(S){b(S instanceof Error?S.message:"Failed to load")}finally{n(!1)}},[]);j.useEffect(()=>{w()},[w]);const k=async()=>{m(""),b("");try{const S=await ls.updateWhatsAppSettings({enabled:o,wabaId:s,phoneNumberId:c,accessToken:d||void 0});if(S.error)throw new Error(S.error);f(""),m("Saved."),await w()}catch(S){b(S instanceof Error?S.message:"Save failed")}};return t?r?i.jsx("p",{style:{color:"var(--muted)"},children:"Loading…"}):i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"16px",maxWidth:520},children:i.jsxs(Tl,{title:"WhatsApp Business Cloud",subtitle:"Connect your WABA and system user access token (encrypted at rest). Used to submit templates from Design → WhatsApp Templates. For single-tenant dev, the server can use META_WHATSAPP_DEFAULT_WABA_ID and META_WHATSAPP_ACCESS_TOKEN instead.",children:[x&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-sm)",margin:0},children:x}),y&&i.jsx("p",{style:{color:"#15803d",fontSize:"var(--text-sm)",margin:0},children:y}),i.jsx($c,{value:o,onChange:a,label:"Enable WhatsApp Cloud"}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"WhatsApp Business Account ID (WABA)"}),i.jsx("input",{style:sn,value:s,onChange:S=>l(S.target.value),placeholder:"Numeric WABA ID from Meta",onFocus:wn,onBlur:Sn})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:"Phone number ID (optional)"}),i.jsx("input",{style:sn,value:c,onChange:S=>u(S.target.value),placeholder:"For future send path",onFocus:wn,onBlur:Sn})]}),i.jsxs(Jr,{children:[i.jsx(Zr,{text:h?"Access token (leave blank to keep existing)":"System user access token"}),i.jsx("input",{style:sn,type:"password",value:d,onChange:S=>f(S.target.value),autoComplete:"new-password",onFocus:wn,onBlur:Sn})]}),i.jsx(lc,{onSave:k,disabled:o&&!s.trim()})]})}):i.jsx("p",{style:{color:"var(--muted)",fontSize:"var(--text-sm)"},children:"Only administrators can change WhatsApp Cloud settings."})}function aNe(){return i.jsx("div",{style:{height:1,background:"var(--border)",margin:"8px 0"}})}function sNe({settingsInitialSection:e,setSettingsInitialSection:t}){var w;const{user:r,refreshUser:n}=Ur(),[o,a]=j.useState([]),[s,l]=j.useState([]),[c,u]=j.useState(null),d=(r==null?void 0:r.role)==="super_admin",f=!!((w=r==null?void 0:r.organization)!=null&&w._id||r!=null&&r.organization),h=j.useMemo(()=>QIe.filter(k=>!k.superOnly||d).filter(k=>k.id!=="org"||f).filter(k=>k.id!=="email"||f).filter(k=>k.id!=="whatsapp"||f),[d,f]),[p,y]=j.useState("profile");j.useEffect(()=>{var k;h.find(S=>S.id===p)||y(((k=h[0])==null?void 0:k.id)??"profile")},[h,p]),j.useEffect(()=>{if(!e)return;const k=h.find(S=>S.id===e);k&&y(k.id),t(null)},[e,h,t]);const m=j.useCallback(async k=>{try{const S=await ls.get(k);u(S)}catch{u(null)}},[]);if(j.useEffect(()=>{const k=(r==null?void 0:r.role)==="super_admin"||(r==null?void 0:r.role)==="admin";if(!f||!k){a([]),l([]);return}p==="billing"&&Ku.catalog().then(S=>{a(S.plans),l(S.features)}).catch(()=>{a([]),l([])})},[f,p,r==null?void 0:r.role]),j.useEffect(()=>{f&&(p==="org"||p==="billing")&&m()},[f,p,m]),!r)return i.jsx("p",{style:{color:"var(--muted)"},children:"Sign in to manage settings."});const x=h.find(k=>k.id===p),b=()=>p==="org"?i.jsx(XIe,{canEdit:d}):p==="profile"?i.jsx(ZIe,{user:r,refreshUser:n}):p==="notifications"?i.jsx(JIe,{user:r,refreshUser:n}):p==="email"?i.jsx(iNe,{}):p==="whatsapp"?i.jsx(oNe,{}):p==="integrations"?i.jsx(eNe,{}):p==="security"?i.jsx(tNe,{user:r,refreshUser:n,isSuperAdmin:d}):p==="billing"&&c?i.jsx(nNe,{org:c,plans:o,featureMetaList:s,refreshOrg:m,user:r}):p==="billing"?i.jsx("p",{style:{color:"var(--muted)"},children:"Loading…"}):null;return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:"Portfolio"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:"Settings"}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"4px"},children:"Manage your organisation, profile, and platform preferences."})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"200px 1fr",gap:"20px",alignItems:"start"},children:[i.jsx("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden",position:"sticky",top:0},children:h.map((k,S)=>i.jsxs("button",{type:"button",onClick:()=>y(k.id),style:{display:"flex",alignItems:"center",gap:"10px",width:"100%",padding:"11px 14px",background:p===k.id?"var(--accent)":"transparent",border:"none",borderBottom:S<h.length-1?"1px solid var(--border)":"none",cursor:"pointer",textAlign:"left",color:p===k.id?"var(--primary)":"var(--card-foreground)",transition:"background .12s"},onMouseEnter:_=>{p!==k.id&&(_.currentTarget.style.background="var(--secondary)")},onMouseLeave:_=>{p!==k.id&&(_.currentTarget.style.background="transparent")},children:[i.jsx("span",{style:{color:p===k.id?"var(--primary)":"var(--muted)",flexShrink:0},children:k.icon}),i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:p===k.id?"var(--font-weight-medium)":"var(--font-weight-normal)",whiteSpace:"nowrap"},children:k.label})]},k.id))}),i.jsxs("div",{children:[x&&i.jsx("p",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",marginBottom:"12px"},children:x.label}),b()]})]}),i.jsx("div",{style:{paddingTop:"8px",borderTop:"1px solid var(--border)",textAlign:"center"},children:i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"© 2026 EventBuzz"})})]})}const lNe=[{value:"en_US",label:"English (US)"},{value:"en_GB",label:"English (UK)"},{value:"en_IN",label:"English (India)"},{value:"hi_IN",label:"Hindi (India)"}];function os(e){const t=/\{\{(\d+)\}\}/g,r=new Set;let n;for(;(n=t.exec(e))!==null;)r.add(parseInt(n[1],10));if(r.size===0)return{count:0};const o=Math.max(...r);for(let a=1;a<=o;a++)if(!r.has(a))return{count:0,error:`Variables must be sequential ({{1}}, {{2}}, …). Missing {{${a}}}.`};return{count:o}}function f0(e){const t=/\{\{(\d+)\}\}/g;let r=0,n;for(;(n=t.exec(e))!==null;)r=Math.max(r,parseInt(n[1],10));return r+1}const cNe=/^[.,;:!?…'"«»""''()[\]\s\u2013\u2014-]+/u,uNe=/[.,;:!?…'"«»""''()[\]\s\u2013\u2014-]+$/u;function M3(e,t){const r=String(e||"").trim();if(!r||!/\{\{\s*\d+\s*\}\}/.test(r))return null;const n=r.replace(cNe,"");if(/^\{\{\s*\d+\s*\}\}/.test(n))return`${t}: add real words before the first variable (not only punctuation).`;const o=r.replace(uNe,"");return/\{\{\s*\d+\s*\}\}$/.test(o)?`${t}: add words after the last variable—a trailing period alone is not enough (e.g. end with "…{{2}} See you there." not "…{{2}}.").`:null}function dNe(e){return String(e||"").trim().toLowerCase().replace(/\s+/g,"_").replace(/[^a-z0-9_]/g,"")}function BW(e){const t=(e||"").toUpperCase();return t==="APPROVED"?{background:"rgba(34,197,94,0.15)",color:"#15803d",border:"1px solid rgba(34,197,94,0.35)"}:t==="PENDING"||t==="IN_APPEAL"||t==="PENDING_DELETION"?{background:"rgba(234,179,8,0.15)",color:"#a16207",border:"1px solid rgba(234,179,8,0.4)"}:t==="REJECTED"?{background:"rgba(239,68,68,0.12)",color:"#b91c1c",border:"1px solid rgba(239,68,68,0.35)"}:t==="PAUSED"||t==="DISABLED"?{background:"var(--secondary)",color:"var(--muted)",border:"1px solid var(--border)"}:{background:"var(--accent)",color:"var(--accent-foreground)",border:"1px solid var(--border)"}}function fNe(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function pNe(e){const t=e.find(n=>String(n.type||"").toUpperCase()==="BODY"),r=(t==null?void 0:t.text)||"";return r.length>80?`${r.slice(0,80)}…`:r||"—"}function p0(e,t){return String(e||"").replace(/\{\{\s*(\d+)\s*\}\}/g,(r,n)=>{const o=parseInt(n,10)-1,a=t[o];return a!==void 0&&String(a).length>0?String(a):`{{${n}}}`})}function hNe(e){var h,p;const t=Array.isArray(e)?e:[];let r=null,n=!1,o="",a=[],s="",l=[],c=null;const u=[];for(const y of t){if(!y||typeof y!="object")continue;const m=String(y.type||"").toUpperCase();if(m==="HEADER"){const x=String(y.format||"").toUpperCase();if(x==="IMAGE"){const b=y.example,w=(h=b==null?void 0:b.header_handle)==null?void 0:h[0],k=w!=null?String(w).trim():"";k&&/^https?:\/\//i.test(k)?r=k:k&&(n=!0)}else if(x==="TEXT"){o=String(y.text||"");const b=y.example;a=Array.isArray(b==null?void 0:b.header_text)?b.header_text.map(w=>String(w??"")):[]}}if(m==="BODY"){s=String(y.text||"");const x=y.example,b=(p=x==null?void 0:x.body_text)==null?void 0:p[0];l=Array.isArray(b)?b.map(w=>String(w??"")):[]}if(m==="FOOTER"&&(c=String(y.text||"").trim()||null),m==="BUTTONS"&&Array.isArray(y.buttons))for(const x of y.buttons){if(!x||typeof x!="object")continue;const b=String(x.type||"").toUpperCase(),w=String(x.text||"").trim();if(b==="QUICK_REPLY"&&w&&u.push({kind:"QUICK_REPLY",label:w}),b==="URL"&&w){const k=String(x.url||""),S=x.example,_=Array.isArray(S)&&S.length>0&&S[0]!=null?String(S[0]).trim():p0(k,[]);u.push({kind:"URL",label:w,url:_||p0(k,[])})}}}const d=o.trim()&&p0(o,a).trim()||null,f=p0(s,l);return{headerImageUrl:r,headerImageUnavailable:n,headerText:d,bodyText:f,footerText:c,buttons:u}}function gNe({model:e}){const t={background:"#fff",borderRadius:"8px",boxShadow:"0 1px 2px rgba(0,0,0,0.12)",overflow:"hidden",maxWidth:"100%",fontFamily:"var(--font-noto-sans), system-ui, sans-serif"},r={background:"linear-gradient(180deg, #efeae2 0%, #e5ddd5 100%)",borderRadius:"12px",padding:"16px 12px",border:"1px solid var(--border)"};return i.jsxs("div",{style:r,children:[i.jsx("p",{style:{margin:"0 0 10px",fontSize:"11px",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.04em"},children:"Approximate WhatsApp preview"}),i.jsxs("div",{style:t,children:[e.headerImageUrl?i.jsx("img",{src:e.headerImageUrl,alt:"",style:{display:"block",width:"100%",maxHeight:"200px",objectFit:"cover",background:"#f0f0f0"}}):null,e.headerImageUnavailable?i.jsx("div",{style:{padding:"24px 12px",textAlign:"center",fontSize:"13px",color:"var(--muted)",background:"var(--secondary)",borderBottom:"1px solid var(--border)"},children:"Image header (sample is on Meta; preview not available)"}):null,i.jsxs("div",{style:{padding:"10px 12px 8px"},children:[e.headerText?i.jsx("p",{style:{margin:"0 0 8px",fontWeight:700,fontSize:"15px",lineHeight:1.35,color:"#111"},children:e.headerText}):null,i.jsx("p",{style:{margin:0,fontSize:"14px",lineHeight:1.45,color:"#111",whiteSpace:"pre-wrap"},children:e.bodyText||"—"}),e.footerText?i.jsx("p",{style:{margin:"10px 0 0",fontSize:"12px",lineHeight:1.35,color:"rgba(0,0,0,0.45)"},children:e.footerText}):null]}),e.buttons.length>0?i.jsx("div",{style:{borderTop:"1px solid rgba(0,0,0,0.06)"},children:e.buttons.map((n,o)=>i.jsx("div",{style:{padding:"11px 12px",textAlign:"center",fontSize:"14px",fontWeight:500,color:"#027eb5",borderTop:o>0?"1px solid rgba(0,0,0,0.06)":void 0,cursor:"default"},children:n.kind==="URL"?i.jsxs("span",{children:[n.label,i.jsx("span",{style:{display:"block",fontSize:"11px",fontWeight:400,color:"rgba(2,126,181,0.75)",marginTop:"4px",wordBreak:"break-all"},children:n.url})]}):n.label},`pv-btn-${o}`))}):null]})]})}const D3={padding:"4px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",cursor:"pointer",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)"};function z3(e){var t;return e?((t=cm.find(r=>r.mergeKey===e))==null?void 0:t.label)??e:"—"}function mNe(){var xe,De,tt,Le,Ke;const{user:e}=Ur(),{setActiveNav:t,setSettingsInitialSection:r}=eo(),n=zn(e),o=(e==null?void 0:e.role)==="super_admin"||(e==null?void 0:e.role)==="admin",[a,s]=j.useState([]),[l,c]=j.useState(!0),[u,d]=j.useState(""),[f,h]=j.useState(null),[p,y]=j.useState(!1),[m,x]=j.useState(null),[b,w]=j.useState(null),[k,S]=j.useState(!1),[_,P]=j.useState(""),[O,T]=j.useState("en_US"),[R,I]=j.useState("none"),[E,A]=j.useState(""),[F,L]=j.useState([]),[z,V]=j.useState([]),[Q,U]=j.useState(""),[ee,H]=j.useState("Hello {{1}}, thanks for registering."),[B,M]=j.useState(["Alex"]),[$,q]=j.useState([""]),[Y,K]=j.useState(""),[G,re]=j.useState("none"),[J,ae]=j.useState("Open link"),[le,me]=j.useState("custom"),[Oe,we]=j.useState(""),[ie,Me]=j.useState(""),[ke,se]=j.useState([]),[fe,Ie]=j.useState({forms:[],microsites:[]}),[ce,je]=j.useState(!1),[qe,Ne]=j.useState(""),[Je,vt]=j.useState(!1),[Ge,Ot]=j.useState(!1),nt=j.useRef(null),Ae=j.useCallback(async Fe=>{var dt;d(""),c(!0);const Ve=await Bg.list({sync:Fe==null?void 0:Fe.sync});if(c(!1),Ve.error){d(typeof Ve.error=="string"?Ve.error:"Failed to load templates"),s([]);return}const xt=(dt=Ve.data)==null?void 0:dt.templates;s(Array.isArray(xt)?xt:[])},[]),Te=j.useCallback(async()=>{const Fe=await ls.getWhatsAppSettings();if(Fe.error||!Fe.data){h(null);return}const Ve=Fe.data;h(Ve.graphAccess)},[]),wt=j.useCallback(async()=>{var Fe;if(n){je(!0);try{const xt=((Fe=(await zr.list({organization:n,limit:300})).data)==null?void 0:Fe.events)??[],dt=[],Tt=[];await Promise.all(xt.map(async Mt=>{const fr=await zr.emailerLinkTargets(Mt._id);if(fr.error||!fr.data)return;const hr=Mt.name?`${Mt.name} — `:"";for(const Qr of fr.data.forms)Qr.href&&dt.push({id:Qr.id,name:`${hr}${Qr.name}`,href:Qr.href});for(const Qr of fr.data.microsites)Qr.href&&Tt.push({id:Qr.id,name:`${hr}${Qr.name}`,href:Qr.href})})),dt.sort((Mt,fr)=>Mt.name.localeCompare(fr.name)),Tt.sort((Mt,fr)=>Mt.name.localeCompare(fr.name)),Ie({forms:dt,microsites:Tt})}finally{je(!1)}}},[n]);j.useEffect(()=>{Ae()},[Ae]),j.useEffect(()=>{n&&Te()},[n,Te]),j.useEffect(()=>{p&&n&&wt()},[p,n,wt]),j.useEffect(()=>{!p||G!=="URL"||(le==="form"&&!Oe.trim()&&fe.forms[0]&&we(fe.forms[0].href),le==="microsite"&&!Oe.trim()&&fe.microsites[0]&&we(fe.microsites[0].href))},[p,G,le,fe,Oe]),j.useEffect(()=>{const{count:Fe,error:Ve}=os(E);Ve||(L(xt=>{const dt=xt.slice(0,Fe);for(;dt.length<Fe;)dt.push("");return dt}),V(xt=>{const dt=xt.slice(0,Fe);for(;dt.length<Fe;)dt.push("");return dt}))},[E]),j.useEffect(()=>{const{count:Fe,error:Ve}=os(ee);Ve||(M(xt=>{const dt=xt.slice(0,Fe);for(;dt.length<Fe;)dt.push("");return dt}),q(xt=>{const dt=xt.slice(0,Fe);for(;dt.length<Fe;)dt.push("");return dt}))},[ee]),j.useEffect(()=>{if(G!=="URL")return;const{count:Fe,error:Ve}=os(Oe);Ve||se(xt=>{const dt=xt.slice(0,Fe);for(;dt.length<Fe;)dt.push("");return dt})},[G,Oe]);const ft=()=>{P(""),T("en_US"),I("none"),A(""),L([]),V([]),U(""),H("Hello {{1}}, thanks for registering."),M(["Alex"]),q([""]),K(""),re("none"),ae("Open link"),me("custom"),we(""),Me(""),se([]),Ne(""),y(!0)},Pt=async Fe=>{if(Fe){if(!Fe.type.startsWith("image/")){Ne("Please choose an image file (JPEG, PNG, etc.).");return}Ne(""),Ot(!0);try{const Ve=await Ys(Fe,{eventId:"portfolio",module:"whatsapp/template-header"});Ve.url&&U(Ve.url)}catch(Ve){Ne(Ve instanceof Error?Ve.message:"Image upload failed")}finally{Ot(!1),nt.current&&(nt.current.value="")}}},At=(Fe,Ve)=>{const xt=f0(Fe),dt=Fe.length===0||/\s$/.test(Fe)?"":" ";Ve(Fe+dt+`{{${xt}}}`)},Ht=()=>{const Fe=[];if(R==="TEXT"&&E.trim()){const dt={type:"HEADER",format:"TEXT",text:E.trim()},{count:Tt}=os(E);Tt>0&&(dt.example={header_text:F.slice(0,Tt).map(Mt=>Mt.trim()||"Sample")}),Fe.push(dt)}R==="IMAGE"&&Fe.push({type:"HEADER",format:"IMAGE",example:{header_handle:[Q.trim()]}});const Ve={type:"BODY",text:ee.trim()},{count:xt}=os(ee);if(xt>0&&(Ve.example={body_text:[B.slice(0,xt).map(dt=>dt.trim()||"Sample")]}),Fe.push(Ve),Y.trim()&&Fe.push({type:"FOOTER",text:Y.trim()}),G==="QUICK_REPLY"&&J.trim()&&Fe.push({type:"BUTTONS",buttons:[{type:"QUICK_REPLY",text:J.trim()}]}),G==="URL"&&J.trim()&&Oe.trim()){const dt=Oe.trim(),Tt={type:"URL",text:J.trim(),url:dt},{count:Mt}=os(dt);Mt>0&&(Tt.example=[ie.trim()||dt.replace(/\{\{1\}\}/g,"sample")]),Fe.push({type:"BUTTONS",buttons:[Tt]})}return Fe},Se=async()=>{const Fe=dNe(_);if(!Fe){Ne("Template name is required (lowercase letters, numbers, underscores).");return}if(!ee.trim()){Ne("Body text is required.");return}const Ve=M3(ee,"Body");if(Ve){Ne(Ve);return}if(Y.trim()&&/\{\{\s*\d+\s*\}\}/.test(Y)){Ne("Footer cannot contain variables. Use static text only or leave the footer empty.");return}if(R==="TEXT"&&E.trim()){const hr=M3(E,"Header");if(hr){Ne(hr);return}}if(J.trim()&&/\{\{\s*\d+\s*\}\}/.test(J)){const hr=M3(J,"Button label");if(hr){Ne(hr);return}}const xt=os(ee);if(xt.error){Ne(xt.error);return}if(xt.count>0&&B.slice(0,xt.count).some(Qr=>!String(Qr||"").trim())){Ne("Enter sample text for each variable in the body (required by Meta).");return}if(R==="TEXT"&&E.trim()){const hr=os(E);if(hr.error){Ne(`Header: ${hr.error}`);return}if(hr.count>0&&F.slice(0,hr.count).some(Rn=>!String(Rn||"").trim())){Ne("Enter sample text for each variable in the header (required by Meta).");return}}if(R==="IMAGE"&&!Q.trim()){Ne("Provide a sample image URL for the image header (Meta requires an example).");return}if(G==="URL"){if(!J.trim()||!Oe.trim()){Ne("URL buttons need a label and a URL.");return}const hr=os(Oe.trim());if(hr.error){Ne(`Button URL: ${hr.error}`);return}if(hr.count>0&&!ie.trim()){Ne("Enter a full sample URL for the button (Meta needs an example when the URL contains {{1}}, etc.).");return}}vt(!0),Ne("");const dt=R==="TEXT"&&E.trim()?os(E).count:0,Tt=xt.count,Mt=G==="URL"?os(Oe.trim()).count:0,fr=await Bg.create({name:Fe,language:O,category:"MARKETING",components:Ht(),variableBindings:{header:dt>0?z.slice(0,dt).map(hr=>hr||""):[],body:Tt>0?$.slice(0,Tt).map(hr=>hr||""):[],url:Mt>0?ke.slice(0,Mt).map(hr=>hr||""):[]}});if(vt(!1),fr.error){Ne(typeof fr.error=="string"?fr.error:"Create failed");return}y(!1),Ae(),Te()},ct=async()=>{S(!0),await Ae({sync:!0}),S(!1)},gt=async Fe=>{w(Fe);const Ve=await Bg.sync(Fe);w(null),Ve.error||Ae()},We=async(Fe,Ve)=>{if(!o||!window.confirm(`Remove template “${Ve}” from the dashboard? This does not delete it in Meta.`))return;w(Fe);const xt=await Bg.remove(Fe);w(null),xt.error||Ae()},Pe=()=>{r("whatsapp"),t("settings")},rt=os(ee),Ze=os(E),pe=G==="URL"?os(Oe):{count:0};return n?i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:"Design"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:0},children:"WhatsApp Templates"}),i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginTop:"6px",maxWidth:"640px"},children:"Create and submit message templates to your WhatsApp Business account via Meta. Status updates sync from Meta periodically or when you refresh."})]}),f===!1&&i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px",flexWrap:"wrap",padding:"12px 16px",borderRadius:"var(--radius-card)",border:"1px solid rgba(234,179,8,0.45)",background:"rgba(234,179,8,0.08)"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[i.jsx(Zs,{size:18,style:{color:"#a16207",flexShrink:0}}),i.jsx("p",{style:{margin:0,fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:"Connect WABA and access token under Settings, or set server defaults (META_WHATSAPP_DEFAULT_WABA_ID, META_WHATSAPP_ACCESS_TOKEN) to submit templates."})]}),i.jsxs("button",{type:"button",onClick:Pe,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx(Pl,{size:14})," WhatsApp settings"]})]}),u&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-sm)",margin:0},children:u}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"10px",alignItems:"center"},children:[o&&i.jsxs("button",{type:"button",onClick:ft,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 16px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"var(--primary-foreground)",cursor:"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)"},children:[i.jsx(wr,{size:16})," Create template"]}),i.jsxs("button",{type:"button",disabled:k||l,onClick:()=>void ct(),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 16px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",cursor:k||l?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",opacity:k||l?.7:1},children:[i.jsx(X3,{size:16,style:{animation:k?"spin 0.8s linear infinite":void 0}}),"Sync from Meta"]})]}),i.jsx("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:l?i.jsx("p",{style:{padding:"20px",color:"var(--muted)",margin:0},children:"Loading…"}):a.length===0?i.jsx("p",{style:{padding:"20px",color:"var(--muted)",margin:0},children:"No templates yet. Create one to submit it to Meta."}):i.jsx("div",{style:{overflowX:"auto"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{background:"var(--secondary)",textAlign:"left"},children:[i.jsx("th",{style:{padding:"10px 14px",borderBottom:"1px solid var(--border)",fontWeight:"var(--font-weight-medium)"},children:"Name"}),i.jsx("th",{style:{padding:"10px 14px",borderBottom:"1px solid var(--border)",fontWeight:"var(--font-weight-medium)"},children:"Language"}),i.jsx("th",{style:{padding:"10px 14px",borderBottom:"1px solid var(--border)",fontWeight:"var(--font-weight-medium)"},children:"Category"}),i.jsx("th",{style:{padding:"10px 14px",borderBottom:"1px solid var(--border)",fontWeight:"var(--font-weight-medium)"},children:"Status"}),i.jsx("th",{style:{padding:"10px 14px",borderBottom:"1px solid var(--border)",fontWeight:"var(--font-weight-medium)"},children:"Last synced"}),i.jsx("th",{style:{padding:"10px 14px",borderBottom:"1px solid var(--border)",fontWeight:"var(--font-weight-medium)",width:"200px"},children:"Actions"})]})}),i.jsx("tbody",{children:a.map(Fe=>i.jsxs("tr",{style:{borderBottom:"1px solid var(--border)"},children:[i.jsxs("td",{style:{padding:"10px 14px",verticalAlign:"top"},children:[i.jsx("div",{style:{fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:Fe.name}),i.jsx("div",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",marginTop:"4px"},children:pNe(Fe.components||[])}),Fe.rejectionReason?i.jsx("div",{style:{fontSize:"var(--text-xs)",color:"var(--destructive)",marginTop:"4px"},children:Fe.rejectionReason}):null]}),i.jsx("td",{style:{padding:"10px 14px",verticalAlign:"top"},children:Fe.language}),i.jsx("td",{style:{padding:"10px 14px",verticalAlign:"top"},children:Fe.category}),i.jsx("td",{style:{padding:"10px 14px",verticalAlign:"top"},children:i.jsx("span",{style:{display:"inline-block",padding:"3px 8px",borderRadius:"var(--radius-button)",fontSize:"var(--text-xs)",fontWeight:"var(--font-weight-medium)",...BW(Fe.status)},children:Fe.status||"—"})}),i.jsx("td",{style:{padding:"10px 14px",verticalAlign:"top",color:"var(--muted)",fontSize:"var(--text-xs)"},children:fNe(Fe.lastSyncedAt)}),i.jsx("td",{style:{padding:"10px 14px",verticalAlign:"top"},children:i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:[i.jsxs("button",{type:"button",onClick:()=>x(Fe),style:{padding:"5px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",cursor:"pointer",fontSize:"var(--text-xs)",display:"inline-flex",alignItems:"center",gap:"4px"},children:[i.jsx(Ah,{size:12})," View"]}),o&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",disabled:b===Fe._id,onClick:()=>void gt(Fe._id),style:{padding:"5px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",cursor:b===Fe._id?"not-allowed":"pointer",fontSize:"var(--text-xs)",display:"inline-flex",alignItems:"center",gap:"4px"},children:[i.jsx(X3,{size:12})," Sync"]}),i.jsxs("button",{type:"button",disabled:b===Fe._id,onClick:()=>void We(Fe._id,Fe.name),style:{padding:"5px 10px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"transparent",cursor:b===Fe._id?"not-allowed":"pointer",fontSize:"var(--text-xs)",color:"var(--destructive)",display:"inline-flex",alignItems:"center",gap:"4px"},children:[i.jsx(gn,{size:12})," Remove"]})]})]})})]},Fe._id))})]})})}),p&&i.jsx(Zo,{onClose:()=>y(!1),title:"New WhatsApp template",breadcrumb:"Design · WhatsApp",description:"Category is Marketing. Use {{1}}, {{2}}… in header (text), body, or URL. Meta requires sample values for every variable. URL buttons can point to a form, microsite, or custom link.",completedCount:1,totalSections:1,showProgress:!1,ctaLabel:Je?"Submitting…":"Submit to Meta",ctaDisabled:Je,onCtaClick:()=>void Se(),panelWidth:"min(720px, 100vw)",children:i.jsxs("div",{style:{padding:"20px",display:"flex",flexDirection:"column",gap:"14px"},children:[qe&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-sm)",margin:0},children:qe}),i.jsxs("p",{style:{margin:0,fontSize:"var(--text-xs)",color:"var(--muted)",fontFamily:"var(--font-noto-sans)"},children:[i.jsx("strong",{style:{color:"var(--card-foreground)"},children:"Category:"})," Marketing (fixed)"]}),i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Template name",required:!0}),i.jsx("input",{style:$t,value:_,onChange:Fe=>P(Fe.target.value),placeholder:"welcome_message",onFocus:kt,onBlur:_t}),i.jsx(Qt,{text:"Lowercase, numbers, underscores only (normalized on save)."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Language",required:!0}),i.jsx(an,{children:i.jsx("select",{style:Nr,value:O,onChange:Fe=>T(Fe.target.value),onFocus:kt,onBlur:_t,children:lNe.map(Fe=>i.jsx("option",{value:Fe.value,children:Fe.label},Fe.value))})})]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Header"}),i.jsx(an,{children:i.jsxs("select",{style:Nr,value:R,onChange:Fe=>I(Fe.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"none",children:"None"}),i.jsx("option",{value:"TEXT",children:"Text (optional variables {{1}}, …)"}),i.jsx("option",{value:"IMAGE",children:"Image"})]})})]}),R==="TEXT"&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Insert variable in header:"}),i.jsxs("button",{type:"button",style:D3,onClick:()=>At(E,A),children:["+ ",`{{${f0(E)}}}`]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Header text"}),i.jsx("input",{style:$t,value:E,onChange:Fe=>A(Fe.target.value),onFocus:kt,onBlur:_t}),Ze.error?i.jsx(Qt,{text:Ze.error}):Ze.count>0?i.jsx(Qt,{text:`${Ze.count} variable(s) — add sample text below for Meta review.`}):null]}),Ze.count>0&&!Ze.error&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",fontWeight:"var(--font-weight-medium)"},children:"For each {{1}}, {{2}}, … in the header — map to contact/event (like email) and enter the Meta sample (required)."}),Array.from({length:Ze.count},(Fe,Ve)=>i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{children:[i.jsx(pt,{text:`Maps to ({{${Ve+1}}} in header)`}),i.jsx(an,{children:i.jsx("select",{style:Nr,value:z[Ve]??"",onChange:xt=>{const dt=xt.target.value,Tt=[...z];Tt[Ve]=dt,V(Tt);const Mt=dt&&a3[dt];if(Mt){const fr=[...F];String(fr[Ve]??"").trim()||(fr[Ve]=Mt),L(fr)}},onFocus:kt,onBlur:_t,children:cm.map(xt=>i.jsx("option",{value:xt.mergeKey,children:xt.label},xt.mergeKey||"__none"))})})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:`Meta sample for {{${Ve+1}}}`,required:!0}),i.jsx("input",{style:$t,value:F[Ve]??"",onChange:xt=>{const dt=[...F];dt[Ve]=xt.target.value,L(dt)},onFocus:kt,onBlur:_t})]})]},`hs-${Ve}`))]})]}),R==="IMAGE"&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"14px"},children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Sample image",required:!0}),i.jsx("input",{ref:nt,type:"file",accept:"image/*",style:{display:"none"},onChange:Fe=>{var Ve;return void Pt((Ve=Fe.target.files)==null?void 0:Ve[0])}}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"12px"},children:[i.jsx("button",{type:"button",disabled:Ge,onClick:()=>{var Fe;return(Fe=nt.current)==null?void 0:Fe.click()},style:{padding:"8px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--secondary)",cursor:Ge?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",opacity:Ge?.7:1},children:Ge?"Uploading…":"Upload image"}),Q.trim()?i.jsx("img",{src:Q.trim(),alt:"",style:{maxHeight:"72px",maxWidth:"120px",objectFit:"cover",borderRadius:"var(--radius-button)",border:"1px solid var(--border)"}}):null]}),i.jsx(Qt,{text:"Upload stores the file and fills the URL below. Meta needs a public https URL it can fetch for the template example."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Image URL (from upload or paste)",required:!0}),i.jsx("input",{style:$t,value:Q,onChange:Fe=>U(Fe.target.value),placeholder:"https://…",onFocus:kt,onBlur:_t})]})]}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Insert variable in body:"}),i.jsxs("button",{type:"button",style:D3,onClick:()=>At(ee,H),children:["+ ",`{{${f0(ee)}}}`]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Body",required:!0}),i.jsx("textarea",{style:{...$t,minHeight:"100px",resize:"vertical"},value:ee,onChange:Fe=>H(Fe.target.value),onFocus:kt,onBlur:_t}),rt.error?i.jsx(Qt,{text:rt.error}):rt.count>0?i.jsx(Qt,{text:`${rt.count} variable(s) — samples required below.`}):i.jsx(Qt,{text:"Meta: put real words before the first and after the last variable. Ending with only “.” or “!” after {{n}} is rejected (e.g. use “…{{2}} See you at the event.”). Footer must be static."})]}),rt.count>0&&!rt.error&&i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",fontWeight:"var(--font-weight-medium)"},children:"For each {{1}}, {{2}}, … in the body — map to contact/event (like email) and enter the Meta sample (required)."}),Array.from({length:rt.count},(Fe,Ve)=>i.jsxs(Zi,{cols:2,children:[i.jsxs(lt,{children:[i.jsx(pt,{text:`Maps to ({{${Ve+1}}} in body)`}),i.jsx(an,{children:i.jsx("select",{style:Nr,value:$[Ve]??"",onChange:xt=>{const dt=xt.target.value,Tt=[...$];Tt[Ve]=dt,q(Tt);const Mt=dt&&a3[dt];if(Mt){const fr=[...B];String(fr[Ve]??"").trim()||(fr[Ve]=Mt),M(fr)}},onFocus:kt,onBlur:_t,children:cm.map(xt=>i.jsx("option",{value:xt.mergeKey,children:xt.label},`b-${xt.mergeKey||"__none"}`))})})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:`Meta sample for {{${Ve+1}}}`,required:!0}),i.jsx("input",{style:$t,value:B[Ve]??"",onChange:xt=>{const dt=[...B];dt[Ve]=xt.target.value,M(dt)},onFocus:kt,onBlur:_t})]})]},`bs-${Ve}`))]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Footer (optional)"}),i.jsx("input",{style:$t,value:Y,onChange:Fe=>K(Fe.target.value),onFocus:kt,onBlur:_t}),i.jsx(Qt,{text:"Footer must be static text only—WhatsApp does not allow variables in the footer."})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Button (optional)"}),i.jsx(an,{children:i.jsxs("select",{style:Nr,value:G,onChange:Fe=>re(Fe.target.value),onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"none",children:"None"}),i.jsx("option",{value:"QUICK_REPLY",children:"Quick reply"}),i.jsx("option",{value:"URL",children:"URL"})]})})]}),G!=="none"&&i.jsxs(lt,{children:[i.jsx(pt,{text:"Button label",required:!0}),i.jsx("input",{style:$t,value:J,onChange:Fe=>ae(Fe.target.value),onFocus:kt,onBlur:_t})]}),G==="URL"&&i.jsxs(i.Fragment,{children:[i.jsxs(lt,{children:[i.jsx(pt,{text:"Link target"}),i.jsx(an,{children:i.jsxs("select",{style:Nr,value:le,onChange:Fe=>{const Ve=Fe.target.value;me(Ve),Ve==="custom"&&we(""),Ve==="form"&&fe.forms[0]&&we(fe.forms[0].href),Ve==="microsite"&&fe.microsites[0]&&we(fe.microsites[0].href)},onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"custom",children:"Custom URL"}),i.jsx("option",{value:"form",children:"Form (published link)"}),i.jsx("option",{value:"microsite",children:"Event microsite"})]})}),ce&&i.jsx(Qt,{text:"Loading forms and microsites from your events…"})]}),le==="form"&&i.jsxs(lt,{children:[i.jsx(pt,{text:"Select form",required:!0}),i.jsx(an,{children:i.jsxs("select",{style:Nr,value:((xe=fe.forms.find(Fe=>Fe.href===Oe))==null?void 0:xe.id)??"",onChange:Fe=>{const Ve=fe.forms.find(xt=>xt.id===Fe.target.value);Ve&&we(Ve.href)},onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:fe.forms.length?"Choose…":"No forms with links found"}),fe.forms.map(Fe=>i.jsx("option",{value:Fe.id,children:Fe.name},Fe.id))]})})]}),le==="microsite"&&i.jsxs(lt,{children:[i.jsx(pt,{text:"Select microsite",required:!0}),i.jsx(an,{children:i.jsxs("select",{style:Nr,value:((De=fe.microsites.find(Fe=>Fe.href===Oe))==null?void 0:De.id)??"",onChange:Fe=>{const Ve=fe.microsites.find(xt=>xt.id===Fe.target.value);Ve&&we(Ve.href)},onFocus:kt,onBlur:_t,children:[i.jsx("option",{value:"",children:fe.microsites.length?"Choose…":"No microsites with publish folder found"}),fe.microsites.map(Fe=>i.jsx("option",{value:Fe.id,children:Fe.name},Fe.id))]})})]}),(le==="custom"||pe.count>0)&&i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Insert variable in URL:"}),i.jsxs("button",{type:"button",style:D3,onClick:()=>At(Oe,we),children:["+ ",`{{${f0(Oe)}}}`]})]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"URL",required:!0}),i.jsx("input",{style:$t,value:Oe,onChange:Fe=>we(Fe.target.value),readOnly:le==="form"||le==="microsite",onFocus:kt,onBlur:_t}),(le==="form"||le==="microsite")&&i.jsx(Qt,{text:"Filled from the selected form or microsite. Switch to Custom URL to edit or add {{1}} for dynamic paths."}),pe.error?i.jsx(Qt,{text:pe.error}):null]}),pe.count>0&&!pe.error&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",color:"var(--muted)",fontWeight:"var(--font-weight-medium)"},children:"Map each {{1}}, … in the button URL to contact/event (optional; used when sending)."}),Array.from({length:pe.count},(Fe,Ve)=>i.jsxs(lt,{children:[i.jsx(pt,{text:`Maps to ({{${Ve+1}}} in URL)`}),i.jsx(an,{children:i.jsx("select",{style:Nr,value:ke[Ve]??"",onChange:xt=>{const dt=xt.target.value,Tt=[...ke];Tt[Ve]=dt,se(Tt);const Mt=dt&&a3[dt];Mt&&(pe.count===1&&/\{\{1\}\}/.test(Oe)&&!ie.trim()?Me(Oe.replace(/\{\{1\}\}/g,Mt)):!ie.trim()&&/^https?:\/\//i.test(Mt)&&Me(Mt))},onFocus:kt,onBlur:_t,children:cm.map(xt=>i.jsx("option",{value:xt.mergeKey,children:xt.label},`u-${xt.mergeKey||"__none"}`))})})]},`ub-${Ve}`))]}),i.jsxs(lt,{children:[i.jsx(pt,{text:"Sample URL for button (required by Meta)",required:!0}),i.jsx("input",{style:$t,value:ie,onChange:Fe=>Me(Fe.target.value),placeholder:Oe.includes("{{1}}")?"Full URL with a real value instead of {{1}}":"Concrete URL Meta can verify",onFocus:kt,onBlur:_t}),i.jsx(Qt,{text:"Meta needs one full example URL. If the template URL uses {{1}}, paste the final URL after substitution."})]})]})]})]})}),m&&i.jsx(Zo,{onClose:()=>x(null),title:m.name,breadcrumb:"WhatsApp template",description:`${m.language} · ${m.category}${m.metaTemplateId?` · Meta ID ${m.metaTemplateId}`:""}`,completedCount:1,totalSections:1,showProgress:!1,hidePrimaryCta:!0,ctaLabel:"Close",ctaDisabled:!1,panelWidth:"min(520px, 100vw)",children:i.jsxs("div",{style:{padding:"20px",fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)"},children:[i.jsx("p",{style:{margin:"0 0 8px",color:"var(--muted)"},children:"Status"}),i.jsx("p",{style:{margin:"0 0 16px"},children:i.jsx("span",{style:{...BW(m.status),padding:"4px 10px",borderRadius:"var(--radius-button)",fontSize:"var(--text-xs)"},children:m.status||"—"})}),m.rejectionReason?i.jsxs(i.Fragment,{children:[i.jsx("p",{style:{margin:"0 0 8px",color:"var(--muted)"},children:"Rejection reason"}),i.jsx("p",{style:{margin:"0 0 16px",color:"var(--destructive)"},children:m.rejectionReason})]}):null,m.variableBindings&&((((tt=m.variableBindings.header)==null?void 0:tt.length)??0)>0||(((Le=m.variableBindings.body)==null?void 0:Le.length)??0)>0||(((Ke=m.variableBindings.url)==null?void 0:Ke.length)??0)>0)?i.jsxs(i.Fragment,{children:[i.jsx("p",{style:{margin:"16px 0 8px",color:"var(--muted)"},children:"Variable → contact / event mapping"}),i.jsxs("ul",{style:{margin:"0 0 16px",paddingLeft:"18px",fontSize:"var(--text-xs)",color:"var(--card-foreground)",lineHeight:1.6},children:[(m.variableBindings.header??[]).map((Fe,Ve)=>i.jsx("li",{children:`Header {{${Ve+1}}} → ${Fe?z3(Fe):"—"}`},`vh-${Ve}`)),(m.variableBindings.body??[]).map((Fe,Ve)=>i.jsx("li",{children:`Body {{${Ve+1}}} → ${Fe?z3(Fe):"—"}`},`vb-${Ve}`)),(m.variableBindings.url??[]).map((Fe,Ve)=>i.jsx("li",{children:`URL {{${Ve+1}}} → ${Fe?z3(Fe):"—"}`},`vu-${Ve}`))]})]}):null,i.jsx("p",{style:{margin:"16px 0 8px",color:"var(--muted)"},children:"Preview"}),i.jsx(gNe,{model:hNe(m.components)})]})}),i.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]}):i.jsx("div",{style:{padding:"8px 0"},children:i.jsx("p",{style:{color:"var(--muted)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)"},children:"WhatsApp templates are available when your account is linked to an organisation."})})}function sh({text:e,query:t}){if(!t.trim())return i.jsx(i.Fragment,{children:e});const r=e.toLowerCase().indexOf(t.toLowerCase());return r===-1?i.jsx(i.Fragment,{children:e}):i.jsxs(i.Fragment,{children:[e.slice(0,r),i.jsx("mark",{style:{background:"var(--accent)",color:"var(--accent-foreground)",borderRadius:"2px",padding:"0 1px"},children:e.slice(r,r+t.length)}),e.slice(r+t.length)]})}function WW({event:e,query:t,onClick:r,isActive:n}){const o=aE[e.status];return i.jsxs("button",{onClick:r,style:{display:"flex",alignItems:"flex-start",gap:"14px",width:"100%",padding:"14px 16px",textAlign:"left",background:n?"var(--accent)":"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",cursor:"pointer",transition:"background 0.1s"},onMouseEnter:a=>{a.currentTarget.style.background="var(--secondary)"},onMouseLeave:a=>{a.currentTarget.style.background=n?"var(--accent)":"var(--card)"},children:[i.jsx("div",{style:{width:"3px",alignSelf:"stretch",borderRadius:"2px",background:o.dot??o.color,flexShrink:0,minHeight:"40px"}}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap",marginBottom:"4px"},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-inter)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:i.jsx(sh,{text:e.title,query:t})}),i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"3px",padding:"1px 7px",borderRadius:"999px",background:o.bg,color:o.color,fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",whiteSpace:"nowrap"},children:[e.status==="Live"&&i.jsx("span",{style:{width:"5px",height:"5px",borderRadius:"50%",background:"#16a34a"}}),e.status]}),i.jsx("span",{style:{padding:"1px 6px",borderRadius:"3px",background:"var(--secondary)",color:"var(--muted)",fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600"},children:e.type})]}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:"0 0 8px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i.jsx(sh,{text:e.subtitle,query:t})}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"14px",flexWrap:"wrap"},children:[i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[i.jsx(lb,{size:11,style:{flexShrink:0}}),i.jsx(sh,{text:e.location,query:t})]}),i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[i.jsx(Wi,{size:11,style:{flexShrink:0}}),e.startDate,e.startDate!==e.endDate?` – ${e.endDate}`:""]}),e.participants>0&&i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[i.jsx(vi,{size:11,style:{flexShrink:0}}),e.participants," attended"]}),i.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"3px",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[Nie[e.locationType],e.locationType]})]})]}),i.jsx(O6,{size:14,style:{color:"var(--muted)",flexShrink:0,marginTop:"2px"}})]})}function qW({page:e,query:t,onClick:r,isActive:n}){return i.jsxs("button",{onClick:r,style:{display:"flex",alignItems:"center",gap:"12px",width:"100%",padding:"10px 14px",textAlign:"left",background:n?"var(--accent)":"transparent",border:"none",borderBottom:"1px solid var(--border)",cursor:"pointer",transition:"background 0.1s"},onMouseEnter:o=>{o.currentTarget.style.background="var(--secondary)"},onMouseLeave:o=>{o.currentTarget.style.background=n?"var(--accent)":"transparent"},children:[i.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"var(--radius-button)",background:"var(--secondary)",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"var(--primary)"},children:e.icon}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"0 0 2px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i.jsx(sh,{text:e.title,query:t})}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:[e.section," · ",i.jsx(sh,{text:e.description,query:t})]})]}),i.jsx(va,{size:13,style:{color:"var(--muted)",flexShrink:0}})]})}function vNe({action:e,query:t,onClick:r,isActive:n}){return i.jsxs("button",{onClick:r,style:{display:"flex",alignItems:"center",gap:"12px",width:"100%",padding:"10px 14px",textAlign:"left",background:n?"var(--accent)":"transparent",border:"none",borderBottom:"1px solid var(--border)",cursor:"pointer",transition:"background 0.1s"},onMouseEnter:o=>{o.currentTarget.style.background="var(--secondary)"},onMouseLeave:o=>{o.currentTarget.style.background=n?"var(--accent)":"transparent"},children:[i.jsx("div",{style:{width:"32px",height:"32px",borderRadius:"var(--radius-button)",background:"var(--accent)",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"var(--accent-foreground)"},children:e.icon}),i.jsxs("div",{style:{flex:1,minWidth:0},children:[i.jsx("p",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"0 0 2px"},children:i.jsx(sh,{text:e.title,query:t})}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",margin:0},children:i.jsx(sh,{text:e.description,query:t})})]}),i.jsx("span",{style:{padding:"3px 10px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",fontSize:"11px",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",flexShrink:0},children:"Go →"})]})}function B3({label:e,count:t}){return i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 0 8px"},children:[i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"700",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.07em",margin:0},children:e}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",background:"var(--secondary)",padding:"1px 7px",borderRadius:"999px"},children:t})]})}function yNe({query:e,onQueryChange:t,onNavigate:r,onEventSelect:n}){const[o,a]=j.useState("all"),l=qi()==="mobile",c=j.useMemo(()=>L$(e),[e]),u=e.trim(),d=[{id:"all",label:"All",count:c.total},{id:"events",label:"Events",count:c.events.length},{id:"pages",label:"Pages",count:c.pages.length},{id:"actions",label:"Actions",count:c.actions.length}],f=o==="all"||o==="events",h=o==="all"||o==="pages",p=o==="all"||o==="actions",y=b=>{n(b.id)},m=b=>{r(b.navId)},x=b=>{r(b.navTarget)};return i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:"Portfolio"}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:l?"var(--text-xl)":"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",margin:"0 0 16px"},children:"Search"}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"0 14px",height:"44px",background:"var(--card)",borderWidth:"1px",borderStyle:"solid",borderColor:"var(--border)",borderRadius:"var(--radius-card)",boxShadow:"var(--elevation-sm)",maxWidth:"680px"},children:[i.jsx(Pi,{size:16,style:{color:"var(--muted)",flexShrink:0}}),i.jsx("input",{autoFocus:!0,type:"text",value:e,onChange:b=>{t(b.target.value),a("all")},placeholder:"Search events, pages, actions…",style:{flex:1,background:"transparent",border:"none",outline:"none",fontSize:"var(--text-base)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"}}),e&&i.jsx("button",{onClick:()=>t(""),style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",padding:"2px"},children:i.jsx(er,{size:14})})]})]}),u?c.total===0?i.jsxs("div",{style:{textAlign:"center",padding:"60px 20px",border:"2px dashed var(--border)",borderRadius:"var(--radius-card)"},children:[i.jsx("div",{style:{width:"44px",height:"44px",borderRadius:"var(--radius-card)",background:"var(--secondary)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 14px"},children:i.jsx(Pi,{size:20,style:{color:"var(--muted)"}})}),i.jsxs("p",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",marginBottom:"6px"},children:['No results for "',u,'"']}),i.jsx("p",{style:{fontFamily:"var(--font-noto-sans)",fontSize:"var(--text-sm)",color:"var(--muted)",marginBottom:"20px"},children:"Try searching for event names, page names, or actions."}),i.jsx("div",{style:{display:"flex",gap:"8px",justifyContent:"center",flexWrap:"wrap"},children:["conference","workshop","settings","faculty","design","payments"].map(b=>i.jsx("button",{onClick:()=>{t(b)},style:{padding:"5px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",cursor:"pointer"},children:b},b))})]}):i.jsxs("div",{children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16px",flexWrap:"wrap",gap:"10px"},children:[i.jsx("div",{style:{display:"flex",gap:"2px",background:"var(--secondary)",borderRadius:"var(--radius-button)",padding:"2px"},children:d.map(b=>i.jsxs("button",{onClick:()=>a(b.id),style:{display:"flex",alignItems:"center",gap:"5px",padding:"5px 12px",borderRadius:"var(--radius-button)",border:"none",cursor:"pointer",background:o===b.id?"var(--card)":"transparent",boxShadow:o===b.id?"var(--elevation-sm)":"none",color:o===b.id?"var(--foreground)":"var(--muted)",fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",fontWeight:o===b.id?"var(--font-weight-medium)":"var(--font-weight-normal)",transition:"all 0.12s"},children:[b.label,b.count>0&&i.jsx("span",{style:{minWidth:"16px",height:"16px",borderRadius:"999px",padding:"0 4px",background:o===b.id?"var(--primary)":"var(--border)",color:o===b.id?"var(--primary-foreground)":"var(--muted)",fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"600",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:b.count})]},b.id))}),i.jsxs("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:[c.total," result",c.total!==1?"s":""," for ",i.jsxs("strong",{style:{color:"var(--foreground)",fontFamily:"var(--font-inter)"},children:['"',u,'"']})]})]}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[f&&c.events.length>0&&i.jsxs("div",{children:[i.jsx(B3,{label:"Events",count:c.events.length}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:c.events.map(b=>i.jsx(WW,{event:b,query:u,onClick:()=>y(b),isActive:!1},b.id))})]}),h&&c.pages.length>0&&i.jsxs("div",{children:[i.jsx(B3,{label:"Pages",count:c.pages.length}),i.jsx("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:c.pages.map(b=>i.jsx(qW,{page:b,query:u,onClick:()=>m(b),isActive:!1},b.id))})]}),p&&c.actions.length>0&&i.jsxs("div",{children:[i.jsx(B3,{label:"Quick Actions",count:c.actions.length}),i.jsx("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:c.actions.map(b=>i.jsx(vNe,{action:b,query:u,onClick:()=>x(b),isActive:!1},b.id))})]})]})]}):i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"700",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.07em",marginBottom:"10px"},children:"Recent Events"}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:Z6.slice(0,5).map(b=>i.jsx(WW,{event:b,query:"",onClick:()=>y(b),isActive:!1},b.id))})]}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",fontWeight:"700",color:"var(--muted)",textTransform:"uppercase",letterSpacing:"0.07em",marginBottom:"10px"},children:"Browse Pages"}),i.jsx("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",overflow:"hidden"},children:R$.slice(0,8).map(b=>i.jsx(qW,{page:b,query:"",onClick:()=>m(b),isActive:!1},b.id))})]})]})]})}function xNe(){const{activeNav:e,setActiveNav:t,selectedEventId:r,setSelectedEventId:n,searchQuery:o,setSearchQuery:a,settingsInitialSection:s,setSettingsInitialSection:l}=eo(),[c,u]=j.useState(null),[d,f]=j.useState(!1),[h,p]=j.useState(null),[y,m]=j.useState(""),[x,b]=j.useState(()=>new Date().toISOString()),[w,k]=j.useState(""),[S,_]=j.useState([]),[P,O]=j.useState({}),[T,R]=j.useState(!1),[I,E]=j.useState(!1),A=j.useRef(null),F=qi(),L=F==="mobile"||F==="tablet",[z,V]=j.useState(null),[Q,U]=j.useState(null),[ee,H]=j.useState(!1),B=j.useCallback(async()=>{if(!r){V(null),U(null),H(!1);return}H(!0);try{const[Y,K]=await Promise.all([zr.get(r),zr.analytics(r)]);V(Y.data??null),U(K.data??null)}finally{H(!1)}},[r]),M=j.useCallback(async()=>{var Y,K;if(!(!r||T)){R(!0);try{const[G,re,J]=await Promise.all([zr.get(r),rh.list(r),Da.list(r)]),ae=G.data;m((ae==null?void 0:ae.name)||(z==null?void 0:z.name)||"Event"),b((ae==null?void 0:ae.startDate)||new Date().toISOString());const le=ae!=null&&ae.organization&&typeof ae.organization=="object"&&"_id"in ae.organization?String(ae.organization._id):ae!=null&&ae.organization?String(ae.organization):"";k(le);const me=((Y=re.data)==null?void 0:Y.tracks)||[];_(me);const Oe=((K=J.data)==null?void 0:K.sessions)||[],we={};Oe.forEach(ie=>{we[ie._id]=ie}),O(we),p({})}finally{R(!1)}}},[r,T,z==null?void 0:z.name]);j.useEffect(()=>{e!=="dashboard"&&e!=="analytics"||B()},[e,B]),j.useEffect(()=>{const Y=K=>{A.current&&!A.current.contains(K.target)&&E(!1)};return document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[]);const $=Y=>{n(Y),t("dashboard")},q=()=>e==="search"?i.jsx(yNe,{query:o,onQueryChange:a,onNavigate:t,onEventSelect:$}):e==="home"?i.jsx(Nwe,{}):e==="events"?i.jsx(v_e,{onNavigateToEvent:$}):e==="activities"?i.jsx(j_e,{onNavigateToActivity:Y=>{n(Y),t("activity-detail")}}):e==="activity-detail"?i.jsx(XAe,{}):e==="design-whatsapp-templates"?i.jsx(mNe,{}):["design-brochure","design-microsite","design-badges","design-emailers"].includes(e)?i.jsx(kIe,{subPage:e}):e==="faculty"?i.jsx(CIe,{}):e==="all-participants"?i.jsx(TIe,{}):e==="participant-lists"?i.jsx(IIe,{}):["forms-feedback","forms-registration","forms-other","forms-add"].includes(e)?i.jsx(FIe,{subPage:e}):["content-library","content-collections"].includes(e)?i.jsx(zIe,{subPage:e}):["messaging-email","messaging-whatsapp"].includes(e)?i.jsx(BIe,{subPage:e}):e==="payment"?i.jsx(VIe,{}):e==="user-management"?i.jsx(UIe,{}):e==="settings"?i.jsx(sNe,{settingsInitialSection:s,setSettingsInitialSection:l}):e==="participants"?i.jsx(kY,{}):e==="ticketing"?i.jsx(l6e,{}):e==="permissions"?i.jsx(t6e,{}):e==="questions"?i.jsx(gQ,{}):e==="quiz"?i.jsx(mQ,{}):e==="rewards"?i.jsx(a6e,{eventId:r}):e==="website"?i.jsx(L6e,{}):e==="analytics"?i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:ee&&r?"Loading…":(z==null?void 0:z.name)??(r?"Event":"Select an event")}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:F==="mobile"?"var(--text-xl)":"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.2"},children:"Analytics"})]}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",fontWeight:"var(--font-weight-medium)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:"10px"},children:"Charts"}),i.jsx(H2e,{})]}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",fontWeight:"var(--font-weight-medium)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:"10px"},children:"Features"}),i.jsx(sae,{})]}),i.jsx("div",{style:{paddingTop:"8px",borderTop:"1px solid var(--border)",textAlign:"center"},children:i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"© 2026 Stratawiz Technologies Pvt Ltd · EventBuzz"})})]}):e==="dashboard"?i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px",flexWrap:"wrap"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",marginBottom:"4px"},children:ee&&r?"Loading…":(z==null?void 0:z.name)??(r?"Event":"Select an event")}),i.jsx("h1",{style:{fontFamily:"var(--font-inter)",fontSize:F==="mobile"?"var(--text-xl)":"var(--text-2xl)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)",lineHeight:"1.2"},children:"Dashboard"})]}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"},children:[!L&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",onClick:()=>u("feedback"),style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:[i.jsx(Zs,{size:14})," Feedback"]}),i.jsxs("button",{type:"button",onClick:()=>u("ratings"),style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",cursor:"pointer"},children:[i.jsx(Rf,{size:14})," Ratings"]})]}),L&&i.jsxs("div",{ref:A,style:{position:"relative"},children:[i.jsx("button",{type:"button",onClick:()=>E(Y=>!Y),style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--card)",color:"var(--card-foreground)",cursor:"pointer"},children:"···"}),I&&i.jsx("div",{style:{position:"absolute",right:0,top:"calc(100% + 6px)",background:"var(--card)",border:"1px solid var(--border)",borderRadius:"var(--radius-card)",boxShadow:"var(--elevation-sm)",zIndex:50,minWidth:"160px",overflow:"hidden"},children:[{label:"Feedback",icon:i.jsx(Zs,{size:13}),action:()=>{u("feedback"),E(!1)}},{label:"Ratings",icon:i.jsx(Rf,{size:13}),action:()=>{u("ratings"),E(!1)}}].map(Y=>i.jsxs("button",{type:"button",onClick:Y.action,style:{width:"100%",display:"flex",alignItems:"center",gap:"8px",padding:"10px 14px",background:"none",border:"none",cursor:"pointer",textAlign:"left",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)",borderBottom:"1px solid var(--border)"},children:[Y.icon," ",Y.label]},Y.label))})]}),i.jsxs("button",{type:"button",disabled:!r||T,onClick:()=>void M(),style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 16px",borderRadius:"var(--radius-button)",background:"var(--primary)",color:"var(--primary-foreground)",border:"none",cursor:!r||T?"not-allowed":"pointer",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",opacity:!r||T?.6:1},children:[i.jsx(wr,{size:14})," ",T?"Loading…":L?"New Session":"Create New Session"]})]})]}),i.jsx(X2e,{event:z,loading:ee&&!!r,canEdit:!!r,onEditEvent:()=>r&&f(!0)}),d&&r&&i.jsx(ioe,{eventId:r,onClose:()=>f(!1),onSuccess:()=>{f(!1),B()}}),i.jsxs("div",{children:[i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",fontWeight:"var(--font-weight-medium)",textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:"10px"},children:"Overview"}),i.jsx(boe,{loading:ee&&!!r,participantCount:Q==null?void 0:Q.participantCount,sessionCount:Q==null?void 0:Q.sessionCount,quizPollCount:Q==null?void 0:Q.quizPollCount,pointsAwarded:Q==null?void 0:Q.pointsAwarded,pointsRedeemed:Q==null?void 0:Q.pointsRedeemed,statusCounts:Q==null?void 0:Q.statusCounts,upcomingSessionCount:Q==null?void 0:Q.upcomingSessionCount})]}),i.jsx(eae,{}),i.jsx(f7,{embedInDashboard:!0}),i.jsx("div",{style:{paddingTop:"8px",borderTop:"1px solid var(--border)",textAlign:"center"},children:i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:"© 2026 Stratawiz Technologies Pvt Ltd · EventBuzz"})})]}):i.jsx(f7,{});return i.jsxs(i.Fragment,{children:[q(),c&&i.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.35)",zIndex:50,display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>u(null),role:"dialog","aria-modal":"true",children:i.jsxs("div",{style:{background:"var(--card)",borderRadius:"var(--radius-card)",width:"440px",maxWidth:"92vw",boxShadow:"var(--elevation-sm)"},onClick:Y=>Y.stopPropagation(),children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid var(--border)"},children:[i.jsx("h3",{style:{fontFamily:"var(--font-inter)",fontSize:"var(--text-base)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:c==="ratings"?"Event Ratings":"Attendee Feedback"}),i.jsx("button",{type:"button",onClick:()=>u(null),style:{background:"none",border:"none",cursor:"pointer",color:"var(--muted)",display:"flex",padding:"2px"},children:i.jsx(er,{size:16})})]}),i.jsxs("div",{style:{padding:"20px",display:"flex",flexDirection:"column",gap:"10px"},children:[c==="ratings"&&[{user:"Dr. Sharma",rating:5,comment:"Excellent conference, very informative!"},{user:"Prof. Mehta",rating:4,comment:"Well organized, good speakers."},{user:"Dr. Patel",rating:5,comment:"Best conference of the year!"}].map((Y,K)=>i.jsxs("div",{style:{padding:"12px 14px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",display:"flex",flexDirection:"column",gap:"4px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:Y.user}),i.jsxs("span",{style:{color:"var(--chart-2)",fontSize:"var(--text-sm)"},children:["★".repeat(Y.rating),"☆".repeat(5-Y.rating)]})]}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:Y.comment})]},K)),c==="feedback"&&[{user:"Ananya R.",time:"2h ago",msg:"The morning keynote was excellent."},{user:"Rajesh K.",time:"4h ago",msg:"Please improve the AV setup for Session 3."},{user:"Priya M.",time:"1d ago",msg:"Great networking opportunities. Well done!"}].map((Y,K)=>i.jsxs("div",{style:{display:"flex",gap:"10px",padding:"12px 14px",border:"1px solid var(--border)",borderRadius:"var(--radius-button)"},children:[i.jsx("div",{style:{width:"28px",height:"28px",borderRadius:"50%",background:"var(--accent)",color:"var(--accent-foreground)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"var(--text-xs)",fontFamily:"var(--font-inter)",flexShrink:0},children:Y.user[0]}),i.jsxs("div",{children:[i.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center",marginBottom:"3px"},children:[i.jsx("span",{style:{fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",fontWeight:"var(--font-weight-medium)",color:"var(--foreground)"},children:Y.user}),i.jsx("span",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--muted)"},children:Y.time})]}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontFamily:"var(--font-noto-sans)",color:"var(--card-foreground)"},children:Y.msg})]})]},K))]})]})}),h&&r&&i.jsx(V$,{eventId:r,eventName:y,eventStartIso:x,organizationId:w,tracks:S,initialTrackId:h.initialTrackId??void 0,session:h.sessionId?P[h.sessionId]??null:null,onClose:()=>p(null),onSuccess:()=>{p(null),B()},onTrackCreated:Y=>_(K=>[...K,Y])})]})}function bNe(){const{activeNav:e,setActiveNav:t,selectedEventId:r,setSelectedEventId:n,setSearchQuery:o,sidebarCollapsed:a,setSidebarCollapsed:s,drawerOpen:l,setDrawerOpen:c}=eo(),u=qi(),d=u==="mobile"||u==="tablet",f=p=>{n(p),t("dashboard")},h=p=>{o(p),t("search")};return j.useEffect(()=>{!r||e!=="agenda"||t("dashboard")},[r,e,t]),i.jsxs("div",{style:{display:"flex",height:"100vh",overflow:"hidden",background:"var(--background)"},children:[!d&&i.jsx(AI,{activeItem:e,onItemClick:t,collapsed:a,onToggleCollapse:()=>s(p=>!p),selectedEventId:r,onEventSelect:f}),d&&i.jsx(AI,{activeItem:e,onItemClick:t,collapsed:!1,onToggleCollapse:()=>{},drawerOpen:l,onDrawerClose:()=>c(!1),selectedEventId:r,onEventSelect:f}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",minWidth:0},children:[i.jsx(Wie,{onMenuClick:()=>c(p=>!p),onNavigate:t,onEventSelect:f,onOpenSearchPage:h}),r!==null&&qie.has(e)&&i.jsx($ie,{activeItem:e,onNavigate:t}),i.jsx("main",{style:{flex:1,overflowY:"auto",background:"var(--background)"},children:i.jsx("div",{style:{padding:u==="mobile"?"16px 14px":u==="tablet"?"20px 20px":"24px 28px",maxWidth:"1280px"},children:i.jsx(xNe,{})})})]})]})}function S6(){const{user:e,loading:t,checked:r}=Ur(),n=xd();return!r||t?i.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx(fh,{message:"Loading…"})}):e?i.jsx(iq,{}):i.jsx(th,{to:"/login",state:{from:n},replace:!0})}function wNe(){const{navId:e}=A6(),t=bd(),r=e||"home",n=o=>t(`/${o}`);return i.jsx(Pie,{activeNavFromUrl:r,setActiveNavToUrl:n,children:i.jsx(bNe,{})})}S6.AppShellWithNav=wNe;const W3={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",borderRadius:"var(--radius-button)",fontSize:"var(--text-sm)",fontFamily:"var(--font-noto-sans)",textDecoration:"none",color:"var(--sidebar-foreground)",border:"none",background:"transparent",cursor:"pointer"};function SNe(){const{user:e,loading:t,checked:r}=Ur(),n=bd();return!r||t?i.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:i.jsx(fh,{message:"Loading…"})}):!e||e.platform_admin!=="yes"?i.jsx(th,{to:"/home",replace:!0}):i.jsxs("div",{style:{display:"flex",minHeight:"100vh",background:"var(--background)"},children:[i.jsxs("aside",{style:{width:"220px",flexShrink:0,borderRight:"1px solid var(--border)",background:"var(--card)",display:"flex",flexDirection:"column",padding:"16px 12px"},children:[i.jsx("p",{style:{fontSize:"10px",fontFamily:"var(--font-noto-sans)",color:"var(--muted)",fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",margin:"0 8px 12px"},children:"Super Admin"}),i.jsxs(KO,{to:"/super-admin/clients",style:({isActive:o})=>({...W3,background:o?"var(--accent)":"transparent",fontWeight:o?600:400}),children:[i.jsx(nb,{size:16}),"Clients"]}),i.jsxs(KO,{to:"/super-admin/plans",style:({isActive:o})=>({...W3,marginTop:"4px",background:o?"var(--accent)":"transparent",fontWeight:o?600:400}),children:[i.jsx(Tw,{size:16}),"Plans"]}),i.jsx("div",{style:{flex:1}}),i.jsxs("button",{type:"button",onClick:()=>n("/home"),style:{...W3,color:"var(--muted)",marginTop:"8px"},children:[i.jsx(wq,{size:16}),"Back to app"]})]}),i.jsx("main",{style:{flex:1,overflow:"auto",padding:"24px 28px"},children:i.jsx(iq,{})})]})}const bl={width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--input-background)",color:"var(--foreground)",fontSize:"var(--text-sm)",boxSizing:"border-box"};function jNe(e){if(!e)return"—";try{return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}catch{return e}}function kNe(){var Je,vt;const[e,t]=j.useState([]),[r,n]=j.useState(0),[o,a]=j.useState(1),[s]=j.useState(20),[l,c]=j.useState(""),[u,d]=j.useState(""),[f,h]=j.useState(!0),[p,y]=j.useState(""),[m,x]=j.useState(null),[b,w]=j.useState("free"),[k,S]=j.useState([]),[_,P]=j.useState("active"),[O,T]=j.useState(!1),[R,I]=j.useState(!1),[E,A]=j.useState(!1),[F,L]=j.useState(""),[z,V]=j.useState(""),[Q,U]=j.useState(""),[ee,H]=j.useState(""),[B,M]=j.useState(""),[$,q]=j.useState(""),[Y,K]=j.useState("Asia/Kolkata"),[G,re]=j.useState("free"),[J,ae]=j.useState(""),[le,me]=j.useState(""),[Oe,we]=j.useState(""),[ie,Me]=j.useState(""),ke=j.useCallback(async()=>{y(""),h(!0);try{const Ge=await Zu.listOrganizations({page:o,limit:s,search:l||void 0});t(Ge.organizations),n(Ge.total)}catch(Ge){y(Ge instanceof Error?Ge.message:"Failed to load organizations. Check that you are logged in as a platform admin and the API is reachable.")}finally{h(!1)}},[o,s,l]);j.useEffect(()=>{ke()},[ke]),j.useEffect(()=>{Zu.listPlans().then(Ge=>S(Ge.plans)).catch(()=>S([]))},[]);const se=Ge=>{Ge.preventDefault(),a(1),c(u.trim())},fe=Ge=>{var nt,Ae,Te;x(Ge);const Ot=((nt=Ge.subscription)==null?void 0:nt.plan)||((Ae=k[0])==null?void 0:Ae.id)||"free";w(Ot),P(((Te=Ge.subscription)==null?void 0:Te.status)||"active")},Ie=async()=>{if(m){T(!0),y("");try{await Zu.patchOrganizationSubscription(m._id,{plan:b,status:_}),x(null),await ke()}catch(Ge){y(Ge instanceof Error?Ge.message:"Save failed")}finally{T(!1)}}},ce=()=>{var Ge;L(""),V(""),U(""),H(""),M(""),q(""),K("Asia/Kolkata"),re(((Ge=k[0])==null?void 0:Ge.id)??"free"),ae(""),me(""),we(""),Me("")},je=()=>{ce(),I(!0)},qe=async Ge=>{if(Ge.preventDefault(),L(""),!z.trim()){L("Organization name is required.");return}if(!J.trim()||!le){L("Admin email and password are required.");return}if(le.length<8){L("Password must be at least 8 characters.");return}A(!0);try{await Zu.createOrganization({organization:{name:z.trim(),description:Q.trim()||void 0,email:ee.trim()||void 0,phone:B.trim()||void 0,website:$.trim()||void 0,timezone:Y.trim()||void 0,subscription:{plan:G,status:"active"}},admin:{email:J.trim(),password:le,firstName:Oe.trim()||void 0,lastName:ie.trim()||void 0}}),I(!1),ce(),a(1),c(""),d(""),await ke()}catch(Ot){L(Ot instanceof Error?Ot.message:"Could not create organization")}finally{A(!1)}},Ne=Math.max(1,Math.ceil(r/s));return i.jsxs("div",{children:[i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"flex-start",justifyContent:"space-between",gap:"16px",marginBottom:"8px"},children:[i.jsxs("div",{children:[i.jsx("h1",{style:{fontSize:"var(--text-xl)",fontFamily:"var(--font-inter)",fontWeight:600,margin:"0 0 8px",color:"var(--foreground)"},children:"Clients"}),i.jsxs("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",margin:0},children:["All tenant organizations. The first user you add becomes the organization's ",i.jsx("strong",{children:"super_admin"})," (org role)."]})]}),i.jsxs("button",{type:"button",onClick:je,style:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"10px 16px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"#fff",fontSize:"var(--text-sm)",cursor:"pointer",fontWeight:600},children:[i.jsx(wr,{size:18}),"Add organization"]})]}),i.jsxs("form",{onSubmit:se,style:{display:"flex",gap:"10px",marginBottom:"16px",flexWrap:"wrap"},children:[i.jsx("input",{value:u,onChange:Ge=>d(Ge.target.value),placeholder:"Search by name or email",style:{...bl,flex:"1 1 220px",maxWidth:"360px"}}),i.jsx("button",{type:"submit",style:{padding:"8px 16px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"#fff",fontSize:"var(--text-sm)",cursor:"pointer"},children:"Search"})]}),p&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-sm)",marginBottom:"12px"},children:p}),f?i.jsx("p",{style:{color:"var(--muted)"},children:"Loading…"}):i.jsxs(i.Fragment,{children:[i.jsx("div",{style:{overflowX:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius-card)"},children:i.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--text-sm)"},children:[i.jsx("thead",{children:i.jsxs("tr",{style:{background:"var(--accent)",textAlign:"left"},children:[i.jsx("th",{style:{padding:"10px 12px",fontWeight:600},children:"Name"}),i.jsx("th",{style:{padding:"10px 12px",fontWeight:600},children:"Email"}),i.jsx("th",{style:{padding:"10px 12px",fontWeight:600},children:"Plan"}),i.jsx("th",{style:{padding:"10px 12px",fontWeight:600},children:"Status"}),i.jsx("th",{style:{padding:"10px 12px",fontWeight:600},children:"Users"}),i.jsx("th",{style:{padding:"10px 12px",fontWeight:600},children:"Created"}),i.jsx("th",{style:{padding:"10px 12px",fontWeight:600}})]})}),i.jsx("tbody",{children:e.length===0?i.jsx("tr",{children:i.jsx("td",{colSpan:7,style:{padding:"24px 16px",color:"var(--muted)",textAlign:"center"},children:l?"No organizations match your search.":"No organizations yet. Use “Add organization” to create a tenant and its first super admin user."})}):e.map(Ge=>{var Ot,nt;return i.jsxs("tr",{style:{borderTop:"1px solid var(--border)"},children:[i.jsx("td",{style:{padding:"10px 12px",color:"var(--foreground)"},children:Ge.name}),i.jsx("td",{style:{padding:"10px 12px",color:"var(--muted)"},children:Ge.email||"—"}),i.jsx("td",{style:{padding:"10px 12px"},children:((Ot=Ge.subscription)==null?void 0:Ot.plan)??"free"}),i.jsx("td",{style:{padding:"10px 12px"},children:((nt=Ge.subscription)==null?void 0:nt.status)??"—"}),i.jsx("td",{style:{padding:"10px 12px"},children:Ge.userCount??"—"}),i.jsx("td",{style:{padding:"10px 12px",color:"var(--muted)"},children:jNe(Ge.createdAt)}),i.jsx("td",{style:{padding:"10px 12px"},children:i.jsx("button",{type:"button",onClick:()=>fe(Ge),style:{background:"transparent",border:"1px solid var(--border)",borderRadius:"var(--radius-button)",padding:"4px 10px",fontSize:"var(--text-xs)",cursor:"pointer",color:"var(--primary)"},children:"Edit sub"})})]},Ge._id)})})]})}),i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px",marginTop:"16px"},children:[i.jsx("button",{type:"button",disabled:o<=1,onClick:()=>a(Ge=>Math.max(1,Ge-1)),style:{padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",cursor:o<=1?"not-allowed":"pointer"},children:"Previous"}),i.jsxs("span",{style:{fontSize:"var(--text-sm)",color:"var(--muted)"},children:["Page ",o," of ",Ne," (",r," total)"]}),i.jsx("button",{type:"button",disabled:o>=Ne,onClick:()=>a(Ge=>Ge+1),style:{padding:"6px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",cursor:o>=Ne?"not-allowed":"pointer"},children:"Next"})]})]}),m&&i.jsx("div",{role:"presentation",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100,padding:"16px"},onClick:()=>!O&&x(null),children:i.jsxs("div",{role:"dialog",style:{background:"var(--card)",borderRadius:"var(--radius-card)",border:"1px solid var(--border)",padding:"20px",maxWidth:"400px",width:"100%"},onClick:Ge=>Ge.stopPropagation(),children:[i.jsxs("h2",{style:{margin:"0 0 12px",fontSize:"var(--text-base)"},children:["Subscription — ",m.name]}),i.jsxs("label",{style:{display:"block",marginBottom:"8px",fontSize:"var(--text-sm)"},children:["Plan",i.jsx("select",{value:k.some(Ge=>Ge.id===b)?b:((Je=k[0])==null?void 0:Je.id)??b,onChange:Ge=>w(Ge.target.value),style:{display:"block",width:"100%",marginTop:"4px",padding:"8px"},children:(k.length?k:[{id:"free",name:"free"}]).map(Ge=>i.jsxs("option",{value:Ge.id,children:[Ge.name," (",Ge.id,")"]},Ge.id))})]}),i.jsxs("label",{style:{display:"block",marginBottom:"16px",fontSize:"var(--text-sm)"},children:["Status",i.jsxs("select",{value:_,onChange:Ge=>P(Ge.target.value),style:{display:"block",width:"100%",marginTop:"4px",padding:"8px"},children:[i.jsx("option",{value:"active",children:"active"}),i.jsx("option",{value:"trial",children:"trial"}),i.jsx("option",{value:"past_due",children:"past_due"}),i.jsx("option",{value:"cancelled",children:"cancelled"})]})]}),i.jsxs("div",{style:{display:"flex",gap:"10px",justifyContent:"flex-end"},children:[i.jsx("button",{type:"button",disabled:O,onClick:()=>x(null),style:{padding:"8px 14px"},children:"Cancel"}),i.jsx("button",{type:"button",disabled:O,onClick:()=>void Ie(),style:{padding:"8px 14px",background:"var(--primary)",color:"#fff",border:"none",borderRadius:"var(--radius-button)",cursor:"pointer"},children:O?"Saving…":"Save"})]})]})}),R&&i.jsx("div",{role:"presentation",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:110,padding:"16px",overflowY:"auto"},onClick:()=>!E&&I(!1),children:i.jsxs("form",{onSubmit:qe,style:{background:"var(--card)",borderRadius:"var(--radius-card)",border:"1px solid var(--border)",padding:"20px",maxWidth:"480px",width:"100%",maxHeight:"90vh",overflowY:"auto"},onClick:Ge=>Ge.stopPropagation(),children:[i.jsx("h2",{style:{margin:"0 0 6px",fontSize:"var(--text-lg)"},children:"New organization"}),i.jsxs("p",{style:{margin:"0 0 16px",fontSize:"var(--text-xs)",color:"var(--muted)"},children:["Creates the tenant org and one user with org role ",i.jsx("code",{children:"super_admin"}),". They can sign in at the normal login page with the email and password below."]}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--muted)",margin:"0 0 8px"},children:"Organization"}),i.jsxs("label",{style:{display:"block",marginBottom:"10px",fontSize:"var(--text-sm)"},children:["Name ",i.jsx("span",{style:{color:"var(--destructive)"},children:"*"}),i.jsx("input",{required:!0,value:z,onChange:Ge=>V(Ge.target.value),style:{...bl,marginTop:"4px"}})]}),i.jsxs("label",{style:{display:"block",marginBottom:"10px",fontSize:"var(--text-sm)"},children:["Description",i.jsx("textarea",{value:Q,onChange:Ge=>U(Ge.target.value),rows:2,style:{...bl,marginTop:"4px",resize:"vertical"}})]}),i.jsxs("label",{style:{display:"block",marginBottom:"10px",fontSize:"var(--text-sm)"},children:["Contact email",i.jsx("input",{type:"email",value:ee,onChange:Ge=>H(Ge.target.value),style:{...bl,marginTop:"4px"},placeholder:"billing@company.com"})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px",marginBottom:"10px"},children:[i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)"},children:["Phone",i.jsx("input",{value:B,onChange:Ge=>M(Ge.target.value),style:{...bl,marginTop:"4px"}})]}),i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)"},children:["Timezone",i.jsx("input",{value:Y,onChange:Ge=>K(Ge.target.value),style:{...bl,marginTop:"4px"}})]})]}),i.jsxs("label",{style:{display:"block",marginBottom:"10px",fontSize:"var(--text-sm)"},children:["Website",i.jsx("input",{value:$,onChange:Ge=>q(Ge.target.value),style:{...bl,marginTop:"4px"},placeholder:"https://…"})]}),i.jsxs("label",{style:{display:"block",marginBottom:"16px",fontSize:"var(--text-sm)"},children:["Initial plan",i.jsx("select",{value:k.some(Ge=>Ge.id===G)?G:((vt=k[0])==null?void 0:vt.id)??G,onChange:Ge=>re(Ge.target.value),style:{...bl,marginTop:"4px"},children:(k.length?k:[{id:"free",name:"free"}]).map(Ge=>i.jsxs("option",{value:Ge.id,children:[Ge.name," (",Ge.id,")"]},Ge.id))})]}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--muted)",margin:"0 0 8px"},children:"First user (super admin)"}),i.jsxs("label",{style:{display:"block",marginBottom:"10px",fontSize:"var(--text-sm)"},children:["Email ",i.jsx("span",{style:{color:"var(--destructive)"},children:"*"}),i.jsx("input",{required:!0,type:"email",value:J,onChange:Ge=>ae(Ge.target.value),style:{...bl,marginTop:"4px"},autoComplete:"off"})]}),i.jsxs("label",{style:{display:"block",marginBottom:"10px",fontSize:"var(--text-sm)"},children:["Password ",i.jsx("span",{style:{color:"var(--destructive)"},children:"*"})," (min 8 characters)",i.jsx("input",{required:!0,type:"password",value:le,onChange:Ge=>me(Ge.target.value),style:{...bl,marginTop:"4px"},autoComplete:"new-password"})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px",marginBottom:"16px"},children:[i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)"},children:["First name",i.jsx("input",{value:Oe,onChange:Ge=>we(Ge.target.value),style:{...bl,marginTop:"4px"}})]}),i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)"},children:["Last name",i.jsx("input",{value:ie,onChange:Ge=>Me(Ge.target.value),style:{...bl,marginTop:"4px"}})]})]}),F&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-sm)",marginBottom:"12px"},children:F}),i.jsxs("div",{style:{display:"flex",gap:"10px",justifyContent:"flex-end"},children:[i.jsx("button",{type:"button",disabled:E,onClick:()=>I(!1),style:{padding:"8px 14px"},children:"Cancel"}),i.jsx("button",{type:"submit",disabled:E,style:{padding:"8px 14px",background:"var(--primary)",color:"#fff",border:"none",borderRadius:"var(--radius-button)",cursor:E?"not-allowed":"pointer"},children:E?"Creating…":"Create organization"})]})]})})]})}const _Ne=/^[a-z][a-z0-9_]{0,62}$/;function CNe(e){return e?e.contactSales?"Contact sales":e.amount===0?`${e.currency} 0`:e.amount==null?"—":`${e.currency} ${Number(e.amount).toLocaleString("en-IN")} / ${e.interval}`:"—"}const $W={event_page:"Event Page",event_microsite:"Event microsite",custom_domain_microsite:"Custom domain event microsite",custom_website:"Custom Website"};function ENe(e){return e==null?"Unlimited outreach emails":`Up to ${Number(e).toLocaleString("en-IN")} outreach emails`}const zc={width:"100%",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--input-background)",color:"var(--foreground)",fontSize:"var(--text-sm)",boxSizing:"border-box"};function ANe(){const[e,t]=j.useState([]),[r,n]=j.useState([]),[o,a]=j.useState(!0),[s,l]=j.useState(""),[c,u]=j.useState(!1),[d,f]=j.useState(null),[h,p]=j.useState(""),[y,m]=j.useState(""),[x,b]=j.useState(""),[w,k]=j.useState(""),[S,_]=j.useState(""),[P,O]=j.useState(""),[T,R]=j.useState("INR"),[I,E]=j.useState("month"),[A,F]=j.useState(!1),[L,z]=j.useState("event_page"),[V,Q]=j.useState("500"),[U,ee]=j.useState(new Set),[H,B]=j.useState(!1),[M,$]=j.useState(""),q=j.useMemo(()=>new Map(r.map(we=>[we.key,we])),[r]),Y=j.useMemo(()=>{var we;return((we=q.get("event_website"))==null?void 0:we.options)??[]},[q]),K=j.useCallback(async()=>{l(""),a(!0);try{const[we,ie]=await Promise.all([Zu.listPermissions(),Zu.listPlans()]);n(we.features),t(ie.plans)}catch(we){l(we instanceof Error?we.message:"Failed to load")}finally{a(!1)}},[]);j.useEffect(()=>{K()},[K]);const G=()=>{f(null),p(""),m(""),b(""),k(""),_(""),O(""),R("INR"),E("month"),F(!1),z("event_page"),Q("500"),ee(new Set),$(""),u(!0)},re=we=>{var se;f(we.id),p(we.id),m(we.name),b(we.tagline??""),k(we.defaultLimits.maxEvents!=null?String(we.defaultLimits.maxEvents):""),_(we.defaultLimits.maxParticipants!=null?String(we.defaultLimits.maxParticipants):"");const ie=we.pricing;F(!!(ie!=null&&ie.contactSales)),R((ie==null?void 0:ie.currency)??"INR"),E((ie==null?void 0:ie.interval)??"month"),ie!=null&&ie.contactSales?O(""):(ie==null?void 0:ie.amount)===0?O("0"):(ie==null?void 0:ie.amount)!=null&&Number.isFinite(ie.amount)?O(String(ie.amount)):O("");const Me=we.featureValues;z((Me==null?void 0:Me.event_website)??"event_page");const ke=(se=Me==null?void 0:Me.email_outreach_campaigns)==null?void 0:se.maxEmails;Q(ke==null?"":String(ke)),ee(new Set(we.featureKeys)),$(""),u(!0)},J=we=>{ee(ie=>{const Me=new Set(ie);return Me.has(we)?Me.delete(we):Me.add(we),Me})},ae=(we,ie)=>{ee(Me=>{const ke=new Set(Me);for(const se of we)ie?ke.add(se):ke.delete(se);return ke})},le=we=>{const ie=we.trim();if(ie==="")return null;const Me=Number(ie);return Number.isFinite(Me)?Me:null},me=async we=>{we.preventDefault(),$("");const ie=[...U].filter(ce=>r.some(je=>je.key===ce)),Me={maxEvents:le(w),maxParticipants:le(S)};if(!y.trim()){$("Name is required.");return}let ke;if(A)ke={amount:null,currency:T.trim()||"INR",interval:I,contactSales:!0};else{const ce=P.trim(),je=ce===""?0:Number(ce);if(!Number.isFinite(je)||je<0){$("Price must be a non-negative number (or enable “Contact sales”).");return}ke={amount:je,currency:T.trim()||"INR",interval:I,contactSales:!1}}const se=V.trim();let fe;if(se==="")fe=null;else{const ce=Number(se);if(!Number.isFinite(ce)||ce<0){$("Email outreach cap must be empty (unlimited) or a non-negative number.");return}fe=ce}const Ie={event_website:L,email_outreach_campaigns:{maxEmails:fe}};if(!d){const ce=h.trim();if(!_Ne.test(ce)){$("Plan id must be a lowercase slug: start with a letter, then letters, digits, or underscores (max 64 characters).");return}B(!0);try{const je=await Zu.createPlan({planId:ce,name:y.trim(),tagline:x,featureKeys:ie,defaultLimits:Me,pricing:ke,featureValues:Ie});t(je.plans),u(!1)}catch(je){$(je instanceof Error?je.message:"Save failed")}finally{B(!1)}return}B(!0);try{const ce=await Zu.updatePlan(d,{name:y.trim(),tagline:x,featureKeys:ie,defaultLimits:Me,pricing:ke,featureValues:Ie});t(ce.plans),u(!1)}catch(ce){$(ce instanceof Error?ce.message:"Save failed")}finally{B(!1)}},Oe=async we=>{const ie=we.organizationCount??0,Me=ie>0?`This plan is used by ${ie} organization(s). Move them to another plan before deleting.`:`Delete plan “${we.name}” (${we.id})? This cannot be undone.`;if(ie>0){window.alert(Me);return}if(window.confirm(Me))try{const ke=await Zu.deletePlan(we.id);t(ke.plans)}catch(ke){window.alert(ke instanceof Error?ke.message:"Delete failed")}};return i.jsxs("div",{children:[i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"flex-start",justifyContent:"space-between",gap:"16px",marginBottom:"8px"},children:[i.jsxs("div",{children:[i.jsx("h1",{style:{fontSize:"var(--text-xl)",fontFamily:"var(--font-inter)",fontWeight:600,margin:"0 0 8px",color:"var(--foreground)"},children:"Plans"}),i.jsxs("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",margin:0},children:["Create and edit subscription tiers. Default feature sets follow ",i.jsx("strong",{children:"eventbuzz_plans.source.csv"})," (Manage / Engage rows). Tier caps for Participants, Event Website, and Email outreach are editable below the limits grid. Plan id is a permanent slug."]})]}),i.jsxs("button",{type:"button",onClick:G,style:{display:"inline-flex",alignItems:"center",gap:"8px",padding:"10px 16px",borderRadius:"var(--radius-button)",border:"none",background:"var(--primary)",color:"#fff",fontSize:"var(--text-sm)",cursor:"pointer",fontWeight:600},children:[i.jsx(wr,{size:18}),"Add plan"]})]}),s&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-sm)",marginBottom:"12px"},children:s}),o?i.jsx("p",{style:{color:"var(--muted)"},children:"Loading…"}):i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:e.map(we=>{var ie;return i.jsxs("div",{style:{border:"1px solid var(--border)",borderRadius:"var(--radius-card)",padding:"14px 16px",background:"var(--card)",display:"flex",flexWrap:"wrap",alignItems:"flex-start",justifyContent:"space-between",gap:"12px"},children:[i.jsxs("div",{children:[i.jsx("p",{style:{margin:0,fontWeight:600,fontSize:"var(--text-base)"},children:we.name}),we.tagline?i.jsx("p",{style:{margin:"6px 0 0",fontSize:"var(--text-sm)",color:"var(--foreground)",whiteSpace:"pre-line",lineHeight:1.45},children:we.tagline}):null,i.jsxs("p",{style:{margin:"8px 0 0",fontSize:"var(--text-xs)",color:"var(--muted)"},children:["id: ",i.jsx("code",{style:{fontSize:"11px"},children:we.id}),we.organizationCount!=null&&i.jsxs("span",{style:{marginLeft:"8px"},children:["· ",we.organizationCount," org(s)"]})]}),i.jsx("p",{style:{margin:"6px 0 0",fontSize:"var(--text-sm)",color:"var(--foreground)"},children:CNe(we.pricing)}),we.featureValues?i.jsxs("p",{style:{margin:"6px 0 0",fontSize:"var(--text-xs)",color:"var(--foreground)",lineHeight:1.45},children:[$W[we.featureValues.event_website]??we.featureValues.event_website," · ",ENe((ie=we.featureValues.email_outreach_campaigns)==null?void 0:ie.maxEmails)]}):null,i.jsxs("p",{style:{margin:"8px 0 0",fontSize:"var(--text-sm)",color:"var(--muted)"},children:[we.featureKeys.length," features · max events: ",we.defaultLimits.maxEvents??"∞"," · max participants:"," ",we.defaultLimits.maxParticipants??"∞"]})]}),i.jsxs("div",{style:{display:"flex",gap:"8px"},children:[i.jsxs("button",{type:"button",onClick:()=>re(we),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"var(--background)",cursor:"pointer",fontSize:"var(--text-xs)"},children:[i.jsx(Ii,{size:14})," Edit"]}),i.jsxs("button",{type:"button",onClick:()=>void Oe(we),title:we.organizationCount?"Plan in use":"Delete plan",disabled:!!(we.organizationCount&&we.organizationCount>0),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 12px",borderRadius:"var(--radius-button)",border:"1px solid var(--border)",background:"transparent",color:"var(--destructive)",cursor:we.organizationCount?"not-allowed":"pointer",fontSize:"var(--text-xs)",opacity:we.organizationCount?.5:1},children:[i.jsx(gn,{size:14})," Delete"]})]})]},we.id)})}),c&&i.jsx("div",{role:"presentation",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",zIndex:120,display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",overflowY:"auto"},onClick:()=>!H&&u(!1),children:i.jsxs("form",{onSubmit:me,style:{background:"var(--card)",borderRadius:"var(--radius-card)",border:"1px solid var(--border)",padding:"20px",maxWidth:"560px",width:"100%",maxHeight:"92vh",overflowY:"auto"},onClick:we=>we.stopPropagation(),children:[i.jsx("h2",{style:{margin:"0 0 16px",fontSize:"var(--text-lg)"},children:d?"Edit plan":"New plan"}),!d&&i.jsxs("label",{style:{display:"block",marginBottom:"12px",fontSize:"var(--text-sm)"},children:["Plan id (slug, cannot change later)",i.jsx("input",{value:h,onChange:we=>p(we.target.value),placeholder:"e.g. growth",style:{...zc,marginTop:"4px"},autoComplete:"off"})]}),d&&i.jsxs("p",{style:{fontSize:"var(--text-sm)",color:"var(--muted)",margin:"0 0 12px"},children:["Plan id: ",i.jsx("code",{children:d})]}),i.jsxs("label",{style:{display:"block",marginBottom:"12px",fontSize:"var(--text-sm)"},children:["Display name",i.jsx("input",{required:!0,value:y,onChange:we=>m(we.target.value),style:{...zc,marginTop:"4px"}})]}),i.jsxs("label",{style:{display:"block",marginBottom:"12px",fontSize:"var(--text-sm)"},children:["Pricing / subtitle (shown in catalog & billing — use line breaks as needed)",i.jsx("textarea",{value:x,onChange:we=>b(we.target.value),rows:4,style:{...zc,marginTop:"4px",resize:"vertical",fontFamily:"var(--font-noto-sans)"},placeholder:`e.g. ₹0
|
||
forever · up to 50 participants/event`})]}),i.jsxs("fieldset",{style:{border:"1px solid var(--border)",borderRadius:"var(--radius-button)",padding:"12px",marginBottom:"12px"},children:[i.jsx("legend",{style:{fontSize:"var(--text-xs)",fontWeight:700,color:"var(--muted)",padding:"0 6px"},children:"Structured price (for future checkout)"}),i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"var(--text-sm)",marginBottom:"10px",cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:A,onChange:we=>{F(we.target.checked),we.target.checked&&O("")}}),"Contact sales (no fixed amount)"]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"10px",opacity:A?.55:1,pointerEvents:A?"none":"auto"},children:[i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)"},children:["Amount (",T,")",i.jsx("input",{value:P,onChange:we=>O(we.target.value),disabled:A,placeholder:"0",style:{...zc,marginTop:"4px"},inputMode:"decimal"})]}),i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)"},children:["Currency",i.jsx("input",{value:T,onChange:we=>R(we.target.value.toUpperCase()),style:{...zc,marginTop:"4px"},maxLength:10})]}),i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)"},children:["Interval",i.jsxs("select",{value:I,onChange:we=>E(we.target.value),style:{...zc,marginTop:"4px"},children:[i.jsx("option",{value:"none",children:"none"}),i.jsx("option",{value:"month",children:"month"}),i.jsx("option",{value:"year",children:"year"}),i.jsx("option",{value:"custom",children:"custom"})]})]})]}),i.jsx("p",{style:{margin:"8px 0 0",fontSize:"var(--text-xs)",color:"var(--muted)"},children:"Amount is in major units (e.g. INR rupees); payment gateways can multiply by 100 for smallest currency units."})]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px",marginBottom:"12px"},children:[i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)"},children:["Max events (empty = unlimited)",i.jsx("input",{value:w,onChange:we=>k(we.target.value),style:{...zc,marginTop:"4px"},inputMode:"numeric"})]}),i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)"},children:["Participants cap (CSV row “Participants”; empty = unlimited)",i.jsx("input",{value:S,onChange:we=>_(we.target.value),style:{...zc,marginTop:"4px"},inputMode:"numeric"})]})]}),i.jsxs("fieldset",{style:{border:"1px solid var(--border)",borderRadius:"var(--radius-button)",padding:"12px",marginBottom:"12px"},children:[i.jsx("legend",{style:{fontSize:"var(--text-xs)",fontWeight:700,color:"var(--muted)",padding:"0 6px"},children:"CSV-style values (eventbuzz_plans)"}),i.jsxs("label",{style:{display:"block",marginBottom:"10px",fontSize:"var(--text-sm)"},children:["Event Website (tier)",i.jsx("select",{value:L,onChange:we=>z(we.target.value),style:{...zc,marginTop:"4px"},children:(Y.length?Y:Object.entries($W).map(([we,ie])=>({value:we,label:ie}))).map(we=>i.jsx("option",{value:we.value,children:we.label},we.value))})]}),i.jsxs("label",{style:{display:"block",fontSize:"var(--text-sm)"},children:["Email outreach campaigns — max emails (empty = unlimited)",i.jsx("input",{value:V,onChange:we=>Q(we.target.value),placeholder:"e.g. 5000",style:{...zc,marginTop:"4px"},inputMode:"numeric"})]}),i.jsxs("p",{style:{margin:"8px 0 0",fontSize:"var(--text-xs)",color:"var(--muted)"},children:["Matches the “Event Website” and “Email outreach campaigns” columns in the spreadsheet; defaults are seeded from"," ",i.jsx("code",{style:{fontSize:"10px"},children:"eventbuzz_plans.source.csv"}),"."]})]}),i.jsx("p",{style:{fontSize:"var(--text-xs)",fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--muted)",margin:"0 0 8px"},children:"Features (Manage & Engage)"}),i.jsx("div",{style:{border:"1px solid var(--border)",borderRadius:"var(--radius-button)",padding:"12px",maxHeight:"280px",overflowY:"auto",marginBottom:"16px"},children:MX.map(({title:we,keys:ie})=>{const Me=ie.map(fe=>q.get(fe)).filter(fe=>!!fe),ke=Me.map(fe=>fe.key),se=ke.length>0&&ke.every(fe=>U.has(fe));return i.jsxs("div",{style:{marginBottom:"14px"},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"6px"},children:[i.jsx("span",{style:{fontSize:"var(--text-xs)",fontWeight:700,color:"var(--primary)",letterSpacing:"0.04em"},children:we}),i.jsx("button",{type:"button",onClick:()=>ae(ke,!se),style:{fontSize:"var(--text-xs)",background:"none",border:"none",color:"var(--primary)",cursor:"pointer",padding:0},children:se?"Deselect all":"Select all"})]}),Me.map(fe=>i.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"8px",fontSize:"var(--text-xs)",color:"var(--foreground)",marginBottom:"6px",cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:U.has(fe.key),onChange:()=>J(fe.key),style:{marginTop:"2px"}}),i.jsxs("span",{children:[i.jsx("strong",{children:fe.label}),i.jsx("span",{style:{color:"var(--muted)",marginLeft:"6px",fontFamily:"monospace",fontSize:"10px"},children:fe.key})]})]},fe.key))]},we)})}),M&&i.jsx("p",{style:{color:"var(--destructive)",fontSize:"var(--text-sm)",marginBottom:"12px"},children:M}),i.jsxs("div",{style:{display:"flex",gap:"10px",justifyContent:"flex-end"},children:[i.jsx("button",{type:"button",disabled:H,onClick:()=>u(!1),style:{padding:"8px 14px"},children:"Cancel"}),i.jsx("button",{type:"submit",disabled:H,style:{padding:"8px 14px",background:"var(--primary)",color:"#fff",border:"none",borderRadius:"var(--radius-button)",cursor:H?"not-allowed":"pointer"},children:H?"Saving…":d?"Save changes":"Create plan"})]})]})})]})}const TNe=[{code:"AN",name:"Andaman & Nicobar"},{code:"AP",name:"Andhra Pradesh"},{code:"AR",name:"Arunachal Pradesh"},{code:"AS",name:"Assam"},{code:"BR",name:"Bihar"},{code:"CH",name:"Chandigarh"},{code:"CT",name:"Chhattisgarh"},{code:"DL",name:"Delhi"},{code:"GA",name:"Goa"},{code:"GJ",name:"Gujarat"},{code:"HR",name:"Haryana"},{code:"HP",name:"Himachal Pradesh"},{code:"JK",name:"Jammu & Kashmir"},{code:"JH",name:"Jharkhand"},{code:"KA",name:"Karnataka"},{code:"KL",name:"Kerala"},{code:"LA",name:"Ladakh"},{code:"MP",name:"Madhya Pradesh"},{code:"MH",name:"Maharashtra"},{code:"MN",name:"Manipur"},{code:"ML",name:"Meghalaya"},{code:"MZ",name:"Mizoram"},{code:"NL",name:"Nagaland"},{code:"OR",name:"Odisha"},{code:"PY",name:"Puducherry"},{code:"PB",name:"Punjab"},{code:"RJ",name:"Rajasthan"},{code:"SK",name:"Sikkim"},{code:"TN",name:"Tamil Nadu"},{code:"TG",name:"Telangana"},{code:"TR",name:"Tripura"},{code:"UP",name:"Uttar Pradesh"},{code:"UT",name:"Uttarakhand"},{code:"WB",name:"West Bengal"}];function UW(){return{firstName:"",lastName:"",email:"",phone:"",organization:"",designation:"",displayName:"",formData:{}}}function PNe(e){return e.mapsTo==="email"||e.mapsTo==="firstName"||e.mapsTo==="lastName"}const HW="__eb_payment_cancelled__";function q3(e,t){return`${(e/100).toLocaleString("en-IN",{minimumFractionDigits:2,maximumFractionDigits:2})} ${t}`}const Ct={ink:"#1a1a18",accent:"#c17d5c",body:"#5a5550",muted:"#7a7068",cream:"#ede8e0",pageBg:"#f8f4ef",card:"#ffffff",border:"rgba(26,26,24,0.12)",borderHairline:"rgba(26,26,24,0.08)",primary:"#7a2340",express:"#5a31f5",success:"#8a9e85",serif:'"Cormorant Garamond", "Georgia", serif',sans:'"Raleway", system-ui, sans-serif'};function ONe(e){return new Promise((t,r)=>{const n=new FileReader;n.onload=()=>t(String(n.result??"")),n.onerror=()=>r(n.error??new Error("read failed")),n.readAsDataURL(e)})}function INe(){var Ie;const{eventId:e}=A6(),[t]=aq(),r=j.useMemo(()=>{var qe,Ne;const ce=(qe=t.get("ticket_id"))==null?void 0:qe.trim(),je=(Ne=t.get("ticketId"))==null?void 0:Ne.trim();return ce||je||""},[t]),[n,o]=j.useState(null),[a,s]=j.useState([]),[l,c]=j.useState(!0),[u,d]=j.useState(null),[f,h]=j.useState(null),[p,y]=j.useState(""),[m,x]=j.useState(1),[b,w]=j.useState(""),[k,S]=j.useState(""),[_,P]=j.useState([UW()]),[O,T]=j.useState(null),[R,I]=j.useState(null),[E,A]=j.useState(!1),[F,L]=j.useState(!1),[z,V]=j.useState(!1),[Q,U]=j.useState("loading"),[ee,H]=j.useState("online"),[B,M]=j.useState(null),$=j.useMemo(()=>Q==="manual"?!0:Q==="both"?ee==="manual":!1,[Q,ee]),[q,Y]=j.useState(null),[K,G]=j.useState(""),[re,J]=j.useState(!1),[ae,le]=j.useState(null),me=j.useMemo(()=>a.find(ce=>ce._id===p),[a,p]),Oe=!!(r&&a.some(ce=>ce._id===r));j.useEffect(()=>{if(!e)return;let ce=!1;return c(!0),d(null),h(null),U("loading"),Promise.all([lf.getEventSummary(e),lf.listTickets(e),lf.checkoutOptions(e)]).then(([je,qe,Ne])=>{if(ce)return;o(je),s(qe),Ne.onlineAvailable&&Ne.manualUpi?(U("both"),H("online"),M(Ne.manualUpi)):Ne.onlineAvailable?(U("online"),M(null)):Ne.manualUpi?(U("manual"),M(Ne.manualUpi)):(U("none"),M(null));const Je=r;Je?qe.some(Ge=>Ge._id===Je)?y(Je):(h("This ticket link is invalid or no longer available."),qe[0]&&y(qe[0]._id)):qe[0]&&y(qe[0]._id)}).catch(je=>{ce||d(je instanceof Error?je.message:"Failed to load")}).finally(()=>{ce||c(!1)}),()=>{ce=!0}},[e,r]),j.useEffect(()=>{P(ce=>{const je=[];for(let qe=0;qe<m;qe++)je.push(ce[qe]?{...ce[qe],formData:{...ce[qe].formData}}:UW());return je})},[m]),j.useEffect(()=>{if(!e||!p||Q==="loading"||Q==="none")return;let ce=!1;A(!0);const je=me,qe=!!(je!=null&&je.requiresBillingState),Ne={ticketId:p,quantity:m,billingStateCode:qe?b:b||void 0};return($?lf.manualQuote(e,Ne):lf.quote(e,Ne)).then(vt=>{ce||(T(vt.totalMinor),I(vt))}).catch(()=>{ce||(T(null),I(null))}).finally(()=>{ce||A(!1)}),()=>{ce=!0}},[e,p,m,b,me,Q,$]),j.useEffect(()=>{var Ge;if(!$||!B||B.manualQrMode!=="dynamic"){le(null);return}const ce=(Ge=B.upiId)==null?void 0:Ge.trim(),je=(B.eventName||(n==null?void 0:n.name)||"").trim();if(!ce||!(me!=null&&me.name)||!je||O==null){le(null);return}const qe=`${me.name} · ${je}`.slice(0,99),Ne=(O/100).toFixed(2),Je=yQ({pa:ce,pn:qe,am:Ne});if(!Je){le(null);return}let vt=!1;return Mw.toDataURL(Je,{margin:1,width:280,errorCorrectionLevel:"M"}).then(Ot=>{vt||le(Ot)}),()=>{vt=!0}},[$,B,me==null?void 0:me.name,n==null?void 0:n.name,O]);const we=(ce,je)=>{P(qe=>{const Ne=[...qe];return Ne[ce]={...Ne[ce],...je},Ne})},ie=(ce,je,qe)=>{P(Ne=>{const Je=[...Ne],vt={...Je[ce].formData,[je]:qe};return Je[ce]={...Je[ce],formData:vt},Je})},Me=async()=>{if(!e||!p||O==null)return;const ce=k.trim();if(!ce){window.alert("Enter purchaser email (receipts).");return}for(let qe=0;qe<_.length;qe++){const Ne=_[qe];if(!Ne.firstName.trim()||!Ne.lastName.trim()||!Ne.email.trim()){window.alert(`Complete name and email for attendee ${qe+1}.`);return}}const je=_.map(qe=>qe.email.trim().toLowerCase());if(new Set(je).size!==je.length){window.alert("Each attendee must have a unique email.");return}if(me!=null&&me.requiresBillingState&&!b){window.alert("Select billing state for tax.");return}L(!0);try{if($){if(!q){window.alert("Attach a screenshot of your UPI payment."),L(!1);return}const vt=await ONe(q);await lf.manualSubmit(e,{ticketId:p,quantity:m,billingStateCode:b||void 0,purchaserEmail:ce,expectedTotalMinor:O,screenshotDataUrl:vt,buyerNote:K.trim()||void 0,attendees:_.map(Ge=>({firstName:Ge.firstName.trim(),lastName:Ge.lastName.trim(),email:Ge.email.trim(),phone:Ge.phone.trim()||void 0,organization:Ge.organization.trim()||void 0,designation:Ge.designation.trim()||void 0,displayName:Ge.displayName.trim()||void 0,formData:Ge.formData}))}),J(!0);return}const qe=`tix-${e}-${Date.now()}-${Math.random().toString(36).slice(2,10)}`,Ne=await lf.checkout(e,{ticketId:p,quantity:m,billingStateCode:b||void 0,purchaserEmail:ce,expectedTotalMinor:O,idempotencyKey:qe,attendees:_.map(vt=>({firstName:vt.firstName.trim(),lastName:vt.lastName.trim(),email:vt.email.trim(),phone:vt.phone.trim()||void 0,organization:vt.organization.trim()||void 0,designation:vt.designation.trim()||void 0,displayName:vt.displayName.trim()||void 0,formData:vt.formData}))});await P6();const Je=window.Razorpay;await new Promise((vt,Ge)=>{var Ae,Te;let Ot=!1;const nt=new Je({key:Ne.keyId,amount:Ne.amount,currency:Ne.currency,order_id:Ne.orderId,name:(n==null?void 0:n.name)||"Event",description:(me==null?void 0:me.name)||"Ticket",handler:wt=>{Ot=!0,lf.verifyPayment(e,{orderId:wt.razorpay_order_id,paymentId:wt.razorpay_payment_id,signature:wt.razorpay_signature}).then(()=>vt()).catch(ft=>Ge(ft instanceof Error?ft:new Error("Verification failed")))},modal:{ondismiss:()=>{Ot||Ge(new Error(HW))}},theme:{color:Ct.primary},prefill:{email:ce,name:`${((Ae=_[0])==null?void 0:Ae.firstName)||""} ${((Te=_[0])==null?void 0:Te.lastName)||""}`.trim()||void 0}});nt.on("payment.failed",wt=>{var ft;Ge(new Error(((ft=wt.error)==null?void 0:ft.description)||"Payment failed"))}),nt.open()}),V(!0)}catch(qe){const Ne=qe instanceof Error?qe.message:"Checkout failed";Ne!==HW&&window.alert(Ne)}finally{L(!1)}};if(!e)return i.jsx("p",{style:{padding:24,fontFamily:"system-ui"},children:"Invalid link."});if(l)return i.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:Ct.sans,background:Ct.pageBg,color:Ct.muted,letterSpacing:"0.12em",textTransform:"uppercase",fontSize:"0.75rem"},children:"Loading…"});if(u||!a.length)return i.jsxs("div",{style:{minHeight:"100vh",padding:"48px 24px",fontFamily:Ct.sans,maxWidth:560,margin:"0 auto",background:Ct.pageBg,color:Ct.body},children:[i.jsx("p",{style:{fontSize:"0.75rem",fontWeight:600,letterSpacing:"0.18em",textTransform:"uppercase",color:Ct.accent,margin:"0 0 12px"},children:"Tickets"}),i.jsx("h1",{style:{fontFamily:Ct.serif,fontSize:"2.25rem",fontWeight:400,color:Ct.ink,margin:"0 0 16px",lineHeight:1.15},children:"Unavailable"}),i.jsx("p",{style:{margin:0,lineHeight:1.6},children:u||"There are no active tickets for this event."})]});if(!l&&Q==="none")return i.jsxs("div",{style:{minHeight:"100vh",padding:"48px 24px",fontFamily:Ct.sans,maxWidth:560,margin:"0 auto",background:Ct.pageBg,color:Ct.body},children:[i.jsx("p",{style:{fontSize:"0.75rem",fontWeight:600,letterSpacing:"0.18em",textTransform:"uppercase",color:Ct.accent,margin:"0 0 12px"},children:"Event"}),i.jsx("h1",{style:{fontFamily:Ct.serif,fontSize:"2.5rem",fontWeight:400,color:Ct.ink,margin:"0 0 16px",lineHeight:1.1},children:(n==null?void 0:n.name)||"Event"}),i.jsx("p",{style:{margin:0,lineHeight:1.65},children:"Ticketing is not available yet: the organiser has not connected their Razorpay account for tickets or enabled UPI checkout for this event."})]});const ke=ce=>(ce||[]).filter(je=>je.label&&!PNe(je)),se={width:"100%",padding:"12px 14px",borderRadius:0,border:`1px solid ${Ct.border}`,fontFamily:Ct.sans,fontSize:"0.9375rem",color:Ct.ink,background:Ct.card,boxSizing:"border-box"},fe={display:"block",fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.14em",textTransform:"uppercase",color:Ct.muted,marginBottom:8};return i.jsx("div",{style:{minHeight:"100vh",background:Ct.pageBg,color:Ct.ink,fontFamily:Ct.sans,padding:"clamp(24px, 4vw, 51px) clamp(16px, 4vw, 51px) 64px"},children:i.jsxs("div",{style:{maxWidth:720,margin:"0 auto"},children:[i.jsxs("header",{style:{marginBottom:36},children:[i.jsx("p",{style:{fontSize:"0.76rem",fontWeight:500,letterSpacing:"0.2em",textTransform:"uppercase",color:Ct.accent,margin:"0 0 10px"},children:"Event tickets"}),i.jsx("h1",{style:{fontFamily:Ct.serif,fontSize:"clamp(2.25rem, 6vw, 3.25rem)",fontWeight:300,lineHeight:1.08,letterSpacing:"-0.02em",margin:"0 0 14px"},children:(n==null?void 0:n.name)||"Event"}),n!=null&&n.subtitle?i.jsx("p",{style:{margin:0,color:Ct.body,fontSize:"1rem",fontWeight:500,lineHeight:1.55,maxWidth:540},children:n.subtitle}):null,((n==null?void 0:n.startDate)||(n==null?void 0:n.location))&&i.jsxs("p",{style:{margin:"14px 0 0",fontSize:"0.9rem",color:Ct.muted,fontWeight:400},children:[n!=null&&n.startDate?new Date(n.startDate).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"}):"",n!=null&&n.location?` · ${n.location}`:""]})]}),re?i.jsxs("div",{style:{background:Ct.cream,padding:"40px 28px",borderLeft:`3px solid ${Ct.accent}`,textAlign:"center"},children:[i.jsx("p",{style:{fontSize:"0.7rem",fontWeight:600,letterSpacing:"0.2em",textTransform:"uppercase",color:Ct.accent,margin:"0 0 12px"},children:"Submitted"}),i.jsx("h2",{style:{fontFamily:Ct.serif,fontSize:"2rem",fontWeight:400,margin:"0 0 16px",color:Ct.ink},children:"We received your proof"}),i.jsx("p",{style:{color:Ct.body,margin:0,lineHeight:1.65,maxWidth:420,marginLeft:"auto",marginRight:"auto"},children:"The organiser will review your payment and confirm your registration. You will get an email when your ticket is approved."})]}):z?i.jsxs("div",{style:{background:Ct.cream,padding:"40px 28px",borderLeft:`3px solid ${Ct.success}`,textAlign:"center"},children:[i.jsx("p",{style:{fontSize:"0.7rem",fontWeight:600,letterSpacing:"0.2em",textTransform:"uppercase",color:Ct.success,margin:"0 0 12px"},children:"Confirmed"}),i.jsx("h2",{style:{fontFamily:Ct.serif,fontSize:"2rem",fontWeight:400,margin:"0 0 16px",color:Ct.ink},children:"Thank you"}),i.jsx("p",{style:{color:Ct.body,margin:0,lineHeight:1.65},children:"Your payment was successful. You should receive a confirmation email shortly."})]}):i.jsxs(i.Fragment,{children:[f&&i.jsx("div",{style:{marginBottom:20,padding:"16px 20px",background:Ct.card,border:`1px solid ${Ct.accent}`,color:Ct.ink,fontSize:"0.875rem",lineHeight:1.5},children:f}),(Q==="both"||Q==="online")&&i.jsxs("section",{style:{background:Ct.card,padding:"24px 22px",border:`1px solid ${Ct.borderHairline}`,marginBottom:24},children:[i.jsx("h2",{style:{fontSize:"0.7rem",fontWeight:600,letterSpacing:"0.22em",textTransform:"uppercase",color:Ct.accent,margin:"0 0 14px"},children:"Payment method"}),Q==="both"?i.jsxs(i.Fragment,{children:[i.jsx("p",{style:{fontSize:"0.9375rem",color:Ct.body,margin:"0 0 16px",lineHeight:1.55,fontWeight:500},children:"Pay with the organiser's Razorpay checkout, or use the UPI details they set up for this event."}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:10},children:[i.jsx("button",{type:"button",onClick:()=>H("online"),style:{padding:"12px 20px",borderRadius:0,border:"none",background:ee==="online"?Ct.primary:Ct.cream,color:ee==="online"?"#fff":Ct.ink,fontWeight:600,cursor:"pointer",fontSize:"0.6875rem",letterSpacing:"0.14em",textTransform:"uppercase",fontFamily:Ct.sans},children:"Card / UPI (Razorpay)"}),i.jsx("button",{type:"button",onClick:()=>H("manual"),style:{padding:"12px 20px",borderRadius:0,border:"none",background:ee==="manual"?Ct.express:Ct.cream,color:ee==="manual"?"#fff":Ct.ink,fontWeight:600,cursor:"pointer",fontSize:"0.6875rem",letterSpacing:"0.14em",textTransform:"uppercase",fontFamily:Ct.sans},children:"UPI (organiser QR)"})]})]}):i.jsx("p",{style:{fontSize:"0.9375rem",color:Ct.body,margin:0,lineHeight:1.55,fontWeight:500},children:"You will pay through the organiser's connected Razorpay account (not a platform wallet)."})]}),!Oe&&i.jsxs("section",{style:{marginBottom:28},children:[i.jsx("h2",{style:{fontSize:"0.7rem",fontWeight:600,letterSpacing:"0.22em",textTransform:"uppercase",color:Ct.accent,margin:"0 0 8px"},children:"Choose a ticket"}),i.jsx("p",{style:{fontSize:"0.9375rem",color:Ct.body,margin:"0 0 20px",lineHeight:1.55,fontWeight:500},children:"Select one option. You can change your choice before paying."}),i.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:14},children:a.map(ce=>{var qe;const je=p===ce._id;return i.jsxs("button",{type:"button",onClick:()=>y(ce._id),style:{textAlign:"left",cursor:"pointer",padding:"20px 18px",borderRadius:0,border:je?`2px solid ${Ct.primary}`:`1px solid ${Ct.border}`,background:je?Ct.cream:Ct.card,transition:"border-color 0.15s, background 0.15s",display:"flex",flexDirection:"column",gap:12,minHeight:140,fontFamily:Ct.sans},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8},children:[i.jsx("span",{style:{fontFamily:Ct.serif,fontSize:"1.35rem",fontWeight:600,color:Ct.ink,lineHeight:1.25},children:ce.name}),je&&i.jsx("span",{style:{flexShrink:0,fontSize:"0.625rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.12em",color:"#fff",background:Ct.primary,padding:"6px 10px"},children:"Selected"})]}),i.jsxs("div",{style:{fontFamily:Ct.serif,fontSize:"1.75rem",fontWeight:400,color:Ct.ink,borderBottom:`1px solid ${Ct.borderHairline}`,paddingBottom:12},children:[(ce.basePriceMinor/100).toLocaleString("en-IN",{minimumFractionDigits:2})," ",i.jsx("span",{style:{fontSize:"1rem",fontFamily:Ct.sans,fontWeight:500},children:ce.currency}),i.jsx("span",{style:{fontSize:"0.75rem",fontFamily:Ct.sans,fontWeight:500,color:Ct.muted,display:"block",marginTop:6},children:ce.requiresBillingState?"Tax depends on billing state":"Tax per rules below"})]}),ce.description?i.jsx("p",{style:{fontSize:"0.875rem",color:Ct.body,margin:0,lineHeight:1.5,fontWeight:500,display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden"},children:ce.description}):null,(qe=ce.keyPoints)!=null&&qe.length?i.jsxs("ul",{style:{fontSize:"0.75rem",color:Ct.ink,margin:0,paddingLeft:16,lineHeight:1.45,fontWeight:500},children:[ce.keyPoints.slice(0,4).map((Ne,Je)=>i.jsx("li",{children:Ne},Je)),ce.keyPoints.length>4?i.jsxs("li",{style:{color:Ct.muted},children:["+",ce.keyPoints.length-4," more…"]}):null]}):null]},ce._id)})})]}),i.jsxs("section",{style:{background:Ct.card,padding:"24px 22px",border:`1px solid ${Ct.borderHairline}`,marginBottom:20},children:[me&&i.jsxs(i.Fragment,{children:[i.jsx("h3",{style:{fontSize:"0.7rem",fontWeight:600,letterSpacing:"0.22em",textTransform:"uppercase",color:Ct.accent,margin:"0 0 12px"},children:"Your selection"}),i.jsx("p",{style:{fontFamily:Ct.serif,fontSize:"1.85rem",fontWeight:400,color:Ct.ink,margin:"0 0 12px",lineHeight:1.15},children:me.name}),me.description&&i.jsx("p",{style:{fontSize:"0.9375rem",color:Ct.body,margin:"0 0 20px",lineHeight:1.55,fontWeight:500},children:me.description}),(Ie=me.keyPoints)!=null&&Ie.length?i.jsxs("div",{style:{background:Ct.cream,borderLeft:`3px solid ${Ct.accent}`,padding:"20px 20px 20px 22px",marginBottom:24},children:[i.jsx("p",{style:{fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.2em",textTransform:"uppercase",color:Ct.accent,margin:"0 0 14px"},children:"Key details"}),i.jsx("ul",{style:{fontSize:"0.875rem",color:Ct.body,margin:0,paddingLeft:18,lineHeight:1.55,fontWeight:500},children:me.keyPoints.map((ce,je)=>i.jsx("li",{style:{marginBottom:6},children:ce},je))})]}):null]}),i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"flex-end",gap:16,marginBottom:20},children:[i.jsxs("div",{children:[i.jsx("span",{style:fe,children:"Quantity"}),i.jsxs("div",{style:{display:"flex",alignItems:"stretch",border:`1px solid ${Ct.border}`,height:52,maxWidth:140},children:[i.jsx("button",{type:"button","aria-label":"Decrease quantity",onClick:()=>x(ce=>Math.max(1,ce-1)),style:{width:44,border:"none",background:Ct.card,cursor:"pointer",fontSize:"1.25rem",color:Ct.ink,fontFamily:Ct.sans},children:"−"}),i.jsx("span",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,fontSize:"1rem",borderLeft:`1px solid ${Ct.border}`,borderRight:`1px solid ${Ct.border}`},children:m}),i.jsx("button",{type:"button","aria-label":"Increase quantity",onClick:()=>x(ce=>Math.min((me==null?void 0:me.maxPerOrder)||100,ce+1)),style:{width:44,border:"none",background:Ct.card,cursor:"pointer",fontSize:"1.25rem",color:Ct.ink,fontFamily:Ct.sans},children:"+"})]})]}),i.jsxs("div",{style:{flex:"1 1 200px",minWidth:0},children:[i.jsxs("span",{style:{...fe,display:"flex",alignItems:"center",gap:8},children:[i.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:Ct.success,flexShrink:0}}),"Tickets available"]}),i.jsx("p",{style:{margin:0,fontSize:"0.875rem",color:Ct.success,fontWeight:500},children:"Complete checkout to secure your spot."})]})]}),(me==null?void 0:me.requiresBillingState)&&i.jsxs(i.Fragment,{children:[i.jsx("label",{style:fe,children:"Billing state (tax)"}),i.jsxs("select",{value:b,onChange:ce=>w(ce.target.value),style:{...se,marginBottom:18},children:[i.jsx("option",{value:"",children:"Select state…"}),TNe.map(ce=>i.jsxs("option",{value:ce.code,children:[ce.name," (",ce.code,")"]},ce.code))]})]}),i.jsx("label",{style:fe,children:"Purchaser email (receipts)"}),i.jsx("input",{type:"email",value:k,onChange:ce=>S(ce.target.value),placeholder:"you@example.com",style:{...se,marginBottom:0}})]}),_.map((ce,je)=>i.jsxs("section",{style:{background:Ct.card,padding:"22px 22px",border:`1px solid ${Ct.borderHairline}`,marginBottom:16},children:[i.jsxs("h3",{style:{fontSize:"0.7rem",fontWeight:600,letterSpacing:"0.18em",textTransform:"uppercase",color:Ct.muted,margin:"0 0 16px"},children:["Attendee ",je+1]}),i.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[i.jsx("input",{placeholder:"First name",value:ce.firstName,onChange:qe=>we(je,{firstName:qe.target.value}),style:{...se}}),i.jsx("input",{placeholder:"Last name",value:ce.lastName,onChange:qe=>we(je,{lastName:qe.target.value}),style:{...se}}),i.jsx("input",{type:"email",placeholder:"Email",value:ce.email,onChange:qe=>we(je,{email:qe.target.value}),style:{...se,gridColumn:"1 / -1"}})]}),ke(me==null?void 0:me.registrationFormFields).map(qe=>i.jsxs("div",{style:{marginTop:14},children:[i.jsxs("label",{style:{...fe,textTransform:"none",letterSpacing:"0.04em",color:Ct.body},children:[qe.label,qe.required?" *":""]}),qe.type==="select"||qe.type==="radio"?i.jsxs("select",{value:ce.formData[qe.label]||"",onChange:Ne=>ie(je,qe.label,Ne.target.value),style:{...se,marginTop:4},children:[i.jsx("option",{value:"",children:"Choose…"}),(qe.options||[]).map(Ne=>i.jsx("option",{value:Ne,children:Ne},Ne))]}):i.jsx("input",{type:qe.type==="email"?"email":qe.type==="phone"?"tel":"text",value:ce.formData[qe.label]||"",onChange:Ne=>ie(je,qe.label,Ne.target.value),style:{...se,marginTop:4}})]},qe.label))]},je)),i.jsxs("div",{style:{background:Ct.card,padding:"24px 22px",border:`1px solid ${Ct.borderHairline}`},children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:16,paddingBottom:R&&O!=null?18:0,borderBottom:R&&O!=null?`1px solid ${Ct.borderHairline}`:"none"},children:[i.jsxs("div",{children:[i.jsxs("div",{style:{fontSize:"0.7rem",fontWeight:600,letterSpacing:"0.16em",textTransform:"uppercase",color:Ct.muted},children:["Total ",E?"· updating…":""]}),i.jsx("div",{style:{fontFamily:Ct.serif,fontSize:"2.35rem",fontWeight:400,color:Ct.ink,lineHeight:1.1,marginTop:4},children:O!=null?q3(O,(me==null?void 0:me.currency)||(R==null?void 0:R.currency)||"INR"):"—"})]}),i.jsx("button",{type:"button",disabled:F||O==null||E,onClick:()=>void Me(),style:{padding:"16px 36px",borderRadius:0,border:"none",background:Ct.primary,color:"#fff",fontWeight:700,fontSize:"0.8125rem",letterSpacing:"0.18em",textTransform:"uppercase",fontFamily:Ct.sans,cursor:F?"wait":"pointer",opacity:O==null?.45:1},children:F?"Processing…":$?"Submit proof":"Pay now"})]}),R&&O!=null?i.jsxs("div",{style:{marginTop:20},children:[i.jsx("div",{style:{fontSize:"0.6875rem",fontWeight:600,color:Ct.accent,textTransform:"uppercase",letterSpacing:"0.2em",marginBottom:12},children:"Line items"}),i.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",fontSize:"0.9375rem",color:Ct.ink,fontWeight:500},children:[i.jsxs("span",{children:["Subtotal",R.quantity>1?i.jsxs("span",{style:{color:Ct.muted,fontWeight:400},children:[" (",R.quantity," tickets)"]}):null]}),i.jsx("span",{style:{fontVariantNumeric:"tabular-nums"},children:q3(R.baseMinor,R.currency)})]}),R.taxLines.map((ce,je)=>i.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",fontSize:"0.9375rem",color:Ct.ink,fontWeight:500},children:[i.jsxs("span",{children:[ce.label,ce.rateBps>0?i.jsxs("span",{style:{color:Ct.muted,fontWeight:400},children:[" ","(",(ce.rateBps/100).toLocaleString("en-IN",{maximumFractionDigits:2}),"%)"]}):null]}),i.jsx("span",{style:{fontVariantNumeric:"tabular-nums"},children:q3(ce.amountMinor,R.currency)})]},`${ce.label}-${je}`))]})]}):null]}),$&&B&&i.jsxs("section",{style:{background:Ct.express,padding:"28px 24px",marginTop:20,borderRadius:24},children:[i.jsx("h2",{style:{fontSize:"0.7rem",fontWeight:700,margin:"0 0 10px",color:"rgba(255,255,255,0.92)",letterSpacing:"0.2em",textTransform:"uppercase"},children:"Pay with UPI"}),i.jsxs("p",{style:{fontSize:"0.9375rem",color:"rgba(255,255,255,0.95)",margin:"0 0 16px",lineHeight:1.55,fontWeight:500},children:["Pay the ",i.jsx("strong",{style:{fontWeight:700},children:"total amount above"})," in your UPI app (ticket and tax only). Then attach your payment screenshot below."]}),(B.manualQrMode==="dynamic"?B.upiId:B.payeeName||B.upiId)?i.jsxs("p",{style:{fontSize:"0.875rem",margin:"0 0 10px",color:"#fff"},children:[B.manualQrMode==="upload"&&B.payeeName?i.jsx("strong",{children:B.payeeName}):null,B.upiId?i.jsxs("span",{style:{opacity:.9},children:[B.manualQrMode==="upload"&&B.payeeName?" · ":"",B.upiId]}):null]}):null,B.instructions?i.jsx("p",{style:{fontSize:"0.8125rem",color:"rgba(255,255,255,0.88)",whiteSpace:"pre-wrap",margin:"0 0 16px",lineHeight:1.5},children:B.instructions}):null,i.jsx("div",{style:{background:"#fff",padding:16,display:"inline-block",borderRadius:8},children:B.manualQrMode==="dynamic"?ae?i.jsx("img",{src:ae,alt:"UPI QR",style:{maxWidth:280,width:"100%",height:"auto",display:"block"}}):i.jsx("p",{style:{fontSize:"0.875rem",color:Ct.muted,margin:0,maxWidth:260},children:"Choose ticket, quantity, and tax — your QR updates with the exact amount."}):B.upiQrImageUrl?i.jsx("img",{src:B.upiQrImageUrl,alt:"UPI QR",style:{maxWidth:280,width:"100%",height:"auto",display:"block"}}):null})]}),$&&i.jsxs("section",{style:{background:Ct.cream,padding:"24px 22px",borderLeft:`3px solid ${Ct.accent}`,marginTop:20},children:[i.jsx("label",{style:{...fe,color:Ct.accent},children:"Payment screenshot"}),i.jsx("input",{type:"file",accept:"image/*",onChange:ce=>{var je;return Y(((je=ce.target.files)==null?void 0:je[0])??null)},style:{marginBottom:16,fontFamily:Ct.sans,fontSize:"0.875rem"}}),i.jsx("label",{style:fe,children:"Note to organiser (optional)"}),i.jsx("textarea",{value:K,onChange:ce=>G(ce.target.value),rows:3,placeholder:"UPI ref, payer name, etc.",style:{...se,fontFamily:Ct.sans,resize:"vertical"}})]})]})]})})}const NNe={conference:"Conference",workshop:"Workshop",summit:"Summit",cme:"CME",webinar:"Webinar"};function RNe(e){return e?NNe[e]||e.replace(/^\w/,t=>t.toUpperCase()):""}function LNe(e){return e==="virtual"?"Virtual":e==="hybrid"?"Hybrid":"In person"}function FNe(e){const{startDate:t,endDate:r}=e;if(!t)return"—";const n=new Date(t),o=r?new Date(r):n;if(Number.isNaN(n.getTime()))return"—";const a=!Number.isNaN(o.getTime())&&n.toDateString()===o.toDateString(),s={month:"short",day:"numeric",year:"numeric"};return a?n.toLocaleDateString(void 0,{weekday:"short",...s}):`${n.toLocaleDateString(void 0,s)} – ${o.toLocaleDateString(void 0,s)}`}function MNe(e){var r;return((r=e.location)==null?void 0:r.trim())?e.locationType==="physical"||e.locationType==="hybrid":!1}function VW({event:e,variant:t="default"}){const r=RNe(e.eventType),n=FNe(e),o=LNe(e.locationType),a=MNe(e),s=t==="embedded";return i.jsxs("div",{style:{marginBottom:s?18:28,paddingBottom:s?0:22,borderBottom:s?"none":"1px solid var(--border, #e2e8f0)"},children:[e.imageUrl&&!e.logoUrl?i.jsx("div",{style:{marginBottom:16,borderRadius:10,overflow:"hidden",maxHeight:160},children:i.jsx("img",{src:e.imageUrl,alt:"",style:{width:"100%",height:"100%",maxHeight:160,objectFit:"cover",display:"block"}})}):null,i.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:16,flexWrap:"wrap"},children:[e.logoUrl?i.jsx("img",{src:e.logoUrl,alt:e.name,style:{maxHeight:64,maxWidth:220,width:"auto",height:"auto",objectFit:"contain",flexShrink:0}}):null,i.jsxs("div",{style:{minWidth:0,flex:"1 1 200px"},children:[i.jsx("h1",{style:{fontFamily:"var(--font-inter, system-ui, sans-serif)",fontSize:"1.375rem",fontWeight:600,margin:"0 0 6px",lineHeight:1.25,color:"var(--foreground, #0f172a)"},children:e.name}),e.subtitle?i.jsx("p",{style:{margin:"0 0 10px",fontSize:"0.95rem",color:"var(--muted, #64748b)",lineHeight:1.45},children:e.subtitle}):null,i.jsxs("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"6px 10px",fontSize:"0.8125rem",color:"var(--muted, #64748b)",fontFamily:"var(--font-noto-sans, system-ui, sans-serif)"},children:[i.jsx("span",{style:{color:"var(--foreground, #334155)",fontWeight:500},children:n}),r?i.jsxs(i.Fragment,{children:[i.jsx("span",{"aria-hidden":"true",style:{opacity:.5},children:"·"}),i.jsx("span",{children:r})]}):null,i.jsx("span",{"aria-hidden":"true",style:{opacity:.5},children:"·"}),i.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:999,background:e.locationType==="virtual"?"rgba(59, 130, 246, 0.12)":e.locationType==="hybrid"?"rgba(147, 51, 234, 0.12)":"rgba(22, 163, 74, 0.12)",color:e.locationType==="virtual"?"#1d4ed8":e.locationType==="hybrid"?"#7e22ce":"#15803d",fontWeight:600,fontSize:"0.75rem"},children:o}),a?i.jsxs(i.Fragment,{children:[i.jsx("span",{"aria-hidden":"true",style:{opacity:.5},children:"·"}),i.jsx("span",{style:{color:"var(--foreground, #475569)"},children:e.location.trim()})]}):null]})]})]})]})}function A0(e){return(e||"").trim()}function DNe(e,t){const r=A0(e.label);return r?e.type==="checkboxes"&&Array.isArray(t)?{[r]:t}:e.type==="checkbox"?{[r]:t===!0||t==="true"?"Yes":""}:{[r]:t}:{}}function zNe(e){var r;if(e.type==="stars")return!0;if(e.type!=="select"||!((r=e.options)!=null&&r.length))return!1;const t=e.options.map(n=>String(n));return t.length===5&&t.every((n,o)=>n===String(o+1))}function BNe(e){var t;if(e.type==="stars"){const r=(t=e.options)==null?void 0:t.length;return r&&r>0?r:5}return 5}function WNe(){var P,O;const{formId:e=""}=A6(),[t,r]=j.useState(null),[n,o]=j.useState(null),[a,s]=j.useState({}),[l,c]=j.useState({}),[u,d]=j.useState(!1),[f,h]=j.useState(null),[p,y]=j.useState(!1),m=j.useCallback(async()=>{if(e){o(null);try{const T=await Ma.getPublic(e);r(T)}catch(T){o(T instanceof Error?T.message:"Could not load form.")}}},[e]);j.useEffect(()=>{m()},[m]);const x=(T,R)=>{s(I=>({...I,[T]:R}))},b=j.useCallback(()=>{var T;if(!((T=t==null?void 0:t.fields)!=null&&T.length))return null;for(const R of t.fields){const I=A0(R.label);if(!I||!R.required)continue;const E=R.type;if(E==="checkboxes"){const F=a[I];if(!Array.isArray(F)||F.length===0)return`“${I}” is required.`;continue}if(E==="checkbox"){if(!a[I])return`“${I}” is required.`;continue}const A=a[I];if(A==null||typeof A=="string"&&A.trim()==="")return`“${I}” is required.`}return null},[t,a]),w=async T=>{if(T.preventDefault(),!e||!t)return;h(null);const R=b();if(R){h(R);return}const I={};for(const E of t.fields||[]){const A=A0(E.label);A&&Object.assign(I,DNe(E,a[A]))}d(!0);try{await Ma.submit(e,{data:I}),y(!0)}catch(E){h(E instanceof Error?E.message:"Submit failed.")}finally{d(!1)}};if(n)return i.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"var(--background, #f8fafc)",color:"var(--foreground, #0f172a)",fontFamily:"var(--font-noto-sans, system-ui, sans-serif)"},children:i.jsx("p",{style:{margin:0,fontSize:"0.95rem"},children:n})});if(!t)return i.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--background, #f8fafc)",color:"var(--muted, #64748b)"},children:"Loading…"});if(p){const T=((O=(P=t.settings)==null?void 0:P.thankYouMessage)==null?void 0:O.trim())||"Thank you for your response.",R=t.event;return i.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"var(--background, #f8fafc)",color:"var(--foreground, #0f172a)",fontFamily:"var(--font-noto-sans, system-ui, sans-serif)"},children:i.jsxs("div",{style:{maxWidth:520,width:"100%",textAlign:R?"left":"center",padding:32,background:"var(--card, #fff)",border:"1px solid var(--border, #e2e8f0)",borderRadius:"var(--radius-card, 12px)",boxShadow:"0 1px 3px rgba(0,0,0,0.08)"},children:[R?i.jsx(VW,{event:R,variant:"embedded"}):null,i.jsx("h1",{style:{fontFamily:"var(--font-inter, system-ui, sans-serif)",fontSize:"1.2rem",fontWeight:600,margin:"0 0 8px"},children:t.name}),i.jsx("p",{style:{margin:0,fontSize:"0.95rem",lineHeight:1.5,color:"var(--foreground)"},children:T})]})})}const k={display:"block",fontSize:"0.75rem",fontWeight:600,color:"var(--muted, #64748b)",marginBottom:6,textTransform:"uppercase",letterSpacing:"0.04em"},S={width:"100%",padding:"10px 12px",fontSize:"0.9rem",borderRadius:8,border:"1px solid var(--border, #e2e8f0)",background:"var(--card, #fff)",color:"var(--foreground, #0f172a)",boxSizing:"border-box"},_=t.event;return i.jsx("div",{style:{minHeight:"100vh",padding:"32px 16px 48px",background:"var(--background, #f8fafc)",color:"var(--foreground, #0f172a)",fontFamily:"var(--font-noto-sans, system-ui, sans-serif)"},children:i.jsxs("div",{style:{maxWidth:520,margin:"0 auto"},children:[_?i.jsx(VW,{event:_}):null,i.jsx("h1",{style:{fontFamily:"var(--font-inter, system-ui, sans-serif)",fontSize:_?"1.25rem":"1.5rem",fontWeight:600,margin:"0 0 8px",lineHeight:1.3,color:"var(--foreground, #0f172a)"},children:t.name}),t.description?i.jsx("p",{style:{margin:"0 0 24px",color:"var(--muted, #64748b)",fontSize:"0.9rem",lineHeight:1.5},children:t.description}):i.jsx("div",{style:{marginBottom:24}}),i.jsxs("form",{onSubmit:T=>void w(T),style:{padding:24,background:"var(--card, #fff)",border:"1px solid var(--border, #e2e8f0)",borderRadius:"var(--radius-card, 12px)",display:"flex",flexDirection:"column",gap:16,boxShadow:"0 1px 3px rgba(0,0,0,0.06)"},children:[(t.fields||[]).map(T=>{var E,A,F;const R=A0(T.label);if(!R)return null;const I=T.required;if(T.type==="text"||T.type==="email"||T.type==="phone")return i.jsxs("div",{children:[i.jsxs("label",{style:k,children:[R,I?i.jsx("span",{style:{color:"var(--destructive, #dc2626)"},children:" *"}):null]}),i.jsx("input",{type:T.type==="email"?"email":T.type==="phone"?"tel":"text",value:String(a[R]??""),onChange:L=>x(R,L.target.value),placeholder:T.placeholder,required:!!I,style:S})]},R);if(zNe(T)){const L=BNe(T),z=a[R],V=z!=null&&z!==""?parseInt(String(z),10):0,Q=!Number.isNaN(V)&&V>=1&&V<=L?V:0;return i.jsxs("div",{children:[i.jsxs("div",{style:k,id:`star-legend-${R}`,children:[R,I?i.jsx("span",{style:{color:"var(--destructive, #dc2626)"},children:" *"}):null]}),i.jsx("div",{role:"radiogroup","aria-labelledby":`star-legend-${R}`,style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:4},children:Array.from({length:L},(U,ee)=>{const H=ee+1,B=Q>=H;return i.jsx("button",{type:"button",role:"radio","aria-checked":Q===H,"aria-label":`${H} of ${L} stars`,onClick:()=>x(R,String(H)),style:{fontSize:"2rem",lineHeight:1,width:44,height:44,border:"none",background:"transparent",cursor:"pointer",padding:0,color:B?"#ca8a04":"var(--border, #e2e8f0)",transition:"color 0.12s, transform 0.12s"},children:"★"},H)})})]},R)}if(T.type==="select"&&(((E=T.options)==null?void 0:E.length)??0)>0)return i.jsxs("div",{children:[i.jsxs("label",{style:k,children:[R,I?i.jsx("span",{style:{color:"var(--destructive, #dc2626)"},children:" *"}):null]}),i.jsxs("select",{value:String(a[R]??""),onChange:L=>x(R,L.target.value),required:!!I,style:{...S,cursor:"pointer"},children:[i.jsx("option",{value:"",children:"Select…"}),T.options.map(L=>i.jsx("option",{value:L,children:L},L))]})]},R);if(T.type==="radio"&&(((A=T.options)==null?void 0:A.length)??0)>0)return i.jsxs("fieldset",{style:{border:"none",padding:0,margin:0},children:[i.jsxs("legend",{style:{...k,marginBottom:8},children:[R,I?i.jsx("span",{style:{color:"var(--destructive, #dc2626)"},children:" *"}):null]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:T.options.map(L=>i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.9rem",cursor:"pointer"},children:[i.jsx("input",{type:"radio",name:R,value:L,checked:a[R]===L,onChange:()=>x(R,L)}),L]},L))})]},R);if(T.type==="checkboxes"&&(((F=T.options)==null?void 0:F.length)??0)>0){const L=a[R]||[];return i.jsxs("fieldset",{style:{border:"none",padding:0,margin:0},children:[i.jsxs("legend",{style:{...k,marginBottom:8},children:[R,I?i.jsx("span",{style:{color:"var(--destructive, #dc2626)"},children:" *"}):null]}),i.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:T.options.map(z=>{const V=L.includes(z);return i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:"0.9rem",cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:V,onChange:()=>{x(R,V?L.filter(Q=>Q!==z):[...L,z])}}),z]},z)})})]},R)}return T.type==="checkbox"?i.jsxs("label",{style:{display:"flex",alignItems:"center",gap:10,fontSize:"0.9rem",cursor:"pointer"},children:[i.jsx("input",{type:"checkbox",checked:!!a[R],onChange:L=>x(R,L.target.checked)}),R,I?i.jsx("span",{style:{color:"var(--destructive, #dc2626)"},children:" *"}):null]},R):T.type==="file"?i.jsxs("div",{children:[i.jsxs("span",{style:k,children:[R,I?i.jsx("span",{style:{color:"var(--destructive, #dc2626)"},children:" *"}):null]}),i.jsx("input",{type:"file",onChange:async L=>{var Q;const z=(Q=L.target.files)==null?void 0:Q[0];if(!z){x(R,""),c(U=>({...U,[R]:""}));return}c(U=>({...U,[R]:z.name}));const V=new FileReader;V.onload=()=>x(R,String(V.result||"")),V.onerror=()=>x(R,""),V.readAsDataURL(z)},style:{fontSize:"0.85rem"}}),l[R]?i.jsx("p",{style:{margin:"6px 0 0",fontSize:"0.8rem",color:"var(--muted)"},children:l[R]}):null]},R):i.jsxs("div",{children:[i.jsx("label",{style:k,children:R}),i.jsx("input",{type:"text",value:String(a[R]??""),onChange:L=>x(R,L.target.value),style:S})]},R)}),f?i.jsx("p",{style:{margin:0,fontSize:"0.85rem",color:"var(--destructive, #dc2626)"},children:f}):null,i.jsx("button",{type:"submit",disabled:u,style:{marginTop:8,padding:"12px 20px",borderRadius:"var(--radius-button, 8px)",border:"none",background:"var(--primary, #0f3072)",color:"var(--primary-foreground, #fff)",fontSize:"0.9rem",fontWeight:600,cursor:u?"not-allowed":"pointer",opacity:u?.75:1},children:u?"Submitting…":"Submit"})]})]})})}function qNe(){return i.jsx(wie,{children:i.jsx(RJ,{children:i.jsx(qJ,{children:i.jsxs(EJ,{children:[i.jsx(Sie,{}),i.jsxs(yJ,{children:[i.jsx(as,{path:"/login",element:i.jsx(Cie,{})}),i.jsx(as,{path:"/register",element:i.jsx(Eie,{})}),i.jsx(as,{path:"/invite/event",element:i.jsx(Aie,{})}),i.jsx(as,{path:"/event/:eventId/tickets",element:i.jsx(INe,{})}),i.jsx(as,{path:"/form/:formId",element:i.jsx(WNe,{})}),i.jsxs(as,{path:"/",element:i.jsx(S6,{}),children:[i.jsx(as,{index:!0,element:i.jsx(th,{to:"/home",replace:!0})}),i.jsxs(as,{path:"super-admin",element:i.jsx(SNe,{}),children:[i.jsx(as,{index:!0,element:i.jsx(th,{to:"clients",replace:!0})}),i.jsx(as,{path:"clients",element:i.jsx(kNe,{})}),i.jsx(as,{path:"plans",element:i.jsx(ANe,{})})]}),i.jsx(as,{path:":navId",element:i.jsx(S6.AppShellWithNav,{})})]}),i.jsx(as,{path:"*",element:i.jsx(th,{to:"/home",replace:!0})})]})]})})})})}YW.createRoot(document.getElementById("root")).render(i.jsx(qNe,{}));export{On as _,h1 as c,un as g};
|