var $xe=Object.defineProperty;var h8=e=>{throw TypeError(e)};var zxe=(e,t,n)=>t in e?$xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var vn=(e,t,n)=>zxe(e,typeof t!="symbol"?t+"":t,n),cP=(e,t,n)=>t.has(e)||h8("Cannot "+n);var Ae=(e,t,n)=>(cP(e,t,"read from private field"),n?n.call(e):t.get(e)),Mt=(e,t,n)=>t.has(e)?h8("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),st=(e,t,n,r)=>(cP(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),An=(e,t,n)=>(cP(e,t,"access private method"),n);var QC=(e,t,n,r)=>({set _(i){st(e,t,i,n)},get _(){return Ae(e,t,r)}});function Vxe(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Dh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function In(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Oee={exports:{}},WN={},Fee={exports:{}},wn={};/**
 * @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 f2=Symbol.for("react.element"),Kxe=Symbol.for("react.portal"),qxe=Symbol.for("react.fragment"),Wxe=Symbol.for("react.strict_mode"),Gxe=Symbol.for("react.profiler"),Yxe=Symbol.for("react.provider"),Xxe=Symbol.for("react.context"),Jxe=Symbol.for("react.forward_ref"),Zxe=Symbol.for("react.suspense"),ewe=Symbol.for("react.memo"),twe=Symbol.for("react.lazy"),f8=Symbol.iterator;function nwe(e){return e===null||typeof e!="object"?null:(e=f8&&e[f8]||e["@@iterator"],typeof e=="function"?e:null)}var Mee={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Lee=Object.assign,Ree={};function Yv(e,t,n){this.props=e,this.context=t,this.refs=Ree,this.updater=n||Mee}Yv.prototype.isReactComponent={};Yv.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Yv.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Dee(){}Dee.prototype=Yv.prototype;function cD(e,t,n){this.props=e,this.context=t,this.refs=Ree,this.updater=n||Mee}var uD=cD.prototype=new Dee;uD.constructor=cD;Lee(uD,Yv.prototype);uD.isPureReactComponent=!0;var A8=Array.isArray,Uee=Object.prototype.hasOwnProperty,dD={current:null},Hee={key:!0,ref:!0,__self:!0,__source:!0};function Qee(e,t,n){var r,i={},s=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(s=""+t.key),t)Uee.call(t,r)&&!Hee.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var c=Array(o),u=0;u<o;u++)c[u]=arguments[u+2];i.children=c}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return{$$typeof:f2,type:e,key:s,ref:a,props:i,_owner:dD.current}}function rwe(e,t){return{$$typeof:f2,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function hD(e){return typeof e=="object"&&e!==null&&e.$$typeof===f2}function iwe(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var p8=/\/+/g;function uP(e,t){return typeof e=="object"&&e!==null&&e.key!=null?iwe(""+e.key):t.toString(36)}function Dk(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(s){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case f2:case Kxe:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+uP(a,0):r,A8(i)?(n="",e!=null&&(n=e.replace(p8,"$&/")+"/"),Dk(i,t,n,"",function(u){return u})):i!=null&&(hD(i)&&(i=rwe(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(p8,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",A8(e))for(var o=0;o<e.length;o++){s=e[o];var c=r+uP(s,o);a+=Dk(s,t,n,c,i)}else if(c=nwe(e),typeof c=="function")for(e=c.call(e),o=0;!(s=e.next()).done;)s=s.value,c=r+uP(s,o++),a+=Dk(s,t,n,c,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function $C(e,t,n){if(e==null)return e;var r=[],i=0;return Dk(e,r,"","",function(s){return t.call(n,s,i++)}),r}function swe(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ta={current:null},Uk={transition:null},awe={ReactCurrentDispatcher:Ta,ReactCurrentBatchConfig:Uk,ReactCurrentOwner:dD};function $ee(){throw Error("act(...) is not supported in production builds of React.")}wn.Children={map:$C,forEach:function(e,t,n){$C(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return $C(e,function(){t++}),t},toArray:function(e){return $C(e,function(t){return t})||[]},only:function(e){if(!hD(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};wn.Component=Yv;wn.Fragment=qxe;wn.Profiler=Gxe;wn.PureComponent=cD;wn.StrictMode=Wxe;wn.Suspense=Zxe;wn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=awe;wn.act=$ee;wn.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Lee({},e.props),i=e.key,s=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,a=dD.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)Uee.call(t,c)&&!Hee.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&o!==void 0?o[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){o=Array(c);for(var u=0;u<c;u++)o[u]=arguments[u+2];r.children=o}return{$$typeof:f2,type:e.type,key:i,ref:s,props:r,_owner:a}};wn.createContext=function(e){return e={$$typeof:Xxe,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Yxe,_context:e},e.Consumer=e};wn.createElement=Qee;wn.createFactory=function(e){var t=Qee.bind(null,e);return t.type=e,t};wn.createRef=function(){return{current:null}};wn.forwardRef=function(e){return{$$typeof:Jxe,render:e}};wn.isValidElement=hD;wn.lazy=function(e){return{$$typeof:twe,_payload:{_status:-1,_result:e},_init:swe}};wn.memo=function(e,t){return{$$typeof:ewe,type:e,compare:t===void 0?null:t}};wn.startTransition=function(e){var t=Uk.transition;Uk.transition={};try{e()}finally{Uk.transition=t}};wn.unstable_act=$ee;wn.useCallback=function(e,t){return Ta.current.useCallback(e,t)};wn.useContext=function(e){return Ta.current.useContext(e)};wn.useDebugValue=function(){};wn.useDeferredValue=function(e){return Ta.current.useDeferredValue(e)};wn.useEffect=function(e,t){return Ta.current.useEffect(e,t)};wn.useId=function(){return Ta.current.useId()};wn.useImperativeHandle=function(e,t,n){return Ta.current.useImperativeHandle(e,t,n)};wn.useInsertionEffect=function(e,t){return Ta.current.useInsertionEffect(e,t)};wn.useLayoutEffect=function(e,t){return Ta.current.useLayoutEffect(e,t)};wn.useMemo=function(e,t){return Ta.current.useMemo(e,t)};wn.useReducer=function(e,t,n){return Ta.current.useReducer(e,t,n)};wn.useRef=function(e){return Ta.current.useRef(e)};wn.useState=function(e){return Ta.current.useState(e)};wn.useSyncExternalStore=function(e,t,n){return Ta.current.useSyncExternalStore(e,t,n)};wn.useTransition=function(){return Ta.current.useTransition()};wn.version="18.3.1";Fee.exports=wn;var C=Fee.exports;const re=In(C),fD=Vxe({__proto__:null,default:re},[C]);/**
 * @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 owe=C,lwe=Symbol.for("react.element"),cwe=Symbol.for("react.fragment"),uwe=Object.prototype.hasOwnProperty,dwe=owe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,hwe={key:!0,ref:!0,__self:!0,__source:!0};function zee(e,t,n){var r,i={},s=null,a=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)uwe.call(t,r)&&!hwe.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:lwe,type:e,key:s,ref:a,props:i,_owner:dwe.current}}WN.Fragment=cwe;WN.jsx=zee;WN.jsxs=zee;Oee.exports=WN;var l=Oee.exports,Vee={exports:{}},Uo={},Kee={exports:{}},qee={};/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(e){function t($,z){var Q=$.length;$.push(z);e:for(;0<Q;){var oe=Q-1>>>1,R=$[oe];if(0<i(R,z))$[oe]=z,$[Q]=R,Q=oe;else break e}}function n($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var z=$[0],Q=$.pop();if(Q!==z){$[0]=Q;e:for(var oe=0,R=$.length,M=R>>>1;oe<M;){var Y=2*(oe+1)-1,X=$[Y],q=Y+1,Z=$[q];if(0>i(X,Q))q<R&&0>i(Z,X)?($[oe]=Z,$[q]=Q,oe=q):($[oe]=X,$[Y]=Q,oe=Y);else if(q<R&&0>i(Z,Q))$[oe]=Z,$[q]=Q,oe=q;else break e}}return z}function i($,z){var Q=$.sortIndex-z.sortIndex;return Q!==0?Q:$.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();e.unstable_now=function(){return a.now()-o}}var c=[],u=[],d=1,h=null,A=3,f=!1,p=!1,m=!1,g=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x($){for(var z=n(u);z!==null;){if(z.callback===null)r(u);else if(z.startTime<=$)r(u),z.sortIndex=z.expirationTime,t(c,z);else break;z=n(u)}}function w($){if(m=!1,x($),!p)if(n(c)!==null)p=!0,H(b);else{var z=n(u);z!==null&&K(w,z.startTime-$)}}function b($,z){p=!1,m&&(m=!1,y(B),B=-1),f=!0;var Q=A;try{for(x(z),h=n(c);h!==null&&(!(h.expirationTime>z)||$&&!T());){var oe=h.callback;if(typeof oe=="function"){h.callback=null,A=h.priorityLevel;var R=oe(h.expirationTime<=z);z=e.unstable_now(),typeof R=="function"?h.callback=R:h===n(c)&&r(c),x(z)}else r(c);h=n(c)}if(h!==null)var M=!0;else{var Y=n(u);Y!==null&&K(w,Y.startTime-z),M=!1}return M}finally{h=null,A=Q,f=!1}}var k=!1,j=null,B=-1,E=5,I=-1;function T(){return!(e.unstable_now()-I<E)}function N(){if(j!==null){var $=e.unstable_now();I=$;var z=!0;try{z=j(!0,$)}finally{z?F():(k=!1,j=null)}}else k=!1}var F;if(typeof v=="function")F=function(){v(N)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,U=L.port2;L.port1.onmessage=N,F=function(){U.postMessage(null)}}else F=function(){g(N,0)};function H($){j=$,k||(k=!0,F())}function K($,z){B=g(function(){$(e.unstable_now())},z)}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($){$.callback=null},e.unstable_continueExecution=function(){p||f||(p=!0,H(b))},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return A},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function($){switch(A){case 1:case 2:case 3:var z=3;break;default:z=A}var Q=A;A=z;try{return $()}finally{A=Q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,z){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var Q=A;A=$;try{return z()}finally{A=Q}},e.unstable_scheduleCallback=function($,z,Q){var oe=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?oe+Q:oe):Q=oe,$){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=Q+R,$={id:d++,callback:z,priorityLevel:$,startTime:Q,expirationTime:R,sortIndex:-1},Q>oe?($.sortIndex=Q,t(u,$),n(c)===null&&$===n(u)&&(m?(y(B),B=-1):m=!0,K(w,Q-oe))):($.sortIndex=R,t(c,$),p||f||(p=!0,H(b))),$},e.unstable_shouldYield=T,e.unstable_wrapCallback=function($){var z=A;return function(){var Q=A;A=z;try{return $.apply(this,arguments)}finally{A=Q}}}})(qee);Kee.exports=qee;var fwe=Kee.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 Awe=C,Ro=fwe;function qe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Wee=new Set,Ab={};function fm(e,t){ev(e,t),ev(e+"Capture",t)}function ev(e,t){for(Ab[e]=t,e=0;e<t.length;e++)Wee.add(t[e])}var Ad=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),UO=Object.prototype.hasOwnProperty,pwe=/^[: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]*$/,m8={},g8={};function mwe(e){return UO.call(g8,e)?!0:UO.call(m8,e)?!1:pwe.test(e)?g8[e]=!0:(m8[e]=!0,!1)}function gwe(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ywe(e,t,n,r){if(t===null||typeof t>"u"||gwe(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Pa(e,t,n,r,i,s,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var Ps={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ps[e]=new Pa(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ps[t]=new Pa(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ps[e]=new Pa(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ps[e]=new Pa(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ps[e]=new Pa(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ps[e]=new Pa(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ps[e]=new Pa(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ps[e]=new Pa(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ps[e]=new Pa(e,5,!1,e.toLowerCase(),null,!1,!1)});var AD=/[\-:]([a-z])/g;function pD(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(AD,pD);Ps[t]=new Pa(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(AD,pD);Ps[t]=new Pa(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(AD,pD);Ps[t]=new Pa(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ps[e]=new Pa(e,1,!1,e.toLowerCase(),null,!1,!1)});Ps.xlinkHref=new Pa("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ps[e]=new Pa(e,1,!1,e.toLowerCase(),null,!0,!0)});function mD(e,t,n,r){var i=Ps.hasOwnProperty(t)?Ps[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(ywe(t,n,i,r)&&(n=null),r||i===null?mwe(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var jd=Awe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,zC=Symbol.for("react.element"),$g=Symbol.for("react.portal"),zg=Symbol.for("react.fragment"),gD=Symbol.for("react.strict_mode"),HO=Symbol.for("react.profiler"),Gee=Symbol.for("react.provider"),Yee=Symbol.for("react.context"),yD=Symbol.for("react.forward_ref"),QO=Symbol.for("react.suspense"),$O=Symbol.for("react.suspense_list"),vD=Symbol.for("react.memo"),Ah=Symbol.for("react.lazy"),Xee=Symbol.for("react.offscreen"),y8=Symbol.iterator;function lx(e){return e===null||typeof e!="object"?null:(e=y8&&e[y8]||e["@@iterator"],typeof e=="function"?e:null)}var Kr=Object.assign,dP;function Gx(e){if(dP===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);dP=t&&t[1]||""}return`
`+dP+e}var hP=!1;function fP(e,t){if(!e||hP)return"";hP=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
`),s=r.stack.split(`
`),a=i.length-1,o=s.length-1;1<=a&&0<=o&&i[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(i[a]!==s[o]){if(a!==1||o!==1)do if(a--,o--,0>o||i[a]!==s[o]){var c=`
`+i[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=o);break}}}finally{hP=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Gx(e):""}function vwe(e){switch(e.tag){case 5:return Gx(e.type);case 16:return Gx("Lazy");case 13:return Gx("Suspense");case 19:return Gx("SuspenseList");case 0:case 2:case 15:return e=fP(e.type,!1),e;case 11:return e=fP(e.type.render,!1),e;case 1:return e=fP(e.type,!0),e;default:return""}}function zO(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case zg:return"Fragment";case $g:return"Portal";case HO:return"Profiler";case gD:return"StrictMode";case QO:return"Suspense";case $O:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Yee:return(e.displayName||"Context")+".Consumer";case Gee:return(e._context.displayName||"Context")+".Provider";case yD:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case vD:return t=e.displayName||null,t!==null?t:zO(e.type)||"Memo";case Ah:t=e._payload,e=e._init;try{return zO(e(t))}catch{}}return null}function xwe(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return zO(t);case 8:return t===gD?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Sf(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Jee(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wwe(e){var t=Jee(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function VC(e){e._valueTracker||(e._valueTracker=wwe(e))}function Zee(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Jee(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function F_(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function VO(e,t){var n=t.checked;return Kr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function v8(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Sf(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ete(e,t){t=t.checked,t!=null&&mD(e,"checked",t,!1)}function KO(e,t){ete(e,t);var n=Sf(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?qO(e,t.type,n):t.hasOwnProperty("defaultValue")&&qO(e,t.type,Sf(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function x8(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function qO(e,t,n){(t!=="number"||F_(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Yx=Array.isArray;function hy(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Sf(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function WO(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(qe(91));return Kr({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function w8(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(qe(92));if(Yx(n)){if(1<n.length)throw Error(qe(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Sf(n)}}function tte(e,t){var n=Sf(t.value),r=Sf(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function b8(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function nte(e){switch(e){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 GO(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?nte(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var KC,rte=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(KC=KC||document.createElement("div"),KC.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=KC.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function pb(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var xw={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},bwe=["Webkit","ms","Moz","O"];Object.keys(xw).forEach(function(e){bwe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xw[t]=xw[e]})});function ite(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||xw.hasOwnProperty(e)&&xw[e]?(""+t).trim():t+"px"}function ste(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=ite(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Cwe=Kr({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 YO(e,t){if(t){if(Cwe[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(qe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(qe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(qe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(qe(62))}}function XO(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var JO=null;function xD(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ZO=null,fy=null,Ay=null;function C8(e){if(e=m2(e)){if(typeof ZO!="function")throw Error(qe(280));var t=e.stateNode;t&&(t=ZN(t),ZO(e.stateNode,e.type,t))}}function ate(e){fy?Ay?Ay.push(e):Ay=[e]:fy=e}function ote(){if(fy){var e=fy,t=Ay;if(Ay=fy=null,C8(e),t)for(e=0;e<t.length;e++)C8(t[e])}}function lte(e,t){return e(t)}function cte(){}var AP=!1;function ute(e,t,n){if(AP)return e(t,n);AP=!0;try{return lte(e,t,n)}finally{AP=!1,(fy!==null||Ay!==null)&&(cte(),ote())}}function mb(e,t){var n=e.stateNode;if(n===null)return null;var r=ZN(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(qe(231,t,typeof n));return n}var e3=!1;if(Ad)try{var cx={};Object.defineProperty(cx,"passive",{get:function(){e3=!0}}),window.addEventListener("test",cx,cx),window.removeEventListener("test",cx,cx)}catch{e3=!1}function Swe(e,t,n,r,i,s,a,o,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var ww=!1,M_=null,L_=!1,t3=null,kwe={onError:function(e){ww=!0,M_=e}};function _we(e,t,n,r,i,s,a,o,c){ww=!1,M_=null,Swe.apply(kwe,arguments)}function jwe(e,t,n,r,i,s,a,o,c){if(_we.apply(this,arguments),ww){if(ww){var u=M_;ww=!1,M_=null}else throw Error(qe(198));L_||(L_=!0,t3=u)}}function Am(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function dte(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function S8(e){if(Am(e)!==e)throw Error(qe(188))}function Bwe(e){var t=e.alternate;if(!t){if(t=Am(e),t===null)throw Error(qe(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return S8(i),e;if(s===r)return S8(i),t;s=s.sibling}throw Error(qe(188))}if(n.return!==r.return)n=i,r=s;else{for(var a=!1,o=i.child;o;){if(o===n){a=!0,n=i,r=s;break}if(o===r){a=!0,r=i,n=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===n){a=!0,n=s,r=i;break}if(o===r){a=!0,r=s,n=i;break}o=o.sibling}if(!a)throw Error(qe(189))}}if(n.alternate!==r)throw Error(qe(190))}if(n.tag!==3)throw Error(qe(188));return n.stateNode.current===n?e:t}function hte(e){return e=Bwe(e),e!==null?fte(e):null}function fte(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=fte(e);if(t!==null)return t;e=e.sibling}return null}var Ate=Ro.unstable_scheduleCallback,k8=Ro.unstable_cancelCallback,Nwe=Ro.unstable_shouldYield,Ewe=Ro.unstable_requestPaint,fi=Ro.unstable_now,Twe=Ro.unstable_getCurrentPriorityLevel,wD=Ro.unstable_ImmediatePriority,pte=Ro.unstable_UserBlockingPriority,R_=Ro.unstable_NormalPriority,Pwe=Ro.unstable_LowPriority,mte=Ro.unstable_IdlePriority,GN=null,tu=null;function Iwe(e){if(tu&&typeof tu.onCommitFiberRoot=="function")try{tu.onCommitFiberRoot(GN,e,void 0,(e.current.flags&128)===128)}catch{}}var uc=Math.clz32?Math.clz32:Mwe,Owe=Math.log,Fwe=Math.LN2;function Mwe(e){return e>>>=0,e===0?32:31-(Owe(e)/Fwe|0)|0}var qC=64,WC=4194304;function Xx(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function D_(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var o=a&~i;o!==0?r=Xx(o):(s&=a,s!==0&&(r=Xx(s)))}else a=n&~i,a!==0?r=Xx(a):s!==0&&(r=Xx(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-uc(t),i=1<<n,r|=e[n],t&=~i;return r}function Lwe(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 Rwe(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var a=31-uc(s),o=1<<a,c=i[a];c===-1?(!(o&n)||o&r)&&(i[a]=Lwe(o,t)):c<=t&&(e.expiredLanes|=o),s&=~o}}function n3(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function gte(){var e=qC;return qC<<=1,!(qC&4194240)&&(qC=64),e}function pP(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function A2(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-uc(t),e[t]=n}function Dwe(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-uc(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function bD(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-uc(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Yn=0;function yte(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var vte,CD,xte,wte,bte,r3=!1,GC=[],Zh=null,ef=null,tf=null,gb=new Map,yb=new Map,bh=[],Uwe="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 _8(e,t){switch(e){case"focusin":case"focusout":Zh=null;break;case"dragenter":case"dragleave":ef=null;break;case"mouseover":case"mouseout":tf=null;break;case"pointerover":case"pointerout":gb.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":yb.delete(t.pointerId)}}function ux(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=m2(t),t!==null&&CD(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Hwe(e,t,n,r,i){switch(t){case"focusin":return Zh=ux(Zh,e,t,n,r,i),!0;case"dragenter":return ef=ux(ef,e,t,n,r,i),!0;case"mouseover":return tf=ux(tf,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return gb.set(s,ux(gb.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,yb.set(s,ux(yb.get(s)||null,e,t,n,r,i)),!0}return!1}function Cte(e){var t=WA(e.target);if(t!==null){var n=Am(t);if(n!==null){if(t=n.tag,t===13){if(t=dte(n),t!==null){e.blockedOn=t,bte(e.priority,function(){xte(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hk(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=i3(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);JO=r,n.target.dispatchEvent(r),JO=null}else return t=m2(n),t!==null&&CD(t),e.blockedOn=n,!1;t.shift()}return!0}function j8(e,t,n){Hk(e)&&n.delete(t)}function Qwe(){r3=!1,Zh!==null&&Hk(Zh)&&(Zh=null),ef!==null&&Hk(ef)&&(ef=null),tf!==null&&Hk(tf)&&(tf=null),gb.forEach(j8),yb.forEach(j8)}function dx(e,t){e.blockedOn===t&&(e.blockedOn=null,r3||(r3=!0,Ro.unstable_scheduleCallback(Ro.unstable_NormalPriority,Qwe)))}function vb(e){function t(i){return dx(i,e)}if(0<GC.length){dx(GC[0],e);for(var n=1;n<GC.length;n++){var r=GC[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Zh!==null&&dx(Zh,e),ef!==null&&dx(ef,e),tf!==null&&dx(tf,e),gb.forEach(t),yb.forEach(t),n=0;n<bh.length;n++)r=bh[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<bh.length&&(n=bh[0],n.blockedOn===null);)Cte(n),n.blockedOn===null&&bh.shift()}var py=jd.ReactCurrentBatchConfig,U_=!0;function $we(e,t,n,r){var i=Yn,s=py.transition;py.transition=null;try{Yn=1,SD(e,t,n,r)}finally{Yn=i,py.transition=s}}function zwe(e,t,n,r){var i=Yn,s=py.transition;py.transition=null;try{Yn=4,SD(e,t,n,r)}finally{Yn=i,py.transition=s}}function SD(e,t,n,r){if(U_){var i=i3(e,t,n,r);if(i===null)kP(e,t,r,H_,n),_8(e,r);else if(Hwe(i,e,t,n,r))r.stopPropagation();else if(_8(e,r),t&4&&-1<Uwe.indexOf(e)){for(;i!==null;){var s=m2(i);if(s!==null&&vte(s),s=i3(e,t,n,r),s===null&&kP(e,t,r,H_,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else kP(e,t,r,null,n)}}var H_=null;function i3(e,t,n,r){if(H_=null,e=xD(r),e=WA(e),e!==null)if(t=Am(e),t===null)e=null;else if(n=t.tag,n===13){if(e=dte(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return H_=e,null}function Ste(e){switch(e){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(Twe()){case wD:return 1;case pte:return 4;case R_:case Pwe:return 16;case mte:return 536870912;default:return 16}default:return 16}}var Uh=null,kD=null,Qk=null;function kte(){if(Qk)return Qk;var e,t=kD,n=t.length,r,i="value"in Uh?Uh.value:Uh.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[s-r];r++);return Qk=i.slice(e,1<r?1-r:void 0)}function $k(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function YC(){return!0}function B8(){return!1}function Ho(e){function t(n,r,i,s,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(s):s[o]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?YC:B8,this.isPropagationStopped=B8,this}return Kr(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=YC)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=YC)},persist:function(){},isPersistent:YC}),t}var Xv={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_D=Ho(Xv),p2=Kr({},Xv,{view:0,detail:0}),Vwe=Ho(p2),mP,gP,hx,YN=Kr({},p2,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jD,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==hx&&(hx&&e.type==="mousemove"?(mP=e.screenX-hx.screenX,gP=e.screenY-hx.screenY):gP=mP=0,hx=e),mP)},movementY:function(e){return"movementY"in e?e.movementY:gP}}),N8=Ho(YN),Kwe=Kr({},YN,{dataTransfer:0}),qwe=Ho(Kwe),Wwe=Kr({},p2,{relatedTarget:0}),yP=Ho(Wwe),Gwe=Kr({},Xv,{animationName:0,elapsedTime:0,pseudoElement:0}),Ywe=Ho(Gwe),Xwe=Kr({},Xv,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Jwe=Ho(Xwe),Zwe=Kr({},Xv,{data:0}),E8=Ho(Zwe),ebe={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},tbe={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"},nbe={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rbe(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=nbe[e])?!!t[e]:!1}function jD(){return rbe}var ibe=Kr({},p2,{key:function(e){if(e.key){var t=ebe[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$k(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?tbe[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jD,charCode:function(e){return e.type==="keypress"?$k(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$k(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),sbe=Ho(ibe),abe=Kr({},YN,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),T8=Ho(abe),obe=Kr({},p2,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jD}),lbe=Ho(obe),cbe=Kr({},Xv,{propertyName:0,elapsedTime:0,pseudoElement:0}),ube=Ho(cbe),dbe=Kr({},YN,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),hbe=Ho(dbe),fbe=[9,13,27,32],BD=Ad&&"CompositionEvent"in window,bw=null;Ad&&"documentMode"in document&&(bw=document.documentMode);var Abe=Ad&&"TextEvent"in window&&!bw,_te=Ad&&(!BD||bw&&8<bw&&11>=bw),P8=" ",I8=!1;function jte(e,t){switch(e){case"keyup":return fbe.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bte(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vg=!1;function pbe(e,t){switch(e){case"compositionend":return Bte(t);case"keypress":return t.which!==32?null:(I8=!0,P8);case"textInput":return e=t.data,e===P8&&I8?null:e;default:return null}}function mbe(e,t){if(Vg)return e==="compositionend"||!BD&&jte(e,t)?(e=kte(),Qk=kD=Uh=null,Vg=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return _te&&t.locale!=="ko"?null:t.data;default:return null}}var gbe={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 O8(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!gbe[e.type]:t==="textarea"}function Nte(e,t,n,r){ate(r),t=Q_(t,"onChange"),0<t.length&&(n=new _D("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Cw=null,xb=null;function ybe(e){Ute(e,0)}function XN(e){var t=Wg(e);if(Zee(t))return e}function vbe(e,t){if(e==="change")return t}var Ete=!1;if(Ad){var vP;if(Ad){var xP="oninput"in document;if(!xP){var F8=document.createElement("div");F8.setAttribute("oninput","return;"),xP=typeof F8.oninput=="function"}vP=xP}else vP=!1;Ete=vP&&(!document.documentMode||9<document.documentMode)}function M8(){Cw&&(Cw.detachEvent("onpropertychange",Tte),xb=Cw=null)}function Tte(e){if(e.propertyName==="value"&&XN(xb)){var t=[];Nte(t,xb,e,xD(e)),ute(ybe,t)}}function xbe(e,t,n){e==="focusin"?(M8(),Cw=t,xb=n,Cw.attachEvent("onpropertychange",Tte)):e==="focusout"&&M8()}function wbe(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return XN(xb)}function bbe(e,t){if(e==="click")return XN(t)}function Cbe(e,t){if(e==="input"||e==="change")return XN(t)}function Sbe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mc=typeof Object.is=="function"?Object.is:Sbe;function wb(e,t){if(mc(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!UO.call(t,i)||!mc(e[i],t[i]))return!1}return!0}function L8(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function R8(e,t){var n=L8(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=L8(n)}}function Pte(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pte(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ite(){for(var e=window,t=F_();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=F_(e.document)}return t}function ND(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function kbe(e){var t=Ite(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Pte(n.ownerDocument.documentElement,n)){if(r!==null&&ND(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=R8(n,s);var a=R8(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var _be=Ad&&"documentMode"in document&&11>=document.documentMode,Kg=null,s3=null,Sw=null,a3=!1;function D8(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;a3||Kg==null||Kg!==F_(r)||(r=Kg,"selectionStart"in r&&ND(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Sw&&wb(Sw,r)||(Sw=r,r=Q_(s3,"onSelect"),0<r.length&&(t=new _D("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Kg)))}function XC(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var qg={animationend:XC("Animation","AnimationEnd"),animationiteration:XC("Animation","AnimationIteration"),animationstart:XC("Animation","AnimationStart"),transitionend:XC("Transition","TransitionEnd")},wP={},Ote={};Ad&&(Ote=document.createElement("div").style,"AnimationEvent"in window||(delete qg.animationend.animation,delete qg.animationiteration.animation,delete qg.animationstart.animation),"TransitionEvent"in window||delete qg.transitionend.transition);function JN(e){if(wP[e])return wP[e];if(!qg[e])return e;var t=qg[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ote)return wP[e]=t[n];return e}var Fte=JN("animationend"),Mte=JN("animationiteration"),Lte=JN("animationstart"),Rte=JN("transitionend"),Dte=new Map,U8="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 Rf(e,t){Dte.set(e,t),fm(t,[e])}for(var bP=0;bP<U8.length;bP++){var CP=U8[bP],jbe=CP.toLowerCase(),Bbe=CP[0].toUpperCase()+CP.slice(1);Rf(jbe,"on"+Bbe)}Rf(Fte,"onAnimationEnd");Rf(Mte,"onAnimationIteration");Rf(Lte,"onAnimationStart");Rf("dblclick","onDoubleClick");Rf("focusin","onFocus");Rf("focusout","onBlur");Rf(Rte,"onTransitionEnd");ev("onMouseEnter",["mouseout","mouseover"]);ev("onMouseLeave",["mouseout","mouseover"]);ev("onPointerEnter",["pointerout","pointerover"]);ev("onPointerLeave",["pointerout","pointerover"]);fm("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));fm("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));fm("onBeforeInput",["compositionend","keypress","textInput","paste"]);fm("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));fm("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));fm("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jx="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(" "),Nbe=new Set("cancel close invalid load scroll toggle".split(" ").concat(Jx));function H8(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,jwe(r,t,void 0,e),e.currentTarget=null}function Ute(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var a=r.length-1;0<=a;a--){var o=r[a],c=o.instance,u=o.currentTarget;if(o=o.listener,c!==s&&i.isPropagationStopped())break e;H8(i,o,u),s=c}else for(a=0;a<r.length;a++){if(o=r[a],c=o.instance,u=o.currentTarget,o=o.listener,c!==s&&i.isPropagationStopped())break e;H8(i,o,u),s=c}}}if(L_)throw e=t3,L_=!1,t3=null,e}function wr(e,t){var n=t[d3];n===void 0&&(n=t[d3]=new Set);var r=e+"__bubble";n.has(r)||(Hte(t,e,2,!1),n.add(r))}function SP(e,t,n){var r=0;t&&(r|=4),Hte(n,e,r,t)}var JC="_reactListening"+Math.random().toString(36).slice(2);function bb(e){if(!e[JC]){e[JC]=!0,Wee.forEach(function(n){n!=="selectionchange"&&(Nbe.has(n)||SP(n,!1,e),SP(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[JC]||(t[JC]=!0,SP("selectionchange",!1,t))}}function Hte(e,t,n,r){switch(Ste(t)){case 1:var i=$we;break;case 4:i=zwe;break;default:i=SD}n=i.bind(null,t,n,e),i=void 0,!e3||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function kP(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var o=r.stateNode.containerInfo;if(o===i||o.nodeType===8&&o.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;a=a.return}for(;o!==null;){if(a=WA(o),a===null)return;if(c=a.tag,c===5||c===6){r=s=a;continue e}o=o.parentNode}}r=r.return}ute(function(){var u=s,d=xD(n),h=[];e:{var A=Dte.get(e);if(A!==void 0){var f=_D,p=e;switch(e){case"keypress":if($k(n)===0)break e;case"keydown":case"keyup":f=sbe;break;case"focusin":p="focus",f=yP;break;case"focusout":p="blur",f=yP;break;case"beforeblur":case"afterblur":f=yP;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=N8;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=qwe;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=lbe;break;case Fte:case Mte:case Lte:f=Ywe;break;case Rte:f=ube;break;case"scroll":f=Vwe;break;case"wheel":f=hbe;break;case"copy":case"cut":case"paste":f=Jwe;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=T8}var m=(t&4)!==0,g=!m&&e==="scroll",y=m?A!==null?A+"Capture":null:A;m=[];for(var v=u,x;v!==null;){x=v;var w=x.stateNode;if(x.tag===5&&w!==null&&(x=w,y!==null&&(w=mb(v,y),w!=null&&m.push(Cb(v,w,x)))),g)break;v=v.return}0<m.length&&(A=new f(A,p,null,n,d),h.push({event:A,listeners:m}))}}if(!(t&7)){e:{if(A=e==="mouseover"||e==="pointerover",f=e==="mouseout"||e==="pointerout",A&&n!==JO&&(p=n.relatedTarget||n.fromElement)&&(WA(p)||p[pd]))break e;if((f||A)&&(A=d.window===d?d:(A=d.ownerDocument)?A.defaultView||A.parentWindow:window,f?(p=n.relatedTarget||n.toElement,f=u,p=p?WA(p):null,p!==null&&(g=Am(p),p!==g||p.tag!==5&&p.tag!==6)&&(p=null)):(f=null,p=u),f!==p)){if(m=N8,w="onMouseLeave",y="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(m=T8,w="onPointerLeave",y="onPointerEnter",v="pointer"),g=f==null?A:Wg(f),x=p==null?A:Wg(p),A=new m(w,v+"leave",f,n,d),A.target=g,A.relatedTarget=x,w=null,WA(d)===u&&(m=new m(y,v+"enter",p,n,d),m.target=x,m.relatedTarget=g,w=m),g=w,f&&p)t:{for(m=f,y=p,v=0,x=m;x;x=Zm(x))v++;for(x=0,w=y;w;w=Zm(w))x++;for(;0<v-x;)m=Zm(m),v--;for(;0<x-v;)y=Zm(y),x--;for(;v--;){if(m===y||y!==null&&m===y.alternate)break t;m=Zm(m),y=Zm(y)}m=null}else m=null;f!==null&&Q8(h,A,f,m,!1),p!==null&&g!==null&&Q8(h,g,p,m,!0)}}e:{if(A=u?Wg(u):window,f=A.nodeName&&A.nodeName.toLowerCase(),f==="select"||f==="input"&&A.type==="file")var b=vbe;else if(O8(A))if(Ete)b=Cbe;else{b=wbe;var k=xbe}else(f=A.nodeName)&&f.toLowerCase()==="input"&&(A.type==="checkbox"||A.type==="radio")&&(b=bbe);if(b&&(b=b(e,u))){Nte(h,b,n,d);break e}k&&k(e,A,u),e==="focusout"&&(k=A._wrapperState)&&k.controlled&&A.type==="number"&&qO(A,"number",A.value)}switch(k=u?Wg(u):window,e){case"focusin":(O8(k)||k.contentEditable==="true")&&(Kg=k,s3=u,Sw=null);break;case"focusout":Sw=s3=Kg=null;break;case"mousedown":a3=!0;break;case"contextmenu":case"mouseup":case"dragend":a3=!1,D8(h,n,d);break;case"selectionchange":if(_be)break;case"keydown":case"keyup":D8(h,n,d)}var j;if(BD)e:{switch(e){case"compositionstart":var B="onCompositionStart";break e;case"compositionend":B="onCompositionEnd";break e;case"compositionupdate":B="onCompositionUpdate";break e}B=void 0}else Vg?jte(e,n)&&(B="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(B="onCompositionStart");B&&(_te&&n.locale!=="ko"&&(Vg||B!=="onCompositionStart"?B==="onCompositionEnd"&&Vg&&(j=kte()):(Uh=d,kD="value"in Uh?Uh.value:Uh.textContent,Vg=!0)),k=Q_(u,B),0<k.length&&(B=new E8(B,e,null,n,d),h.push({event:B,listeners:k}),j?B.data=j:(j=Bte(n),j!==null&&(B.data=j)))),(j=Abe?pbe(e,n):mbe(e,n))&&(u=Q_(u,"onBeforeInput"),0<u.length&&(d=new E8("onBeforeInput","beforeinput",null,n,d),h.push({event:d,listeners:u}),d.data=j))}Ute(h,t)})}function Cb(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Q_(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=mb(e,n),s!=null&&r.unshift(Cb(e,s,i)),s=mb(e,t),s!=null&&r.push(Cb(e,s,i))),e=e.return}return r}function Zm(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Q8(e,t,n,r,i){for(var s=t._reactName,a=[];n!==null&&n!==r;){var o=n,c=o.alternate,u=o.stateNode;if(c!==null&&c===r)break;o.tag===5&&u!==null&&(o=u,i?(c=mb(n,s),c!=null&&a.unshift(Cb(n,c,o))):i||(c=mb(n,s),c!=null&&a.push(Cb(n,c,o)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var Ebe=/\r\n?/g,Tbe=/\u0000|\uFFFD/g;function $8(e){return(typeof e=="string"?e:""+e).replace(Ebe,`
`).replace(Tbe,"")}function ZC(e,t,n){if(t=$8(t),$8(e)!==t&&n)throw Error(qe(425))}function $_(){}var o3=null,l3=null;function c3(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var u3=typeof setTimeout=="function"?setTimeout:void 0,Pbe=typeof clearTimeout=="function"?clearTimeout:void 0,z8=typeof Promise=="function"?Promise:void 0,Ibe=typeof queueMicrotask=="function"?queueMicrotask:typeof z8<"u"?function(e){return z8.resolve(null).then(e).catch(Obe)}:u3;function Obe(e){setTimeout(function(){throw e})}function _P(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),vb(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);vb(t)}function nf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function V8(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Jv=Math.random().toString(36).slice(2),Wc="__reactFiber$"+Jv,Sb="__reactProps$"+Jv,pd="__reactContainer$"+Jv,d3="__reactEvents$"+Jv,Fbe="__reactListeners$"+Jv,Mbe="__reactHandles$"+Jv;function WA(e){var t=e[Wc];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pd]||n[Wc]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=V8(e);e!==null;){if(n=e[Wc])return n;e=V8(e)}return t}e=n,n=e.parentNode}return null}function m2(e){return e=e[Wc]||e[pd],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Wg(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(qe(33))}function ZN(e){return e[Sb]||null}var h3=[],Gg=-1;function Df(e){return{current:e}}function _r(e){0>Gg||(e.current=h3[Gg],h3[Gg]=null,Gg--)}function mr(e,t){Gg++,h3[Gg]=e.current,e.current=t}var kf={},na=Df(kf),Xa=Df(!1),Lp=kf;function tv(e,t){var n=e.type.contextTypes;if(!n)return kf;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ja(e){return e=e.childContextTypes,e!=null}function z_(){_r(Xa),_r(na)}function K8(e,t,n){if(na.current!==kf)throw Error(qe(168));mr(na,t),mr(Xa,n)}function Qte(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(qe(108,xwe(e)||"Unknown",i));return Kr({},n,r)}function V_(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||kf,Lp=na.current,mr(na,e),mr(Xa,Xa.current),!0}function q8(e,t,n){var r=e.stateNode;if(!r)throw Error(qe(169));n?(e=Qte(e,t,Lp),r.__reactInternalMemoizedMergedChildContext=e,_r(Xa),_r(na),mr(na,e)):_r(Xa),mr(Xa,n)}var Wu=null,eE=!1,jP=!1;function $te(e){Wu===null?Wu=[e]:Wu.push(e)}function Lbe(e){eE=!0,$te(e)}function Uf(){if(!jP&&Wu!==null){jP=!0;var e=0,t=Yn;try{var n=Wu;for(Yn=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Wu=null,eE=!1}catch(i){throw Wu!==null&&(Wu=Wu.slice(e+1)),Ate(wD,Uf),i}finally{Yn=t,jP=!1}}return null}var Yg=[],Xg=0,K_=null,q_=0,al=[],ol=0,Rp=null,Zu=1,ed="";function IA(e,t){Yg[Xg++]=q_,Yg[Xg++]=K_,K_=e,q_=t}function zte(e,t,n){al[ol++]=Zu,al[ol++]=ed,al[ol++]=Rp,Rp=e;var r=Zu;e=ed;var i=32-uc(r)-1;r&=~(1<<i),n+=1;var s=32-uc(t)+i;if(30<s){var a=i-i%5;s=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Zu=1<<32-uc(t)+i|n<<i|r,ed=s+e}else Zu=1<<s|n<<i|r,ed=e}function ED(e){e.return!==null&&(IA(e,1),zte(e,1,0))}function TD(e){for(;e===K_;)K_=Yg[--Xg],Yg[Xg]=null,q_=Yg[--Xg],Yg[Xg]=null;for(;e===Rp;)Rp=al[--ol],al[ol]=null,ed=al[--ol],al[ol]=null,Zu=al[--ol],al[ol]=null}var Io=null,Bo=null,Or=!1,rc=null;function Vte(e,t){var n=hl(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function W8(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Io=e,Bo=nf(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Io=e,Bo=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Rp!==null?{id:Zu,overflow:ed}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=hl(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Io=e,Bo=null,!0):!1;default:return!1}}function f3(e){return(e.mode&1)!==0&&(e.flags&128)===0}function A3(e){if(Or){var t=Bo;if(t){var n=t;if(!W8(e,t)){if(f3(e))throw Error(qe(418));t=nf(n.nextSibling);var r=Io;t&&W8(e,t)?Vte(r,n):(e.flags=e.flags&-4097|2,Or=!1,Io=e)}}else{if(f3(e))throw Error(qe(418));e.flags=e.flags&-4097|2,Or=!1,Io=e}}}function G8(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Io=e}function eS(e){if(e!==Io)return!1;if(!Or)return G8(e),Or=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!c3(e.type,e.memoizedProps)),t&&(t=Bo)){if(f3(e))throw Kte(),Error(qe(418));for(;t;)Vte(e,t),t=nf(t.nextSibling)}if(G8(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(qe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Bo=nf(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Bo=null}}else Bo=Io?nf(e.stateNode.nextSibling):null;return!0}function Kte(){for(var e=Bo;e;)e=nf(e.nextSibling)}function nv(){Bo=Io=null,Or=!1}function PD(e){rc===null?rc=[e]:rc.push(e)}var Rbe=jd.ReactCurrentBatchConfig;function fx(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(qe(309));var r=n.stateNode}if(!r)throw Error(qe(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(a){var o=i.refs;a===null?delete o[s]:o[s]=a},t._stringRef=s,t)}if(typeof e!="string")throw Error(qe(284));if(!n._owner)throw Error(qe(290,e))}return e}function tS(e,t){throw e=Object.prototype.toString.call(t),Error(qe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Y8(e){var t=e._init;return t(e._payload)}function qte(e){function t(y,v){if(e){var x=y.deletions;x===null?(y.deletions=[v],y.flags|=16):x.push(v)}}function n(y,v){if(!e)return null;for(;v!==null;)t(y,v),v=v.sibling;return null}function r(y,v){for(y=new Map;v!==null;)v.key!==null?y.set(v.key,v):y.set(v.index,v),v=v.sibling;return y}function i(y,v){return y=of(y,v),y.index=0,y.sibling=null,y}function s(y,v,x){return y.index=x,e?(x=y.alternate,x!==null?(x=x.index,x<v?(y.flags|=2,v):x):(y.flags|=2,v)):(y.flags|=1048576,v)}function a(y){return e&&y.alternate===null&&(y.flags|=2),y}function o(y,v,x,w){return v===null||v.tag!==6?(v=OP(x,y.mode,w),v.return=y,v):(v=i(v,x),v.return=y,v)}function c(y,v,x,w){var b=x.type;return b===zg?d(y,v,x.props.children,w,x.key):v!==null&&(v.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Ah&&Y8(b)===v.type)?(w=i(v,x.props),w.ref=fx(y,v,x),w.return=y,w):(w=Yk(x.type,x.key,x.props,null,y.mode,w),w.ref=fx(y,v,x),w.return=y,w)}function u(y,v,x,w){return v===null||v.tag!==4||v.stateNode.containerInfo!==x.containerInfo||v.stateNode.implementation!==x.implementation?(v=FP(x,y.mode,w),v.return=y,v):(v=i(v,x.children||[]),v.return=y,v)}function d(y,v,x,w,b){return v===null||v.tag!==7?(v=Cp(x,y.mode,w,b),v.return=y,v):(v=i(v,x),v.return=y,v)}function h(y,v,x){if(typeof v=="string"&&v!==""||typeof v=="number")return v=OP(""+v,y.mode,x),v.return=y,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case zC:return x=Yk(v.type,v.key,v.props,null,y.mode,x),x.ref=fx(y,null,v),x.return=y,x;case $g:return v=FP(v,y.mode,x),v.return=y,v;case Ah:var w=v._init;return h(y,w(v._payload),x)}if(Yx(v)||lx(v))return v=Cp(v,y.mode,x,null),v.return=y,v;tS(y,v)}return null}function A(y,v,x,w){var b=v!==null?v.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return b!==null?null:o(y,v,""+x,w);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case zC:return x.key===b?c(y,v,x,w):null;case $g:return x.key===b?u(y,v,x,w):null;case Ah:return b=x._init,A(y,v,b(x._payload),w)}if(Yx(x)||lx(x))return b!==null?null:d(y,v,x,w,null);tS(y,x)}return null}function f(y,v,x,w,b){if(typeof w=="string"&&w!==""||typeof w=="number")return y=y.get(x)||null,o(v,y,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case zC:return y=y.get(w.key===null?x:w.key)||null,c(v,y,w,b);case $g:return y=y.get(w.key===null?x:w.key)||null,u(v,y,w,b);case Ah:var k=w._init;return f(y,v,x,k(w._payload),b)}if(Yx(w)||lx(w))return y=y.get(x)||null,d(v,y,w,b,null);tS(v,w)}return null}function p(y,v,x,w){for(var b=null,k=null,j=v,B=v=0,E=null;j!==null&&B<x.length;B++){j.index>B?(E=j,j=null):E=j.sibling;var I=A(y,j,x[B],w);if(I===null){j===null&&(j=E);break}e&&j&&I.alternate===null&&t(y,j),v=s(I,v,B),k===null?b=I:k.sibling=I,k=I,j=E}if(B===x.length)return n(y,j),Or&&IA(y,B),b;if(j===null){for(;B<x.length;B++)j=h(y,x[B],w),j!==null&&(v=s(j,v,B),k===null?b=j:k.sibling=j,k=j);return Or&&IA(y,B),b}for(j=r(y,j);B<x.length;B++)E=f(j,y,B,x[B],w),E!==null&&(e&&E.alternate!==null&&j.delete(E.key===null?B:E.key),v=s(E,v,B),k===null?b=E:k.sibling=E,k=E);return e&&j.forEach(function(T){return t(y,T)}),Or&&IA(y,B),b}function m(y,v,x,w){var b=lx(x);if(typeof b!="function")throw Error(qe(150));if(x=b.call(x),x==null)throw Error(qe(151));for(var k=b=null,j=v,B=v=0,E=null,I=x.next();j!==null&&!I.done;B++,I=x.next()){j.index>B?(E=j,j=null):E=j.sibling;var T=A(y,j,I.value,w);if(T===null){j===null&&(j=E);break}e&&j&&T.alternate===null&&t(y,j),v=s(T,v,B),k===null?b=T:k.sibling=T,k=T,j=E}if(I.done)return n(y,j),Or&&IA(y,B),b;if(j===null){for(;!I.done;B++,I=x.next())I=h(y,I.value,w),I!==null&&(v=s(I,v,B),k===null?b=I:k.sibling=I,k=I);return Or&&IA(y,B),b}for(j=r(y,j);!I.done;B++,I=x.next())I=f(j,y,B,I.value,w),I!==null&&(e&&I.alternate!==null&&j.delete(I.key===null?B:I.key),v=s(I,v,B),k===null?b=I:k.sibling=I,k=I);return e&&j.forEach(function(N){return t(y,N)}),Or&&IA(y,B),b}function g(y,v,x,w){if(typeof x=="object"&&x!==null&&x.type===zg&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case zC:e:{for(var b=x.key,k=v;k!==null;){if(k.key===b){if(b=x.type,b===zg){if(k.tag===7){n(y,k.sibling),v=i(k,x.props.children),v.return=y,y=v;break e}}else if(k.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Ah&&Y8(b)===k.type){n(y,k.sibling),v=i(k,x.props),v.ref=fx(y,k,x),v.return=y,y=v;break e}n(y,k);break}else t(y,k);k=k.sibling}x.type===zg?(v=Cp(x.props.children,y.mode,w,x.key),v.return=y,y=v):(w=Yk(x.type,x.key,x.props,null,y.mode,w),w.ref=fx(y,v,x),w.return=y,y=w)}return a(y);case $g:e:{for(k=x.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(y,v.sibling),v=i(v,x.children||[]),v.return=y,y=v;break e}else{n(y,v);break}else t(y,v);v=v.sibling}v=FP(x,y.mode,w),v.return=y,y=v}return a(y);case Ah:return k=x._init,g(y,v,k(x._payload),w)}if(Yx(x))return p(y,v,x,w);if(lx(x))return m(y,v,x,w);tS(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(y,v.sibling),v=i(v,x),v.return=y,y=v):(n(y,v),v=OP(x,y.mode,w),v.return=y,y=v),a(y)):n(y,v)}return g}var rv=qte(!0),Wte=qte(!1),W_=Df(null),G_=null,Jg=null,ID=null;function OD(){ID=Jg=G_=null}function FD(e){var t=W_.current;_r(W_),e._currentValue=t}function p3(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function my(e,t){G_=e,ID=Jg=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(za=!0),e.firstContext=null)}function kl(e){var t=e._currentValue;if(ID!==e)if(e={context:e,memoizedValue:t,next:null},Jg===null){if(G_===null)throw Error(qe(308));Jg=e,G_.dependencies={lanes:0,firstContext:e}}else Jg=Jg.next=e;return t}var GA=null;function MD(e){GA===null?GA=[e]:GA.push(e)}function Gte(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,MD(t)):(n.next=i.next,i.next=n),t.interleaved=n,md(e,r)}function md(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ph=!1;function LD(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Yte(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function sd(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function rf(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Fn&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,md(e,n)}return i=r.interleaved,i===null?(t.next=t,MD(r)):(t.next=i.next,i.next=t),r.interleaved=t,md(e,n)}function zk(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bD(e,n)}}function X8(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Y_(e,t,n,r){var i=e.updateQueue;ph=!1;var s=i.firstBaseUpdate,a=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var c=o,u=c.next;c.next=null,a===null?s=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==a&&(o===null?d.firstBaseUpdate=u:o.next=u,d.lastBaseUpdate=c))}if(s!==null){var h=i.baseState;a=0,d=u=c=null,o=s;do{var A=o.lane,f=o.eventTime;if((r&A)===A){d!==null&&(d=d.next={eventTime:f,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=e,m=o;switch(A=t,f=n,m.tag){case 1:if(p=m.payload,typeof p=="function"){h=p.call(f,h,A);break e}h=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,A=typeof p=="function"?p.call(f,h,A):p,A==null)break e;h=Kr({},h,A);break e;case 2:ph=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,A=i.effects,A===null?i.effects=[o]:A.push(o))}else f={eventTime:f,lane:A,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(u=d=f,c=h):d=d.next=f,a|=A;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;A=o,o=A.next,A.next=null,i.lastBaseUpdate=A,i.shared.pending=null}}while(!0);if(d===null&&(c=h),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Up|=a,e.lanes=a,e.memoizedState=h}}function J8(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(qe(191,i));i.call(r)}}}var g2={},nu=Df(g2),kb=Df(g2),_b=Df(g2);function YA(e){if(e===g2)throw Error(qe(174));return e}function RD(e,t){switch(mr(_b,t),mr(kb,e),mr(nu,g2),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:GO(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=GO(t,e)}_r(nu),mr(nu,t)}function iv(){_r(nu),_r(kb),_r(_b)}function Xte(e){YA(_b.current);var t=YA(nu.current),n=GO(t,e.type);t!==n&&(mr(kb,e),mr(nu,n))}function DD(e){kb.current===e&&(_r(nu),_r(kb))}var Qr=Df(0);function X_(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var BP=[];function UD(){for(var e=0;e<BP.length;e++)BP[e]._workInProgressVersionPrimary=null;BP.length=0}var Vk=jd.ReactCurrentDispatcher,NP=jd.ReactCurrentBatchConfig,Dp=0,Vr=null,Ui=null,ns=null,J_=!1,kw=!1,jb=0,Dbe=0;function Ds(){throw Error(qe(321))}function HD(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mc(e[n],t[n]))return!1;return!0}function QD(e,t,n,r,i,s){if(Dp=s,Vr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Vk.current=e===null||e.memoizedState===null?$be:zbe,e=n(r,i),kw){s=0;do{if(kw=!1,jb=0,25<=s)throw Error(qe(301));s+=1,ns=Ui=null,t.updateQueue=null,Vk.current=Vbe,e=n(r,i)}while(kw)}if(Vk.current=Z_,t=Ui!==null&&Ui.next!==null,Dp=0,ns=Ui=Vr=null,J_=!1,t)throw Error(qe(300));return e}function $D(){var e=jb!==0;return jb=0,e}function Hc(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ns===null?Vr.memoizedState=ns=e:ns=ns.next=e,ns}function _l(){if(Ui===null){var e=Vr.alternate;e=e!==null?e.memoizedState:null}else e=Ui.next;var t=ns===null?Vr.memoizedState:ns.next;if(t!==null)ns=t,Ui=e;else{if(e===null)throw Error(qe(310));Ui=e,e={memoizedState:Ui.memoizedState,baseState:Ui.baseState,baseQueue:Ui.baseQueue,queue:Ui.queue,next:null},ns===null?Vr.memoizedState=ns=e:ns=ns.next=e}return ns}function Bb(e,t){return typeof t=="function"?t(e):t}function EP(e){var t=_l(),n=t.queue;if(n===null)throw Error(qe(311));n.lastRenderedReducer=e;var r=Ui,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var a=i.next;i.next=s.next,s.next=a}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var o=a=null,c=null,u=s;do{var d=u.lane;if((Dp&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(o=c=h,a=r):c=c.next=h,Vr.lanes|=d,Up|=d}u=u.next}while(u!==null&&u!==s);c===null?a=r:c.next=o,mc(r,t.memoizedState)||(za=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Vr.lanes|=s,Up|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function TP(e){var t=_l(),n=t.queue;if(n===null)throw Error(qe(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do s=e(s,a.action),a=a.next;while(a!==i);mc(s,t.memoizedState)||(za=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Jte(){}function Zte(e,t){var n=Vr,r=_l(),i=t(),s=!mc(r.memoizedState,i);if(s&&(r.memoizedState=i,za=!0),r=r.queue,zD(nne.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||ns!==null&&ns.memoizedState.tag&1){if(n.flags|=2048,Nb(9,tne.bind(null,n,r,i,t),void 0,null),ss===null)throw Error(qe(349));Dp&30||ene(n,t,i)}return i}function ene(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Vr.updateQueue,t===null?(t={lastEffect:null,stores:null},Vr.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function tne(e,t,n,r){t.value=n,t.getSnapshot=r,rne(t)&&ine(e)}function nne(e,t,n){return n(function(){rne(t)&&ine(e)})}function rne(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mc(e,n)}catch{return!0}}function ine(e){var t=md(e,1);t!==null&&dc(t,e,1,-1)}function Z8(e){var t=Hc();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bb,lastRenderedState:e},t.queue=e,e=e.dispatch=Qbe.bind(null,Vr,e),[t.memoizedState,e]}function Nb(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Vr.updateQueue,t===null?(t={lastEffect:null,stores:null},Vr.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function sne(){return _l().memoizedState}function Kk(e,t,n,r){var i=Hc();Vr.flags|=e,i.memoizedState=Nb(1|t,n,void 0,r===void 0?null:r)}function tE(e,t,n,r){var i=_l();r=r===void 0?null:r;var s=void 0;if(Ui!==null){var a=Ui.memoizedState;if(s=a.destroy,r!==null&&HD(r,a.deps)){i.memoizedState=Nb(t,n,s,r);return}}Vr.flags|=e,i.memoizedState=Nb(1|t,n,s,r)}function e7(e,t){return Kk(8390656,8,e,t)}function zD(e,t){return tE(2048,8,e,t)}function ane(e,t){return tE(4,2,e,t)}function one(e,t){return tE(4,4,e,t)}function lne(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cne(e,t,n){return n=n!=null?n.concat([e]):null,tE(4,4,lne.bind(null,t,e),n)}function VD(){}function une(e,t){var n=_l();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&HD(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function dne(e,t){var n=_l();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&HD(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function hne(e,t,n){return Dp&21?(mc(n,t)||(n=gte(),Vr.lanes|=n,Up|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,za=!0),e.memoizedState=n)}function Ube(e,t){var n=Yn;Yn=n!==0&&4>n?n:4,e(!0);var r=NP.transition;NP.transition={};try{e(!1),t()}finally{Yn=n,NP.transition=r}}function fne(){return _l().memoizedState}function Hbe(e,t,n){var r=af(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ane(e))pne(t,n);else if(n=Gte(e,t,n,r),n!==null){var i=_a();dc(n,e,r,i),mne(n,t,r)}}function Qbe(e,t,n){var r=af(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ane(e))pne(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,o=s(a,n);if(i.hasEagerState=!0,i.eagerState=o,mc(o,a)){var c=t.interleaved;c===null?(i.next=i,MD(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=Gte(e,t,i,r),n!==null&&(i=_a(),dc(n,e,r,i),mne(n,t,r))}}function Ane(e){var t=e.alternate;return e===Vr||t!==null&&t===Vr}function pne(e,t){kw=J_=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mne(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bD(e,n)}}var Z_={readContext:kl,useCallback:Ds,useContext:Ds,useEffect:Ds,useImperativeHandle:Ds,useInsertionEffect:Ds,useLayoutEffect:Ds,useMemo:Ds,useReducer:Ds,useRef:Ds,useState:Ds,useDebugValue:Ds,useDeferredValue:Ds,useTransition:Ds,useMutableSource:Ds,useSyncExternalStore:Ds,useId:Ds,unstable_isNewReconciler:!1},$be={readContext:kl,useCallback:function(e,t){return Hc().memoizedState=[e,t===void 0?null:t],e},useContext:kl,useEffect:e7,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Kk(4194308,4,lne.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Kk(4194308,4,e,t)},useInsertionEffect:function(e,t){return Kk(4,2,e,t)},useMemo:function(e,t){var n=Hc();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Hc();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Hbe.bind(null,Vr,e),[r.memoizedState,e]},useRef:function(e){var t=Hc();return e={current:e},t.memoizedState=e},useState:Z8,useDebugValue:VD,useDeferredValue:function(e){return Hc().memoizedState=e},useTransition:function(){var e=Z8(!1),t=e[0];return e=Ube.bind(null,e[1]),Hc().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Vr,i=Hc();if(Or){if(n===void 0)throw Error(qe(407));n=n()}else{if(n=t(),ss===null)throw Error(qe(349));Dp&30||ene(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,e7(nne.bind(null,r,s,e),[e]),r.flags|=2048,Nb(9,tne.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Hc(),t=ss.identifierPrefix;if(Or){var n=ed,r=Zu;n=(r&~(1<<32-uc(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=jb++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Dbe++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},zbe={readContext:kl,useCallback:une,useContext:kl,useEffect:zD,useImperativeHandle:cne,useInsertionEffect:ane,useLayoutEffect:one,useMemo:dne,useReducer:EP,useRef:sne,useState:function(){return EP(Bb)},useDebugValue:VD,useDeferredValue:function(e){var t=_l();return hne(t,Ui.memoizedState,e)},useTransition:function(){var e=EP(Bb)[0],t=_l().memoizedState;return[e,t]},useMutableSource:Jte,useSyncExternalStore:Zte,useId:fne,unstable_isNewReconciler:!1},Vbe={readContext:kl,useCallback:une,useContext:kl,useEffect:zD,useImperativeHandle:cne,useInsertionEffect:ane,useLayoutEffect:one,useMemo:dne,useReducer:TP,useRef:sne,useState:function(){return TP(Bb)},useDebugValue:VD,useDeferredValue:function(e){var t=_l();return Ui===null?t.memoizedState=e:hne(t,Ui.memoizedState,e)},useTransition:function(){var e=TP(Bb)[0],t=_l().memoizedState;return[e,t]},useMutableSource:Jte,useSyncExternalStore:Zte,useId:fne,unstable_isNewReconciler:!1};function Yl(e,t){if(e&&e.defaultProps){t=Kr({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function m3(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Kr({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var nE={isMounted:function(e){return(e=e._reactInternals)?Am(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_a(),i=af(e),s=sd(r,i);s.payload=t,n!=null&&(s.callback=n),t=rf(e,s,i),t!==null&&(dc(t,e,i,r),zk(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_a(),i=af(e),s=sd(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=rf(e,s,i),t!==null&&(dc(t,e,i,r),zk(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_a(),r=af(e),i=sd(n,r);i.tag=2,t!=null&&(i.callback=t),t=rf(e,i,r),t!==null&&(dc(t,e,r,n),zk(t,e,r))}};function t7(e,t,n,r,i,s,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,a):t.prototype&&t.prototype.isPureReactComponent?!wb(n,r)||!wb(i,s):!0}function gne(e,t,n){var r=!1,i=kf,s=t.contextType;return typeof s=="object"&&s!==null?s=kl(s):(i=Ja(t)?Lp:na.current,r=t.contextTypes,s=(r=r!=null)?tv(e,i):kf),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=nE,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function n7(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&nE.enqueueReplaceState(t,t.state,null)}function g3(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},LD(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=kl(s):(s=Ja(t)?Lp:na.current,i.context=tv(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(m3(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&nE.enqueueReplaceState(i,i.state,null),Y_(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function sv(e,t){try{var n="",r=t;do n+=vwe(r),r=r.return;while(r);var i=n}catch(s){i=`
Error generating stack: `+s.message+`
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function PP(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function y3(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Kbe=typeof WeakMap=="function"?WeakMap:Map;function yne(e,t,n){n=sd(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){tj||(tj=!0,B3=r),y3(e,t)},n}function vne(e,t,n){n=sd(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){y3(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){y3(e,t),typeof r!="function"&&(sf===null?sf=new Set([this]):sf.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function r7(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Kbe;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=a1e.bind(null,e,t,n),t.then(e,e))}function i7(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function s7(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=sd(-1,1),t.tag=2,rf(n,t,1))),n.lanes|=1),e)}var qbe=jd.ReactCurrentOwner,za=!1;function ma(e,t,n,r){t.child=e===null?Wte(t,null,n,r):rv(t,e.child,n,r)}function a7(e,t,n,r,i){n=n.render;var s=t.ref;return my(t,i),r=QD(e,t,n,r,s,i),n=$D(),e!==null&&!za?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,gd(e,t,i)):(Or&&n&&ED(t),t.flags|=1,ma(e,t,r,i),t.child)}function o7(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!ZD(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,xne(e,t,s,r,i)):(e=Yk(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:wb,n(a,r)&&e.ref===t.ref)return gd(e,t,i)}return t.flags|=1,e=of(s,r),e.ref=t.ref,e.return=t,t.child=e}function xne(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(wb(s,r)&&e.ref===t.ref)if(za=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(za=!0);else return t.lanes=e.lanes,gd(e,t,i)}return v3(e,t,n,r,i)}function wne(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},mr(ey,Co),Co|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,mr(ey,Co),Co|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,mr(ey,Co),Co|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,mr(ey,Co),Co|=r;return ma(e,t,i,n),t.child}function bne(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function v3(e,t,n,r,i){var s=Ja(n)?Lp:na.current;return s=tv(t,s),my(t,i),n=QD(e,t,n,r,s,i),r=$D(),e!==null&&!za?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,gd(e,t,i)):(Or&&r&&ED(t),t.flags|=1,ma(e,t,n,i),t.child)}function l7(e,t,n,r,i){if(Ja(n)){var s=!0;V_(t)}else s=!1;if(my(t,i),t.stateNode===null)qk(e,t),gne(t,n,r),g3(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,o=t.memoizedProps;a.props=o;var c=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=kl(u):(u=Ja(n)?Lp:na.current,u=tv(t,u));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";h||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||c!==u)&&n7(t,a,r,u),ph=!1;var A=t.memoizedState;a.state=A,Y_(t,r,a,i),c=t.memoizedState,o!==r||A!==c||Xa.current||ph?(typeof d=="function"&&(m3(t,n,d,r),c=t.memoizedState),(o=ph||t7(t,n,o,r,A,c,u))?(h||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=u,r=o):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Yte(e,t),o=t.memoizedProps,u=t.type===t.elementType?o:Yl(t.type,o),a.props=u,h=t.pendingProps,A=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=kl(c):(c=Ja(n)?Lp:na.current,c=tv(t,c));var f=n.getDerivedStateFromProps;(d=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==h||A!==c)&&n7(t,a,r,c),ph=!1,A=t.memoizedState,a.state=A,Y_(t,r,a,i);var p=t.memoizedState;o!==h||A!==p||Xa.current||ph?(typeof f=="function"&&(m3(t,n,f,r),p=t.memoizedState),(u=ph||t7(t,n,u,r,A,p,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!="function"||o===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),r=!1)}return x3(e,t,n,r,s,i)}function x3(e,t,n,r,i,s){bne(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&q8(t,n,!1),gd(e,t,s);r=t.stateNode,qbe.current=t;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=rv(t,e.child,null,s),t.child=rv(t,null,o,s)):ma(e,t,o,s),t.memoizedState=r.state,i&&q8(t,n,!0),t.child}function Cne(e){var t=e.stateNode;t.pendingContext?K8(e,t.pendingContext,t.pendingContext!==t.context):t.context&&K8(e,t.context,!1),RD(e,t.containerInfo)}function c7(e,t,n,r,i){return nv(),PD(i),t.flags|=256,ma(e,t,n,r),t.child}var w3={dehydrated:null,treeContext:null,retryLane:0};function b3(e){return{baseLanes:e,cachePool:null,transitions:null}}function Sne(e,t,n){var r=t.pendingProps,i=Qr.current,s=!1,a=(t.flags&128)!==0,o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:(i&2)!==0),o?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),mr(Qr,i&1),e===null)return A3(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,s?(r=t.mode,s=t.child,a={mode:"hidden",children:a},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=a):s=sE(a,r,0,null),e=Cp(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=b3(n),t.memoizedState=w3,e):KD(t,a));if(i=e.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return Wbe(e,t,a,r,o,i,n);if(s){s=r.fallback,a=t.mode,i=e.child,o=i.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=of(i,c),r.subtreeFlags=i.subtreeFlags&14680064),o!==null?s=of(o,s):(s=Cp(s,a,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,a=e.child.memoizedState,a=a===null?b3(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=e.childLanes&~n,t.memoizedState=w3,r}return s=e.child,e=s.sibling,r=of(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function KD(e,t){return t=sE({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function nS(e,t,n,r){return r!==null&&PD(r),rv(t,e.child,null,n),e=KD(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wbe(e,t,n,r,i,s,a){if(n)return t.flags&256?(t.flags&=-257,r=PP(Error(qe(422))),nS(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=sE({mode:"visible",children:r.children},i,0,null),s=Cp(s,i,a,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&rv(t,e.child,null,a),t.child.memoizedState=b3(a),t.memoizedState=w3,s);if(!(t.mode&1))return nS(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var o=r.dgst;return r=o,s=Error(qe(419)),r=PP(s,r,void 0),nS(e,t,a,r)}if(o=(a&e.childLanes)!==0,za||o){if(r=ss,r!==null){switch(a&-a){case 4:i=2;break;case 16:i=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:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|a)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,md(e,i),dc(r,e,i,-1))}return JD(),r=PP(Error(qe(421))),nS(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=o1e.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,Bo=nf(i.nextSibling),Io=t,Or=!0,rc=null,e!==null&&(al[ol++]=Zu,al[ol++]=ed,al[ol++]=Rp,Zu=e.id,ed=e.overflow,Rp=t),t=KD(t,r.children),t.flags|=4096,t)}function u7(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),p3(e.return,t,n)}function IP(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function kne(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(ma(e,t,r.children,n),r=Qr.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&u7(e,n,t);else if(e.tag===19)u7(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(mr(Qr,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&X_(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),IP(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&X_(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}IP(t,!0,n,null,s);break;case"together":IP(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function qk(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function gd(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Up|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(qe(153));if(t.child!==null){for(e=t.child,n=of(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=of(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Gbe(e,t,n){switch(t.tag){case 3:Cne(t),nv();break;case 5:Xte(t);break;case 1:Ja(t.type)&&V_(t);break;case 4:RD(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;mr(W_,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(mr(Qr,Qr.current&1),t.flags|=128,null):n&t.child.childLanes?Sne(e,t,n):(mr(Qr,Qr.current&1),e=gd(e,t,n),e!==null?e.sibling:null);mr(Qr,Qr.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return kne(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),mr(Qr,Qr.current),r)break;return null;case 22:case 23:return t.lanes=0,wne(e,t,n)}return gd(e,t,n)}var _ne,C3,jne,Bne;_ne=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};C3=function(){};jne=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,YA(nu.current);var s=null;switch(n){case"input":i=VO(e,i),r=VO(e,r),s=[];break;case"select":i=Kr({},i,{value:void 0}),r=Kr({},r,{value:void 0}),s=[];break;case"textarea":i=WO(e,i),r=WO(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=$_)}YO(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var o=i[u];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ab.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var c=r[u];if(o=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&c!==o&&(c!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&o[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(s||(s=[]),s.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(s=s||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ab.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&wr("scroll",e),s||o===c||(s=[])):(s=s||[]).push(u,c))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};Bne=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ax(e,t){if(!Or)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Us(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ybe(e,t,n){var r=t.pendingProps;switch(TD(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Us(t),null;case 1:return Ja(t.type)&&z_(),Us(t),null;case 3:return r=t.stateNode,iv(),_r(Xa),_r(na),UD(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(eS(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,rc!==null&&(T3(rc),rc=null))),C3(e,t),Us(t),null;case 5:DD(t);var i=YA(_b.current);if(n=t.type,e!==null&&t.stateNode!=null)jne(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(qe(166));return Us(t),null}if(e=YA(nu.current),eS(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Wc]=t,r[Sb]=s,e=(t.mode&1)!==0,n){case"dialog":wr("cancel",r),wr("close",r);break;case"iframe":case"object":case"embed":wr("load",r);break;case"video":case"audio":for(i=0;i<Jx.length;i++)wr(Jx[i],r);break;case"source":wr("error",r);break;case"img":case"image":case"link":wr("error",r),wr("load",r);break;case"details":wr("toggle",r);break;case"input":v8(r,s),wr("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},wr("invalid",r);break;case"textarea":w8(r,s),wr("invalid",r)}YO(n,s),i=null;for(var a in s)if(s.hasOwnProperty(a)){var o=s[a];a==="children"?typeof o=="string"?r.textContent!==o&&(s.suppressHydrationWarning!==!0&&ZC(r.textContent,o,e),i=["children",o]):typeof o=="number"&&r.textContent!==""+o&&(s.suppressHydrationWarning!==!0&&ZC(r.textContent,o,e),i=["children",""+o]):Ab.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&wr("scroll",r)}switch(n){case"input":VC(r),x8(r,s,!0);break;case"textarea":VC(r),b8(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=$_)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=nte(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Wc]=t,e[Sb]=r,_ne(e,t,!1,!1),t.stateNode=e;e:{switch(a=XO(n,r),n){case"dialog":wr("cancel",e),wr("close",e),i=r;break;case"iframe":case"object":case"embed":wr("load",e),i=r;break;case"video":case"audio":for(i=0;i<Jx.length;i++)wr(Jx[i],e);i=r;break;case"source":wr("error",e),i=r;break;case"img":case"image":case"link":wr("error",e),wr("load",e),i=r;break;case"details":wr("toggle",e),i=r;break;case"input":v8(e,r),i=VO(e,r),wr("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Kr({},r,{value:void 0}),wr("invalid",e);break;case"textarea":w8(e,r),i=WO(e,r),wr("invalid",e);break;default:i=r}YO(n,i),o=i;for(s in o)if(o.hasOwnProperty(s)){var c=o[s];s==="style"?ste(e,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&rte(e,c)):s==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&pb(e,c):typeof c=="number"&&pb(e,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ab.hasOwnProperty(s)?c!=null&&s==="onScroll"&&wr("scroll",e):c!=null&&mD(e,s,c,a))}switch(n){case"input":VC(e),x8(e,r,!1);break;case"textarea":VC(e),b8(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Sf(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?hy(e,!!r.multiple,s,!1):r.defaultValue!=null&&hy(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=$_)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Us(t),null;case 6:if(e&&t.stateNode!=null)Bne(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(qe(166));if(n=YA(_b.current),YA(nu.current),eS(t)){if(r=t.stateNode,n=t.memoizedProps,r[Wc]=t,(s=r.nodeValue!==n)&&(e=Io,e!==null))switch(e.tag){case 3:ZC(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ZC(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Wc]=t,t.stateNode=r}return Us(t),null;case 13:if(_r(Qr),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Or&&Bo!==null&&t.mode&1&&!(t.flags&128))Kte(),nv(),t.flags|=98560,s=!1;else if(s=eS(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(qe(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(qe(317));s[Wc]=t}else nv(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Us(t),s=!1}else rc!==null&&(T3(rc),rc=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Qr.current&1?zi===0&&(zi=3):JD())),t.updateQueue!==null&&(t.flags|=4),Us(t),null);case 4:return iv(),C3(e,t),e===null&&bb(t.stateNode.containerInfo),Us(t),null;case 10:return FD(t.type._context),Us(t),null;case 17:return Ja(t.type)&&z_(),Us(t),null;case 19:if(_r(Qr),s=t.memoizedState,s===null)return Us(t),null;if(r=(t.flags&128)!==0,a=s.rendering,a===null)if(r)Ax(s,!1);else{if(zi!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=X_(e),a!==null){for(t.flags|=128,Ax(s,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,a=s.alternate,a===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=a.childLanes,s.lanes=a.lanes,s.child=a.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=a.memoizedProps,s.memoizedState=a.memoizedState,s.updateQueue=a.updateQueue,s.type=a.type,e=a.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return mr(Qr,Qr.current&1|2),t.child}e=e.sibling}s.tail!==null&&fi()>av&&(t.flags|=128,r=!0,Ax(s,!1),t.lanes=4194304)}else{if(!r)if(e=X_(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ax(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Or)return Us(t),null}else 2*fi()-s.renderingStartTime>av&&n!==1073741824&&(t.flags|=128,r=!0,Ax(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=fi(),t.sibling=null,n=Qr.current,mr(Qr,r?n&1|2:n&1),t):(Us(t),null);case 22:case 23:return XD(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Co&1073741824&&(Us(t),t.subtreeFlags&6&&(t.flags|=8192)):Us(t),null;case 24:return null;case 25:return null}throw Error(qe(156,t.tag))}function Xbe(e,t){switch(TD(t),t.tag){case 1:return Ja(t.type)&&z_(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return iv(),_r(Xa),_r(na),UD(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return DD(t),null;case 13:if(_r(Qr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(qe(340));nv()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _r(Qr),null;case 4:return iv(),null;case 10:return FD(t.type._context),null;case 22:case 23:return XD(),null;case 24:return null;default:return null}}var rS=!1,Ys=!1,Jbe=typeof WeakSet=="function"?WeakSet:Set,dt=null;function Zg(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ni(e,t,r)}else n.current=null}function S3(e,t,n){try{n()}catch(r){ni(e,t,r)}}var d7=!1;function Zbe(e,t){if(o3=U_,e=Ite(),ND(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,o=-1,c=-1,u=0,d=0,h=e,A=null;t:for(;;){for(var f;h!==n||i!==0&&h.nodeType!==3||(o=a+i),h!==s||r!==0&&h.nodeType!==3||(c=a+r),h.nodeType===3&&(a+=h.nodeValue.length),(f=h.firstChild)!==null;)A=h,h=f;for(;;){if(h===e)break t;if(A===n&&++u===i&&(o=a),A===s&&++d===r&&(c=a),(f=h.nextSibling)!==null)break;h=A,A=h.parentNode}h=f}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(l3={focusedElem:e,selectionRange:n},U_=!1,dt=t;dt!==null;)if(t=dt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,dt=e;else for(;dt!==null;){t=dt;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,g=p.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:Yl(t.type,m),g);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(qe(163))}}catch(w){ni(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,dt=e;break}dt=t.return}return p=d7,d7=!1,p}function _w(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&S3(t,n,s)}i=i.next}while(i!==r)}}function rE(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function k3(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Nne(e){var t=e.alternate;t!==null&&(e.alternate=null,Nne(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wc],delete t[Sb],delete t[d3],delete t[Fbe],delete t[Mbe])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ene(e){return e.tag===5||e.tag===3||e.tag===4}function h7(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ene(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function _3(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$_));else if(r!==4&&(e=e.child,e!==null))for(_3(e,t,n),e=e.sibling;e!==null;)_3(e,t,n),e=e.sibling}function j3(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(j3(e,t,n),e=e.sibling;e!==null;)j3(e,t,n),e=e.sibling}var xs=null,Zl=!1;function Xd(e,t,n){for(n=n.child;n!==null;)Tne(e,t,n),n=n.sibling}function Tne(e,t,n){if(tu&&typeof tu.onCommitFiberUnmount=="function")try{tu.onCommitFiberUnmount(GN,n)}catch{}switch(n.tag){case 5:Ys||Zg(n,t);case 6:var r=xs,i=Zl;xs=null,Xd(e,t,n),xs=r,Zl=i,xs!==null&&(Zl?(e=xs,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xs.removeChild(n.stateNode));break;case 18:xs!==null&&(Zl?(e=xs,n=n.stateNode,e.nodeType===8?_P(e.parentNode,n):e.nodeType===1&&_P(e,n),vb(e)):_P(xs,n.stateNode));break;case 4:r=xs,i=Zl,xs=n.stateNode.containerInfo,Zl=!0,Xd(e,t,n),xs=r,Zl=i;break;case 0:case 11:case 14:case 15:if(!Ys&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,a=s.destroy;s=s.tag,a!==void 0&&(s&2||s&4)&&S3(n,t,a),i=i.next}while(i!==r)}Xd(e,t,n);break;case 1:if(!Ys&&(Zg(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){ni(n,t,o)}Xd(e,t,n);break;case 21:Xd(e,t,n);break;case 22:n.mode&1?(Ys=(r=Ys)||n.memoizedState!==null,Xd(e,t,n),Ys=r):Xd(e,t,n);break;default:Xd(e,t,n)}}function f7(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Jbe),t.forEach(function(r){var i=l1e.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,a=t,o=a;e:for(;o!==null;){switch(o.tag){case 5:xs=o.stateNode,Zl=!1;break e;case 3:xs=o.stateNode.containerInfo,Zl=!0;break e;case 4:xs=o.stateNode.containerInfo,Zl=!0;break e}o=o.return}if(xs===null)throw Error(qe(160));Tne(s,a,i),xs=null,Zl=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(u){ni(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Pne(t,e),t=t.sibling}function Pne(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Hl(t,e),Lc(e),r&4){try{_w(3,e,e.return),rE(3,e)}catch(m){ni(e,e.return,m)}try{_w(5,e,e.return)}catch(m){ni(e,e.return,m)}}break;case 1:Hl(t,e),Lc(e),r&512&&n!==null&&Zg(n,n.return);break;case 5:if(Hl(t,e),Lc(e),r&512&&n!==null&&Zg(n,n.return),e.flags&32){var i=e.stateNode;try{pb(i,"")}catch(m){ni(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,a=n!==null?n.memoizedProps:s,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&s.type==="radio"&&s.name!=null&&ete(i,s),XO(o,a);var u=XO(o,s);for(a=0;a<c.length;a+=2){var d=c[a],h=c[a+1];d==="style"?ste(i,h):d==="dangerouslySetInnerHTML"?rte(i,h):d==="children"?pb(i,h):mD(i,d,h,u)}switch(o){case"input":KO(i,s);break;case"textarea":tte(i,s);break;case"select":var A=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var f=s.value;f!=null?hy(i,!!s.multiple,f,!1):A!==!!s.multiple&&(s.defaultValue!=null?hy(i,!!s.multiple,s.defaultValue,!0):hy(i,!!s.multiple,s.multiple?[]:"",!1))}i[Sb]=s}catch(m){ni(e,e.return,m)}}break;case 6:if(Hl(t,e),Lc(e),r&4){if(e.stateNode===null)throw Error(qe(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(m){ni(e,e.return,m)}}break;case 3:if(Hl(t,e),Lc(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{vb(t.containerInfo)}catch(m){ni(e,e.return,m)}break;case 4:Hl(t,e),Lc(e);break;case 13:Hl(t,e),Lc(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(GD=fi())),r&4&&f7(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Ys=(u=Ys)||d,Hl(t,e),Ys=u):Hl(t,e),Lc(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(dt=e,d=e.child;d!==null;){for(h=dt=d;dt!==null;){switch(A=dt,f=A.child,A.tag){case 0:case 11:case 14:case 15:_w(4,A,A.return);break;case 1:Zg(A,A.return);var p=A.stateNode;if(typeof p.componentWillUnmount=="function"){r=A,n=A.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(m){ni(r,n,m)}}break;case 5:Zg(A,A.return);break;case 22:if(A.memoizedState!==null){p7(h);continue}}f!==null?(f.return=A,dt=f):p7(h)}d=d.sibling}e:for(d=null,h=e;;){if(h.tag===5){if(d===null){d=h;try{i=h.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(o=h.stateNode,c=h.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=ite("display",a))}catch(m){ni(e,e.return,m)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(m){ni(e,e.return,m)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Hl(t,e),Lc(e),r&4&&f7(e);break;case 21:break;default:Hl(t,e),Lc(e)}}function Lc(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Ene(n)){var r=n;break e}n=n.return}throw Error(qe(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(pb(i,""),r.flags&=-33);var s=h7(e);j3(e,s,i);break;case 3:case 4:var a=r.stateNode.containerInfo,o=h7(e);_3(e,o,a);break;default:throw Error(qe(161))}}catch(c){ni(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function e1e(e,t,n){dt=e,Ine(e)}function Ine(e,t,n){for(var r=(e.mode&1)!==0;dt!==null;){var i=dt,s=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||rS;if(!a){var o=i.alternate,c=o!==null&&o.memoizedState!==null||Ys;o=rS;var u=Ys;if(rS=a,(Ys=c)&&!u)for(dt=i;dt!==null;)a=dt,c=a.child,a.tag===22&&a.memoizedState!==null?m7(i):c!==null?(c.return=a,dt=c):m7(i);for(;s!==null;)dt=s,Ine(s),s=s.sibling;dt=i,rS=o,Ys=u}A7(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,dt=s):A7(e)}}function A7(e){for(;dt!==null;){var t=dt;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ys||rE(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ys)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Yl(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&J8(t,s,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}J8(t,a,n)}break;case 5:var o=t.stateNode;if(n===null&&t.flags&4){n=o;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&vb(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(qe(163))}Ys||t.flags&512&&k3(t)}catch(A){ni(t,t.return,A)}}if(t===e){dt=null;break}if(n=t.sibling,n!==null){n.return=t.return,dt=n;break}dt=t.return}}function p7(e){for(;dt!==null;){var t=dt;if(t===e){dt=null;break}var n=t.sibling;if(n!==null){n.return=t.return,dt=n;break}dt=t.return}}function m7(e){for(;dt!==null;){var t=dt;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{rE(4,t)}catch(c){ni(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){ni(t,i,c)}}var s=t.return;try{k3(t)}catch(c){ni(t,s,c)}break;case 5:var a=t.return;try{k3(t)}catch(c){ni(t,a,c)}}}catch(c){ni(t,t.return,c)}if(t===e){dt=null;break}var o=t.sibling;if(o!==null){o.return=t.return,dt=o;break}dt=t.return}}var t1e=Math.ceil,ej=jd.ReactCurrentDispatcher,qD=jd.ReactCurrentOwner,gl=jd.ReactCurrentBatchConfig,Fn=0,ss=null,Bi=null,Es=0,Co=0,ey=Df(0),zi=0,Eb=null,Up=0,iE=0,WD=0,jw=null,Qa=null,GD=0,av=1/0,Vu=null,tj=!1,B3=null,sf=null,iS=!1,Hh=null,nj=0,Bw=0,N3=null,Wk=-1,Gk=0;function _a(){return Fn&6?fi():Wk!==-1?Wk:Wk=fi()}function af(e){return e.mode&1?Fn&2&&Es!==0?Es&-Es:Rbe.transition!==null?(Gk===0&&(Gk=gte()),Gk):(e=Yn,e!==0||(e=window.event,e=e===void 0?16:Ste(e.type)),e):1}function dc(e,t,n,r){if(50<Bw)throw Bw=0,N3=null,Error(qe(185));A2(e,n,r),(!(Fn&2)||e!==ss)&&(e===ss&&(!(Fn&2)&&(iE|=n),zi===4&&Ch(e,Es)),Za(e,r),n===1&&Fn===0&&!(t.mode&1)&&(av=fi()+500,eE&&Uf()))}function Za(e,t){var n=e.callbackNode;Rwe(e,t);var r=D_(e,e===ss?Es:0);if(r===0)n!==null&&k8(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&k8(n),t===1)e.tag===0?Lbe(g7.bind(null,e)):$te(g7.bind(null,e)),Ibe(function(){!(Fn&6)&&Uf()}),n=null;else{switch(yte(r)){case 1:n=wD;break;case 4:n=pte;break;case 16:n=R_;break;case 536870912:n=mte;break;default:n=R_}n=Hne(n,One.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function One(e,t){if(Wk=-1,Gk=0,Fn&6)throw Error(qe(327));var n=e.callbackNode;if(gy()&&e.callbackNode!==n)return null;var r=D_(e,e===ss?Es:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=rj(e,r);else{t=r;var i=Fn;Fn|=2;var s=Mne();(ss!==e||Es!==t)&&(Vu=null,av=fi()+500,bp(e,t));do try{i1e();break}catch(o){Fne(e,o)}while(!0);OD(),ej.current=s,Fn=i,Bi!==null?t=0:(ss=null,Es=0,t=zi)}if(t!==0){if(t===2&&(i=n3(e),i!==0&&(r=i,t=E3(e,i))),t===1)throw n=Eb,bp(e,0),Ch(e,r),Za(e,fi()),n;if(t===6)Ch(e,r);else{if(i=e.current.alternate,!(r&30)&&!n1e(i)&&(t=rj(e,r),t===2&&(s=n3(e),s!==0&&(r=s,t=E3(e,s))),t===1))throw n=Eb,bp(e,0),Ch(e,r),Za(e,fi()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(qe(345));case 2:OA(e,Qa,Vu);break;case 3:if(Ch(e,r),(r&130023424)===r&&(t=GD+500-fi(),10<t)){if(D_(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){_a(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=u3(OA.bind(null,e,Qa,Vu),t);break}OA(e,Qa,Vu);break;case 4:if(Ch(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-uc(r);s=1<<a,a=t[a],a>i&&(i=a),r&=~s}if(r=i,r=fi()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*t1e(r/1960))-r,10<r){e.timeoutHandle=u3(OA.bind(null,e,Qa,Vu),r);break}OA(e,Qa,Vu);break;case 5:OA(e,Qa,Vu);break;default:throw Error(qe(329))}}}return Za(e,fi()),e.callbackNode===n?One.bind(null,e):null}function E3(e,t){var n=jw;return e.current.memoizedState.isDehydrated&&(bp(e,t).flags|=256),e=rj(e,t),e!==2&&(t=Qa,Qa=n,t!==null&&T3(t)),e}function T3(e){Qa===null?Qa=e:Qa.push.apply(Qa,e)}function n1e(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!mc(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ch(e,t){for(t&=~WD,t&=~iE,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-uc(t),r=1<<n;e[n]=-1,t&=~r}}function g7(e){if(Fn&6)throw Error(qe(327));gy();var t=D_(e,0);if(!(t&1))return Za(e,fi()),null;var n=rj(e,t);if(e.tag!==0&&n===2){var r=n3(e);r!==0&&(t=r,n=E3(e,r))}if(n===1)throw n=Eb,bp(e,0),Ch(e,t),Za(e,fi()),n;if(n===6)throw Error(qe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,OA(e,Qa,Vu),Za(e,fi()),null}function YD(e,t){var n=Fn;Fn|=1;try{return e(t)}finally{Fn=n,Fn===0&&(av=fi()+500,eE&&Uf())}}function Hp(e){Hh!==null&&Hh.tag===0&&!(Fn&6)&&gy();var t=Fn;Fn|=1;var n=gl.transition,r=Yn;try{if(gl.transition=null,Yn=1,e)return e()}finally{Yn=r,gl.transition=n,Fn=t,!(Fn&6)&&Uf()}}function XD(){Co=ey.current,_r(ey)}function bp(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Pbe(n)),Bi!==null)for(n=Bi.return;n!==null;){var r=n;switch(TD(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&z_();break;case 3:iv(),_r(Xa),_r(na),UD();break;case 5:DD(r);break;case 4:iv();break;case 13:_r(Qr);break;case 19:_r(Qr);break;case 10:FD(r.type._context);break;case 22:case 23:XD()}n=n.return}if(ss=e,Bi=e=of(e.current,null),Es=Co=t,zi=0,Eb=null,WD=iE=Up=0,Qa=jw=null,GA!==null){for(t=0;t<GA.length;t++)if(n=GA[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var a=s.next;s.next=i,r.next=a}n.pending=r}GA=null}return e}function Fne(e,t){do{var n=Bi;try{if(OD(),Vk.current=Z_,J_){for(var r=Vr.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}J_=!1}if(Dp=0,ns=Ui=Vr=null,kw=!1,jb=0,qD.current=null,n===null||n.return===null){zi=1,Eb=t,Bi=null;break}e:{var s=e,a=n.return,o=n,c=t;if(t=Es,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=o,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var A=d.alternate;A?(d.updateQueue=A.updateQueue,d.memoizedState=A.memoizedState,d.lanes=A.lanes):(d.updateQueue=null,d.memoizedState=null)}var f=i7(a);if(f!==null){f.flags&=-257,s7(f,a,o,s,t),f.mode&1&&r7(s,u,t),t=f,c=u;var p=t.updateQueue;if(p===null){var m=new Set;m.add(c),t.updateQueue=m}else p.add(c);break e}else{if(!(t&1)){r7(s,u,t),JD();break e}c=Error(qe(426))}}else if(Or&&o.mode&1){var g=i7(a);if(g!==null){!(g.flags&65536)&&(g.flags|=256),s7(g,a,o,s,t),PD(sv(c,o));break e}}s=c=sv(c,o),zi!==4&&(zi=2),jw===null?jw=[s]:jw.push(s),s=a;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var y=yne(s,c,t);X8(s,y);break e;case 1:o=c;var v=s.type,x=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(sf===null||!sf.has(x)))){s.flags|=65536,t&=-t,s.lanes|=t;var w=vne(s,o,t);X8(s,w);break e}}s=s.return}while(s!==null)}Rne(n)}catch(b){t=b,Bi===n&&n!==null&&(Bi=n=n.return);continue}break}while(!0)}function Mne(){var e=ej.current;return ej.current=Z_,e===null?Z_:e}function JD(){(zi===0||zi===3||zi===2)&&(zi=4),ss===null||!(Up&268435455)&&!(iE&268435455)||Ch(ss,Es)}function rj(e,t){var n=Fn;Fn|=2;var r=Mne();(ss!==e||Es!==t)&&(Vu=null,bp(e,t));do try{r1e();break}catch(i){Fne(e,i)}while(!0);if(OD(),Fn=n,ej.current=r,Bi!==null)throw Error(qe(261));return ss=null,Es=0,zi}function r1e(){for(;Bi!==null;)Lne(Bi)}function i1e(){for(;Bi!==null&&!Nwe();)Lne(Bi)}function Lne(e){var t=Une(e.alternate,e,Co);e.memoizedProps=e.pendingProps,t===null?Rne(e):Bi=t,qD.current=null}function Rne(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Xbe(n,t),n!==null){n.flags&=32767,Bi=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{zi=6,Bi=null;return}}else if(n=Ybe(n,t,Co),n!==null){Bi=n;return}if(t=t.sibling,t!==null){Bi=t;return}Bi=t=e}while(t!==null);zi===0&&(zi=5)}function OA(e,t,n){var r=Yn,i=gl.transition;try{gl.transition=null,Yn=1,s1e(e,t,n,r)}finally{gl.transition=i,Yn=r}return null}function s1e(e,t,n,r){do gy();while(Hh!==null);if(Fn&6)throw Error(qe(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(qe(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(Dwe(e,s),e===ss&&(Bi=ss=null,Es=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||iS||(iS=!0,Hne(R_,function(){return gy(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=gl.transition,gl.transition=null;var a=Yn;Yn=1;var o=Fn;Fn|=4,qD.current=null,Zbe(e,n),Pne(n,e),kbe(l3),U_=!!o3,l3=o3=null,e.current=n,e1e(n),Ewe(),Fn=o,Yn=a,gl.transition=s}else e.current=n;if(iS&&(iS=!1,Hh=e,nj=i),s=e.pendingLanes,s===0&&(sf=null),Iwe(n.stateNode),Za(e,fi()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(tj)throw tj=!1,e=B3,B3=null,e;return nj&1&&e.tag!==0&&gy(),s=e.pendingLanes,s&1?e===N3?Bw++:(Bw=0,N3=e):Bw=0,Uf(),null}function gy(){if(Hh!==null){var e=yte(nj),t=gl.transition,n=Yn;try{if(gl.transition=null,Yn=16>e?16:e,Hh===null)var r=!1;else{if(e=Hh,Hh=null,nj=0,Fn&6)throw Error(qe(331));var i=Fn;for(Fn|=4,dt=e.current;dt!==null;){var s=dt,a=s.child;if(dt.flags&16){var o=s.deletions;if(o!==null){for(var c=0;c<o.length;c++){var u=o[c];for(dt=u;dt!==null;){var d=dt;switch(d.tag){case 0:case 11:case 15:_w(8,d,s)}var h=d.child;if(h!==null)h.return=d,dt=h;else for(;dt!==null;){d=dt;var A=d.sibling,f=d.return;if(Nne(d),d===u){dt=null;break}if(A!==null){A.return=f,dt=A;break}dt=f}}}var p=s.alternate;if(p!==null){var m=p.child;if(m!==null){p.child=null;do{var g=m.sibling;m.sibling=null,m=g}while(m!==null)}}dt=s}}if(s.subtreeFlags&2064&&a!==null)a.return=s,dt=a;else e:for(;dt!==null;){if(s=dt,s.flags&2048)switch(s.tag){case 0:case 11:case 15:_w(9,s,s.return)}var y=s.sibling;if(y!==null){y.return=s.return,dt=y;break e}dt=s.return}}var v=e.current;for(dt=v;dt!==null;){a=dt;var x=a.child;if(a.subtreeFlags&2064&&x!==null)x.return=a,dt=x;else e:for(a=v;dt!==null;){if(o=dt,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:rE(9,o)}}catch(b){ni(o,o.return,b)}if(o===a){dt=null;break e}var w=o.sibling;if(w!==null){w.return=o.return,dt=w;break e}dt=o.return}}if(Fn=i,Uf(),tu&&typeof tu.onPostCommitFiberRoot=="function")try{tu.onPostCommitFiberRoot(GN,e)}catch{}r=!0}return r}finally{Yn=n,gl.transition=t}}return!1}function y7(e,t,n){t=sv(n,t),t=yne(e,t,1),e=rf(e,t,1),t=_a(),e!==null&&(A2(e,1,t),Za(e,t))}function ni(e,t,n){if(e.tag===3)y7(e,e,n);else for(;t!==null;){if(t.tag===3){y7(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(sf===null||!sf.has(r))){e=sv(n,e),e=vne(t,e,1),t=rf(t,e,1),e=_a(),t!==null&&(A2(t,1,e),Za(t,e));break}}t=t.return}}function a1e(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=_a(),e.pingedLanes|=e.suspendedLanes&n,ss===e&&(Es&n)===n&&(zi===4||zi===3&&(Es&130023424)===Es&&500>fi()-GD?bp(e,0):WD|=n),Za(e,t)}function Dne(e,t){t===0&&(e.mode&1?(t=WC,WC<<=1,!(WC&130023424)&&(WC=4194304)):t=1);var n=_a();e=md(e,t),e!==null&&(A2(e,t,n),Za(e,n))}function o1e(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Dne(e,n)}function l1e(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(qe(314))}r!==null&&r.delete(t),Dne(e,n)}var Une;Une=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Xa.current)za=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return za=!1,Gbe(e,t,n);za=!!(e.flags&131072)}else za=!1,Or&&t.flags&1048576&&zte(t,q_,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;qk(e,t),e=t.pendingProps;var i=tv(t,na.current);my(t,n),i=QD(null,t,r,e,i,n);var s=$D();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ja(r)?(s=!0,V_(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,LD(t),i.updater=nE,t.stateNode=i,i._reactInternals=t,g3(t,r,e,n),t=x3(null,t,r,!0,s,n)):(t.tag=0,Or&&s&&ED(t),ma(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(qk(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=u1e(r),e=Yl(r,e),i){case 0:t=v3(null,t,r,e,n);break e;case 1:t=l7(null,t,r,e,n);break e;case 11:t=a7(null,t,r,e,n);break e;case 14:t=o7(null,t,r,Yl(r.type,e),n);break e}throw Error(qe(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Yl(r,i),v3(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Yl(r,i),l7(e,t,r,i,n);case 3:e:{if(Cne(t),e===null)throw Error(qe(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Yte(e,t),Y_(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=sv(Error(qe(423)),t),t=c7(e,t,r,n,i);break e}else if(r!==i){i=sv(Error(qe(424)),t),t=c7(e,t,r,n,i);break e}else for(Bo=nf(t.stateNode.containerInfo.firstChild),Io=t,Or=!0,rc=null,n=Wte(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(nv(),r===i){t=gd(e,t,n);break e}ma(e,t,r,n)}t=t.child}return t;case 5:return Xte(t),e===null&&A3(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,c3(r,i)?a=null:s!==null&&c3(r,s)&&(t.flags|=32),bne(e,t),ma(e,t,a,n),t.child;case 6:return e===null&&A3(t),null;case 13:return Sne(e,t,n);case 4:return RD(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=rv(t,null,r,n):ma(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Yl(r,i),a7(e,t,r,i,n);case 7:return ma(e,t,t.pendingProps,n),t.child;case 8:return ma(e,t,t.pendingProps.children,n),t.child;case 12:return ma(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value,mr(W_,r._currentValue),r._currentValue=a,s!==null)if(mc(s.value,a)){if(s.children===i.children&&!Xa.current){t=gd(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var o=s.dependencies;if(o!==null){a=s.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=sd(-1,n&-n),c.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),p3(s.return,n,t),o.lanes|=n;break}c=c.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(qe(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),p3(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}ma(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,my(t,n),i=kl(i),r=r(i),t.flags|=1,ma(e,t,r,n),t.child;case 14:return r=t.type,i=Yl(r,t.pendingProps),i=Yl(r.type,i),o7(e,t,r,i,n);case 15:return xne(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Yl(r,i),qk(e,t),t.tag=1,Ja(r)?(e=!0,V_(t)):e=!1,my(t,n),gne(t,r,i),g3(t,r,i,n),x3(null,t,r,!0,e,n);case 19:return kne(e,t,n);case 22:return wne(e,t,n)}throw Error(qe(156,t.tag))};function Hne(e,t){return Ate(e,t)}function c1e(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hl(e,t,n,r){return new c1e(e,t,n,r)}function ZD(e){return e=e.prototype,!(!e||!e.isReactComponent)}function u1e(e){if(typeof e=="function")return ZD(e)?1:0;if(e!=null){if(e=e.$$typeof,e===yD)return 11;if(e===vD)return 14}return 2}function of(e,t){var n=e.alternate;return n===null?(n=hl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Yk(e,t,n,r,i,s){var a=2;if(r=e,typeof e=="function")ZD(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case zg:return Cp(n.children,i,s,t);case gD:a=8,i|=8;break;case HO:return e=hl(12,n,t,i|2),e.elementType=HO,e.lanes=s,e;case QO:return e=hl(13,n,t,i),e.elementType=QO,e.lanes=s,e;case $O:return e=hl(19,n,t,i),e.elementType=$O,e.lanes=s,e;case Xee:return sE(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Gee:a=10;break e;case Yee:a=9;break e;case yD:a=11;break e;case vD:a=14;break e;case Ah:a=16,r=null;break e}throw Error(qe(130,e==null?e:typeof e,""))}return t=hl(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Cp(e,t,n,r){return e=hl(7,e,r,t),e.lanes=n,e}function sE(e,t,n,r){return e=hl(22,e,r,t),e.elementType=Xee,e.lanes=n,e.stateNode={isHidden:!1},e}function OP(e,t,n){return e=hl(6,e,null,t),e.lanes=n,e}function FP(e,t,n){return t=hl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function d1e(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=pP(0),this.expirationTimes=pP(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pP(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function eU(e,t,n,r,i,s,a,o,c){return e=new d1e(e,t,n,o,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=hl(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},LD(s),e}function h1e(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$g,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Qne(e){if(!e)return kf;e=e._reactInternals;e:{if(Am(e)!==e||e.tag!==1)throw Error(qe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ja(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(qe(171))}if(e.tag===1){var n=e.type;if(Ja(n))return Qte(e,n,t)}return t}function $ne(e,t,n,r,i,s,a,o,c){return e=eU(n,r,!0,e,i,s,a,o,c),e.context=Qne(null),n=e.current,r=_a(),i=af(n),s=sd(r,i),s.callback=t??null,rf(n,s,i),e.current.lanes=i,A2(e,i,r),Za(e,r),e}function aE(e,t,n,r){var i=t.current,s=_a(),a=af(i);return n=Qne(n),t.context===null?t.context=n:t.pendingContext=n,t=sd(s,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=rf(i,t,a),e!==null&&(dc(e,i,a,s),zk(e,i,a)),a}function ij(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function v7(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function tU(e,t){v7(e,t),(e=e.alternate)&&v7(e,t)}function f1e(){return null}var zne=typeof reportError=="function"?reportError:function(e){console.error(e)};function nU(e){this._internalRoot=e}oE.prototype.render=nU.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(qe(409));aE(e,t,null,null)};oE.prototype.unmount=nU.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hp(function(){aE(null,e,null,null)}),t[pd]=null}};function oE(e){this._internalRoot=e}oE.prototype.unstable_scheduleHydration=function(e){if(e){var t=wte();e={blockedOn:null,target:e,priority:t};for(var n=0;n<bh.length&&t!==0&&t<bh[n].priority;n++);bh.splice(n,0,e),n===0&&Cte(e)}};function rU(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function lE(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function x7(){}function A1e(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=ij(a);s.call(u)}}var a=$ne(t,r,e,0,null,!1,!1,"",x7);return e._reactRootContainer=a,e[pd]=a.current,bb(e.nodeType===8?e.parentNode:e),Hp(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var o=r;r=function(){var u=ij(c);o.call(u)}}var c=eU(e,0,!1,null,null,!1,!1,"",x7);return e._reactRootContainer=c,e[pd]=c.current,bb(e.nodeType===8?e.parentNode:e),Hp(function(){aE(t,c,n,r)}),c}function cE(e,t,n,r,i){var s=n._reactRootContainer;if(s){var a=s;if(typeof i=="function"){var o=i;i=function(){var c=ij(a);o.call(c)}}aE(t,a,e,i)}else a=A1e(n,t,e,i,r);return ij(a)}vte=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Xx(t.pendingLanes);n!==0&&(bD(t,n|1),Za(t,fi()),!(Fn&6)&&(av=fi()+500,Uf()))}break;case 13:Hp(function(){var r=md(e,1);if(r!==null){var i=_a();dc(r,e,1,i)}}),tU(e,1)}};CD=function(e){if(e.tag===13){var t=md(e,134217728);if(t!==null){var n=_a();dc(t,e,134217728,n)}tU(e,134217728)}};xte=function(e){if(e.tag===13){var t=af(e),n=md(e,t);if(n!==null){var r=_a();dc(n,e,t,r)}tU(e,t)}};wte=function(){return Yn};bte=function(e,t){var n=Yn;try{return Yn=e,t()}finally{Yn=n}};ZO=function(e,t,n){switch(t){case"input":if(KO(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=ZN(r);if(!i)throw Error(qe(90));Zee(r),KO(r,i)}}}break;case"textarea":tte(e,n);break;case"select":t=n.value,t!=null&&hy(e,!!n.multiple,t,!1)}};lte=YD;cte=Hp;var p1e={usingClientEntryPoint:!1,Events:[m2,Wg,ZN,ate,ote,YD]},px={findFiberByHostInstance:WA,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},m1e={bundleType:px.bundleType,version:px.version,rendererPackageName:px.rendererPackageName,rendererConfig:px.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:jd.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=hte(e),e===null?null:e.stateNode},findFiberByHostInstance:px.findFiberByHostInstance||f1e,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 sS=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sS.isDisabled&&sS.supportsFiber)try{GN=sS.inject(m1e),tu=sS}catch{}}Uo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=p1e;Uo.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!rU(t))throw Error(qe(200));return h1e(e,t,null,n)};Uo.createRoot=function(e,t){if(!rU(e))throw Error(qe(299));var n=!1,r="",i=zne;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=eU(e,1,!1,null,null,n,!1,r,i),e[pd]=t.current,bb(e.nodeType===8?e.parentNode:e),new nU(t)};Uo.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(qe(188)):(e=Object.keys(e).join(","),Error(qe(268,e)));return e=hte(t),e=e===null?null:e.stateNode,e};Uo.flushSync=function(e){return Hp(e)};Uo.hydrate=function(e,t,n){if(!lE(t))throw Error(qe(200));return cE(null,e,t,!0,n)};Uo.hydrateRoot=function(e,t,n){if(!rU(e))throw Error(qe(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",a=zne;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=$ne(t,null,e,1,n??null,i,!1,s,a),e[pd]=t.current,bb(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new oE(t)};Uo.render=function(e,t,n){if(!lE(t))throw Error(qe(200));return cE(null,e,t,!1,n)};Uo.unmountComponentAtNode=function(e){if(!lE(e))throw Error(qe(40));return e._reactRootContainer?(Hp(function(){cE(null,null,e,!1,function(){e._reactRootContainer=null,e[pd]=null})}),!0):!1};Uo.unstable_batchedUpdates=YD;Uo.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!lE(n))throw Error(qe(200));if(e==null||e._reactInternals===void 0)throw Error(qe(38));return cE(e,t,n,!1,r)};Uo.version="18.3.1-next-f1338f8080-20240426";function Vne(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vne)}catch(e){console.error(e)}}Vne(),Vee.exports=Uo;var Hf=Vee.exports;const iU=In(Hf);var Kne,w7=Hf;Kne=w7.createRoot,w7.hydrateRoot;const g1e=1,y1e=1e6;let MP=0;function v1e(){return MP=(MP+1)%Number.MAX_SAFE_INTEGER,MP.toString()}const LP=new Map,b7=e=>{if(LP.has(e))return;const t=setTimeout(()=>{LP.delete(e),Nw({type:"REMOVE_TOAST",toastId:e})},y1e);LP.set(e,t)},x1e=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,g1e)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?b7(n):e.toasts.forEach(r=>{b7(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Xk=[];let Jk={toasts:[]};function Nw(e){Jk=x1e(Jk,e),Xk.forEach(t=>{t(Jk)})}function De({...e}){const t=v1e(),n=i=>Nw({type:"UPDATE_TOAST",toast:{...i,id:t}}),r=()=>Nw({type:"DISMISS_TOAST",toastId:t});return Nw({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||r()}}}),{id:t,dismiss:r,update:n}}function Qf(){const[e,t]=C.useState(Jk);return C.useEffect(()=>(Xk.push(t),()=>{const n=Xk.indexOf(t);n>-1&&Xk.splice(n,1)}),[e]),{...e,toast:De,dismiss:n=>Nw({type:"DISMISS_TOAST",toastId:n})}}function et(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function C7(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qne(...e){return t=>{let n=!1;const r=e.map(i=>{const s=C7(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():C7(e[i],null)}}}}function Qt(...e){return C.useCallback(qne(...e),e)}function w1e(e,t){const n=C.createContext(t),r=s=>{const{children:a,...o}=s,c=C.useMemo(()=>o,Object.values(o));return l.jsx(n.Provider,{value:c,children:a})};r.displayName=e+"Provider";function i(s){const a=C.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function Wi(e,t=[]){let n=[];function r(s,a){const o=C.createContext(a),c=n.length;n=[...n,a];const u=h=>{var y;const{scope:A,children:f,...p}=h,m=((y=A==null?void 0:A[e])==null?void 0:y[c])||o,g=C.useMemo(()=>p,Object.values(p));return l.jsx(m.Provider,{value:g,children:f})};u.displayName=s+"Provider";function d(h,A){var m;const f=((m=A==null?void 0:A[e])==null?void 0:m[c])||o,p=C.useContext(f);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[u,d]}const i=()=>{const s=n.map(a=>C.createContext(a));return function(o){const c=(o==null?void 0:o[e])||s;return C.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return i.scopeName=e,[r,b1e(i,...t)]}function b1e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const a=r.reduce((o,{useScope:c,scopeName:u})=>{const h=c(s)[`__scope${u}`];return{...o,...h}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function Qp(e){const t=S1e(e),n=C.forwardRef((r,i)=>{const{children:s,...a}=r,o=C.Children.toArray(s),c=o.find(k1e);if(c){const u=c.props.children,d=o.map(h=>h===c?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:h);return l.jsx(t,{...a,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,d):null})}return l.jsx(t,{...a,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var C1e=Qp("Slot");function S1e(e){const t=C.forwardRef((n,r)=>{const{children:i,...s}=n;if(C.isValidElement(i)){const a=j1e(i),o=_1e(s,i.props);return i.type!==C.Fragment&&(o.ref=r?qne(r,a):a),C.cloneElement(i,o)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Wne=Symbol("radix.slottable");function Gne(e){const t=({children:n})=>l.jsx(l.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Wne,t}function k1e(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wne}function _1e(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...o)=>{const c=s(...o);return i(...o),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function j1e(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function y2(e){const t=e+"CollectionProvider",[n,r]=Wi(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:g,children:y}=m,v=re.useRef(null),x=re.useRef(new Map).current;return l.jsx(i,{scope:g,itemMap:x,collectionRef:v,children:y})};a.displayName=t;const o=e+"CollectionSlot",c=Qp(o),u=re.forwardRef((m,g)=>{const{scope:y,children:v}=m,x=s(o,y),w=Qt(g,x.collectionRef);return l.jsx(c,{ref:w,children:v})});u.displayName=o;const d=e+"CollectionItemSlot",h="data-radix-collection-item",A=Qp(d),f=re.forwardRef((m,g)=>{const{scope:y,children:v,...x}=m,w=re.useRef(null),b=Qt(g,w),k=s(d,y);return re.useEffect(()=>(k.itemMap.set(w,{ref:w,...x}),()=>void k.itemMap.delete(w))),l.jsx(A,{[h]:"",ref:b,children:v})});f.displayName=d;function p(m){const g=s(e+"CollectionConsumer",m);return re.useCallback(()=>{const v=g.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${h}]`));return Array.from(g.itemMap.values()).sort((k,j)=>x.indexOf(k.ref.current)-x.indexOf(j.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:a,Slot:u,ItemSlot:f},p,r]}var B1e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ut=B1e.reduce((e,t)=>{const n=Qp(`Primitive.${t}`),r=C.forwardRef((i,s)=>{const{asChild:a,...o}=i,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(c,{...o,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Yne(e,t){e&&Hf.flushSync(()=>e.dispatchEvent(t))}function $i(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function N1e(e,t=globalThis==null?void 0:globalThis.document){const n=$i(e);C.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var E1e="DismissableLayer",P3="dismissableLayer.update",T1e="dismissableLayer.pointerDownOutside",P1e="dismissableLayer.focusOutside",S7,Xne=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Zv=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...c}=e,u=C.useContext(Xne),[d,h]=C.useState(null),A=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=C.useState({}),p=Qt(t,j=>h(j)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),v=d?m.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,w=v>=y,b=O1e(j=>{const B=j.target,E=[...u.branches].some(I=>I.contains(B));!w||E||(i==null||i(j),a==null||a(j),j.defaultPrevented||o==null||o())},A),k=F1e(j=>{const B=j.target;[...u.branches].some(I=>I.contains(B))||(s==null||s(j),a==null||a(j),j.defaultPrevented||o==null||o())},A);return N1e(j=>{v===u.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&o&&(j.preventDefault(),o()))},A),C.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(S7=A.body.style.pointerEvents,A.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),k7(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(A.body.style.pointerEvents=S7)}},[d,A,n,u]),C.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),k7())},[d,u]),C.useEffect(()=>{const j=()=>f({});return document.addEventListener(P3,j),()=>document.removeEventListener(P3,j)},[]),l.jsx(ut.div,{...c,ref:p,style:{pointerEvents:x?w?"auto":"none":void 0,...e.style},onFocusCapture:et(e.onFocusCapture,k.onFocusCapture),onBlurCapture:et(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:et(e.onPointerDownCapture,b.onPointerDownCapture)})});Zv.displayName=E1e;var I1e="DismissableLayerBranch",Jne=C.forwardRef((e,t)=>{const n=C.useContext(Xne),r=C.useRef(null),i=Qt(t,r);return C.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),l.jsx(ut.div,{...e,ref:i})});Jne.displayName=I1e;function O1e(e,t=globalThis==null?void 0:globalThis.document){const n=$i(e),r=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const s=o=>{if(o.target&&!r.current){let c=function(){Zne(T1e,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function F1e(e,t=globalThis==null?void 0:globalThis.document){const n=$i(e),r=C.useRef(!1);return C.useEffect(()=>{const i=s=>{s.target&&!r.current&&Zne(P1e,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function k7(){const e=new CustomEvent(P3);document.dispatchEvent(e)}function Zne(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Yne(i,s):i.dispatchEvent(s)}var M1e=Zv,L1e=Jne,qi=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},R1e="Portal",v2=C.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[i,s]=C.useState(!1);qi(()=>s(!0),[]);const a=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?iU.createPortal(l.jsx(ut.div,{...r,ref:t}),a):null});v2.displayName=R1e;function D1e(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var ia=e=>{const{present:t,children:n}=e,r=U1e(t),i=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),s=Qt(r.ref,H1e(i));return typeof n=="function"||r.isPresent?C.cloneElement(i,{ref:s}):null};ia.displayName="Presence";function U1e(e){const[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),s=C.useRef("none"),a=e?"mounted":"unmounted",[o,c]=D1e(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=aS(r.current);s.current=o==="mounted"?u:"none"},[o]),qi(()=>{const u=r.current,d=i.current;if(d!==e){const A=s.current,f=aS(u);e?c("MOUNT"):f==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&A!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),qi(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,h=f=>{const m=aS(r.current).includes(f.animationName);if(f.target===t&&m&&(c("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},A=f=>{f.target===t&&(s.current=aS(r.current))};return t.addEventListener("animationstart",A),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",A),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:C.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function aS(e){return(e==null?void 0:e.animationName)||"none"}function H1e(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Q1e=fD[" useInsertionEffect ".trim().toString()]||qi;function ja({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,a]=$1e({defaultProp:t,onChange:n}),o=e!==void 0,c=o?e:i;{const d=C.useRef(e!==void 0);C.useEffect(()=>{const h=d.current;h!==o&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=o},[o,r])}const u=C.useCallback(d=>{var h;if(o){const A=z1e(d)?d(e):d;A!==e&&((h=a.current)==null||h.call(a,A))}else s(d)},[o,e,s,a]);return[c,u]}function $1e({defaultProp:e,onChange:t}){const[n,r]=C.useState(e),i=C.useRef(n),s=C.useRef(t);return Q1e(()=>{s.current=t},[t]),C.useEffect(()=>{var a;i.current!==n&&((a=s.current)==null||a.call(s,n),i.current=n)},[n,i]),[n,r,s]}function z1e(e){return typeof e=="function"}var ere=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),V1e="VisuallyHidden",uE=C.forwardRef((e,t)=>l.jsx(ut.span,{...e,ref:t,style:{...ere,...e.style}}));uE.displayName=V1e;var K1e=uE,sU="ToastProvider",[aU,q1e,W1e]=y2("Toast"),[tre,XTt]=Wi("Toast",[W1e]),[G1e,dE]=tre(sU),nre=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:a}=e,[o,c]=C.useState(null),[u,d]=C.useState(0),h=C.useRef(!1),A=C.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${sU}\`. Expected non-empty \`string\`.`),l.jsx(aU.Provider,{scope:t,children:l.jsx(G1e,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:o,onViewportChange:c,onToastAdd:C.useCallback(()=>d(f=>f+1),[]),onToastRemove:C.useCallback(()=>d(f=>f-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:A,children:a})})};nre.displayName=sU;var rre="ToastViewport",Y1e=["F8"],I3="toast.viewportPause",O3="toast.viewportResume",ire=C.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=Y1e,label:i="Notifications ({hotkey})",...s}=e,a=dE(rre,n),o=q1e(n),c=C.useRef(null),u=C.useRef(null),d=C.useRef(null),h=C.useRef(null),A=Qt(t,h,a.onViewportChange),f=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=a.toastCount>0;C.useEffect(()=>{const g=y=>{var x;r.length!==0&&r.every(w=>y[w]||y.code===w)&&((x=h.current)==null||x.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]),C.useEffect(()=>{const g=c.current,y=h.current;if(p&&g&&y){const v=()=>{if(!a.isClosePausedRef.current){const k=new CustomEvent(I3);y.dispatchEvent(k),a.isClosePausedRef.current=!0}},x=()=>{if(a.isClosePausedRef.current){const k=new CustomEvent(O3);y.dispatchEvent(k),a.isClosePausedRef.current=!1}},w=k=>{!g.contains(k.relatedTarget)&&x()},b=()=>{g.contains(document.activeElement)||x()};return g.addEventListener("focusin",v),g.addEventListener("focusout",w),g.addEventListener("pointermove",v),g.addEventListener("pointerleave",b),window.addEventListener("blur",v),window.addEventListener("focus",x),()=>{g.removeEventListener("focusin",v),g.removeEventListener("focusout",w),g.removeEventListener("pointermove",v),g.removeEventListener("pointerleave",b),window.removeEventListener("blur",v),window.removeEventListener("focus",x)}}},[p,a.isClosePausedRef]);const m=C.useCallback(({tabbingDirection:g})=>{const v=o().map(x=>{const w=x.ref.current,b=[w,...c2e(w)];return g==="forwards"?b:b.reverse()});return(g==="forwards"?v.reverse():v).flat()},[o]);return C.useEffect(()=>{const g=h.current;if(g){const y=v=>{var b,k,j;const x=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!x){const B=document.activeElement,E=v.shiftKey;if(v.target===g&&E){(b=u.current)==null||b.focus();return}const N=m({tabbingDirection:E?"backwards":"forwards"}),F=N.findIndex(L=>L===B);RP(N.slice(F+1))?v.preventDefault():E?(k=u.current)==null||k.focus():(j=d.current)==null||j.focus()}};return g.addEventListener("keydown",y),()=>g.removeEventListener("keydown",y)}},[o,m]),l.jsxs(L1e,{ref:c,role:"region","aria-label":i.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&l.jsx(F3,{ref:u,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"forwards"});RP(g)}}),l.jsx(aU.Slot,{scope:n,children:l.jsx(ut.ol,{tabIndex:-1,...s,ref:A})}),p&&l.jsx(F3,{ref:d,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"backwards"});RP(g)}})]})});ire.displayName=rre;var sre="ToastFocusProxy",F3=C.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,s=dE(sre,n);return l.jsx(uE,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:a=>{var u;const o=a.relatedTarget;!((u=s.viewport)!=null&&u.contains(o))&&r()}})});F3.displayName=sre;var x2="Toast",X1e="toast.swipeStart",J1e="toast.swipeMove",Z1e="toast.swipeCancel",e2e="toast.swipeEnd",are=C.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...a}=e,[o,c]=ja({prop:r,defaultProp:i??!0,onChange:s,caller:x2});return l.jsx(ia,{present:n||o,children:l.jsx(r2e,{open:o,...a,ref:t,onClose:()=>c(!1),onPause:$i(e.onPause),onResume:$i(e.onResume),onSwipeStart:et(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:et(e.onSwipeMove,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:et(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:et(e.onSwipeEnd,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});are.displayName=x2;var[t2e,n2e]=tre(x2,{onClose(){}}),r2e=C.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:a,onEscapeKeyDown:o,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:A,onSwipeEnd:f,...p}=e,m=dE(x2,n),[g,y]=C.useState(null),v=Qt(t,L=>y(L)),x=C.useRef(null),w=C.useRef(null),b=i||m.duration,k=C.useRef(0),j=C.useRef(b),B=C.useRef(0),{onToastAdd:E,onToastRemove:I}=m,T=$i(()=>{var U;(g==null?void 0:g.contains(document.activeElement))&&((U=m.viewport)==null||U.focus()),a()}),N=C.useCallback(L=>{!L||L===1/0||(window.clearTimeout(B.current),k.current=new Date().getTime(),B.current=window.setTimeout(T,L))},[T]);C.useEffect(()=>{const L=m.viewport;if(L){const U=()=>{N(j.current),u==null||u()},H=()=>{const K=new Date().getTime()-k.current;j.current=j.current-K,window.clearTimeout(B.current),c==null||c()};return L.addEventListener(I3,H),L.addEventListener(O3,U),()=>{L.removeEventListener(I3,H),L.removeEventListener(O3,U)}}},[m.viewport,b,c,u,N]),C.useEffect(()=>{s&&!m.isClosePausedRef.current&&N(b)},[s,b,m.isClosePausedRef,N]),C.useEffect(()=>(E(),()=>I()),[E,I]);const F=C.useMemo(()=>g?fre(g):null,[g]);return m.viewport?l.jsxs(l.Fragment,{children:[F&&l.jsx(i2e,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:F}),l.jsx(t2e,{scope:n,onClose:T,children:Hf.createPortal(l.jsx(aU.ItemSlot,{scope:n,children:l.jsx(M1e,{asChild:!0,onEscapeKeyDown:et(o,()=>{m.isFocusedToastEscapeKeyDownRef.current||T(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:l.jsx(ut.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":m.swipeDirection,...p,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:et(e.onKeyDown,L=>{L.key==="Escape"&&(o==null||o(L.nativeEvent),L.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,T()))}),onPointerDown:et(e.onPointerDown,L=>{L.button===0&&(x.current={x:L.clientX,y:L.clientY})}),onPointerMove:et(e.onPointerMove,L=>{if(!x.current)return;const U=L.clientX-x.current.x,H=L.clientY-x.current.y,K=!!w.current,$=["left","right"].includes(m.swipeDirection),z=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,Q=$?z(0,U):0,oe=$?0:z(0,H),R=L.pointerType==="touch"?10:2,M={x:Q,y:oe},Y={originalEvent:L,delta:M};K?(w.current=M,oS(J1e,h,Y,{discrete:!1})):_7(M,m.swipeDirection,R)?(w.current=M,oS(X1e,d,Y,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(U)>R||Math.abs(H)>R)&&(x.current=null)}),onPointerUp:et(e.onPointerUp,L=>{const U=w.current,H=L.target;if(H.hasPointerCapture(L.pointerId)&&H.releasePointerCapture(L.pointerId),w.current=null,x.current=null,U){const K=L.currentTarget,$={originalEvent:L,delta:U};_7(U,m.swipeDirection,m.swipeThreshold)?oS(e2e,f,$,{discrete:!0}):oS(Z1e,A,$,{discrete:!0}),K.addEventListener("click",z=>z.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),i2e=e=>{const{__scopeToast:t,children:n,...r}=e,i=dE(x2,t),[s,a]=C.useState(!1),[o,c]=C.useState(!1);return o2e(()=>a(!0)),C.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),o?null:l.jsx(v2,{asChild:!0,children:l.jsx(uE,{...r,children:s&&l.jsxs(l.Fragment,{children:[i.label," ",n]})})})},s2e="ToastTitle",ore=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ut.div,{...r,ref:t})});ore.displayName=s2e;var a2e="ToastDescription",lre=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return l.jsx(ut.div,{...r,ref:t})});lre.displayName=a2e;var cre="ToastAction",ure=C.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?l.jsx(hre,{altText:n,asChild:!0,children:l.jsx(oU,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${cre}\`. Expected non-empty \`string\`.`),null)});ure.displayName=cre;var dre="ToastClose",oU=C.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,i=n2e(dre,n);return l.jsx(hre,{asChild:!0,children:l.jsx(ut.button,{type:"button",...r,ref:t,onClick:et(e.onClick,i.onClose)})})});oU.displayName=dre;var hre=C.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...i}=e;return l.jsx(ut.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function fre(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),l2e(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const a=r.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...fre(r))}}),t}function oS(e,t,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Yne(i,s):i.dispatchEvent(s)}var _7=(e,t,n=0)=>{const r=Math.abs(e.x),i=Math.abs(e.y),s=r>i;return t==="left"||t==="right"?s&&r>n:!s&&i>n};function o2e(e=()=>{}){const t=$i(e);qi(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function l2e(e){return e.nodeType===e.ELEMENT_NODE}function c2e(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function RP(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var u2e=nre,Are=ire,pre=are,mre=ore,gre=lre,yre=ure,vre=oU;function xre(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=xre(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Pn(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=xre(e))&&(r&&(r+=" "),r+=t);return r}const j7=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,B7=Pn,w2=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return B7(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,a=Object.keys(i).map(u=>{const d=n==null?void 0:n[u],h=s==null?void 0:s[u];if(d===null)return null;const A=j7(d)||j7(h);return i[u][A]}),o=n&&Object.entries(n).reduce((u,d)=>{let[h,A]=d;return A===void 0||(u[h]=A),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:A,...f}=d;return Object.entries(f).every(p=>{let[m,g]=p;return Array.isArray(g)?g.includes({...s,...o}[m]):{...s,...o}[m]===g})?[...u,h,A]:u},[]);return B7(e,a,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const d2e=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wre=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var h2e={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.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const f2e=C.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},c)=>C.createElement("svg",{ref:c,...h2e,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:wre("lucide",i),...o},[...a.map(([u,d])=>C.createElement(u,d)),...Array.isArray(s)?s:[s]]));/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const He=(e,t)=>{const n=C.forwardRef(({className:r,...i},s)=>C.createElement(f2e,{ref:s,iconNode:t,className:wre(`lucide-${d2e(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sj=He("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pm=He("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Va=He("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lU=He("Bath",[["path",{d:"M10 4 8 6",key:"1rru8s"}],["path",{d:"M17 19v2",key:"ts1sot"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"M7 19v2",key:"12npes"}],["path",{d:"M9 5 7.621 3.621A2.121 2.121 0 0 0 4 5v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5",key:"14ym8i"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bre=He("BedDouble",[["path",{d:"M2 20v-8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v8",key:"1k78r4"}],["path",{d:"M4 10V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4",key:"fb3tl2"}],["path",{d:"M12 4v6",key:"1dcgq2"}],["path",{d:"M2 18h20",key:"ajqnye"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const A2e=He("Bed",[["path",{d:"M2 4v16",key:"vw9hq8"}],["path",{d:"M2 8h18a2 2 0 0 1 2 2v10",key:"1dgv2r"}],["path",{d:"M2 17h20",key:"18nfp3"}],["path",{d:"M6 8v9",key:"1yriud"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const p2e=He("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const m2e=He("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Zk=He("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const g2e=He("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cre=He("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Oo=He("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const y2e=He("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Sre=He("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const kre=He("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fo=He("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hc=He("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _re=He("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fc=He("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const v2e=He("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const x2e=He("CircleAlert",[["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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cU=He("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const e0=He("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jre=He("CircleMinus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const b2=He("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uU=He("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const w2e=He("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const b2e=He("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const M3=He("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const C2e=He("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const S2e=He("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const eo=He("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const N7=He("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Tb=He("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const k2e=He("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _2e=He("FileCheck",[["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:"m9 15 2 2 4-4",key:"1grp1n"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Bre=He("FileDown",[["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:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $p=He("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Nre=He("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const C2=He("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const j2e=He("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const B2e=He("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const N2e=He("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const E2e=He("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ere=He("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const T2e=He("House",[["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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const P2e=He("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dU=He("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const L3=He("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const I2e=He("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const O2e=He("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const E7=He("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Tre=He("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const F2e=He("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const M2e=He("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const L2e=He("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const R2e=He("ListPlus",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const D2e=He("List",[["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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ba=He("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pre=He("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ire=He("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const e_=He("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ov=He("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const T7=He("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const aj=He("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ad=He("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ore=He("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const U2e=He("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Fre=He("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lf=He("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const H2e=He("PiggyBank",[["path",{d:"M19 5c-1.5 0-2.8 1.4-3 2-3.5-1.5-11-.3-11 5 0 1.8 0 3 2 4.5V20h4v-2h3v2h4v-4c1-.5 1.7-1 2-2h2v-4h-2c0-1-.5-1.5-1-2V5z",key:"1ivx2i"}],["path",{d:"M2 9v1c0 1.1.9 2 2 2h1",key:"nm575m"}],["path",{d:"M16 11h.01",key:"xkw8gn"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const R3=He("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zp=He("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Q2e=He("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $2e=He("Redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Xc=He("RefreshCw",[["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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z2e=He("Ruler",[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pb=He("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hE=He("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Mre=He("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hU=He("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const V2e=He("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const K2e=He("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ts=He("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Lre=He("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const D3=He("Star",[["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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fE=He("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jl=He("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const q2e=He("Trees",[["path",{d:"M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z",key:"1l6gj6"}],["path",{d:"M7 16v6",key:"1a82de"}],["path",{d:"M13 19v3",key:"13sx9i"}],["path",{d:"M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5",key:"1sj9kv"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Rre=He("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Dre=He("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vp=He("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ure=He("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const W2e=He("Undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Hre=He("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const AE=He("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const G2e=He("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Y2e=He("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const X2e=He("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const P7=He("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ta=He("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qre=He("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]),fU="-",J2e=e=>{const t=eCe(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const o=a.split(fU);return o[0]===""&&o.length!==1&&o.shift(),$re(o,t)||Z2e(a)},getConflictingClassGroupIds:(a,o)=>{const c=n[a]||[];return o&&r[a]?[...c,...r[a]]:c}}},$re=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?$re(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(fU);return(a=t.validators.find(({validator:o})=>o(s)))==null?void 0:a.classGroupId},I7=/^\[(.+)\]$/,Z2e=e=>{if(I7.test(e)){const t=I7.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},eCe=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return nCe(Object.entries(e.classGroups),n).forEach(([s,a])=>{U3(a,r,s,t)}),r},U3=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:O7(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(tCe(i)){U3(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{U3(a,O7(t,s),n,r)})})},O7=(e,t)=>{let n=e;return t.split(fU).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},tCe=e=>e.isThemeGetter,nCe=(e,t)=>t?e.map(([n,r])=>{const i=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([a,o])=>[t+a,o])):s);return[n,i]}):e,rCe=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(s,a)=>{n.set(s,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set(s,a){n.has(s)?n.set(s,a):i(s,a)}}},zre="!",iCe=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,a=o=>{const c=[];let u=0,d=0,h;for(let g=0;g<o.length;g++){let y=o[g];if(u===0){if(y===i&&(r||o.slice(g,g+s)===t)){c.push(o.slice(d,g)),d=g+s;continue}if(y==="/"){h=g;continue}}y==="["?u++:y==="]"&&u--}const A=c.length===0?o:o.substring(d),f=A.startsWith(zre),p=f?A.substring(1):A,m=h&&h>d?h-d:void 0;return{modifiers:c,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}};return n?o=>n({className:o,parseClassName:a}):a},sCe=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},aCe=e=>({cache:rCe(e.cacheSize),parseClassName:iCe(e),...J2e(e)}),oCe=/\s+/,lCe=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],a=e.trim().split(oCe);let o="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:d,hasImportantModifier:h,baseClassName:A,maybePostfixModifierPosition:f}=n(u);let p=!!f,m=r(p?A.substring(0,f):A);if(!m){if(!p){o=u+(o.length>0?" "+o:o);continue}if(m=r(A),!m){o=u+(o.length>0?" "+o:o);continue}p=!1}const g=sCe(d).join(":"),y=h?g+zre:g,v=y+m;if(s.includes(v))continue;s.push(v);const x=i(m,p);for(let w=0;w<x.length;++w){const b=x[w];s.push(y+b)}o=u+(o.length>0?" "+o:o)}return o};function cCe(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Vre(t))&&(r&&(r+=" "),r+=n);return r}const Vre=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Vre(e[r]))&&(n&&(n+=" "),n+=t);return n};function uCe(e,...t){let n,r,i,s=a;function a(c){const u=t.reduce((d,h)=>h(d),e());return n=aCe(u),r=n.cache.get,i=n.cache.set,s=o,o(c)}function o(c){const u=r(c);if(u)return u;const d=lCe(c,n);return i(c,d),d}return function(){return s(cCe.apply(null,arguments))}}const xr=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Kre=/^\[(?:([a-z-]+):)?(.+)\]$/i,dCe=/^\d+\/\d+$/,hCe=new Set(["px","full","screen"]),fCe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ACe=/\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$/,pCe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,mCe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gCe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Iu=e=>yy(e)||hCe.has(e)||dCe.test(e),Jd=e=>t0(e,"length",kCe),yy=e=>!!e&&!Number.isNaN(Number(e)),DP=e=>t0(e,"number",yy),mx=e=>!!e&&Number.isInteger(Number(e)),yCe=e=>e.endsWith("%")&&yy(e.slice(0,-1)),hn=e=>Kre.test(e),Zd=e=>fCe.test(e),vCe=new Set(["length","size","percentage"]),xCe=e=>t0(e,vCe,qre),wCe=e=>t0(e,"position",qre),bCe=new Set(["image","url"]),CCe=e=>t0(e,bCe,jCe),SCe=e=>t0(e,"",_Ce),gx=()=>!0,t0=(e,t,n)=>{const r=Kre.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},kCe=e=>ACe.test(e)&&!pCe.test(e),qre=()=>!1,_Ce=e=>mCe.test(e),jCe=e=>gCe.test(e),BCe=()=>{const e=xr("colors"),t=xr("spacing"),n=xr("blur"),r=xr("brightness"),i=xr("borderColor"),s=xr("borderRadius"),a=xr("borderSpacing"),o=xr("borderWidth"),c=xr("contrast"),u=xr("grayscale"),d=xr("hueRotate"),h=xr("invert"),A=xr("gap"),f=xr("gradientColorStops"),p=xr("gradientColorStopPositions"),m=xr("inset"),g=xr("margin"),y=xr("opacity"),v=xr("padding"),x=xr("saturate"),w=xr("scale"),b=xr("sepia"),k=xr("skew"),j=xr("space"),B=xr("translate"),E=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",hn,t],N=()=>[hn,t],F=()=>["",Iu,Jd],L=()=>["auto",yy,hn],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",hn],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],oe=()=>[yy,hn];return{cacheSize:500,separator:":",theme:{colors:[gx],spacing:[Iu,Jd],blur:["none","",Zd,hn],brightness:oe(),borderColor:[e],borderRadius:["none","","full",Zd,hn],borderSpacing:N(),borderWidth:F(),contrast:oe(),grayscale:z(),hueRotate:oe(),invert:z(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[yCe,Jd],inset:T(),margin:T(),opacity:oe(),padding:N(),saturate:oe(),scale:oe(),sepia:z(),skew:oe(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",hn]}],container:["container"],columns:[{columns:[Zd]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"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"],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:[...U(),hn]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",mx,hn]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",hn]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",mx,hn]}],"grid-cols":[{"grid-cols":[gx]}],"col-start-end":[{col:["auto",{span:["full",mx,hn]},hn]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[gx]}],"row-start-end":[{row:["auto",{span:[mx,hn]},hn]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",hn]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",hn]}],gap:[{gap:[A]}],"gap-x":[{"gap-x":[A]}],"gap-y":[{"gap-y":[A]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",hn,t]}],"min-w":[{"min-w":[hn,t,"min","max","fit"]}],"max-w":[{"max-w":[hn,t,"none","full","min","max","fit","prose",{screen:[Zd]},Zd]}],h:[{h:[hn,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[hn,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[hn,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[hn,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Zd,Jd]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",DP]}],"font-family":[{font:[gx]}],"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:["tighter","tight","normal","wide","wider","widest",hn]}],"line-clamp":[{"line-clamp":["none",yy,DP]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Iu,hn]}],"list-image":[{"list-image":["none",hn]}],"list-style-type":[{list:["none","disc","decimal",hn]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Iu,Jd]}],"underline-offset":[{"underline-offset":["auto",Iu,hn]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",hn]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",hn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),wCe]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",xCe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},CCe]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...H(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:H()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...H()]}],"outline-offset":[{"outline-offset":[Iu,hn]}],"outline-w":[{outline:[Iu,Jd]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Iu,Jd]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Zd,SCe]}],"shadow-color":[{shadow:[gx]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...K(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":K()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Zd,hn]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[x]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",hn]}],duration:[{duration:oe()}],ease:[{ease:["linear","in","out","in-out",hn]}],delay:[{delay:oe()}],animate:[{animate:["none","spin","ping","pulse","bounce",hn]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[mx,hn]}],"translate-x":[{"translate-x":[B]}],"translate-y":[{"translate-y":[B]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",hn]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",hn]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",hn]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Iu,Jd,DP]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}},NCe=uCe(BCe);function it(...e){return NCe(Pn(e))}const ECe=u2e,Wre=C.forwardRef(({className:e,...t},n)=>l.jsx(Are,{ref:n,className:it("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Wre.displayName=Are.displayName;const TCe=w2("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Gre=C.forwardRef(({className:e,variant:t,...n},r)=>l.jsx(pre,{ref:r,className:it(TCe({variant:t}),e),...n}));Gre.displayName=pre.displayName;const PCe=C.forwardRef(({className:e,...t},n)=>l.jsx(yre,{ref:n,className:it("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));PCe.displayName=yre.displayName;const Yre=C.forwardRef(({className:e,...t},n)=>l.jsx(vre,{ref:n,className:it("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:l.jsx(ta,{className:"h-4 w-4"})}));Yre.displayName=vre.displayName;const Xre=C.forwardRef(({className:e,...t},n)=>l.jsx(mre,{ref:n,className:it("text-sm font-semibold",e),...t}));Xre.displayName=mre.displayName;const Jre=C.forwardRef(({className:e,...t},n)=>l.jsx(gre,{ref:n,className:it("text-sm opacity-90",e),...t}));Jre.displayName=gre.displayName;function ICe(){const{toasts:e}=Qf();return l.jsxs(ECe,{children:[e.map(function({id:t,title:n,description:r,action:i,...s}){return l.jsxs(Gre,{...s,children:[l.jsxs("div",{className:"grid gap-1",children:[n&&l.jsx(Xre,{children:n}),r&&l.jsx(Jre,{children:r})]}),i,l.jsx(Yre,{})]},t)}),l.jsx(Wre,{})]})}var F7=["light","dark"],OCe="(prefers-color-scheme: dark)",FCe=C.createContext(void 0),MCe={setTheme:e=>{},themes:[]},LCe=()=>{var e;return(e=C.useContext(FCe))!=null?e:MCe};C.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:s,value:a,attrs:o,nonce:c})=>{let u=s==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${o.map(p=>`'${p}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=i?F7.includes(s)&&s?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${s}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",A=(p,m=!1,g=!0)=>{let y=a?a[p]:p,v=m?p+"|| ''":`'${y}'`,x="";return i&&g&&!m&&F7.includes(p)&&(x+=`d.style.colorScheme = '${p}';`),n==="class"?m||y?x+=`c.add(${v})`:x+="null":y&&(x+=`d[s](n,${v})`),x},f=e?`!function(){${d}${A(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${OCe}',m=window.matchMedia(t);if(m.media!==t||m.matches){${A("dark")}}else{${A("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${A(a?"x[e]":"e",!0)}}${u?"":"else{"+A(s,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${A(a?"x[e]":"e",!0)}}else{${A(s,!1,!1)};}${h}}catch(t){}}();`;return C.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:f}})});var RCe=e=>{switch(e){case"success":return HCe;case"info":return $Ce;case"warning":return QCe;case"error":return zCe;default:return null}},DCe=Array(12).fill(0),UCe=({visible:e,className:t})=>re.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},re.createElement("div",{className:"sonner-spinner"},DCe.map((n,r)=>re.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),HCe=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),QCe=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),$Ce=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),zCe=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),VCe=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},re.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),re.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),KCe=()=>{let[e,t]=re.useState(document.hidden);return re.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},H3=1,qCe=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;let{message:r,...i}=t,s=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:H3++,a=this.toasts.find(c=>c.id===s),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),a?this.toasts=this.toasts.map(c=>c.id===s?(this.publish({...c,...t,id:s,title:r}),{...c,...t,id:s,dismissible:o,title:r}):c):this.addToast({title:r,...i,dismissible:o,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:t,dismiss:!0})),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let i=t instanceof Promise?t:t(),s=r!==void 0,a,o=i.then(async u=>{if(a=["resolve",u],re.isValidElement(u))s=!1,this.create({id:r,type:"default",message:u});else if(GCe(u)&&!u.ok){s=!1;let d=typeof n.error=="function"?await n.error(`HTTP error! status: ${u.status}`):n.error,h=typeof n.description=="function"?await n.description(`HTTP error! status: ${u.status}`):n.description;this.create({id:r,type:"error",message:d,description:h})}else if(n.success!==void 0){s=!1;let d=typeof n.success=="function"?await n.success(u):n.success,h=typeof n.description=="function"?await n.description(u):n.description;this.create({id:r,type:"success",message:d,description:h})}}).catch(async u=>{if(a=["reject",u],n.error!==void 0){s=!1;let d=typeof n.error=="function"?await n.error(u):n.error,h=typeof n.description=="function"?await n.description(u):n.description;this.create({id:r,type:"error",message:d,description:h})}}).finally(()=>{var u;s&&(this.dismiss(r),r=void 0),(u=n.finally)==null||u.call(n)}),c=()=>new Promise((u,d)=>o.then(()=>a[0]==="reject"?d(a[1]):u(a[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:c}:Object.assign(r,{unwrap:c})},this.custom=(t,n)=>{let r=(n==null?void 0:n.id)||H3++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ua=new qCe,WCe=(e,t)=>{let n=(t==null?void 0:t.id)||H3++;return Ua.addToast({title:e,...t,id:n}),n},GCe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",YCe=WCe,XCe=()=>Ua.toasts,JCe=()=>Ua.getActiveToasts(),Ew=Object.assign(YCe,{success:Ua.success,info:Ua.info,warning:Ua.warning,error:Ua.error,custom:Ua.custom,message:Ua.message,promise:Ua.promise,dismiss:Ua.dismiss,loading:Ua.loading},{getHistory:XCe,getToasts:JCe});function ZCe(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}ZCe(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
`);function lS(e){return e.label!==void 0}var eSe=3,tSe="32px",nSe="16px",M7=4e3,rSe=356,iSe=14,sSe=20,aSe=200;function Ql(...e){return e.filter(Boolean).join(" ")}function oSe(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var lSe=e=>{var t,n,r,i,s,a,o,c,u,d,h;let{invert:A,toast:f,unstyled:p,interacting:m,setHeights:g,visibleToasts:y,heights:v,index:x,toasts:w,expanded:b,removeToast:k,defaultRichColors:j,closeButton:B,style:E,cancelButtonStyle:I,actionButtonStyle:T,className:N="",descriptionClassName:F="",duration:L,position:U,gap:H,loadingIcon:K,expandByDefault:$,classNames:z,icons:Q,closeButtonAriaLabel:oe="Close toast",pauseWhenPageIsHidden:R}=e,[M,Y]=re.useState(null),[X,q]=re.useState(null),[Z,de]=re.useState(!1),[ue,ae]=re.useState(!1),[he,ie]=re.useState(!1),[Ce,Oe]=re.useState(!1),[te,je]=re.useState(!1),[tt,nt]=re.useState(0),[Te,ct]=re.useState(0),we=re.useRef(f.duration||L||M7),$e=re.useRef(null),Ve=re.useRef(null),$t=x===0,yt=x+1<=y,ye=f.type,Be=f.dismissible!==!1,Ge=f.className||"",Ue=f.descriptionClassName||"",Ye=re.useMemo(()=>v.findIndex(Ht=>Ht.toastId===f.id)||0,[v,f.id]),pe=re.useMemo(()=>{var Ht;return(Ht=f.closeButton)!=null?Ht:B},[f.closeButton,B]),bt=re.useMemo(()=>f.duration||L||M7,[f.duration,L]),mt=re.useRef(0),_t=re.useRef(0),Rt=re.useRef(0),Wt=re.useRef(null),[vt,Dt]=U.split("-"),Ft=re.useMemo(()=>v.reduce((Ht,en,Bn)=>Bn>=Ye?Ht:Ht+en.height,0),[v,Ye]),Zt=KCe(),lr=f.invert||A,cn=ye==="loading";_t.current=re.useMemo(()=>Ye*H+Ft,[Ye,Ft]),re.useEffect(()=>{we.current=bt},[bt]),re.useEffect(()=>{de(!0)},[]),re.useEffect(()=>{let Ht=Ve.current;if(Ht){let en=Ht.getBoundingClientRect().height;return ct(en),g(Bn=>[{toastId:f.id,height:en,position:f.position},...Bn]),()=>g(Bn=>Bn.filter(Wr=>Wr.toastId!==f.id))}},[g,f.id]),re.useLayoutEffect(()=>{if(!Z)return;let Ht=Ve.current,en=Ht.style.height;Ht.style.height="auto";let Bn=Ht.getBoundingClientRect().height;Ht.style.height=en,ct(Bn),g(Wr=>Wr.find(St=>St.toastId===f.id)?Wr.map(St=>St.toastId===f.id?{...St,height:Bn}:St):[{toastId:f.id,height:Bn,position:f.position},...Wr])},[Z,f.title,f.description,g,f.id]);let Et=re.useCallback(()=>{ae(!0),nt(_t.current),g(Ht=>Ht.filter(en=>en.toastId!==f.id)),setTimeout(()=>{k(f)},aSe)},[f,k,g,_t]);re.useEffect(()=>{if(f.promise&&ye==="loading"||f.duration===1/0||f.type==="loading")return;let Ht;return b||m||R&&Zt?(()=>{if(Rt.current<mt.current){let en=new Date().getTime()-mt.current;we.current=we.current-en}Rt.current=new Date().getTime()})():we.current!==1/0&&(mt.current=new Date().getTime(),Ht=setTimeout(()=>{var en;(en=f.onAutoClose)==null||en.call(f,f),Et()},we.current)),()=>clearTimeout(Ht)},[b,m,f,ye,R,Zt,Et]),re.useEffect(()=>{f.delete&&Et()},[Et,f.delete]);function Mn(){var Ht,en,Bn;return Q!=null&&Q.loading?re.createElement("div",{className:Ql(z==null?void 0:z.loader,(Ht=f==null?void 0:f.classNames)==null?void 0:Ht.loader,"sonner-loader"),"data-visible":ye==="loading"},Q.loading):K?re.createElement("div",{className:Ql(z==null?void 0:z.loader,(en=f==null?void 0:f.classNames)==null?void 0:en.loader,"sonner-loader"),"data-visible":ye==="loading"},K):re.createElement(UCe,{className:Ql(z==null?void 0:z.loader,(Bn=f==null?void 0:f.classNames)==null?void 0:Bn.loader),visible:ye==="loading"})}return re.createElement("li",{tabIndex:0,ref:Ve,className:Ql(N,Ge,z==null?void 0:z.toast,(t=f==null?void 0:f.classNames)==null?void 0:t.toast,z==null?void 0:z.default,z==null?void 0:z[ye],(n=f==null?void 0:f.classNames)==null?void 0:n[ye]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:j,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":Z,"data-promise":!!f.promise,"data-swiped":te,"data-removed":ue,"data-visible":yt,"data-y-position":vt,"data-x-position":Dt,"data-index":x,"data-front":$t,"data-swiping":he,"data-dismissible":Be,"data-type":ye,"data-invert":lr,"data-swipe-out":Ce,"data-swipe-direction":X,"data-expanded":!!(b||$&&Z),style:{"--index":x,"--toasts-before":x,"--z-index":w.length-x,"--offset":`${ue?tt:_t.current}px`,"--initial-height":$?"auto":`${Te}px`,...E,...f.style},onDragEnd:()=>{ie(!1),Y(null),Wt.current=null},onPointerDown:Ht=>{cn||!Be||($e.current=new Date,nt(_t.current),Ht.target.setPointerCapture(Ht.pointerId),Ht.target.tagName!=="BUTTON"&&(ie(!0),Wt.current={x:Ht.clientX,y:Ht.clientY}))},onPointerUp:()=>{var Ht,en,Bn,Wr;if(Ce||!Be)return;Wt.current=null;let St=Number(((Ht=Ve.current)==null?void 0:Ht.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Xi=Number(((en=Ve.current)==null?void 0:en.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ds=new Date().getTime()-((Bn=$e.current)==null?void 0:Bn.getTime()),Er=M==="x"?St:Xi,ai=Math.abs(Er)/ds;if(Math.abs(Er)>=sSe||ai>.11){nt(_t.current),(Wr=f.onDismiss)==null||Wr.call(f,f),q(M==="x"?St>0?"right":"left":Xi>0?"down":"up"),Et(),Oe(!0),je(!1);return}ie(!1),Y(null)},onPointerMove:Ht=>{var en,Bn,Wr,St;if(!Wt.current||!Be||((en=window.getSelection())==null?void 0:en.toString().length)>0)return;let Xi=Ht.clientY-Wt.current.y,ds=Ht.clientX-Wt.current.x,Er=(Bn=e.swipeDirections)!=null?Bn:oSe(U);!M&&(Math.abs(ds)>1||Math.abs(Xi)>1)&&Y(Math.abs(ds)>Math.abs(Xi)?"x":"y");let ai={x:0,y:0};M==="y"?(Er.includes("top")||Er.includes("bottom"))&&(Er.includes("top")&&Xi<0||Er.includes("bottom")&&Xi>0)&&(ai.y=Xi):M==="x"&&(Er.includes("left")||Er.includes("right"))&&(Er.includes("left")&&ds<0||Er.includes("right")&&ds>0)&&(ai.x=ds),(Math.abs(ai.x)>0||Math.abs(ai.y)>0)&&je(!0),(Wr=Ve.current)==null||Wr.style.setProperty("--swipe-amount-x",`${ai.x}px`),(St=Ve.current)==null||St.style.setProperty("--swipe-amount-y",`${ai.y}px`)}},pe&&!f.jsx?re.createElement("button",{"aria-label":oe,"data-disabled":cn,"data-close-button":!0,onClick:cn||!Be?()=>{}:()=>{var Ht;Et(),(Ht=f.onDismiss)==null||Ht.call(f,f)},className:Ql(z==null?void 0:z.closeButton,(i=f==null?void 0:f.classNames)==null?void 0:i.closeButton)},(s=Q==null?void 0:Q.close)!=null?s:VCe):null,f.jsx||C.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:re.createElement(re.Fragment,null,ye||f.icon||f.promise?re.createElement("div",{"data-icon":"",className:Ql(z==null?void 0:z.icon,(a=f==null?void 0:f.classNames)==null?void 0:a.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Mn():null,f.type!=="loading"?f.icon||(Q==null?void 0:Q[ye])||RCe(ye):null):null,re.createElement("div",{"data-content":"",className:Ql(z==null?void 0:z.content,(o=f==null?void 0:f.classNames)==null?void 0:o.content)},re.createElement("div",{"data-title":"",className:Ql(z==null?void 0:z.title,(c=f==null?void 0:f.classNames)==null?void 0:c.title)},typeof f.title=="function"?f.title():f.title),f.description?re.createElement("div",{"data-description":"",className:Ql(F,Ue,z==null?void 0:z.description,(u=f==null?void 0:f.classNames)==null?void 0:u.description)},typeof f.description=="function"?f.description():f.description):null),C.isValidElement(f.cancel)?f.cancel:f.cancel&&lS(f.cancel)?re.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||I,onClick:Ht=>{var en,Bn;lS(f.cancel)&&Be&&((Bn=(en=f.cancel).onClick)==null||Bn.call(en,Ht),Et())},className:Ql(z==null?void 0:z.cancelButton,(d=f==null?void 0:f.classNames)==null?void 0:d.cancelButton)},f.cancel.label):null,C.isValidElement(f.action)?f.action:f.action&&lS(f.action)?re.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||T,onClick:Ht=>{var en,Bn;lS(f.action)&&((Bn=(en=f.action).onClick)==null||Bn.call(en,Ht),!Ht.defaultPrevented&&Et())},className:Ql(z==null?void 0:z.actionButton,(h=f==null?void 0:f.classNames)==null?void 0:h.actionButton)},f.action.label):null))};function L7(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function cSe(e,t){let n={};return[e,t].forEach((r,i)=>{let s=i===1,a=s?"--mobile-offset":"--offset",o=s?nSe:tSe;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${a}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${a}-${u}`]=o:n[`${a}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(o)}),n}var uSe=C.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:s,closeButton:a,className:o,offset:c,mobileOffset:u,theme:d="light",richColors:h,duration:A,style:f,visibleToasts:p=eSe,toastOptions:m,dir:g=L7(),gap:y=iSe,loadingIcon:v,icons:x,containerAriaLabel:w="Notifications",pauseWhenPageIsHidden:b}=e,[k,j]=re.useState([]),B=re.useMemo(()=>Array.from(new Set([r].concat(k.filter(R=>R.position).map(R=>R.position)))),[k,r]),[E,I]=re.useState([]),[T,N]=re.useState(!1),[F,L]=re.useState(!1),[U,H]=re.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=re.useRef(null),$=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),z=re.useRef(null),Q=re.useRef(!1),oe=re.useCallback(R=>{j(M=>{var Y;return(Y=M.find(X=>X.id===R.id))!=null&&Y.delete||Ua.dismiss(R.id),M.filter(({id:X})=>X!==R.id)})},[]);return re.useEffect(()=>Ua.subscribe(R=>{if(R.dismiss){j(M=>M.map(Y=>Y.id===R.id?{...Y,delete:!0}:Y));return}setTimeout(()=>{iU.flushSync(()=>{j(M=>{let Y=M.findIndex(X=>X.id===R.id);return Y!==-1?[...M.slice(0,Y),{...M[Y],...R},...M.slice(Y+1)]:[R,...M]})})})}),[]),re.useEffect(()=>{if(d!=="system"){H(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;let R=window.matchMedia("(prefers-color-scheme: dark)");try{R.addEventListener("change",({matches:M})=>{H(M?"dark":"light")})}catch{R.addListener(({matches:Y})=>{try{H(Y?"dark":"light")}catch(X){console.error(X)}})}},[d]),re.useEffect(()=>{k.length<=1&&N(!1)},[k]),re.useEffect(()=>{let R=M=>{var Y,X;i.every(q=>M[q]||M.code===q)&&(N(!0),(Y=K.current)==null||Y.focus()),M.code==="Escape"&&(document.activeElement===K.current||(X=K.current)!=null&&X.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[i]),re.useEffect(()=>{if(K.current)return()=>{z.current&&(z.current.focus({preventScroll:!0}),z.current=null,Q.current=!1)}},[K.current]),re.createElement("section",{ref:t,"aria-label":`${w} ${$}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},B.map((R,M)=>{var Y;let[X,q]=R.split("-");return k.length?re.createElement("ol",{key:R,dir:g==="auto"?L7():g,tabIndex:-1,ref:K,className:o,"data-sonner-toaster":!0,"data-theme":U,"data-y-position":X,"data-lifted":T&&k.length>1&&!s,"data-x-position":q,style:{"--front-toast-height":`${((Y=E[0])==null?void 0:Y.height)||0}px`,"--width":`${rSe}px`,"--gap":`${y}px`,...f,...cSe(c,u)},onBlur:Z=>{Q.current&&!Z.currentTarget.contains(Z.relatedTarget)&&(Q.current=!1,z.current&&(z.current.focus({preventScroll:!0}),z.current=null))},onFocus:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||Q.current||(Q.current=!0,z.current=Z.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{F||N(!1)},onDragEnd:()=>N(!1),onPointerDown:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},k.filter(Z=>!Z.position&&M===0||Z.position===R).map((Z,de)=>{var ue,ae;return re.createElement(lSe,{key:Z.id,icons:x,index:de,toast:Z,defaultRichColors:h,duration:(ue=m==null?void 0:m.duration)!=null?ue:A,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:n,visibleToasts:p,closeButton:(ae=m==null?void 0:m.closeButton)!=null?ae:a,interacting:F,position:R,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,removeToast:oe,toasts:k.filter(he=>he.position==Z.position),heights:E.filter(he=>he.position==Z.position),setHeights:I,expandByDefault:s,gap:y,loadingIcon:v,expanded:T,pauseWhenPageIsHidden:b,swipeDirections:e.swipeDirections})})):null}))});const dSe=({...e})=>{const{theme:t="system"}=LCe();return l.jsx(uSe,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var hSe=fD[" useId ".trim().toString()]||(()=>{}),fSe=0;function yl(e){const[t,n]=C.useState(hSe());return qi(()=>{n(r=>r??String(fSe++))},[e]),t?`radix-${t}`:""}const ASe=["top","right","bottom","left"],_f=Math.min,ko=Math.max,oj=Math.round,cS=Math.floor,ru=e=>({x:e,y:e}),pSe={left:"right",right:"left",bottom:"top",top:"bottom"},mSe={start:"end",end:"start"};function Q3(e,t,n){return ko(e,_f(t,n))}function yd(e,t){return typeof e=="function"?e(t):e}function vd(e){return e.split("-")[0]}function n0(e){return e.split("-")[1]}function AU(e){return e==="x"?"y":"x"}function pU(e){return e==="y"?"height":"width"}const gSe=new Set(["top","bottom"]);function Jc(e){return gSe.has(vd(e))?"y":"x"}function mU(e){return AU(Jc(e))}function ySe(e,t,n){n===void 0&&(n=!1);const r=n0(e),i=mU(e),s=pU(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=lj(a)),[a,lj(a)]}function vSe(e){const t=lj(e);return[$3(e),t,$3(t)]}function $3(e){return e.replace(/start|end/g,t=>mSe[t])}const R7=["left","right"],D7=["right","left"],xSe=["top","bottom"],wSe=["bottom","top"];function bSe(e,t,n){switch(e){case"top":case"bottom":return n?t?D7:R7:t?R7:D7;case"left":case"right":return t?xSe:wSe;default:return[]}}function CSe(e,t,n,r){const i=n0(e);let s=bSe(vd(e),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),t&&(s=s.concat(s.map($3)))),s}function lj(e){return e.replace(/left|right|bottom|top/g,t=>pSe[t])}function SSe(e){return{top:0,right:0,bottom:0,left:0,...e}}function Zre(e){return typeof e!="number"?SSe(e):{top:e,right:e,bottom:e,left:e}}function cj(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function U7(e,t,n){let{reference:r,floating:i}=e;const s=Jc(t),a=mU(t),o=pU(a),c=vd(t),u=s==="y",d=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,A=r[o]/2-i[o]/2;let f;switch(c){case"top":f={x:d,y:r.y-i.height};break;case"bottom":f={x:d,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:h};break;case"left":f={x:r.x-i.width,y:h};break;default:f={x:r.x,y:r.y}}switch(n0(t)){case"start":f[a]-=A*(n&&u?-1:1);break;case"end":f[a]+=A*(n&&u?-1:1);break}return f}const kSe=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:a}=n,o=s.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:h}=U7(u,r,c),A=r,f={},p=0;for(let m=0;m<o.length;m++){const{name:g,fn:y}=o[m],{x:v,y:x,data:w,reset:b}=await y({x:d,y:h,initialPlacement:r,placement:A,strategy:i,middlewareData:f,rects:u,platform:a,elements:{reference:e,floating:t}});d=v??d,h=x??h,f={...f,[g]:{...f[g],...w}},b&&p<=50&&(p++,typeof b=="object"&&(b.placement&&(A=b.placement),b.rects&&(u=b.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:i}):b.rects),{x:d,y:h}=U7(u,A,c)),m=-1)}return{x:d,y:h,placement:A,strategy:i,middlewareData:f}};async function Ib(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:a,elements:o,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:A=!1,padding:f=0}=yd(t,e),p=Zre(f),g=o[A?h==="floating"?"reference":"floating":h],y=cj(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:u,rootBoundary:d,strategy:c})),v=h==="floating"?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),w=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},b=cj(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:v,offsetParent:x,strategy:c}):v);return{top:(y.top-b.top+p.top)/w.y,bottom:(b.bottom-y.bottom+p.bottom)/w.y,left:(y.left-b.left+p.left)/w.x,right:(b.right-y.right+p.right)/w.x}}const _Se=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:a,elements:o,middlewareData:c}=t,{element:u,padding:d=0}=yd(e,t)||{};if(u==null)return{};const h=Zre(d),A={x:n,y:r},f=mU(i),p=pU(f),m=await a.getDimensions(u),g=f==="y",y=g?"top":"left",v=g?"bottom":"right",x=g?"clientHeight":"clientWidth",w=s.reference[p]+s.reference[f]-A[f]-s.floating[p],b=A[f]-s.reference[f],k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let j=k?k[x]:0;(!j||!await(a.isElement==null?void 0:a.isElement(k)))&&(j=o.floating[x]||s.floating[p]);const B=w/2-b/2,E=j/2-m[p]/2-1,I=_f(h[y],E),T=_f(h[v],E),N=I,F=j-m[p]-T,L=j/2-m[p]/2+B,U=Q3(N,L,F),H=!c.arrow&&n0(i)!=null&&L!==U&&s.reference[p]/2-(L<N?I:T)-m[p]/2<0,K=H?L<N?L-N:L-F:0;return{[f]:A[f]+K,data:{[f]:U,centerOffset:L-U-K,...H&&{alignmentOffset:K}},reset:H}}}),jSe=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:a,initialPlacement:o,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:A,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=yd(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=vd(i),v=Jc(o),x=vd(o)===o,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),b=A||(x||!m?[lj(o)]:vSe(o)),k=p!=="none";!A&&k&&b.push(...CSe(o,m,p,w));const j=[o,...b],B=await Ib(t,g),E=[];let I=((r=s.flip)==null?void 0:r.overflows)||[];if(d&&E.push(B[y]),h){const L=ySe(i,a,w);E.push(B[L[0]],B[L[1]])}if(I=[...I,{placement:i,overflows:E}],!E.every(L=>L<=0)){var T,N;const L=(((T=s.flip)==null?void 0:T.index)||0)+1,U=j[L];if(U&&(!(h==="alignment"?v!==Jc(U):!1)||I.every($=>$.overflows[0]>0&&Jc($.placement)===v)))return{data:{index:L,overflows:I},reset:{placement:U}};let H=(N=I.filter(K=>K.overflows[0]<=0).sort((K,$)=>K.overflows[1]-$.overflows[1])[0])==null?void 0:N.placement;if(!H)switch(f){case"bestFit":{var F;const K=(F=I.filter($=>{if(k){const z=Jc($.placement);return z===v||z==="y"}return!0}).map($=>[$.placement,$.overflows.filter(z=>z>0).reduce((z,Q)=>z+Q,0)]).sort(($,z)=>$[1]-z[1])[0])==null?void 0:F[0];K&&(H=K);break}case"initialPlacement":H=o;break}if(i!==H)return{reset:{placement:H}}}return{}}}};function H7(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Q7(e){return ASe.some(t=>e[t]>=0)}const BSe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=yd(e,t);switch(r){case"referenceHidden":{const s=await Ib(t,{...i,elementContext:"reference"}),a=H7(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Q7(a)}}}case"escaped":{const s=await Ib(t,{...i,altBoundary:!0}),a=H7(s,n.floating);return{data:{escapedOffsets:a,escaped:Q7(a)}}}default:return{}}}}},eie=new Set(["left","top"]);async function NSe(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=vd(n),o=n0(n),c=Jc(n)==="y",u=eie.has(a)?-1:1,d=s&&c?-1:1,h=yd(t,e);let{mainAxis:A,crossAxis:f,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&typeof p=="number"&&(f=o==="end"?p*-1:p),c?{x:f*d,y:A*u}:{x:A*u,y:f*d}}const ESe=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:a,middlewareData:o}=t,c=await NSe(t,e);return a===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:a}}}}},TSe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:o={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...c}=yd(e,t),u={x:n,y:r},d=await Ib(t,c),h=Jc(vd(i)),A=AU(h);let f=u[A],p=u[h];if(s){const g=A==="y"?"top":"left",y=A==="y"?"bottom":"right",v=f+d[g],x=f-d[y];f=Q3(v,f,x)}if(a){const g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=p+d[g],x=p-d[y];p=Q3(v,p,x)}const m=o.fn({...t,[A]:f,[h]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[A]:s,[h]:a}}}}}},PSe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:a}=t,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=yd(e,t),d={x:n,y:r},h=Jc(i),A=AU(h);let f=d[A],p=d[h];const m=yd(o,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const x=A==="y"?"height":"width",w=s.reference[A]-s.floating[x]+g.mainAxis,b=s.reference[A]+s.reference[x]-g.mainAxis;f<w?f=w:f>b&&(f=b)}if(u){var y,v;const x=A==="y"?"width":"height",w=eie.has(vd(i)),b=s.reference[h]-s.floating[x]+(w&&((y=a.offset)==null?void 0:y[h])||0)+(w?0:g.crossAxis),k=s.reference[h]+s.reference[x]+(w?0:((v=a.offset)==null?void 0:v[h])||0)-(w?g.crossAxis:0);p<b?p=b:p>k&&(p=k)}return{[A]:f,[h]:p}}}},ISe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:a,elements:o}=t,{apply:c=()=>{},...u}=yd(e,t),d=await Ib(t,u),h=vd(i),A=n0(i),f=Jc(i)==="y",{width:p,height:m}=s.floating;let g,y;h==="top"||h==="bottom"?(g=h,y=A===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(y=h,g=A==="end"?"top":"bottom");const v=m-d.top-d.bottom,x=p-d.left-d.right,w=_f(m-d[g],v),b=_f(p-d[y],x),k=!t.middlewareData.shift;let j=w,B=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(B=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=v),k&&!A){const I=ko(d.left,0),T=ko(d.right,0),N=ko(d.top,0),F=ko(d.bottom,0);f?B=p-2*(I!==0||T!==0?I+T:ko(d.left,d.right)):j=m-2*(N!==0||F!==0?N+F:ko(d.top,d.bottom))}await c({...t,availableWidth:B,availableHeight:j});const E=await a.getDimensions(o.floating);return p!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}};function pE(){return typeof window<"u"}function r0(e){return tie(e)?(e.nodeName||"").toLowerCase():"#document"}function Mo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pu(e){var t;return(t=(tie(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function tie(e){return pE()?e instanceof Node||e instanceof Mo(e).Node:!1}function gc(e){return pE()?e instanceof Element||e instanceof Mo(e).Element:!1}function uu(e){return pE()?e instanceof HTMLElement||e instanceof Mo(e).HTMLElement:!1}function $7(e){return!pE()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Mo(e).ShadowRoot}const OSe=new Set(["inline","contents"]);function S2(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=yc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!OSe.has(i)}const FSe=new Set(["table","td","th"]);function MSe(e){return FSe.has(r0(e))}const LSe=[":popover-open",":modal"];function mE(e){return LSe.some(t=>{try{return e.matches(t)}catch{return!1}})}const RSe=["transform","translate","scale","rotate","perspective"],DSe=["transform","translate","scale","rotate","perspective","filter"],USe=["paint","layout","strict","content"];function gU(e){const t=yU(),n=gc(e)?yc(e):e;return RSe.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||DSe.some(r=>(n.willChange||"").includes(r))||USe.some(r=>(n.contain||"").includes(r))}function HSe(e){let t=jf(e);for(;uu(t)&&!lv(t);){if(gU(t))return t;if(mE(t))return null;t=jf(t)}return null}function yU(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const QSe=new Set(["html","body","#document"]);function lv(e){return QSe.has(r0(e))}function yc(e){return Mo(e).getComputedStyle(e)}function gE(e){return gc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jf(e){if(r0(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$7(e)&&e.host||pu(e);return $7(t)?t.host:t}function nie(e){const t=jf(e);return lv(t)?e.ownerDocument?e.ownerDocument.body:e.body:uu(t)&&S2(t)?t:nie(t)}function Ob(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=nie(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),a=Mo(i);if(s){const o=z3(a);return t.concat(a,a.visualViewport||[],S2(i)?i:[],o&&n?Ob(o):[])}return t.concat(i,Ob(i,[],n))}function z3(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rie(e){const t=yc(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=uu(e),s=i?e.offsetWidth:n,a=i?e.offsetHeight:r,o=oj(n)!==s||oj(r)!==a;return o&&(n=s,r=a),{width:n,height:r,$:o}}function vU(e){return gc(e)?e:e.contextElement}function vy(e){const t=vU(e);if(!uu(t))return ru(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=rie(t);let a=(s?oj(n.width):n.width)/r,o=(s?oj(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const $Se=ru(0);function iie(e){const t=Mo(e);return!yU()||!t.visualViewport?$Se:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zSe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Mo(e)?!1:t}function Kp(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=vU(e);let a=ru(1);t&&(r?gc(r)&&(a=vy(r)):a=vy(e));const o=zSe(s,n,r)?iie(s):ru(0);let c=(i.left+o.x)/a.x,u=(i.top+o.y)/a.y,d=i.width/a.x,h=i.height/a.y;if(s){const A=Mo(s),f=r&&gc(r)?Mo(r):r;let p=A,m=z3(p);for(;m&&r&&f!==p;){const g=vy(m),y=m.getBoundingClientRect(),v=yc(m),x=y.left+(m.clientLeft+parseFloat(v.paddingLeft))*g.x,w=y.top+(m.clientTop+parseFloat(v.paddingTop))*g.y;c*=g.x,u*=g.y,d*=g.x,h*=g.y,c+=x,u+=w,p=Mo(m),m=z3(p)}}return cj({width:d,height:h,x:c,y:u})}function xU(e,t){const n=gE(e).scrollLeft;return t?t.left+n:Kp(pu(e)).left+n}function sie(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:xU(e,r)),s=r.top+t.scrollTop;return{x:i,y:s}}function VSe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",a=pu(r),o=t?mE(t.floating):!1;if(r===a||o&&s)return n;let c={scrollLeft:0,scrollTop:0},u=ru(1);const d=ru(0),h=uu(r);if((h||!h&&!s)&&((r0(r)!=="body"||S2(a))&&(c=gE(r)),uu(r))){const f=Kp(r);u=vy(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}const A=a&&!h&&!s?sie(a,c,!0):ru(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+A.x,y:n.y*u.y-c.scrollTop*u.y+d.y+A.y}}function KSe(e){return Array.from(e.getClientRects())}function qSe(e){const t=pu(e),n=gE(e),r=e.ownerDocument.body,i=ko(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ko(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+xU(e);const o=-n.scrollTop;return yc(r).direction==="rtl"&&(a+=ko(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:o}}function WSe(e,t){const n=Mo(e),r=pu(e),i=n.visualViewport;let s=r.clientWidth,a=r.clientHeight,o=0,c=0;if(i){s=i.width,a=i.height;const u=yU();(!u||u&&t==="fixed")&&(o=i.offsetLeft,c=i.offsetTop)}return{width:s,height:a,x:o,y:c}}const GSe=new Set(["absolute","fixed"]);function YSe(e,t){const n=Kp(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=uu(e)?vy(e):ru(1),a=e.clientWidth*s.x,o=e.clientHeight*s.y,c=i*s.x,u=r*s.y;return{width:a,height:o,x:c,y:u}}function z7(e,t,n){let r;if(t==="viewport")r=WSe(e,n);else if(t==="document")r=qSe(pu(e));else if(gc(t))r=YSe(t,n);else{const i=iie(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return cj(r)}function aie(e,t){const n=jf(e);return n===t||!gc(n)||lv(n)?!1:yc(n).position==="fixed"||aie(n,t)}function XSe(e,t){const n=t.get(e);if(n)return n;let r=Ob(e,[],!1).filter(o=>gc(o)&&r0(o)!=="body"),i=null;const s=yc(e).position==="fixed";let a=s?jf(e):e;for(;gc(a)&&!lv(a);){const o=yc(a),c=gU(a);!c&&o.position==="fixed"&&(i=null),(s?!c&&!i:!c&&o.position==="static"&&!!i&&GSe.has(i.position)||S2(a)&&!c&&aie(e,a))?r=r.filter(d=>d!==a):i=o,a=jf(a)}return t.set(e,r),r}function JSe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?mE(t)?[]:XSe(t,this._c):[].concat(n),r],o=a[0],c=a.reduce((u,d)=>{const h=z7(t,d,i);return u.top=ko(h.top,u.top),u.right=_f(h.right,u.right),u.bottom=_f(h.bottom,u.bottom),u.left=ko(h.left,u.left),u},z7(t,o,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ZSe(e){const{width:t,height:n}=rie(e);return{width:t,height:n}}function eke(e,t,n){const r=uu(t),i=pu(t),s=n==="fixed",a=Kp(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const c=ru(0);function u(){c.x=xU(i)}if(r||!r&&!s)if((r0(t)!=="body"||S2(i))&&(o=gE(t)),r){const f=Kp(t,!0,s,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else i&&u();s&&!r&&i&&u();const d=i&&!r&&!s?sie(i,o):ru(0),h=a.left+o.scrollLeft-c.x-d.x,A=a.top+o.scrollTop-c.y-d.y;return{x:h,y:A,width:a.width,height:a.height}}function UP(e){return yc(e).position==="static"}function V7(e,t){if(!uu(e)||yc(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return pu(e)===n&&(n=n.ownerDocument.body),n}function oie(e,t){const n=Mo(e);if(mE(e))return n;if(!uu(e)){let i=jf(e);for(;i&&!lv(i);){if(gc(i)&&!UP(i))return i;i=jf(i)}return n}let r=V7(e,t);for(;r&&MSe(r)&&UP(r);)r=V7(r,t);return r&&lv(r)&&UP(r)&&!gU(r)?n:r||HSe(e)||n}const tke=async function(e){const t=this.getOffsetParent||oie,n=this.getDimensions,r=await n(e.floating);return{reference:eke(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function nke(e){return yc(e).direction==="rtl"}const rke={convertOffsetParentRelativeRectToViewportRelativeRect:VSe,getDocumentElement:pu,getClippingRect:JSe,getOffsetParent:oie,getElementRects:tke,getClientRects:KSe,getDimensions:ZSe,getScale:vy,isElement:gc,isRTL:nke};function lie(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ike(e,t){let n=null,r;const i=pu(e);function s(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function a(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),s();const u=e.getBoundingClientRect(),{left:d,top:h,width:A,height:f}=u;if(o||t(),!A||!f)return;const p=cS(h),m=cS(i.clientWidth-(d+A)),g=cS(i.clientHeight-(h+f)),y=cS(d),x={rootMargin:-p+"px "+-m+"px "+-g+"px "+-y+"px",threshold:ko(0,_f(1,c))||1};let w=!0;function b(k){const j=k[0].intersectionRatio;if(j!==c){if(!w)return a();j?a(!1,j):r=setTimeout(()=>{a(!1,1e-7)},1e3)}j===1&&!lie(u,e.getBoundingClientRect())&&a(),w=!1}try{n=new IntersectionObserver(b,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,x)}n.observe(e)}return a(!0),s}function ske(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=vU(e),d=i||s?[...u?Ob(u):[],...Ob(t)]:[];d.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const h=u&&o?ike(u,n):null;let A=-1,f=null;a&&(f=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(A),A=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(t)})),n()}),u&&!c&&f.observe(u),f.observe(t));let p,m=c?Kp(e):null;c&&g();function g(){const y=Kp(e);m&&!lie(m,y)&&n(),m=y,p=requestAnimationFrame(g)}return n(),()=>{var y;d.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),h==null||h(),(y=f)==null||y.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const ake=ESe,oke=TSe,lke=jSe,cke=ISe,uke=BSe,K7=_Se,dke=PSe,hke=(e,t,n)=>{const r=new Map,i={platform:rke,...n},s={...i.platform,_c:r};return kSe(e,t,{...i,platform:s})};var fke=typeof document<"u",Ake=function(){},t_=fke?C.useLayoutEffect:Ake;function uj(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 n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!uj(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!uj(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function cie(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function q7(e,t){const n=cie(e);return Math.round(t*n)/n}function HP(e){const t=C.useRef(e);return t_(()=>{t.current=e}),t}function pke(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:a}={},transform:o=!0,whileElementsMounted:c,open:u}=e,[d,h]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[A,f]=C.useState(r);uj(A,r)||f(r);const[p,m]=C.useState(null),[g,y]=C.useState(null),v=C.useCallback($=>{$!==k.current&&(k.current=$,m($))},[]),x=C.useCallback($=>{$!==j.current&&(j.current=$,y($))},[]),w=s||p,b=a||g,k=C.useRef(null),j=C.useRef(null),B=C.useRef(d),E=c!=null,I=HP(c),T=HP(i),N=HP(u),F=C.useCallback(()=>{if(!k.current||!j.current)return;const $={placement:t,strategy:n,middleware:A};T.current&&($.platform=T.current),hke(k.current,j.current,$).then(z=>{const Q={...z,isPositioned:N.current!==!1};L.current&&!uj(B.current,Q)&&(B.current=Q,Hf.flushSync(()=>{h(Q)}))})},[A,t,n,T,N]);t_(()=>{u===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,h($=>({...$,isPositioned:!1})))},[u]);const L=C.useRef(!1);t_(()=>(L.current=!0,()=>{L.current=!1}),[]),t_(()=>{if(w&&(k.current=w),b&&(j.current=b),w&&b){if(I.current)return I.current(w,b,F);F()}},[w,b,F,I,E]);const U=C.useMemo(()=>({reference:k,floating:j,setReference:v,setFloating:x}),[v,x]),H=C.useMemo(()=>({reference:w,floating:b}),[w,b]),K=C.useMemo(()=>{const $={position:n,left:0,top:0};if(!H.floating)return $;const z=q7(H.floating,d.x),Q=q7(H.floating,d.y);return o?{...$,transform:"translate("+z+"px, "+Q+"px)",...cie(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:z,top:Q}},[n,o,H.floating,d.x,d.y]);return C.useMemo(()=>({...d,update:F,refs:U,elements:H,floatingStyles:K}),[d,F,U,H,K])}const mke=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?K7({element:r.current,padding:i}).fn(n):{}:r?K7({element:r,padding:i}).fn(n):{}}}},gke=(e,t)=>({...ake(e),options:[e,t]}),yke=(e,t)=>({...oke(e),options:[e,t]}),vke=(e,t)=>({...dke(e),options:[e,t]}),xke=(e,t)=>({...lke(e),options:[e,t]}),wke=(e,t)=>({...cke(e),options:[e,t]}),bke=(e,t)=>({...uke(e),options:[e,t]}),Cke=(e,t)=>({...mke(e),options:[e,t]});var Ske="Arrow",uie=C.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return l.jsx(ut.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});uie.displayName=Ske;var kke=uie;function k2(e){const[t,n]=C.useState(void 0);return qi(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let a,o;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,o=u.blockSize}else a=e.offsetWidth,o=e.offsetHeight;n({width:a,height:o})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var wU="Popper",[die,i0]=Wi(wU),[_ke,hie]=die(wU),fie=e=>{const{__scopePopper:t,children:n}=e,[r,i]=C.useState(null);return l.jsx(_ke,{scope:t,anchor:r,onAnchorChange:i,children:n})};fie.displayName=wU;var Aie="PopperAnchor",pie=C.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=hie(Aie,n),a=C.useRef(null),o=Qt(t,a);return C.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:l.jsx(ut.div,{...i,ref:o})});pie.displayName=Aie;var bU="PopperContent",[jke,Bke]=die(bU),mie=C.forwardRef((e,t)=>{var Z,de,ue,ae,he,ie;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:A=!1,updatePositionStrategy:f="optimized",onPlaced:p,...m}=e,g=hie(bU,n),[y,v]=C.useState(null),x=Qt(t,Ce=>v(Ce)),[w,b]=C.useState(null),k=k2(w),j=(k==null?void 0:k.width)??0,B=(k==null?void 0:k.height)??0,E=r+(s!=="center"?"-"+s:""),I=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},T=Array.isArray(u)?u:[u],N=T.length>0,F={padding:I,boundary:T.filter(Eke),altBoundary:N},{refs:L,floatingStyles:U,placement:H,isPositioned:K,middlewareData:$}=pke({strategy:"fixed",placement:E,whileElementsMounted:(...Ce)=>ske(...Ce,{animationFrame:f==="always"}),elements:{reference:g.anchor},middleware:[gke({mainAxis:i+B,alignmentAxis:a}),c&&yke({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?vke():void 0,...F}),c&&xke({...F}),wke({...F,apply:({elements:Ce,rects:Oe,availableWidth:te,availableHeight:je})=>{const{width:tt,height:nt}=Oe.reference,Te=Ce.floating.style;Te.setProperty("--radix-popper-available-width",`${te}px`),Te.setProperty("--radix-popper-available-height",`${je}px`),Te.setProperty("--radix-popper-anchor-width",`${tt}px`),Te.setProperty("--radix-popper-anchor-height",`${nt}px`)}}),w&&Cke({element:w,padding:o}),Tke({arrowWidth:j,arrowHeight:B}),A&&bke({strategy:"referenceHidden",...F})]}),[z,Q]=vie(H),oe=$i(p);qi(()=>{K&&(oe==null||oe())},[K,oe]);const R=(Z=$.arrow)==null?void 0:Z.x,M=(de=$.arrow)==null?void 0:de.y,Y=((ue=$.arrow)==null?void 0:ue.centerOffset)!==0,[X,q]=C.useState();return qi(()=>{y&&q(window.getComputedStyle(y).zIndex)},[y]),l.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:K?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[(ae=$.transformOrigin)==null?void 0:ae.x,(he=$.transformOrigin)==null?void 0:he.y].join(" "),...((ie=$.hide)==null?void 0:ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(jke,{scope:n,placedSide:z,onArrowChange:b,arrowX:R,arrowY:M,shouldHideArrow:Y,children:l.jsx(ut.div,{"data-side":z,"data-align":Q,...m,ref:x,style:{...m.style,animation:K?void 0:"none"}})})})});mie.displayName=bU;var gie="PopperArrow",Nke={top:"bottom",right:"left",bottom:"top",left:"right"},yie=C.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=Bke(gie,r),a=Nke[s.placedSide];return l.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:l.jsx(kke,{...i,ref:n,style:{...i.style,display:"block"}})})});yie.displayName=gie;function Eke(e){return e!==null}var Tke=e=>({name:"transformOrigin",options:e,fn(t){var g,y,v;const{placement:n,rects:r,middlewareData:i}=t,a=((g=i.arrow)==null?void 0:g.centerOffset)!==0,o=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[u,d]=vie(n),h={start:"0%",center:"50%",end:"100%"}[d],A=(((y=i.arrow)==null?void 0:y.x)??0)+o/2,f=(((v=i.arrow)==null?void 0:v.y)??0)+c/2;let p="",m="";return u==="bottom"?(p=a?h:`${A}px`,m=`${-c}px`):u==="top"?(p=a?h:`${A}px`,m=`${r.floating.height+c}px`):u==="right"?(p=`${-c}px`,m=a?h:`${f}px`):u==="left"&&(p=`${r.floating.width+c}px`,m=a?h:`${f}px`),{data:{x:p,y:m}}}});function vie(e){const[t,n="center"]=e.split("-");return[t,n]}var CU=fie,yE=pie,SU=mie,kU=yie,[vE,ZTt]=Wi("Tooltip",[i0]),xE=i0(),xie="TooltipProvider",Pke=700,V3="tooltip.open",[Ike,_U]=vE(xie),wie=e=>{const{__scopeTooltip:t,delayDuration:n=Pke,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,a=C.useRef(!0),o=C.useRef(!1),c=C.useRef(0);return C.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),l.jsx(Ike,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:C.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:C.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:o,onPointerInTransitChange:C.useCallback(u=>{o.current=u},[]),disableHoverableContent:i,children:s})};wie.displayName=xie;var Fb="Tooltip",[Oke,wE]=vE(Fb),bie=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:a,delayDuration:o}=e,c=_U(Fb,e.__scopeTooltip),u=xE(t),[d,h]=C.useState(null),A=yl(),f=C.useRef(0),p=a??c.disableHoverableContent,m=o??c.delayDuration,g=C.useRef(!1),[y,v]=ja({prop:r,defaultProp:i??!1,onChange:j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(V3))):c.onClose(),s==null||s(j)},caller:Fb}),x=C.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),w=C.useCallback(()=>{window.clearTimeout(f.current),f.current=0,g.current=!1,v(!0)},[v]),b=C.useCallback(()=>{window.clearTimeout(f.current),f.current=0,v(!1)},[v]),k=C.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{g.current=!0,v(!0),f.current=0},m)},[m,v]);return C.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),l.jsx(CU,{...u,children:l.jsx(Oke,{scope:t,contentId:A,open:y,stateAttribute:x,trigger:d,onTriggerChange:h,onTriggerEnter:C.useCallback(()=>{c.isOpenDelayedRef.current?k():w()},[c.isOpenDelayedRef,k,w]),onTriggerLeave:C.useCallback(()=>{p?b():(window.clearTimeout(f.current),f.current=0)},[b,p]),onOpen:w,onClose:b,disableHoverableContent:p,children:n})})};bie.displayName=Fb;var K3="TooltipTrigger",Cie=C.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=wE(K3,n),s=_U(K3,n),a=xE(n),o=C.useRef(null),c=Qt(t,o,i.onTriggerChange),u=C.useRef(!1),d=C.useRef(!1),h=C.useCallback(()=>u.current=!1,[]);return C.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.jsx(yE,{asChild:!0,...a,children:l.jsx(ut.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:c,onPointerMove:et(e.onPointerMove,A=>{A.pointerType!=="touch"&&!d.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:et(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:et(e.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:et(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:et(e.onBlur,i.onClose),onClick:et(e.onClick,i.onClose)})})});Cie.displayName=K3;var Fke="TooltipPortal",[ePt,Mke]=vE(Fke,{forceMount:void 0}),cv="TooltipContent",Sie=C.forwardRef((e,t)=>{const n=Mke(cv,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,a=wE(cv,e.__scopeTooltip);return l.jsx(ia,{present:r||a.open,children:a.disableHoverableContent?l.jsx(kie,{side:i,...s,ref:t}):l.jsx(Lke,{side:i,...s,ref:t})})}),Lke=C.forwardRef((e,t)=>{const n=wE(cv,e.__scopeTooltip),r=_U(cv,e.__scopeTooltip),i=C.useRef(null),s=Qt(t,i),[a,o]=C.useState(null),{trigger:c,onClose:u}=n,d=i.current,{onPointerInTransitChange:h}=r,A=C.useCallback(()=>{o(null),h(!1)},[h]),f=C.useCallback((p,m)=>{const g=p.currentTarget,y={x:p.clientX,y:p.clientY},v=Qke(y,g.getBoundingClientRect()),x=$ke(y,v),w=zke(m.getBoundingClientRect()),b=Kke([...x,...w]);o(b),h(!0)},[h]);return C.useEffect(()=>()=>A(),[A]),C.useEffect(()=>{if(c&&d){const p=g=>f(g,d),m=g=>f(g,c);return c.addEventListener("pointerleave",p),d.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",p),d.removeEventListener("pointerleave",m)}}},[c,d,f,A]),C.useEffect(()=>{if(a){const p=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},v=(c==null?void 0:c.contains(g))||(d==null?void 0:d.contains(g)),x=!Vke(y,a);v?A():x&&(A(),u())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[c,d,a,u,A]),l.jsx(kie,{...e,ref:s})}),[Rke,Dke]=vE(Fb,{isInside:!1}),Uke=Gne("TooltipContent"),kie=C.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...o}=e,c=wE(cv,n),u=xE(n),{onClose:d}=c;return C.useEffect(()=>(document.addEventListener(V3,d),()=>document.removeEventListener(V3,d)),[d]),C.useEffect(()=>{if(c.trigger){const h=A=>{const f=A.target;f!=null&&f.contains(c.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,d]),l.jsx(Zv,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:l.jsxs(SU,{"data-state":c.stateAttribute,...u,...o,ref:t,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Uke,{children:r}),l.jsx(Rke,{scope:n,isInside:!0,children:l.jsx(K1e,{id:c.contentId,role:"tooltip",children:i||r})})]})})});Sie.displayName=cv;var _ie="TooltipArrow",Hke=C.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=xE(n);return Dke(_ie,n).isInside?null:l.jsx(kU,{...i,...r,ref:t})});Hke.displayName=_ie;function Qke(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function $ke(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function zke(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Vke(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,a=t.length-1;s<t.length;a=s++){const o=t[s],c=t[a],u=o.x,d=o.y,h=c.x,A=c.y;d>r!=A>r&&n<(h-u)*(r-d)/(A-d)+u&&(i=!i)}return i}function Kke(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),qke(t)}function qke(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const s=t[t.length-1],a=t[t.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const s=n[n.length-1],a=n[n.length-2];if((s.x-a.x)*(i.y-a.y)>=(s.y-a.y)*(i.x-a.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Wke=wie,Gke=bie,Yke=Cie,jie=Sie;const jU=Wke,BU=Gke,NU=Yke,bE=C.forwardRef(({className:e,sideOffset:t=4,...n},r)=>l.jsx(jie,{ref:r,sideOffset:t,className:it("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n}));bE.displayName=jie.displayName;var s0=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},qp=typeof window>"u"||"Deno"in globalThis;function ga(){}function Xke(e,t){return typeof e=="function"?e(t):e}function q3(e){return typeof e=="number"&&e>=0&&e!==1/0}function Bie(e,t){return Math.max(e+(t||0)-Date.now(),0)}function cf(e,t){return typeof e=="function"?e(t):e}function rl(e,t){return typeof e=="function"?e(t):e}function W7(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:o}=e;if(a){if(r){if(t.queryHash!==EU(a,t.options))return!1}else if(!Mb(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof o=="boolean"&&t.isStale()!==o||i&&i!==t.state.fetchStatus||s&&!s(t))}function G7(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Wp(t.options.mutationKey)!==Wp(s))return!1}else if(!Mb(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function EU(e,t){return((t==null?void 0:t.queryKeyHashFn)||Wp)(e)}function Wp(e){return JSON.stringify(e,(t,n)=>W3(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Mb(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Mb(e[n],t[n])):!1}function Nie(e,t){if(e===t)return e;const n=Y7(e)&&Y7(t);if(n||W3(e)&&W3(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),a=s.length,o=n?[]:{},c=new Set(r);let u=0;for(let d=0;d<a;d++){const h=n?d:s[d];(!n&&c.has(h)||n)&&e[h]===void 0&&t[h]===void 0?(o[h]=void 0,u++):(o[h]=Nie(e[h],t[h]),o[h]===e[h]&&e[h]!==void 0&&u++)}return i===a&&u===i?e:o}return t}function dj(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Y7(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function W3(e){if(!X7(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!X7(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function X7(e){return Object.prototype.toString.call(e)==="[object Object]"}function Jke(e){return new Promise(t=>{setTimeout(t,e)})}function G3(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Nie(e,t):t}function Zke(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function e_e(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var TU=Symbol();function Eie(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===TU?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Tie(e,t){return typeof e=="function"?e(...t):!!e}var hp,Nh,Qy,See,t_e=(See=class extends s0{constructor(){super();Mt(this,hp);Mt(this,Nh);Mt(this,Qy);st(this,Qy,t=>{if(!qp&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Ae(this,Nh)||this.setEventListener(Ae(this,Qy))}onUnsubscribe(){var t;this.hasListeners()||((t=Ae(this,Nh))==null||t.call(this),st(this,Nh,void 0))}setEventListener(t){var n;st(this,Qy,t),(n=Ae(this,Nh))==null||n.call(this),st(this,Nh,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Ae(this,hp)!==t&&(st(this,hp,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Ae(this,hp)=="boolean"?Ae(this,hp):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},hp=new WeakMap,Nh=new WeakMap,Qy=new WeakMap,See),PU=new t_e,$y,Eh,zy,kee,n_e=(kee=class extends s0{constructor(){super();Mt(this,$y,!0);Mt(this,Eh);Mt(this,zy);st(this,zy,t=>{if(!qp&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Ae(this,Eh)||this.setEventListener(Ae(this,zy))}onUnsubscribe(){var t;this.hasListeners()||((t=Ae(this,Eh))==null||t.call(this),st(this,Eh,void 0))}setEventListener(t){var n;st(this,zy,t),(n=Ae(this,Eh))==null||n.call(this),st(this,Eh,t(this.setOnline.bind(this)))}setOnline(t){Ae(this,$y)!==t&&(st(this,$y,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Ae(this,$y)}},$y=new WeakMap,Eh=new WeakMap,zy=new WeakMap,kee),hj=new n_e;function Y3(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function r_e(e){return Math.min(1e3*2**e,3e4)}function Pie(e){return(e??"online")==="online"?hj.isOnline():!0}var Iie=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function QP(e){return e instanceof Iie}function Oie(e){let t=!1,n=0,r=!1,i;const s=Y3(),a=m=>{var g;r||(A(new Iie(m)),(g=e.abort)==null||g.call(e))},o=()=>{t=!0},c=()=>{t=!1},u=()=>PU.isFocused()&&(e.networkMode==="always"||hj.isOnline())&&e.canRun(),d=()=>Pie(e.networkMode)&&e.canRun(),h=m=>{var g;r||(r=!0,(g=e.onSuccess)==null||g.call(e,m),i==null||i(),s.resolve(m))},A=m=>{var g;r||(r=!0,(g=e.onError)==null||g.call(e,m),i==null||i(),s.reject(m))},f=()=>new Promise(m=>{var g;i=y=>{(r||u())&&m(y)},(g=e.onPause)==null||g.call(e)}).then(()=>{var m;i=void 0,r||(m=e.onContinue)==null||m.call(e)}),p=()=>{if(r)return;let m;const g=n===0?e.initialPromise:void 0;try{m=g??e.fn()}catch(y){m=Promise.reject(y)}Promise.resolve(m).then(h).catch(y=>{var k;if(r)return;const v=e.retry??(qp?0:3),x=e.retryDelay??r_e,w=typeof x=="function"?x(n,y):x,b=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,y);if(t||!b){A(y);return}n++,(k=e.onFail)==null||k.call(e,n,y),Jke(w).then(()=>u()?void 0:f()).then(()=>{t?A(y):p()})})};return{promise:s,cancel:a,continue:()=>(i==null||i(),s),cancelRetry:o,continueRetry:c,canStart:d,start:()=>(d()?p():f().then(p),s)}}var i_e=e=>setTimeout(e,0);function s_e(){let e=[],t=0,n=o=>{o()},r=o=>{o()},i=i_e;const s=o=>{t?e.push(o):i(()=>{n(o)})},a=()=>{const o=e;e=[],o.length&&i(()=>{r(()=>{o.forEach(c=>{n(c)})})})};return{batch:o=>{let c;t++;try{c=o()}finally{t--,t||a()}return c},batchCalls:o=>(...c)=>{s(()=>{o(...c)})},schedule:s,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var Hi=s_e(),fp,_ee,Fie=(_ee=class{constructor(){Mt(this,fp)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),q3(this.gcTime)&&st(this,fp,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(qp?1/0:5*60*1e3))}clearGcTimeout(){Ae(this,fp)&&(clearTimeout(Ae(this,fp)),st(this,fp,void 0))}},fp=new WeakMap,_ee),Vy,Ap,nl,pp,Vs,c2,mp,Xl,$u,jee,a_e=(jee=class extends Fie{constructor(t){super();Mt(this,Xl);Mt(this,Vy);Mt(this,Ap);Mt(this,nl);Mt(this,pp);Mt(this,Vs);Mt(this,c2);Mt(this,mp);st(this,mp,!1),st(this,c2,t.defaultOptions),this.setOptions(t.options),this.observers=[],st(this,pp,t.client),st(this,nl,Ae(this,pp).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,st(this,Vy,o_e(this.options)),this.state=t.state??Ae(this,Vy),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=Ae(this,Vs))==null?void 0:t.promise}setOptions(t){this.options={...Ae(this,c2),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Ae(this,nl).remove(this)}setData(t,n){const r=G3(this.state.data,t,this.options);return An(this,Xl,$u).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){An(this,Xl,$u).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=Ae(this,Vs))==null?void 0:r.promise;return(i=Ae(this,Vs))==null||i.cancel(t),n?n.then(ga).catch(ga):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Ae(this,Vy))}isActive(){return this.observers.some(t=>rl(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===TU||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>cf(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Bie(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Ae(this,Vs))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Ae(this,Vs))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Ae(this,nl).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(Ae(this,Vs)&&(Ae(this,mp)?Ae(this,Vs).cancel({revert:!0}):Ae(this,Vs).cancelRetry()),this.scheduleGc()),Ae(this,nl).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||An(this,Xl,$u).call(this,{type:"invalidate"})}fetch(t,n){var u,d,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Ae(this,Vs))return Ae(this,Vs).continueRetry(),Ae(this,Vs).promise}if(t&&this.setOptions(t),!this.options.queryFn){const A=this.observers.find(f=>f.options.queryFn);A&&this.setOptions(A.options)}const r=new AbortController,i=A=>{Object.defineProperty(A,"signal",{enumerable:!0,get:()=>(st(this,mp,!0),r.signal)})},s=()=>{const A=Eie(this.options,n),p=(()=>{const m={client:Ae(this,pp),queryKey:this.queryKey,meta:this.meta};return i(m),m})();return st(this,mp,!1),this.options.persister?this.options.persister(A,p,this):A(p)},o=(()=>{const A={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Ae(this,pp),state:this.state,fetchFn:s};return i(A),A})();(u=this.options.behavior)==null||u.onFetch(o,this),st(this,Ap,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&An(this,Xl,$u).call(this,{type:"fetch",meta:(h=o.fetchOptions)==null?void 0:h.meta});const c=A=>{var f,p,m,g;QP(A)&&A.silent||An(this,Xl,$u).call(this,{type:"error",error:A}),QP(A)||((p=(f=Ae(this,nl).config).onError)==null||p.call(f,A,this),(g=(m=Ae(this,nl).config).onSettled)==null||g.call(m,this.state.data,A,this)),this.scheduleGc()};return st(this,Vs,Oie({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:A=>{var f,p,m,g;if(A===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(A)}catch(y){c(y);return}(p=(f=Ae(this,nl).config).onSuccess)==null||p.call(f,A,this),(g=(m=Ae(this,nl).config).onSettled)==null||g.call(m,A,this.state.error,this),this.scheduleGc()},onError:c,onFail:(A,f)=>{An(this,Xl,$u).call(this,{type:"failed",failureCount:A,error:f})},onPause:()=>{An(this,Xl,$u).call(this,{type:"pause"})},onContinue:()=>{An(this,Xl,$u).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),Ae(this,Vs).start()}},Vy=new WeakMap,Ap=new WeakMap,nl=new WeakMap,pp=new WeakMap,Vs=new WeakMap,c2=new WeakMap,mp=new WeakMap,Xl=new WeakSet,$u=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Mie(r.data,this.options),fetchMeta:t.meta??null};case"success":return st(this,Ap,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return QP(i)&&i.revert&&Ae(this,Ap)?{...Ae(this,Ap),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Hi.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),Ae(this,nl).notify({query:this,type:"updated",action:t})})},jee);function Mie(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Pie(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function o_e(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Vc,Bee,l_e=(Bee=class extends s0{constructor(t={}){super();Mt(this,Vc);this.config=t,st(this,Vc,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??EU(i,n);let a=this.get(s);return a||(a=new a_e({client:t,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){Ae(this,Vc).has(t.queryHash)||(Ae(this,Vc).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Ae(this,Vc).get(t.queryHash);n&&(t.destroy(),n===t&&Ae(this,Vc).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Hi.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Ae(this,Vc).get(t)}getAll(){return[...Ae(this,Vc).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>W7(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>W7(t,r)):n}notify(t){Hi.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Hi.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Hi.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Vc=new WeakMap,Bee),Kc,fa,gp,qc,lh,Nee,c_e=(Nee=class extends Fie{constructor(t){super();Mt(this,qc);Mt(this,Kc);Mt(this,fa);Mt(this,gp);this.mutationId=t.mutationId,st(this,fa,t.mutationCache),st(this,Kc,[]),this.state=t.state||Lie(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Ae(this,Kc).includes(t)||(Ae(this,Kc).push(t),this.clearGcTimeout(),Ae(this,fa).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){st(this,Kc,Ae(this,Kc).filter(n=>n!==t)),this.scheduleGc(),Ae(this,fa).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Ae(this,Kc).length||(this.state.status==="pending"?this.scheduleGc():Ae(this,fa).remove(this))}continue(){var t;return((t=Ae(this,gp))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,a,o,c,u,d,h,A,f,p,m,g,y,v,x,w,b,k,j,B;const n=()=>{An(this,qc,lh).call(this,{type:"continue"})};st(this,gp,Oie({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,I)=>{An(this,qc,lh).call(this,{type:"failed",failureCount:E,error:I})},onPause:()=>{An(this,qc,lh).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Ae(this,fa).canRun(this)}));const r=this.state.status==="pending",i=!Ae(this,gp).canStart();try{if(r)n();else{An(this,qc,lh).call(this,{type:"pending",variables:t,isPaused:i}),await((a=(s=Ae(this,fa).config).onMutate)==null?void 0:a.call(s,t,this));const I=await((c=(o=this.options).onMutate)==null?void 0:c.call(o,t));I!==this.state.context&&An(this,qc,lh).call(this,{type:"pending",context:I,variables:t,isPaused:i})}const E=await Ae(this,gp).start();return await((d=(u=Ae(this,fa).config).onSuccess)==null?void 0:d.call(u,E,t,this.state.context,this)),await((A=(h=this.options).onSuccess)==null?void 0:A.call(h,E,t,this.state.context)),await((p=(f=Ae(this,fa).config).onSettled)==null?void 0:p.call(f,E,null,this.state.variables,this.state.context,this)),await((g=(m=this.options).onSettled)==null?void 0:g.call(m,E,null,t,this.state.context)),An(this,qc,lh).call(this,{type:"success",data:E}),E}catch(E){try{throw await((v=(y=Ae(this,fa).config).onError)==null?void 0:v.call(y,E,t,this.state.context,this)),await((w=(x=this.options).onError)==null?void 0:w.call(x,E,t,this.state.context)),await((k=(b=Ae(this,fa).config).onSettled)==null?void 0:k.call(b,void 0,E,this.state.variables,this.state.context,this)),await((B=(j=this.options).onSettled)==null?void 0:B.call(j,void 0,E,t,this.state.context)),E}finally{An(this,qc,lh).call(this,{type:"error",error:E})}}finally{Ae(this,fa).runNext(this)}}},Kc=new WeakMap,fa=new WeakMap,gp=new WeakMap,qc=new WeakSet,lh=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Hi.batch(()=>{Ae(this,Kc).forEach(r=>{r.onMutationUpdate(t)}),Ae(this,fa).notify({mutation:this,type:"updated",action:t})})},Nee);function Lie(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Xu,Jl,u2,Eee,u_e=(Eee=class extends s0{constructor(t={}){super();Mt(this,Xu);Mt(this,Jl);Mt(this,u2);this.config=t,st(this,Xu,new Set),st(this,Jl,new Map),st(this,u2,0)}build(t,n,r){const i=new c_e({mutationCache:this,mutationId:++QC(this,u2)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){Ae(this,Xu).add(t);const n=uS(t);if(typeof n=="string"){const r=Ae(this,Jl).get(n);r?r.push(t):Ae(this,Jl).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Ae(this,Xu).delete(t)){const n=uS(t);if(typeof n=="string"){const r=Ae(this,Jl).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&Ae(this,Jl).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=uS(t);if(typeof n=="string"){const r=Ae(this,Jl).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=uS(t);if(typeof n=="string"){const i=(r=Ae(this,Jl).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Hi.batch(()=>{Ae(this,Xu).forEach(t=>{this.notify({type:"removed",mutation:t})}),Ae(this,Xu).clear(),Ae(this,Jl).clear()})}getAll(){return Array.from(Ae(this,Xu))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>G7(n,r))}findAll(t={}){return this.getAll().filter(n=>G7(t,n))}notify(t){Hi.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Hi.batch(()=>Promise.all(t.map(n=>n.continue().catch(ga))))}},Xu=new WeakMap,Jl=new WeakMap,u2=new WeakMap,Eee);function uS(e){var t;return(t=e.options.scope)==null?void 0:t.id}function J7(e){return{onFetch:(t,n)=>{var d,h,A,f,p;const r=t.options,i=(A=(h=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:A.direction,s=((f=t.state.data)==null?void 0:f.pages)||[],a=((p=t.state.data)==null?void 0:p.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let m=!1;const g=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},y=Eie(t.options,t.fetchOptions),v=async(x,w,b)=>{if(m)return Promise.reject();if(w==null&&x.pages.length)return Promise.resolve(x);const j=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:w,direction:b?"backward":"forward",meta:t.options.meta};return g(T),T})(),B=await y(j),{maxPages:E}=t.options,I=b?e_e:Zke;return{pages:I(x.pages,B,E),pageParams:I(x.pageParams,w,E)}};if(i&&s.length){const x=i==="backward",w=x?d_e:Z7,b={pages:s,pageParams:a},k=w(r,b);o=await v(b,k,x)}else{const x=e??s.length;do{const w=c===0?a[0]??r.initialPageParam:Z7(r,o);if(c>0&&w==null)break;o=await v(o,w),c++}while(c<x)}return o};t.options.persister?t.fetchFn=()=>{var m,g;return(g=(m=t.options).persister)==null?void 0:g.call(m,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Z7(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function d_e(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Zr,Th,Ph,Ky,qy,Ih,Wy,Gy,Tee,h_e=(Tee=class{constructor(e={}){Mt(this,Zr);Mt(this,Th);Mt(this,Ph);Mt(this,Ky);Mt(this,qy);Mt(this,Ih);Mt(this,Wy);Mt(this,Gy);st(this,Zr,e.queryCache||new l_e),st(this,Th,e.mutationCache||new u_e),st(this,Ph,e.defaultOptions||{}),st(this,Ky,new Map),st(this,qy,new Map),st(this,Ih,0)}mount(){QC(this,Ih)._++,Ae(this,Ih)===1&&(st(this,Wy,PU.subscribe(async e=>{e&&(await this.resumePausedMutations(),Ae(this,Zr).onFocus())})),st(this,Gy,hj.subscribe(async e=>{e&&(await this.resumePausedMutations(),Ae(this,Zr).onOnline())})))}unmount(){var e,t;QC(this,Ih)._--,Ae(this,Ih)===0&&((e=Ae(this,Wy))==null||e.call(this),st(this,Wy,void 0),(t=Ae(this,Gy))==null||t.call(this),st(this,Gy,void 0))}isFetching(e){return Ae(this,Zr).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Ae(this,Th).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Ae(this,Zr).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Ae(this,Zr).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(cf(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Ae(this,Zr).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=Ae(this,Zr).get(r.queryHash),s=i==null?void 0:i.state.data,a=Xke(t,s);if(a!==void 0)return Ae(this,Zr).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Hi.batch(()=>Ae(this,Zr).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Ae(this,Zr).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Ae(this,Zr);Hi.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Ae(this,Zr);return Hi.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Hi.batch(()=>Ae(this,Zr).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(ga).catch(ga)}invalidateQueries(e,t={}){return Hi.batch(()=>(Ae(this,Zr).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Hi.batch(()=>Ae(this,Zr).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(ga)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(ga)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Ae(this,Zr).build(this,t);return n.isStaleByTime(cf(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ga).catch(ga)}fetchInfiniteQuery(e){return e.behavior=J7(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ga).catch(ga)}ensureInfiniteQueryData(e){return e.behavior=J7(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return hj.isOnline()?Ae(this,Th).resumePausedMutations():Promise.resolve()}getQueryCache(){return Ae(this,Zr)}getMutationCache(){return Ae(this,Th)}getDefaultOptions(){return Ae(this,Ph)}setDefaultOptions(e){st(this,Ph,e)}setQueryDefaults(e,t){Ae(this,Ky).set(Wp(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Ae(this,Ky).values()],n={};return t.forEach(r=>{Mb(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){Ae(this,qy).set(Wp(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Ae(this,qy).values()],n={};return t.forEach(r=>{Mb(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Ae(this,Ph).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=EU(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===TU&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Ae(this,Ph).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Ae(this,Zr).clear(),Ae(this,Th).clear()}},Zr=new WeakMap,Th=new WeakMap,Ph=new WeakMap,Ky=new WeakMap,qy=new WeakMap,Ih=new WeakMap,Wy=new WeakMap,Gy=new WeakMap,Tee),Ra,kn,d2,Aa,yp,Yy,Oh,Fh,h2,Xy,Jy,vp,xp,Mh,Zy,Vn,Zx,X3,J3,Z3,eF,tF,nF,rF,Rie,Pee,f_e=(Pee=class extends s0{constructor(t,n){super();Mt(this,Vn);Mt(this,Ra);Mt(this,kn);Mt(this,d2);Mt(this,Aa);Mt(this,yp);Mt(this,Yy);Mt(this,Oh);Mt(this,Fh);Mt(this,h2);Mt(this,Xy);Mt(this,Jy);Mt(this,vp);Mt(this,xp);Mt(this,Mh);Mt(this,Zy,new Set);this.options=n,st(this,Ra,t),st(this,Fh,null),st(this,Oh,Y3()),this.options.experimental_prefetchInRender||Ae(this,Oh).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Ae(this,kn).addObserver(this),ez(Ae(this,kn),this.options)?An(this,Vn,Zx).call(this):this.updateResult(),An(this,Vn,eF).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return iF(Ae(this,kn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return iF(Ae(this,kn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,An(this,Vn,tF).call(this),An(this,Vn,nF).call(this),Ae(this,kn).removeObserver(this)}setOptions(t){const n=this.options,r=Ae(this,kn);if(this.options=Ae(this,Ra).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof rl(this.options.enabled,Ae(this,kn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");An(this,Vn,rF).call(this),Ae(this,kn).setOptions(this.options),n._defaulted&&!dj(this.options,n)&&Ae(this,Ra).getQueryCache().notify({type:"observerOptionsUpdated",query:Ae(this,kn),observer:this});const i=this.hasListeners();i&&tz(Ae(this,kn),r,this.options,n)&&An(this,Vn,Zx).call(this),this.updateResult(),i&&(Ae(this,kn)!==r||rl(this.options.enabled,Ae(this,kn))!==rl(n.enabled,Ae(this,kn))||cf(this.options.staleTime,Ae(this,kn))!==cf(n.staleTime,Ae(this,kn)))&&An(this,Vn,X3).call(this);const s=An(this,Vn,J3).call(this);i&&(Ae(this,kn)!==r||rl(this.options.enabled,Ae(this,kn))!==rl(n.enabled,Ae(this,kn))||s!==Ae(this,Mh))&&An(this,Vn,Z3).call(this,s)}getOptimisticResult(t){const n=Ae(this,Ra).getQueryCache().build(Ae(this,Ra),t),r=this.createResult(n,t);return p_e(this,r)&&(st(this,Aa,r),st(this,Yy,this.options),st(this,yp,Ae(this,kn).state)),r}getCurrentResult(){return Ae(this,Aa)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),Reflect.get(r,i))})}trackProp(t){Ae(this,Zy).add(t)}getCurrentQuery(){return Ae(this,kn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Ae(this,Ra).defaultQueryOptions(t),r=Ae(this,Ra).getQueryCache().build(Ae(this,Ra),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return An(this,Vn,Zx).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Ae(this,Aa)))}createResult(t,n){var E;const r=Ae(this,kn),i=this.options,s=Ae(this,Aa),a=Ae(this,yp),o=Ae(this,Yy),u=t!==r?t.state:Ae(this,d2),{state:d}=t;let h={...d},A=!1,f;if(n._optimisticResults){const I=this.hasListeners(),T=!I&&ez(t,n),N=I&&tz(t,r,n,i);(T||N)&&(h={...h,...Mie(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:g}=h;f=h.data;let y=!1;if(n.placeholderData!==void 0&&f===void 0&&g==="pending"){let I;s!=null&&s.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(I=s.data,y=!0):I=typeof n.placeholderData=="function"?n.placeholderData((E=Ae(this,Jy))==null?void 0:E.state.data,Ae(this,Jy)):n.placeholderData,I!==void 0&&(g="success",f=G3(s==null?void 0:s.data,I,n),A=!0)}if(n.select&&f!==void 0&&!y)if(s&&f===(a==null?void 0:a.data)&&n.select===Ae(this,h2))f=Ae(this,Xy);else try{st(this,h2,n.select),f=n.select(f),f=G3(s==null?void 0:s.data,f,n),st(this,Xy,f),st(this,Fh,null)}catch(I){st(this,Fh,I)}Ae(this,Fh)&&(p=Ae(this,Fh),f=Ae(this,Xy),m=Date.now(),g="error");const v=h.fetchStatus==="fetching",x=g==="pending",w=g==="error",b=x&&v,k=f!==void 0,B={status:g,fetchStatus:h.fetchStatus,isPending:x,isSuccess:g==="success",isError:w,isInitialLoading:b,isLoading:b,data:f,dataUpdatedAt:h.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!x,isLoadingError:w&&!k,isPaused:h.fetchStatus==="paused",isPlaceholderData:A,isRefetchError:w&&k,isStale:IU(t,n),refetch:this.refetch,promise:Ae(this,Oh),isEnabled:rl(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const I=F=>{B.status==="error"?F.reject(B.error):B.data!==void 0&&F.resolve(B.data)},T=()=>{const F=st(this,Oh,B.promise=Y3());I(F)},N=Ae(this,Oh);switch(N.status){case"pending":t.queryHash===r.queryHash&&I(N);break;case"fulfilled":(B.status==="error"||B.data!==N.value)&&T();break;case"rejected":(B.status!=="error"||B.error!==N.reason)&&T();break}}return B}updateResult(){const t=Ae(this,Aa),n=this.createResult(Ae(this,kn),this.options);if(st(this,yp,Ae(this,kn).state),st(this,Yy,this.options),Ae(this,yp).data!==void 0&&st(this,Jy,Ae(this,kn)),dj(n,t))return;st(this,Aa,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!Ae(this,Zy).size)return!0;const a=new Set(s??Ae(this,Zy));return this.options.throwOnError&&a.add("error"),Object.keys(Ae(this,Aa)).some(o=>{const c=o;return Ae(this,Aa)[c]!==t[c]&&a.has(c)})};An(this,Vn,Rie).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&An(this,Vn,eF).call(this)}},Ra=new WeakMap,kn=new WeakMap,d2=new WeakMap,Aa=new WeakMap,yp=new WeakMap,Yy=new WeakMap,Oh=new WeakMap,Fh=new WeakMap,h2=new WeakMap,Xy=new WeakMap,Jy=new WeakMap,vp=new WeakMap,xp=new WeakMap,Mh=new WeakMap,Zy=new WeakMap,Vn=new WeakSet,Zx=function(t){An(this,Vn,rF).call(this);let n=Ae(this,kn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ga)),n},X3=function(){An(this,Vn,tF).call(this);const t=cf(this.options.staleTime,Ae(this,kn));if(qp||Ae(this,Aa).isStale||!q3(t))return;const r=Bie(Ae(this,Aa).dataUpdatedAt,t)+1;st(this,vp,setTimeout(()=>{Ae(this,Aa).isStale||this.updateResult()},r))},J3=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Ae(this,kn)):this.options.refetchInterval)??!1},Z3=function(t){An(this,Vn,nF).call(this),st(this,Mh,t),!(qp||rl(this.options.enabled,Ae(this,kn))===!1||!q3(Ae(this,Mh))||Ae(this,Mh)===0)&&st(this,xp,setInterval(()=>{(this.options.refetchIntervalInBackground||PU.isFocused())&&An(this,Vn,Zx).call(this)},Ae(this,Mh)))},eF=function(){An(this,Vn,X3).call(this),An(this,Vn,Z3).call(this,An(this,Vn,J3).call(this))},tF=function(){Ae(this,vp)&&(clearTimeout(Ae(this,vp)),st(this,vp,void 0))},nF=function(){Ae(this,xp)&&(clearInterval(Ae(this,xp)),st(this,xp,void 0))},rF=function(){const t=Ae(this,Ra).getQueryCache().build(Ae(this,Ra),this.options);if(t===Ae(this,kn))return;const n=Ae(this,kn);st(this,kn,t),st(this,d2,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Rie=function(t){Hi.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Ae(this,Aa))}),Ae(this,Ra).getQueryCache().notify({query:Ae(this,kn),type:"observerResultsUpdated"})})},Pee);function A_e(e,t){return rl(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ez(e,t){return A_e(e,t)||e.state.data!==void 0&&iF(e,t,t.refetchOnMount)}function iF(e,t,n){if(rl(t.enabled,e)!==!1&&cf(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&IU(e,t)}return!1}function tz(e,t,n,r){return(e!==t||rl(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&IU(e,n)}function IU(e,t){return rl(t.enabled,e)!==!1&&e.isStaleByTime(cf(t.staleTime,e))}function p_e(e,t){return!dj(e.getCurrentResult(),t)}var Lh,Rh,Da,Ju,fd,n_,sF,Iee,m_e=(Iee=class extends s0{constructor(n,r){super();Mt(this,fd);Mt(this,Lh);Mt(this,Rh);Mt(this,Da);Mt(this,Ju);st(this,Lh,n),this.setOptions(r),this.bindMethods(),An(this,fd,n_).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=Ae(this,Lh).defaultMutationOptions(n),dj(this.options,r)||Ae(this,Lh).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Ae(this,Da),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Wp(r.mutationKey)!==Wp(this.options.mutationKey)?this.reset():((i=Ae(this,Da))==null?void 0:i.state.status)==="pending"&&Ae(this,Da).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=Ae(this,Da))==null||n.removeObserver(this)}onMutationUpdate(n){An(this,fd,n_).call(this),An(this,fd,sF).call(this,n)}getCurrentResult(){return Ae(this,Rh)}reset(){var n;(n=Ae(this,Da))==null||n.removeObserver(this),st(this,Da,void 0),An(this,fd,n_).call(this),An(this,fd,sF).call(this)}mutate(n,r){var i;return st(this,Ju,r),(i=Ae(this,Da))==null||i.removeObserver(this),st(this,Da,Ae(this,Lh).getMutationCache().build(Ae(this,Lh),this.options)),Ae(this,Da).addObserver(this),Ae(this,Da).execute(n)}},Lh=new WeakMap,Rh=new WeakMap,Da=new WeakMap,Ju=new WeakMap,fd=new WeakSet,n_=function(){var r;const n=((r=Ae(this,Da))==null?void 0:r.state)??Lie();st(this,Rh,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},sF=function(n){Hi.batch(()=>{var r,i,s,a,o,c,u,d;if(Ae(this,Ju)&&this.hasListeners()){const h=Ae(this,Rh).variables,A=Ae(this,Rh).context;(n==null?void 0:n.type)==="success"?((i=(r=Ae(this,Ju)).onSuccess)==null||i.call(r,n.data,h,A),(a=(s=Ae(this,Ju)).onSettled)==null||a.call(s,n.data,null,h,A)):(n==null?void 0:n.type)==="error"&&((c=(o=Ae(this,Ju)).onError)==null||c.call(o,n.error,h,A),(d=(u=Ae(this,Ju)).onSettled)==null||d.call(u,void 0,n.error,h,A))}this.listeners.forEach(h=>{h(Ae(this,Rh))})})},Iee),Die=C.createContext(void 0),cs=e=>{const t=C.useContext(Die);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},g_e=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(Die.Provider,{value:e,children:t})),Uie=C.createContext(!1),y_e=()=>C.useContext(Uie);Uie.Provider;function v_e(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var x_e=C.createContext(v_e()),w_e=()=>C.useContext(x_e),b_e=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},C_e=e=>{C.useEffect(()=>{e.clearReset()},[e])},S_e=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Tie(n,[e.error,r])),k_e=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},__e=(e,t)=>e.isLoading&&e.isFetching&&!t,j_e=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,nz=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function B_e(e,t,n){var h,A,f,p,m;const r=y_e(),i=w_e(),s=cs(),a=s.defaultQueryOptions(e);(A=(h=s.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||A.call(h,a),a._optimisticResults=r?"isRestoring":"optimistic",k_e(a),b_e(a,i),C_e(i);const o=!s.getQueryCache().get(a.queryHash),[c]=C.useState(()=>new t(s,a)),u=c.getOptimisticResult(a),d=!r&&e.subscribed!==!1;if(C.useSyncExternalStore(C.useCallback(g=>{const y=d?c.subscribe(Hi.batchCalls(g)):ga;return c.updateResult(),y},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),C.useEffect(()=>{c.setOptions(a)},[a,c]),j_e(a,u))throw nz(a,c,i);if(S_e({result:u,errorResetBoundary:i,throwOnError:a.throwOnError,query:s.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((p=(f=s.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||p.call(f,a,u),a.experimental_prefetchInRender&&!qp&&__e(u,r)){const g=o?nz(a,c,i):(m=s.getQueryCache().get(a.queryHash))==null?void 0:m.promise;g==null||g.catch(ga).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?u:c.trackResult(u)}function gr(e,t){return B_e(e,f_e)}function Is(e,t){const n=cs(),[r]=C.useState(()=>new m_e(n,e));C.useEffect(()=>{r.setOptions(e)},[r,e]);const i=C.useSyncExternalStore(C.useCallback(a=>r.subscribe(Hi.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=C.useCallback((a,o)=>{r.mutate(a,o).catch(ga)},[r]);if(i.error&&Tie(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}/**
 * @remix-run/router v1.23.0
 *
 * 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 Lb(){return Lb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lb.apply(this,arguments)}var Qh;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qh||(Qh={}));const rz="popstate";function N_e(e){e===void 0&&(e={});function t(r,i){let{pathname:s,search:a,hash:o}=r.location;return aF("",{pathname:s,search:a,hash:o},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:fj(i)}return T_e(t,n,null,e)}function yi(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Hie(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function E_e(){return Math.random().toString(36).substr(2,8)}function iz(e,t){return{usr:e.state,key:e.key,idx:t}}function aF(e,t,n,r){return n===void 0&&(n=null),Lb({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?a0(t):t,{state:n,key:t&&t.key||r||E_e()})}function fj(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function a0(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function T_e(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,a=i.history,o=Qh.Pop,c=null,u=d();u==null&&(u=0,a.replaceState(Lb({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function h(){o=Qh.Pop;let g=d(),y=g==null?null:g-u;u=g,c&&c({action:o,location:m.location,delta:y})}function A(g,y){o=Qh.Push;let v=aF(m.location,g,y);u=d()+1;let x=iz(v,u),w=m.createHref(v);try{a.pushState(x,"",w)}catch(b){if(b instanceof DOMException&&b.name==="DataCloneError")throw b;i.location.assign(w)}s&&c&&c({action:o,location:m.location,delta:1})}function f(g,y){o=Qh.Replace;let v=aF(m.location,g,y);u=d();let x=iz(v,u),w=m.createHref(v);a.replaceState(x,"",w),s&&c&&c({action:o,location:m.location,delta:0})}function p(g){let y=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof g=="string"?g:fj(g);return v=v.replace(/ $/,"%20"),yi(y,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,y)}let m={get action(){return o},get location(){return e(i,a)},listen(g){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(rz,h),c=g,()=>{i.removeEventListener(rz,h),c=null}},createHref(g){return t(i,g)},createURL:p,encodeLocation(g){let y=p(g);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:A,replace:f,go(g){return a.go(g)}};return m}var sz;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(sz||(sz={}));function P_e(e,t,n){return n===void 0&&(n="/"),I_e(e,t,n,!1)}function I_e(e,t,n,r){let i=typeof t=="string"?a0(t):t,s=OU(i.pathname||"/",n);if(s==null)return null;let a=Qie(e);O_e(a);let o=null;for(let c=0;o==null&&c<a.length;++c){let u=V_e(s);o=$_e(a[c],u,r)}return o}function Qie(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,a,o)=>{let c={relativePath:o===void 0?s.path||"":o,caseSensitive:s.caseSensitive===!0,childrenIndex:a,route:s};c.relativePath.startsWith("/")&&(yi(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=uf([r,c.relativePath]),d=n.concat(c);s.children&&s.children.length>0&&(yi(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Qie(s.children,t,d,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:H_e(u,s.index),routesMeta:d})};return e.forEach((s,a)=>{var o;if(s.path===""||!((o=s.path)!=null&&o.includes("?")))i(s,a);else for(let c of $ie(s.path))i(s,a,c)}),t}function $ie(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let a=$ie(r.join("/")),o=[];return o.push(...a.map(c=>c===""?s:[s,c].join("/"))),i&&o.push(...a),o.map(c=>e.startsWith("/")&&c===""?"/":c)}function O_e(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Q_e(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const F_e=/^:[\w-]+$/,M_e=3,L_e=2,R_e=1,D_e=10,U_e=-2,az=e=>e==="*";function H_e(e,t){let n=e.split("/"),r=n.length;return n.some(az)&&(r+=U_e),t&&(r+=L_e),n.filter(i=>!az(i)).reduce((i,s)=>i+(F_e.test(s)?M_e:s===""?R_e:D_e),r)}function Q_e(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function $_e(e,t,n){let{routesMeta:r}=e,i={},s="/",a=[];for(let o=0;o<r.length;++o){let c=r[o],u=o===r.length-1,d=s==="/"?t:t.slice(s.length)||"/",h=oz({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),A=c.route;if(!h&&u&&n&&!r[r.length-1].route.index&&(h=oz({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!h)return null;Object.assign(i,h.params),a.push({params:i,pathname:uf([s,h.pathname]),pathnameBase:G_e(uf([s,h.pathnameBase])),route:A}),h.pathnameBase!=="/"&&(s=uf([s,h.pathnameBase]))}return a}function oz(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=z_e(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],a=s.replace(/(.)\/+$/,"$1"),o=i.slice(1);return{params:r.reduce((u,d,h)=>{let{paramName:A,isOptional:f}=d;if(A==="*"){let m=o[h]||"";a=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}const p=o[h];return f&&!p?u[A]=void 0:u[A]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:a,pattern:e}}function z_e(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Hie(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,c)=>(r.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function V_e(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Hie(!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 OU(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function K_e(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?a0(e):e;return{pathname:n?n.startsWith("/")?n:q_e(n,t):t,search:Y_e(r),hash:X_e(i)}}function q_e(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function $P(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"].  Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function W_e(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function FU(e,t){let n=W_e(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function MU(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=a0(e):(i=Lb({},e),yi(!i.pathname||!i.pathname.includes("?"),$P("?","pathname","search",i)),yi(!i.pathname||!i.pathname.includes("#"),$P("#","pathname","hash",i)),yi(!i.search||!i.search.includes("#"),$P("#","search","hash",i)));let s=e===""||i.pathname==="",a=s?"/":i.pathname,o;if(a==null)o=n;else{let h=t.length-1;if(!r&&a.startsWith("..")){let A=a.split("/");for(;A[0]==="..";)A.shift(),h-=1;i.pathname=A.join("/")}o=h>=0?t[h]:"/"}let c=K_e(i,o),u=a&&a!=="/"&&a.endsWith("/"),d=(s||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const uf=e=>e.join("/").replace(/\/\/+/g,"/"),G_e=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Y_e=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,X_e=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function J_e(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const zie=["post","put","patch","delete"];new Set(zie);const Z_e=["get",...zie];new Set(Z_e);/**
 * React Router v6.30.1
 *
 * 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 Rb(){return Rb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rb.apply(this,arguments)}const LU=C.createContext(null),eje=C.createContext(null),$f=C.createContext(null),CE=C.createContext(null),Bd=C.createContext({outlet:null,matches:[],isDataRoute:!1}),Vie=C.createContext(null);function tje(e,t){let{relative:n}=t===void 0?{}:t;o0()||yi(!1);let{basename:r,navigator:i}=C.useContext($f),{hash:s,pathname:a,search:o}=qie(e,{relative:n}),c=a;return r!=="/"&&(c=a==="/"?r:uf([r,a])),i.createHref({pathname:c,search:o,hash:s})}function o0(){return C.useContext(CE)!=null}function ro(){return o0()||yi(!1),C.useContext(CE).location}function Kie(e){C.useContext($f).static||C.useLayoutEffect(e)}function El(){let{isDataRoute:e}=C.useContext(Bd);return e?Aje():nje()}function nje(){o0()||yi(!1);let e=C.useContext(LU),{basename:t,future:n,navigator:r}=C.useContext($f),{matches:i}=C.useContext(Bd),{pathname:s}=ro(),a=JSON.stringify(FU(i,n.v7_relativeSplatPath)),o=C.useRef(!1);return Kie(()=>{o.current=!0}),C.useCallback(function(u,d){if(d===void 0&&(d={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let h=MU(u,JSON.parse(a),s,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:uf([t,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[t,r,a,s,e])}function mm(){let{matches:e}=C.useContext(Bd),t=e[e.length-1];return t?t.params:{}}function qie(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=C.useContext($f),{matches:i}=C.useContext(Bd),{pathname:s}=ro(),a=JSON.stringify(FU(i,r.v7_relativeSplatPath));return C.useMemo(()=>MU(e,JSON.parse(a),s,n==="path"),[e,a,s,n])}function rje(e,t){return ije(e,t)}function ije(e,t,n,r){o0()||yi(!1);let{navigator:i}=C.useContext($f),{matches:s}=C.useContext(Bd),a=s[s.length-1],o=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let u=ro(),d;if(t){var h;let g=typeof t=="string"?a0(t):t;c==="/"||(h=g.pathname)!=null&&h.startsWith(c)||yi(!1),d=g}else d=u;let A=d.pathname||"/",f=A;if(c!=="/"){let g=c.replace(/^\//,"").split("/");f="/"+A.replace(/^\//,"").split("/").slice(g.length).join("/")}let p=P_e(e,{pathname:f}),m=cje(p&&p.map(g=>Object.assign({},g,{params:Object.assign({},o,g.params),pathname:uf([c,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?c:uf([c,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),s,n,r);return t&&m?C.createElement(CE.Provider,{value:{location:Rb({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Qh.Pop}},m):m}function sje(){let e=fje(),t=J_e(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},t),n?C.createElement("pre",{style:i},n):null,null)}const aje=C.createElement(sje,null);class oje extends C.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?C.createElement(Bd.Provider,{value:this.props.routeContext},C.createElement(Vie.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function lje(e){let{routeContext:t,match:n,children:r}=e,i=C.useContext(LU);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),C.createElement(Bd.Provider,{value:t},r)}function cje(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=(i=n)==null?void 0:i.errors;if(o!=null){let d=a.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);d>=0||yi(!1),a=a.slice(0,Math.min(a.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<a.length;d++){let h=a[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:A,errors:f}=n,p=h.route.loader&&A[h.route.id]===void 0&&(!f||f[h.route.id]===void 0);if(h.route.lazy||p){c=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,h,A)=>{let f,p=!1,m=null,g=null;n&&(f=o&&h.route.id?o[h.route.id]:void 0,m=h.route.errorElement||aje,c&&(u<0&&A===0?(p=!0,g=null):u===A&&(p=!0,g=h.route.hydrateFallbackElement||null)));let y=t.concat(a.slice(0,A+1)),v=()=>{let x;return f?x=m:p?x=g:h.route.Component?x=C.createElement(h.route.Component,null):h.route.element?x=h.route.element:x=d,C.createElement(lje,{match:h,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:x})};return n&&(h.route.ErrorBoundary||h.route.errorElement||A===0)?C.createElement(oje,{location:n.location,revalidation:n.revalidation,component:m,error:f,children:v(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):v()},null)}var Wie=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Wie||{}),Aj=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}(Aj||{});function uje(e){let t=C.useContext(LU);return t||yi(!1),t}function dje(e){let t=C.useContext(eje);return t||yi(!1),t}function hje(e){let t=C.useContext(Bd);return t||yi(!1),t}function Gie(e){let t=hje(),n=t.matches[t.matches.length-1];return n.route.id||yi(!1),n.route.id}function fje(){var e;let t=C.useContext(Vie),n=dje(Aj.UseRouteError),r=Gie(Aj.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Aje(){let{router:e}=uje(Wie.UseNavigateStable),t=Gie(Aj.UseNavigateStable),n=C.useRef(!1);return Kie(()=>{n.current=!0}),C.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Rb({fromRouteId:t},s)))},[e,t])}function pje(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function SE(e){let{to:t,replace:n,state:r,relative:i}=e;o0()||yi(!1);let{future:s,static:a}=C.useContext($f),{matches:o}=C.useContext(Bd),{pathname:c}=ro(),u=El(),d=MU(t,FU(o,s.v7_relativeSplatPath),c,i==="path"),h=JSON.stringify(d);return C.useEffect(()=>u(JSON.parse(h),{replace:n,state:r,relative:i}),[u,h,i,n,r]),null}function Nt(e){yi(!1)}function mje(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Qh.Pop,navigator:s,static:a=!1,future:o}=e;o0()&&yi(!1);let c=t.replace(/^\/*/,"/"),u=C.useMemo(()=>({basename:c,navigator:s,static:a,future:Rb({v7_relativeSplatPath:!1},o)}),[c,o,s,a]);typeof r=="string"&&(r=a0(r));let{pathname:d="/",search:h="",hash:A="",state:f=null,key:p="default"}=r,m=C.useMemo(()=>{let g=OU(d,c);return g==null?null:{location:{pathname:g,search:h,hash:A,state:f,key:p},navigationType:i}},[c,d,h,A,f,p,i]);return m==null?null:C.createElement($f.Provider,{value:u},C.createElement(CE.Provider,{children:n,value:m}))}function gje(e){let{children:t,location:n}=e;return rje(oF(t),n)}new Promise(()=>{});function oF(e,t){t===void 0&&(t=[]);let n=[];return C.Children.forEach(e,(r,i)=>{if(!C.isValidElement(r))return;let s=[...t,i];if(r.type===C.Fragment){n.push.apply(n,oF(r.props.children,s));return}r.type!==Nt&&yi(!1),!r.props.index||!r.props.children||yi(!1);let a={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=oF(r.props.children,s)),n.push(a)}),n}/**
 * React Router DOM v6.30.1
 *
 * 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 lF(){return lF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lF.apply(this,arguments)}function yje(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function vje(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xje(e,t){return e.button===0&&(!t||t==="_self")&&!vje(e)}function cF(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function wje(e,t){let n=cF(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}const bje=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Cje="6";try{window.__reactRouterVersion=Cje}catch{}const Sje="startTransition",lz=fD[Sje];function kje(e){let{basename:t,children:n,future:r,window:i}=e,s=C.useRef();s.current==null&&(s.current=N_e({window:i,v5Compat:!0}));let a=s.current,[o,c]=C.useState({action:a.action,location:a.location}),{v7_startTransition:u}=r||{},d=C.useCallback(h=>{u&&lz?lz(()=>c(h)):c(h)},[c,u]);return C.useLayoutEffect(()=>a.listen(d),[a,d]),C.useEffect(()=>pje(r),[r]),C.createElement(mje,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:a,future:r})}const _je=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jje=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,At=C.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:a,state:o,target:c,to:u,preventScrollReset:d,viewTransition:h}=t,A=yje(t,bje),{basename:f}=C.useContext($f),p,m=!1;if(typeof u=="string"&&jje.test(u)&&(p=u,_je))try{let x=new URL(window.location.href),w=u.startsWith("//")?new URL(x.protocol+u):new URL(u),b=OU(w.pathname,f);w.origin===x.origin&&b!=null?u=b+w.search+w.hash:m=!0}catch{}let g=tje(u,{relative:i}),y=Bje(u,{replace:a,state:o,target:c,preventScrollReset:d,relative:i,viewTransition:h});function v(x){r&&r(x),x.defaultPrevented||y(x)}return C.createElement("a",lF({},A,{href:p||g,onClick:m||s?r:v,ref:n,target:c}))});var cz;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(cz||(cz={}));var uz;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(uz||(uz={}));function Bje(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:a,viewTransition:o}=t===void 0?{}:t,c=El(),u=ro(),d=qie(e,{relative:a});return C.useCallback(h=>{if(xje(h,n)){h.preventDefault();let A=r!==void 0?r:fj(u)===fj(d);c(e,{replace:A,state:i,preventScrollReset:s,relative:a,viewTransition:o})}},[u,c,d,r,i,n,e,s,a,o])}function Yie(e){let t=C.useRef(cF(e)),n=C.useRef(!1),r=ro(),i=C.useMemo(()=>wje(r.search,n.current?null:t.current),[r.search]),s=El(),a=C.useCallback((o,c)=>{const u=cF(typeof o=="function"?o(i):o);n.current=!0,s("?"+u,c)},[s,i]);return[i,a]}var Nje=typeof Element<"u",Eje=typeof Map=="function",Tje=typeof Set=="function",Pje=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function r_(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!r_(e[r],t[r]))return!1;return!0}var s;if(Eje&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(s=e.entries();!(r=s.next()).done;)if(!t.has(r.value[0]))return!1;for(s=e.entries();!(r=s.next()).done;)if(!r_(r.value[1],t.get(r.value[0])))return!1;return!0}if(Tje&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(s=e.entries();!(r=s.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(Pje&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(Nje&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!r_(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var Ije=function(t,n){try{return r_(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const Oje=In(Ije);var Fje=function(e,t,n,r,i,s,a,o){if(!e){var c;if(t===void 0)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,s,a,o],d=0;c=new Error(t.replace(/%s/g,function(){return u[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}},Mje=Fje;const dz=In(Mje);var Lje=function(t,n,r,i){var s=r?r.call(i,t,n):void 0;if(s!==void 0)return!!s;if(t===n)return!0;if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var a=Object.keys(t),o=Object.keys(n);if(a.length!==o.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(n),u=0;u<a.length;u++){var d=a[u];if(!c(d))return!1;var h=t[d],A=n[d];if(s=r?r.call(i,h,A,d):void 0,s===!1||s===void 0&&h!==A)return!1}return!0};const Rje=In(Lje);var Xie=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(Xie||{}),zP={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},hz=Object.values(Xie),RU={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},Dje=Object.entries(RU).reduce((e,[t,n])=>(e[n]=t,e),{}),oc="data-rh",xy={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},wy=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},Uje=e=>{let t=wy(e,"title");const n=wy(e,xy.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=wy(e,xy.DEFAULT_TITLE);return t||r||void 0},Hje=e=>wy(e,xy.ON_CHANGE_CLIENT_STATE)||(()=>{}),VP=(e,t)=>t.filter(n=>typeof n[e]<"u").map(n=>n[e]).reduce((n,r)=>({...n,...r}),{}),Qje=(e,t)=>t.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const i=Object.keys(r);for(let s=0;s<i.length;s+=1){const o=i[s].toLowerCase();if(e.indexOf(o)!==-1&&r[o])return n.concat(r)}}return n},[]),$je=e=>console&&typeof console.warn=="function"&&console.warn(e),yx=(e,t,n)=>{const r={};return n.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&$je(`Helmet: ${e} should be of type "Array". Instead found type "${typeof i[e]}"`),!1)).map(i=>i[e]).reverse().reduce((i,s)=>{const a={};s.filter(c=>{let u;const d=Object.keys(c);for(let A=0;A<d.length;A+=1){const f=d[A],p=f.toLowerCase();t.indexOf(p)!==-1&&!(u==="rel"&&c[u].toLowerCase()==="canonical")&&!(p==="rel"&&c[p].toLowerCase()==="stylesheet")&&(u=p),t.indexOf(f)!==-1&&(f==="innerHTML"||f==="cssText"||f==="itemprop")&&(u=f)}if(!u||!c[u])return!1;const h=c[u].toLowerCase();return r[u]||(r[u]={}),a[u]||(a[u]={}),r[u][h]?!1:(a[u][h]=!0,!0)}).reverse().forEach(c=>i.push(c));const o=Object.keys(a);for(let c=0;c<o.length;c+=1){const u=o[c],d={...r[u],...a[u]};r[u]=d}return i},[]).reverse()},zje=(e,t)=>{if(Array.isArray(e)&&e.length){for(let n=0;n<e.length;n+=1)if(e[n][t])return!0}return!1},Vje=e=>({baseTag:Qje(["href"],e),bodyAttributes:VP("bodyAttributes",e),defer:wy(e,xy.DEFER),encode:wy(e,xy.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:VP("htmlAttributes",e),linkTags:yx("link",["rel","href"],e),metaTags:yx("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:yx("noscript",["innerHTML"],e),onChangeClientState:Hje(e),scriptTags:yx("script",["src","innerHTML"],e),styleTags:yx("style",["cssText"],e),title:Uje(e),titleAttributes:VP("titleAttributes",e),prioritizeSeoTags:zje(e,xy.PRIORITIZE_SEO_TAGS)}),Jie=e=>Array.isArray(e)?e.join(""):e,Kje=(e,t)=>{const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1},KP=(e,t)=>Array.isArray(e)?e.reduce((n,r)=>(Kje(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},fz=(e,t)=>({...e,[t]:void 0}),qje=["noscript","script","style"],uF=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),Zie=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),Wje=(e,t,n,r)=>{const i=Zie(n),s=Jie(t);return i?`<${e} ${oc}="true" ${i}>${uF(s,r)}</${e}>`:`<${e} ${oc}="true">${uF(s,r)}</${e}>`},Gje=(e,t,n=!0)=>t.reduce((r,i)=>{const s=i,a=Object.keys(s).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,d)=>{const h=typeof s[d]>"u"?d:`${d}="${uF(s[d],n)}"`;return u?`${u} ${h}`:h},""),o=s.innerHTML||s.cssText||"",c=qje.indexOf(e)===-1;return`${r}<${e} ${oc}="true" ${a}${c?"/>":`>${o}</${e}>`}`},""),ese=(e,t={})=>Object.keys(e).reduce((n,r)=>{const i=RU[r];return n[i||r]=e[r],n},t),Yje=(e,t,n)=>{const r={key:t,[oc]:!0},i=ese(n,r);return[re.createElement("title",i,t)]},i_=(e,t)=>t.map((n,r)=>{const i={key:r,[oc]:!0};return Object.keys(n).forEach(s=>{const o=RU[s]||s;if(o==="innerHTML"||o==="cssText"){const c=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:c}}else i[o]=n[s]}),re.createElement(e,i)}),el=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>Yje(e,t.title,t.titleAttributes),toString:()=>Wje(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>ese(t),toString:()=>Zie(t)};default:return{toComponent:()=>i_(e,t),toString:()=>Gje(e,t,n)}}},Xje=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const i=KP(e,zP.meta),s=KP(t,zP.link),a=KP(n,zP.script);return{priorityMethods:{toComponent:()=>[...i_("meta",i.priority),...i_("link",s.priority),...i_("script",a.priority)],toString:()=>`${el("meta",i.priority,r)} ${el("link",s.priority,r)} ${el("script",a.priority,r)}`},metaTags:i.default,linkTags:s.default,scriptTags:a.default}},Jje=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:i,noscriptTags:s,styleTags:a,title:o="",titleAttributes:c,prioritizeSeoTags:u}=e;let{linkTags:d,metaTags:h,scriptTags:A}=e,f={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:f,linkTags:d,metaTags:h,scriptTags:A}=Xje(e)),{priority:f,base:el("base",t,r),bodyAttributes:el("bodyAttributes",n,r),htmlAttributes:el("htmlAttributes",i,r),link:el("link",d,r),meta:el("meta",h,r),noscript:el("noscript",s,r),script:el("script",A,r),style:el("style",a,r),title:el("title",{title:o,titleAttributes:c},r)}},dF=Jje,dS=[],tse=!!(typeof window<"u"&&window.document&&window.document.createElement),hF=class{constructor(e,t){vn(this,"instances",[]);vn(this,"canUseDOM",tse);vn(this,"context");vn(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?dS:this.instances,add:e=>{(this.canUseDOM?dS:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?dS:this.instances).indexOf(e);(this.canUseDOM?dS:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=dF({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Zje={},nse=re.createContext(Zje),wp,rse=(wp=class extends C.Component{constructor(n){super(n);vn(this,"helmetData");this.helmetData=new hF(this.props.context||{},wp.canUseDOM)}render(){return re.createElement(nse.Provider,{value:this.helmetData.value},this.props.children)}},vn(wp,"canUseDOM",tse),wp),eg=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${e}[${oc}]`),i=[].slice.call(r),s=[];let a;return t&&t.length&&t.forEach(o=>{const c=document.createElement(e);for(const u in o)if(Object.prototype.hasOwnProperty.call(o,u))if(u==="innerHTML")c.innerHTML=o.innerHTML;else if(u==="cssText")c.styleSheet?c.styleSheet.cssText=o.cssText:c.appendChild(document.createTextNode(o.cssText));else{const d=u,h=typeof o[d]>"u"?"":o[d];c.setAttribute(u,h)}c.setAttribute(oc,"true"),i.some((u,d)=>(a=d,c.isEqualNode(u)))?i.splice(a,1):s.push(c)}),i.forEach(o=>{var c;return(c=o.parentNode)==null?void 0:c.removeChild(o)}),s.forEach(o=>n.appendChild(o)),{oldTags:i,newTags:s}},fF=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(oc),i=r?r.split(","):[],s=[...i],a=Object.keys(t);for(const o of a){const c=t[o]||"";n.getAttribute(o)!==c&&n.setAttribute(o,c),i.indexOf(o)===-1&&i.push(o);const u=s.indexOf(o);u!==-1&&s.splice(u,1)}for(let o=s.length-1;o>=0;o-=1)n.removeAttribute(s[o]);i.length===s.length?n.removeAttribute(oc):n.getAttribute(oc)!==a.join(",")&&n.setAttribute(oc,a.join(","))},eBe=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=Jie(e)),fF("title",t)},Az=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:i,linkTags:s,metaTags:a,noscriptTags:o,onChangeClientState:c,scriptTags:u,styleTags:d,title:h,titleAttributes:A}=e;fF("body",r),fF("html",i),eBe(h,A);const f={baseTag:eg("base",n),linkTags:eg("link",s),metaTags:eg("meta",a),noscriptTags:eg("noscript",o),scriptTags:eg("script",u),styleTags:eg("style",d)},p={},m={};Object.keys(f).forEach(g=>{const{newTags:y,oldTags:v}=f[g];y.length&&(p[g]=y),v.length&&(m[g]=f[g].oldTags)}),t&&t(),c(e,p,m)},vx=null,tBe=e=>{vx&&cancelAnimationFrame(vx),e.defer?vx=requestAnimationFrame(()=>{Az(e,()=>{vx=null})}):(Az(e),vx=null)},nBe=tBe,pz=class extends C.Component{constructor(){super(...arguments);vn(this,"rendered",!1)}shouldComponentUpdate(t){return!Rje(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let r=null;const i=Vje(t.get().map(s=>{const a={...s.props};return delete a.context,a}));rse.canUseDOM?nBe(i):dF&&(r=dF(i)),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},DO,Ln=(DO=class extends C.Component{shouldComponentUpdate(e){return!Oje(fz(this.props,"helmetData"),fz(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,n,r){return{...t,[e.type]:[...t[e.type]||[],{...n,...this.mapNestedChildrenToProps(e,r)}]}}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return{...t,[e.type]:r,titleAttributes:{...n}};case"body":return{...t,bodyAttributes:{...n}};case"html":return{...t,htmlAttributes:{...n}};default:return{...t,[e.type]:{...n}}}}mapArrayTypeChildrenToProps(e,t){let n={...t};return Object.keys(e).forEach(r=>{n={...n,[r]:e[r]}}),n}warnOnInvalidChildren(e,t){return dz(hz.some(n=>e.type===n),typeof e.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${hz.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),dz(!t||typeof t=="string"||Array.isArray(t)&&!t.some(n=>typeof n!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let n={};return re.Children.forEach(e,r=>{if(!r||!r.props)return;const{children:i,...s}=r.props,a=Object.keys(s).reduce((c,u)=>(c[Dje[u]||u]=s[u],c),{});let{type:o}=r;switch(typeof o=="symbol"?o=o.toString():this.warnOnInvalidChildren(r,i),o){case"Symbol(react.fragment)":t=this.mapChildrenToProps(i,t);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,a,i);break;default:t=this.mapObjectTypeChildren(r,t,a,i);break}}),this.mapArrayTypeChildrenToProps(n,t)}render(){const{children:e,...t}=this.props;let n={...t},{helmetData:r}=t;if(e&&(n=this.mapChildrenToProps(e,n)),r&&!(r instanceof hF)){const i=r;r=new hF(i.context,!0),delete n.helmetData}return r?re.createElement(pz,{...n,context:r.value}):re.createElement(nse.Consumer,null,i=>re.createElement(pz,{...n,context:i}))}},vn(DO,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),DO);const rBe=["bot","Bot","crawler","Crawler","spider","Spider","GPT","Claude","Perplexity","Anthropic","Amazonbot","meta-externalagent","FacebookExternalHit","Bytespider","CCBot","cohere","Bingbot","bingbot","Googlebot","Google-Extended","AppleBot","DuckDuckBot","YandexBot","OAI-SearchBot"];function iBe(){const e=navigator.userAgent;if(!rBe.some(i=>e.includes(i)))return;fetch("https://khmmwvmdbhaplcfcndjx.supabase.co/functions/v1/log-crawler",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q"},body:JSON.stringify({user_agent:e,page_path:window.location.pathname,full_url:window.location.href,site_domain:window.location.hostname,status_code:200})}).catch(()=>{})}const sBe=()=>{const{pathname:e,hash:t}=ro();return C.useEffect(()=>{if(t){const n=document.querySelector(t);n&&n.scrollIntoView({behavior:"smooth"})}else window.scrollTo(0,0)},[e,t]),null},DU=C.createContext({});function UU(e){const t=C.useRef(null);return t.current===null&&(t.current=e()),t.current}const ise=typeof window<"u",sse=ise?C.useLayoutEffect:C.useEffect,kE=C.createContext(null);function HU(e,t){e.indexOf(t)===-1&&e.push(t)}function QU(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const du=(e,t,n)=>n>t?t:n<e?e:n;let _E=()=>{},uv=()=>{};const xd={},ase=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function ose(e){return typeof e=="object"&&e!==null}const lse=e=>/^0[^.\s]+$/u.test(e);function $U(e){let t;return()=>(t===void 0&&(t=e()),t)}const vl=e=>e,aBe=(e,t)=>n=>t(e(n)),_2=(...e)=>e.reduce(aBe),Db=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class zU{constructor(){this.subscriptions=[]}add(t){return HU(this.subscriptions,t),()=>QU(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const a=this.subscriptions[s];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const iu=e=>e*1e3,fl=e=>e/1e3;function cse(e,t){return t?e*(1e3/t):0}const use=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,oBe=1e-7,lBe=12;function cBe(e,t,n,r,i){let s,a,o=0;do a=t+(n-t)/2,s=use(a,r,i)-e,s>0?n=a:t=a;while(Math.abs(s)>oBe&&++o<lBe);return a}function j2(e,t,n,r){if(e===t&&n===r)return vl;const i=s=>cBe(s,0,1,e,n);return s=>s===0||s===1?s:use(i(s),t,r)}const dse=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,hse=e=>t=>1-e(1-t),fse=j2(.33,1.53,.69,.99),VU=hse(fse),Ase=dse(VU),pse=e=>(e*=2)<1?.5*VU(e):.5*(2-Math.pow(2,-10*(e-1))),KU=e=>1-Math.sin(Math.acos(e)),mse=hse(KU),gse=dse(KU),uBe=j2(.42,0,1,1),dBe=j2(0,0,.58,1),yse=j2(.42,0,.58,1),hBe=e=>Array.isArray(e)&&typeof e[0]!="number",vse=e=>Array.isArray(e)&&typeof e[0]=="number",mz={linear:vl,easeIn:uBe,easeInOut:yse,easeOut:dBe,circIn:KU,circInOut:gse,circOut:mse,backIn:VU,backInOut:Ase,backOut:fse,anticipate:pse},fBe=e=>typeof e=="string",gz=e=>{if(vse(e)){uv(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,r,i]=e;return j2(t,n,r,i)}else if(fBe(e))return uv(mz[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),mz[e];return e},hS=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],yz={value:null,addProjectionMetrics:null};function ABe(e,t){let n=new Set,r=new Set,i=!1,s=!1;const a=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},c=0;function u(h){a.has(h)&&(d.schedule(h),e()),c++,h(o)}const d={schedule:(h,A=!1,f=!1)=>{const m=f&&i?n:r;return A&&a.add(h),m.has(h)||m.add(h),h},cancel:h=>{r.delete(h),a.delete(h)},process:h=>{if(o=h,i){s=!0;return}i=!0,[n,r]=[r,n],n.forEach(u),t&&yz.value&&yz.value.frameloop[t].push(c),c=0,n.clear(),i=!1,s&&(s=!1,d.process(h))}};return d}const pBe=40;function xse(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,a=hS.reduce((x,w)=>(x[w]=ABe(s,t?w:void 0),x),{}),{setup:o,read:c,resolveKeyframes:u,preUpdate:d,update:h,preRender:A,render:f,postRender:p}=a,m=()=>{const x=xd.useManualTiming?i.timestamp:performance.now();n=!1,xd.useManualTiming||(i.delta=r?1e3/60:Math.max(Math.min(x-i.timestamp,pBe),1)),i.timestamp=x,i.isProcessing=!0,o.process(i),c.process(i),u.process(i),d.process(i),h.process(i),A.process(i),f.process(i),p.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))},g=()=>{n=!0,r=!0,i.isProcessing||e(m)};return{schedule:hS.reduce((x,w)=>{const b=a[w];return x[w]=(k,j=!1,B=!1)=>(n||g(),b.schedule(k,j,B)),x},{}),cancel:x=>{for(let w=0;w<hS.length;w++)a[hS[w]].cancel(x)},state:i,steps:a}}const{schedule:jr,cancel:Bf,state:Cs,steps:qP}=xse(typeof requestAnimationFrame<"u"?requestAnimationFrame:vl,!0);let s_;function mBe(){s_=void 0}const va={now:()=>(s_===void 0&&va.set(Cs.isProcessing||xd.useManualTiming?Cs.timestamp:performance.now()),s_),set:e=>{s_=e,queueMicrotask(mBe)}},wse=e=>t=>typeof t=="string"&&t.startsWith(e),bse=wse("--"),gBe=wse("var(--"),qU=e=>gBe(e)?yBe.test(e.split("/*")[0].trim()):!1,yBe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function vz(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const l0={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ub={...l0,transform:e=>du(0,1,e)},fS={...l0,default:1},Tw=e=>Math.round(e*1e5)/1e5,WU=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vBe(e){return e==null}const xBe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,GU=(e,t)=>n=>!!(typeof n=="string"&&xBe.test(n)&&n.startsWith(e)||t&&!vBe(n)&&Object.prototype.hasOwnProperty.call(n,t)),Cse=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,a,o]=r.match(WU);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(a),alpha:o!==void 0?parseFloat(o):1}},wBe=e=>du(0,255,e),WP={...l0,transform:e=>Math.round(wBe(e))},XA={test:GU("rgb","red"),parse:Cse("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+WP.transform(e)+", "+WP.transform(t)+", "+WP.transform(n)+", "+Tw(Ub.transform(r))+")"};function bBe(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const AF={test:GU("#"),parse:bBe,transform:XA.transform},B2=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ch=B2("deg"),su=B2("%"),xt=B2("px"),CBe=B2("vh"),SBe=B2("vw"),xz={...su,parse:e=>su.parse(e)/100,transform:e=>su.transform(e*100)},ty={test:GU("hsl","hue"),parse:Cse("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+su.transform(Tw(t))+", "+su.transform(Tw(n))+", "+Tw(Ub.transform(r))+")"},_i={test:e=>XA.test(e)||AF.test(e)||ty.test(e),parse:e=>XA.test(e)?XA.parse(e):ty.test(e)?ty.parse(e):AF.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?XA.transform(e):ty.transform(e),getAnimatableNone:e=>{const t=_i.parse(e);return t.alpha=0,_i.transform(t)}},kBe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function _Be(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(WU))==null?void 0:t.length)||0)+(((n=e.match(kBe))==null?void 0:n.length)||0)>0}const Sse="number",kse="color",jBe="var",BBe="var(",wz="${}",NBe=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Hb(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const o=t.replace(NBe,c=>(_i.test(c)?(r.color.push(s),i.push(kse),n.push(_i.parse(c))):c.startsWith(BBe)?(r.var.push(s),i.push(jBe),n.push(c)):(r.number.push(s),i.push(Sse),n.push(parseFloat(c))),++s,wz)).split(wz);return{values:n,split:o,indexes:r,types:i}}function _se(e){return Hb(e).values}function jse(e){const{split:t,types:n}=Hb(e),r=t.length;return i=>{let s="";for(let a=0;a<r;a++)if(s+=t[a],i[a]!==void 0){const o=n[a];o===Sse?s+=Tw(i[a]):o===kse?s+=_i.transform(i[a]):s+=i[a]}return s}}const EBe=e=>typeof e=="number"?0:_i.test(e)?_i.getAnimatableNone(e):e;function TBe(e){const t=_se(e);return jse(e)(t.map(EBe))}const Nf={test:_Be,parse:_se,createTransformer:jse,getAnimatableNone:TBe};function GP(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function PBe({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,a=0;if(!t)i=s=a=n;else{const o=n<.5?n*(1+t):n+t-n*t,c=2*n-o;i=GP(c,o,e+1/3),s=GP(c,o,e),a=GP(c,o,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:r}}function pj(e,t){return n=>n>0?t:e}const zr=(e,t,n)=>e+(t-e)*n,YP=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},IBe=[AF,XA,ty],OBe=e=>IBe.find(t=>t.test(e));function bz(e){const t=OBe(e);if(_E(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===ty&&(n=PBe(n)),n}const Cz=(e,t)=>{const n=bz(e),r=bz(t);if(!n||!r)return pj(e,t);const i={...n};return s=>(i.red=YP(n.red,r.red,s),i.green=YP(n.green,r.green,s),i.blue=YP(n.blue,r.blue,s),i.alpha=zr(n.alpha,r.alpha,s),XA.transform(i))},pF=new Set(["none","hidden"]);function FBe(e,t){return pF.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function MBe(e,t){return n=>zr(e,t,n)}function YU(e){return typeof e=="number"?MBe:typeof e=="string"?qU(e)?pj:_i.test(e)?Cz:DBe:Array.isArray(e)?Bse:typeof e=="object"?_i.test(e)?Cz:LBe:pj}function Bse(e,t){const n=[...e],r=n.length,i=e.map((s,a)=>YU(s)(s,t[a]));return s=>{for(let a=0;a<r;a++)n[a]=i[a](s);return n}}function LBe(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=YU(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function RBe(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],a=e.indexes[s][r[s]],o=e.values[a]??0;n[i]=o,r[s]++}return n}const DBe=(e,t)=>{const n=Nf.createTransformer(t),r=Hb(e),i=Hb(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?pF.has(e)&&!i.values.length||pF.has(t)&&!r.values.length?FBe(e,t):_2(Bse(RBe(r,i),i.values),n):(_E(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),pj(e,t))};function Nse(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?zr(e,t,n):YU(e)(e,t)}const UBe=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>jr.update(t,n),stop:()=>Bf(t),now:()=>Cs.isProcessing?Cs.timestamp:va.now()}},Ese=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=Math.round(e(s/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},mj=2e4;function XU(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<mj;)t+=n,r=e.next(t);return t>=mj?1/0:t}function HBe(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(XU(r),mj);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:fl(i)}}const QBe=5;function Tse(e,t,n){const r=Math.max(t-QBe,0);return cse(n-e(r),t-r)}const Hr={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},XP=.001;function $Be({duration:e=Hr.duration,bounce:t=Hr.bounce,velocity:n=Hr.velocity,mass:r=Hr.mass}){let i,s;_E(e<=iu(Hr.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let a=1-t;a=du(Hr.minDamping,Hr.maxDamping,a),e=du(Hr.minDuration,Hr.maxDuration,fl(e)),a<1?(i=u=>{const d=u*a,h=d*e,A=d-n,f=mF(u,a),p=Math.exp(-h);return XP-A/f*p},s=u=>{const h=u*a*e,A=h*n+n,f=Math.pow(a,2)*Math.pow(u,2)*e,p=Math.exp(-h),m=mF(Math.pow(u,2),a);return(-i(u)+XP>0?-1:1)*((A-f)*p)/m}):(i=u=>{const d=Math.exp(-u*e),h=(u-n)*e+1;return-XP+d*h},s=u=>{const d=Math.exp(-u*e),h=(n-u)*(e*e);return d*h});const o=5/e,c=VBe(i,s,o);if(e=iu(e),isNaN(c))return{stiffness:Hr.stiffness,damping:Hr.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const zBe=12;function VBe(e,t,n){let r=n;for(let i=1;i<zBe;i++)r=r-e(r)/t(r);return r}function mF(e,t){return e*Math.sqrt(1-t*t)}const KBe=["duration","bounce"],qBe=["stiffness","damping","mass"];function Sz(e,t){return t.some(n=>e[n]!==void 0)}function WBe(e){let t={velocity:Hr.velocity,stiffness:Hr.stiffness,damping:Hr.damping,mass:Hr.mass,isResolvedFromDuration:!1,...e};if(!Sz(e,qBe)&&Sz(e,KBe))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*du(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Hr.mass,stiffness:i,damping:s}}else{const n=$Be(e);t={...t,...n,mass:Hr.mass},t.isResolvedFromDuration=!0}return t}function gj(e=Hr.visualDuration,t=Hr.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],o={done:!1,value:s},{stiffness:c,damping:u,mass:d,duration:h,velocity:A,isResolvedFromDuration:f}=WBe({...n,velocity:-fl(n.velocity||0)}),p=A||0,m=u/(2*Math.sqrt(c*d)),g=a-s,y=fl(Math.sqrt(c/d)),v=Math.abs(g)<5;r||(r=v?Hr.restSpeed.granular:Hr.restSpeed.default),i||(i=v?Hr.restDelta.granular:Hr.restDelta.default);let x;if(m<1){const b=mF(y,m);x=k=>{const j=Math.exp(-m*y*k);return a-j*((p+m*y*g)/b*Math.sin(b*k)+g*Math.cos(b*k))}}else if(m===1)x=b=>a-Math.exp(-y*b)*(g+(p+y*g)*b);else{const b=y*Math.sqrt(m*m-1);x=k=>{const j=Math.exp(-m*y*k),B=Math.min(b*k,300);return a-j*((p+m*y*g)*Math.sinh(B)+b*g*Math.cosh(B))/b}}const w={calculatedDuration:f&&h||null,next:b=>{const k=x(b);if(f)o.done=b>=h;else{let j=b===0?p:0;m<1&&(j=b===0?iu(p):Tse(x,b,k));const B=Math.abs(j)<=r,E=Math.abs(a-k)<=i;o.done=B&&E}return o.value=o.done?a:k,o},toString:()=>{const b=Math.min(XU(w),mj),k=Ese(j=>w.next(b*j).value,b,30);return b+"ms "+k},toTransition:()=>{}};return w}gj.applyToOptions=e=>{const t=HBe(e,100,gj);return e.ease=t.ease,e.duration=iu(t.duration),e.type="keyframes",e};function gF({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:a,min:o,max:c,restDelta:u=.5,restSpeed:d}){const h=e[0],A={done:!1,value:h},f=B=>o!==void 0&&B<o||c!==void 0&&B>c,p=B=>o===void 0?c:c===void 0||Math.abs(o-B)<Math.abs(c-B)?o:c;let m=n*t;const g=h+m,y=a===void 0?g:a(g);y!==g&&(m=y-h);const v=B=>-m*Math.exp(-B/r),x=B=>y+v(B),w=B=>{const E=v(B),I=x(B);A.done=Math.abs(E)<=u,A.value=A.done?y:I};let b,k;const j=B=>{f(A.value)&&(b=B,k=gj({keyframes:[A.value,p(A.value)],velocity:Tse(x,B,A.value),damping:i,stiffness:s,restDelta:u,restSpeed:d}))};return j(0),{calculatedDuration:null,next:B=>{let E=!1;return!k&&b===void 0&&(E=!0,w(B),j(B)),b!==void 0&&B>=b?k.next(B-b):(!E&&w(B),A)}}}function GBe(e,t,n){const r=[],i=n||xd.mix||Nse,s=e.length-1;for(let a=0;a<s;a++){let o=i(e[a],e[a+1]);if(t){const c=Array.isArray(t)?t[a]||vl:t;o=_2(c,o)}r.push(o)}return r}function YBe(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(uv(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=GBe(t,r,i),c=o.length,u=d=>{if(a&&d<e[0])return t[0];let h=0;if(c>1)for(;h<e.length-2&&!(d<e[h+1]);h++);const A=Db(e[h],e[h+1],d);return o[h](A)};return n?d=>u(du(e[0],e[s-1],d)):u}function XBe(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Db(0,t,r);e.push(zr(n,1,i))}}function JBe(e){const t=[0];return XBe(t,e.length-1),t}function ZBe(e,t){return e.map(n=>n*t)}function eNe(e,t){return e.map(()=>t||yse).splice(0,e.length-1)}function Pw({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=hBe(r)?r.map(gz):gz(r),s={done:!1,value:t[0]},a=ZBe(n&&n.length===t.length?n:JBe(t),e),o=YBe(a,t,{ease:Array.isArray(i)?i:eNe(t,i)});return{calculatedDuration:e,next:c=>(s.value=o(c),s.done=c>=e,s)}}const tNe=e=>e!==null;function JU(e,{repeat:t,repeatType:n="loop"},r,i=1){const s=e.filter(tNe),o=i<0||t&&n!=="loop"&&t%2===1?0:s.length-1;return!o||r===void 0?s[o]:r}const nNe={decay:gF,inertia:gF,tween:Pw,keyframes:Pw,spring:gj};function Pse(e){typeof e.type=="string"&&(e.type=nNe[e.type])}class ZU{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const rNe=e=>e/100;class e6 extends ZU{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,i;const{motionValue:n}=this.options;n&&n.updatedAt!==va.now()&&this.tick(va.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(r=this.options).onStop)==null||i.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Pse(t);const{type:n=Pw,repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:a=0}=t;let{keyframes:o}=t;const c=n||Pw;c!==Pw&&typeof o[0]!="number"&&(this.mixKeyframes=_2(rNe,Nse(o[0],o[1])),o=[0,100]);const u=c({...t,keyframes:o});s==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...o].reverse(),velocity:-a})),u.calculatedDuration===null&&(u.calculatedDuration=XU(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:i,mixKeyframes:s,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:h,repeatType:A,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const y=this.currentTime-u*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let x=this.currentTime,w=r;if(h){const B=Math.min(this.currentTime,i)/o;let E=Math.floor(B),I=B%1;!I&&B>=1&&(I=1),I===1&&E--,E=Math.min(E,h+1),!!(E%2)&&(A==="reverse"?(I=1-I,f&&(I-=f/o)):A==="mirror"&&(w=a)),x=du(0,1,I)*o}const b=v?{done:!1,value:d[0]}:w.next(x);s&&(b.value=s(b.value));let{done:k}=b;!v&&c!==null&&(k=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return j&&p!==gF&&(b.value=JU(d,this.options,g,this.speed)),m&&m(b.value),j&&this.finish(),b}then(t,n){return this.finished.then(t,n)}get duration(){return fl(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+fl(t)}get time(){return fl(this.currentTime)}set time(t){var n;t=iu(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(va.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=fl(this.currentTime))}play(){var i,s;if(this.isStopped)return;const{driver:t=UBe,startTime:n}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),(s=(i=this.options).onPlay)==null||s.call(i);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(va.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function iNe(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const JA=e=>e*180/Math.PI,yF=e=>{const t=JA(Math.atan2(e[1],e[0]));return vF(t)},sNe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:yF,rotateZ:yF,skewX:e=>JA(Math.atan(e[1])),skewY:e=>JA(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vF=e=>(e=e%360,e<0&&(e+=360),e),kz=yF,_z=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),jz=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),aNe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:_z,scaleY:jz,scale:e=>(_z(e)+jz(e))/2,rotateX:e=>vF(JA(Math.atan2(e[6],e[5]))),rotateY:e=>vF(JA(Math.atan2(-e[2],e[0]))),rotateZ:kz,rotate:kz,skewX:e=>JA(Math.atan(e[4])),skewY:e=>JA(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function xF(e){return e.includes("scale")?1:0}function wF(e,t){if(!e||e==="none")return xF(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=aNe,i=n;else{const o=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=sNe,i=o}if(!i)return xF(t);const s=r[t],a=i[1].split(",").map(lNe);return typeof s=="function"?s(a):a[s]}const oNe=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return wF(n,t)};function lNe(e){return parseFloat(e.trim())}const c0=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],u0=new Set(c0),Bz=e=>e===l0||e===xt,cNe=new Set(["x","y","z"]),uNe=c0.filter(e=>!cNe.has(e));function dNe(e){const t=[];return uNe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const $h={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>wF(t,"x"),y:(e,{transform:t})=>wF(t,"y")};$h.translateX=$h.x;$h.translateY=$h.y;const Sp=new Set;let bF=!1,CF=!1,SF=!1;function Ise(){if(CF){const e=Array.from(Sp).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=dNe(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,a])=>{var o;(o=r.getValue(s))==null||o.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}CF=!1,bF=!1,Sp.forEach(e=>e.complete(SF)),Sp.clear()}function Ose(){Sp.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(CF=!0)})}function hNe(){SF=!0,Ose(),Ise(),SF=!1}class t6{constructor(t,n,r,i,s,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(Sp.add(this),bF||(bF=!0,jr.read(Ose),jr.resolveKeyframes(Ise))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const s=i==null?void 0:i.get(),a=t[t.length-1];if(s!==void 0)t[0]=s;else if(r&&n){const o=r.readValue(n,a);o!=null&&(t[0]=o)}t[0]===void 0&&(t[0]=a),i&&s===void 0&&i.set(t[0])}iNe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Sp.delete(this)}cancel(){this.state==="scheduled"&&(Sp.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const fNe=e=>e.startsWith("--");function ANe(e,t,n){fNe(t)?e.style.setProperty(t,n):e.style[t]=n}const pNe=$U(()=>window.ScrollTimeline!==void 0),mNe={};function gNe(e,t){const n=$U(e);return()=>mNe[t]??n()}const Fse=gNe(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ew=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Nz={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ew([0,.65,.55,1]),circOut:ew([.55,0,1,.45]),backIn:ew([.31,.01,.66,-.59]),backOut:ew([.33,1.53,.69,.99])};function Mse(e,t){if(e)return typeof e=="function"?Fse()?Ese(e,t):"ease-out":vse(e)?ew(e):Array.isArray(e)?e.map(n=>Mse(n,t)||Nz.easeOut):Nz[e]}function yNe(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:a="loop",ease:o="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const h=Mse(o,i);Array.isArray(h)&&(d.easing=h);const A={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:s+1,direction:a==="reverse"?"alternate":"normal"};return u&&(A.pseudoElement=u),e.animate(d,A)}function Lse(e){return typeof e=="function"&&"applyToOptions"in e}function vNe({type:e,...t}){return Lse(e)&&Fse()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class xNe extends ZU{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:s,allowFlatten:a=!1,finalKeyframe:o,onComplete:c}=t;this.isPseudoElement=!!s,this.allowFlatten=a,this.options=t,uv(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const u=vNe(t);this.animation=yNe(n,r,i,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const d=JU(i,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(d):ANe(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return fl(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+fl(t)}get time(){return fl(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=iu(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&pNe()?(this.animation.timeline=t,vl):n(this)}}const Rse={anticipate:pse,backInOut:Ase,circInOut:gse};function wNe(e){return e in Rse}function bNe(e){typeof e.ease=="string"&&wNe(e.ease)&&(e.ease=Rse[e.ease])}const JP=10;class CNe extends xNe{constructor(t){bNe(t),Pse(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:s,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const o=new e6({...a,autoplay:!1}),c=Math.max(JP,va.now()-this.startTime),u=du(0,JP,c-JP);n.setWithVelocity(o.sample(Math.max(0,c-u)).value,o.sample(c).value,u),o.stop()}}const Ez=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Nf.test(e)||e==="0")&&!e.startsWith("url("));function SNe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function kNe(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],a=Ez(i,t),o=Ez(s,t);return _E(a===o,`You are trying to animate ${t} from "${i}" to "${s}". "${a?s:i}" is not an animatable value.`,"value-not-animatable"),!a||!o?!1:SNe(e)||(n==="spring"||Lse(n))&&r}function kF(e){e.duration=0,e.type="keyframes"}const _Ne=new Set(["opacity","clipPath","filter","transform"]),jNe=$U(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function BNe(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:s,type:a}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return jNe()&&n&&_Ne.has(n)&&(n!=="transform"||!u)&&!c&&!r&&i!=="mirror"&&s!==0&&a!=="inertia"}const NNe=40;class ENe extends ZU{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",keyframes:o,name:c,motionValue:u,element:d,...h}){var p;super(),this.stop=()=>{var m,g;this._animation&&(this._animation.stop(),(m=this.stopTimeline)==null||m.call(this)),(g=this.keyframeResolver)==null||g.cancel()},this.createdAt=va.now();const A={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:a,name:c,motionValue:u,element:d,...h},f=(d==null?void 0:d.KeyframeResolver)||t6;this.keyframeResolver=new f(o,(m,g,y)=>this.onKeyframesResolved(m,g,A,!y),c,u,d),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(t,n,r,i){var g,y;this.keyframeResolver=void 0;const{name:s,type:a,velocity:o,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=va.now(),kNe(t,s,a,o)||((xd.instantAnimations||!c)&&(d==null||d(JU(t,r,n))),t[0]=t[t.length-1],kF(r),r.repeat=0);const A={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>NNe?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},f=!u&&BNe(A),p=(y=(g=A.motionValue)==null?void 0:g.owner)==null?void 0:y.current,m=f?new CNe({...A,element:p}):new e6(A);m.finished.then(()=>{this.notifyFinished()}).catch(vl),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),hNe()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function Dse(e,t,n,r=0,i=1){const s=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),a=e.size,o=(a-1)*r;return typeof n=="function"?n(s,a):i===1?s*r:o-s*r}const TNe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function PNe(e){const t=TNe.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const INe=4;function Use(e,t,n=1){uv(n<=INe,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[r,i]=PNe(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const a=s.trim();return ase(a)?parseFloat(a):a}return qU(i)?Use(i,t,n+1):i}const ONe={type:"spring",stiffness:500,damping:25,restSpeed:10},FNe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),MNe={type:"keyframes",duration:.8},LNe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},RNe=(e,{keyframes:t})=>t.length>2?MNe:u0.has(e)?e.startsWith("scale")?FNe(t[1]):ONe:LNe,DNe=e=>e!==null;function UNe(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(DNe),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}function n6(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}function HNe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:a,repeatDelay:o,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const r6=(e,t,n,r={},i,s)=>a=>{const o=n6(r,e)||{},c=o.delay||r.delay||0;let{elapsed:u=0}=r;u=u-iu(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-u,onUpdate:A=>{t.set(A),o.onUpdate&&o.onUpdate(A)},onComplete:()=>{a(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:s?void 0:i};HNe(o)||Object.assign(d,RNe(e,d)),d.duration&&(d.duration=iu(d.duration)),d.repeatDelay&&(d.repeatDelay=iu(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(kF(d),d.delay===0&&(h=!0)),(xd.instantAnimations||xd.skipAnimations)&&(h=!0,kF(d),d.delay=0),d.allowFlatten=!o.type&&!o.ease,h&&!s&&t.get()!==void 0){const A=UNe(d.keyframes,o);if(A!==void 0){jr.update(()=>{d.onUpdate(A),d.onComplete()});return}}return o.isSync?new e6(d):new ENe(d)};function Tz(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function i6(e,t,n,r){if(typeof t=="function"){const[i,s]=Tz(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=Tz(r);t=t(n!==void 0?n:e.custom,i,s)}return t}function by(e,t,n){const r=e.getProps();return i6(r,t,n!==void 0?n:r.custom,e)}const Hse=new Set(["width","height","top","left","right","bottom",...c0]),Pz=30,QNe=e=>!isNaN(parseFloat(e));class $Ne{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var s;const i=va.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=va.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=QNe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new zU);const r=this.events[t].add(n);return t==="change"?()=>{r(),jr.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=va.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Pz)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Pz);return cse(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function dv(e,t){return new $Ne(e,t)}const _F=e=>Array.isArray(e);function zNe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,dv(n))}function VNe(e){return _F(e)?e[e.length-1]||0:e}function KNe(e,t){const n=by(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const a in s){const o=VNe(s[a]);zNe(e,a,o)}}const Zs=e=>!!(e&&e.getVelocity);function qNe(e){return!!(Zs(e)&&e.add)}function jF(e,t){const n=e.getValue("willChange");if(qNe(n))return n.add(t);if(!n&&xd.WillChange){const r=new xd.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function s6(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const WNe="framerAppearId",Qse="data-"+s6(WNe);function $se(e){return e.props[Qse]}function GNe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function zse(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:a,...o}=t;r&&(s=r);const c=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const d in o){const h=e.getValue(d,e.latestValues[d]??null),A=o[d];if(A===void 0||u&&GNe(u,d))continue;const f={delay:n,...n6(s||{},d)},p=h.get();if(p!==void 0&&!h.isAnimating&&!Array.isArray(A)&&A===p&&!f.velocity)continue;let m=!1;if(window.MotionHandoffAnimation){const y=$se(e);if(y){const v=window.MotionHandoffAnimation(y,d,jr);v!==null&&(f.startTime=v,m=!0)}}jF(e,d),h.start(r6(d,h,A,e.shouldReduceMotion&&Hse.has(d)?{type:!1}:f,e,m));const g=h.animation;g&&c.push(g)}return a&&Promise.all(c).then(()=>{jr.update(()=>{a&&KNe(e,a)})}),c}function BF(e,t,n={}){var c;const r=by(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(zse(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:A}=i;return YNe(e,t,u,d,h,A,n)}:()=>Promise.resolve(),{when:o}=i;if(o){const[u,d]=o==="beforeChildren"?[s,a]:[a,s];return u().then(()=>d())}else return Promise.all([s(),a(n.delay)])}function YNe(e,t,n=0,r=0,i=0,s=1,a){const o=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),o.push(BF(c,t,{...a,delay:n+(typeof r=="function"?0:r)+Dse(e.variantChildren,c,r,i,s)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(o)}function XNe(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>BF(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=BF(e,t,n);else{const i=typeof t=="function"?by(e,t,n.custom):t;r=Promise.all(zse(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const JNe={test:e=>e==="auto",parse:e=>e},Vse=e=>t=>t.test(e),Kse=[l0,xt,su,ch,SBe,CBe,JNe],Iz=e=>Kse.find(Vse(e));function ZNe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||lse(e):!0}const eEe=new Set(["brightness","contrast","saturate","opacity"]);function tEe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(WU)||[];if(!r)return e;const i=n.replace(r,"");let s=eEe.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const nEe=/\b([a-z-]*)\(.*?\)/gu,NF={...Nf,getAnimatableNone:e=>{const t=e.match(nEe);return t?t.map(tEe).join(" "):e}},Oz={...l0,transform:Math.round},rEe={rotate:ch,rotateX:ch,rotateY:ch,rotateZ:ch,scale:fS,scaleX:fS,scaleY:fS,scaleZ:fS,skew:ch,skewX:ch,skewY:ch,distance:xt,translateX:xt,translateY:xt,translateZ:xt,x:xt,y:xt,z:xt,perspective:xt,transformPerspective:xt,opacity:Ub,originX:xz,originY:xz,originZ:xt},a6={borderWidth:xt,borderTopWidth:xt,borderRightWidth:xt,borderBottomWidth:xt,borderLeftWidth:xt,borderRadius:xt,borderTopLeftRadius:xt,borderTopRightRadius:xt,borderBottomRightRadius:xt,borderBottomLeftRadius:xt,width:xt,maxWidth:xt,height:xt,maxHeight:xt,top:xt,right:xt,bottom:xt,left:xt,inset:xt,insetBlock:xt,insetBlockStart:xt,insetBlockEnd:xt,insetInline:xt,insetInlineStart:xt,insetInlineEnd:xt,padding:xt,paddingTop:xt,paddingRight:xt,paddingBottom:xt,paddingLeft:xt,paddingBlock:xt,paddingBlockStart:xt,paddingBlockEnd:xt,paddingInline:xt,paddingInlineStart:xt,paddingInlineEnd:xt,margin:xt,marginTop:xt,marginRight:xt,marginBottom:xt,marginLeft:xt,marginBlock:xt,marginBlockStart:xt,marginBlockEnd:xt,marginInline:xt,marginInlineStart:xt,marginInlineEnd:xt,fontSize:xt,backgroundPositionX:xt,backgroundPositionY:xt,...rEe,zIndex:Oz,fillOpacity:Ub,strokeOpacity:Ub,numOctaves:Oz},iEe={...a6,color:_i,backgroundColor:_i,outlineColor:_i,fill:_i,stroke:_i,borderColor:_i,borderTopColor:_i,borderRightColor:_i,borderBottomColor:_i,borderLeftColor:_i,filter:NF,WebkitFilter:NF},qse=e=>iEe[e];function Wse(e,t){let n=qse(e);return n!==NF&&(n=Nf),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const sEe=new Set(["auto","none","0"]);function aEe(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!sEe.has(s)&&Hb(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=Wse(n,i)}class oEe extends t6{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let h=t[d];if(typeof h=="string"&&(h=h.trim(),qU(h))){const A=Use(h,n.current);A!==void 0&&(t[d]=A),d===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Hse.has(r)||t.length!==2)return;const[i,s]=t,a=Iz(i),o=Iz(s),c=vz(i),u=vz(s);if(c!==u&&$h[r]){this.needsMeasurement=!0;return}if(a!==o)if(Bz(a)&&Bz(o))for(let d=0;d<t.length;d++){const h=t[d];typeof h=="string"&&(t[d]=parseFloat(h))}else $h[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||ZNe(t[i]))&&r.push(i);r.length&&aEe(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=$h[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var o;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const s=r.length-1,a=r[s];r[s]=$h[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(o=this.removedTransforms)!=null&&o.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function Gse(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){const i=document.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(r=>r!=null)}const Yse=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function EF(e){return ose(e)&&"offsetHeight"in e}const{schedule:o6,cancel:nPt}=xse(queueMicrotask,!1),Wl={x:!1,y:!1};function Xse(){return Wl.x||Wl.y}function lEe(e){return e==="x"||e==="y"?Wl[e]?null:(Wl[e]=!0,()=>{Wl[e]=!1}):Wl.x||Wl.y?null:(Wl.x=Wl.y=!0,()=>{Wl.x=Wl.y=!1})}function Jse(e,t){const n=Gse(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Fz(e){return!(e.pointerType==="touch"||Xse())}function cEe(e,t,n={}){const[r,i,s]=Jse(e,n),a=o=>{if(!Fz(o))return;const{target:c}=o,u=t(c,o);if(typeof u!="function"||!c)return;const d=h=>{Fz(h)&&(u(h),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,i)};return r.forEach(o=>{o.addEventListener("pointerenter",a,i)}),s}const Zse=(e,t)=>t?e===t?!0:Zse(e,t.parentElement):!1,l6=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,uEe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function eae(e){return uEe.has(e.tagName)||e.isContentEditable===!0}const a_=new WeakSet;function Mz(e){return t=>{t.key==="Enter"&&e(t)}}function ZP(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const dEe=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Mz(()=>{if(a_.has(n))return;ZP(n,"down");const i=Mz(()=>{ZP(n,"up")}),s=()=>ZP(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Lz(e){return l6(e)&&!Xse()}function hEe(e,t,n={}){const[r,i,s]=Jse(e,n),a=o=>{const c=o.currentTarget;if(!Lz(o))return;a_.add(c);const u=t(c,o),d=(f,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",A),a_.has(c)&&a_.delete(c),Lz(f)&&typeof u=="function"&&u(f,{success:p})},h=f=>{d(f,c===window||c===document||n.useGlobalTarget||Zse(c,f.target))},A=f=>{d(f,!1)};window.addEventListener("pointerup",h,i),window.addEventListener("pointercancel",A,i)};return r.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",a,i),EF(o)&&(o.addEventListener("focus",u=>dEe(u,i)),!eae(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),s}function tae(e){return ose(e)&&"ownerSVGElement"in e}function fEe(e){return tae(e)&&e.tagName==="svg"}const AEe=[...Kse,_i,Nf],pEe=e=>AEe.find(Vse(e)),Rz=()=>({translate:0,scale:1,origin:0,originPoint:0}),ny=()=>({x:Rz(),y:Rz()}),Dz=()=>({min:0,max:0}),Di=()=>({x:Dz(),y:Dz()}),TF={current:null},nae={current:!1},mEe=typeof window<"u";function gEe(){if(nae.current=!0,!!mEe)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>TF.current=e.matches;e.addEventListener("change",t),t()}else TF.current=!1}const yEe=new WeakMap;function jE(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Qb(e){return typeof e=="string"||Array.isArray(e)}const c6=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],u6=["initial",...c6];function BE(e){return jE(e.animate)||u6.some(t=>Qb(e[t]))}function rae(e){return!!(BE(e)||e.variants)}function vEe(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Zs(i))e.addValue(r,i);else if(Zs(s))e.addValue(r,dv(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=e.getStaticValue(r);e.addValue(r,dv(a!==void 0?a:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Uz=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let yj={};function iae(e){yj=e}function xEe(){return yj}class wEe{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:a},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=t6,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const A=va.now();this.renderScheduledAt<A&&(this.renderScheduledAt=A,jr.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.blockInitialAnimation=!!s,this.isControllingVariants=BE(n),this.isVariantNode=rae(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const A in h){const f=h[A];c[A]!==void 0&&Zs(f)&&f.set(c[A])}}mount(t){var n;this.current=t,yEe.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((r,i)=>this.bindToMotionValue(i,r)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(nae.current||gEe(),this.shouldReduceMotion=TF.current),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Bf(this.notifyUpdate),Bf(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=u0.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&jr.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;typeof window<"u"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in yj){const n=yj[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Di()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Uz.length;r++){const i=Uz[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,a=t[s];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=vEe(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=dv(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(ase(r)||lse(r))?r=parseFloat(r):!pEe(r)&&Nf.test(n)&&(r=Wse(t,n)),this.setBaseTarget(t,Zs(r)?r.get():r)),Zs(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var s;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=i6(this.props,n,(s=this.presenceContext)==null?void 0:s.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Zs(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new zU),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){o6.render(this.render)}}class sae extends wEe{constructor(){super(...arguments),this.KeyframeResolver=oEe}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Zs(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class zf{constructor(t){this.isMounted=!1,this.node=t}update(){}}function aae({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function bEe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function CEe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function eI(e){return e===void 0||e===1}function PF({scale:e,scaleX:t,scaleY:n}){return!eI(e)||!eI(t)||!eI(n)}function FA(e){return PF(e)||oae(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function oae(e){return Hz(e.x)||Hz(e.y)}function Hz(e){return e&&e!=="0%"}function vj(e,t,n){const r=e-n,i=t*r;return n+i}function Qz(e,t,n,r,i){return i!==void 0&&(e=vj(e,i,r)),vj(e,n,r)+t}function IF(e,t=0,n=1,r,i){e.min=Qz(e.min,t,n,r,i),e.max=Qz(e.max,t,n,r,i)}function lae(e,{x:t,y:n}){IF(e.x,t.translate,t.scale,t.originPoint),IF(e.y,n.translate,n.scale,n.originPoint)}const $z=.999999999999,zz=1.0000000000001;function SEe(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,a;for(let o=0;o<i;o++){s=n[o],a=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&iy(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,lae(e,a)),r&&FA(s.latestValues)&&iy(e,s.latestValues))}t.x<zz&&t.x>$z&&(t.x=1),t.y<zz&&t.y>$z&&(t.y=1)}function ry(e,t){e.min=e.min+t,e.max=e.max+t}function Vz(e,t,n,r,i=.5){const s=zr(e.min,e.max,i);IF(e,t,n,s,r)}function iy(e,t){Vz(e.x,t.x,t.scaleX,t.scale,t.originX),Vz(e.y,t.y,t.scaleY,t.scale,t.originY)}function cae(e,t){return aae(CEe(e.getBoundingClientRect(),t))}function kEe(e,t,n){const r=cae(e,n),{scroll:i}=t;return i&&(ry(r.x,i.offset.x),ry(r.y,i.offset.y)),r}const _Ee={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jEe=c0.length;function BEe(e,t,n){let r="",i=!0;for(let s=0;s<jEe;s++){const a=c0[s],o=e[a];if(o===void 0)continue;let c=!0;if(typeof o=="number")c=o===(a.startsWith("scale")?1:0);else{const u=parseFloat(o);c=a.startsWith("scale")?u===1:u===0}if(!c||n){const u=Yse(o,a6[a]);if(!c){i=!1;const d=_Ee[a]||a;r+=`${d}(${u}) `}n&&(t[a]=u)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function d6(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let a=!1,o=!1;for(const c in t){const u=t[c];if(u0.has(c)){a=!0;continue}else if(bse(c)){i[c]=u;continue}else{const d=Yse(u,a6[c]);c.startsWith("origin")?(o=!0,s[c]=d):r[c]=d}}if(t.transform||(a||n?r.transform=BEe(t,e.transform,n):r.transform&&(r.transform="none")),o){const{originX:c="50%",originY:u="50%",originZ:d=0}=s;r.transformOrigin=`${c} ${u} ${d}`}}function uae(e,{style:t,vars:n},r,i){const s=e.style;let a;for(a in t)s[a]=t[a];i==null||i.applyProjectionStyles(s,r);for(a in n)s.setProperty(a,n[a])}function Kz(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const xx={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(xt.test(e))e=parseFloat(e);else return e;const n=Kz(e,t.target.x),r=Kz(e,t.target.y);return`${n}% ${r}%`}},NEe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Nf.parse(e);if(i.length>5)return r;const s=Nf.createTransformer(e),a=typeof i[0]!="number"?1:0,o=n.x.scale*t.x,c=n.y.scale*t.y;i[0+a]/=o,i[1+a]/=c;const u=zr(o,c,.5);return typeof i[2+a]=="number"&&(i[2+a]/=u),typeof i[3+a]=="number"&&(i[3+a]/=u),s(i)}},OF={borderRadius:{...xx,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xx,borderTopRightRadius:xx,borderBottomLeftRadius:xx,borderBottomRightRadius:xx,boxShadow:NEe};function dae(e,{layout:t,layoutId:n}){return u0.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!OF[e]||e==="opacity")}function h6(e,t,n){var a;const r=e.style,i=t==null?void 0:t.style,s={};if(!r)return s;for(const o in r)(Zs(r[o])||i&&Zs(i[o])||dae(o,e)||((a=n==null?void 0:n.getValue(o))==null?void 0:a.liveStyle)!==void 0)&&(s[o]=r[o]);return s}function EEe(e){return window.getComputedStyle(e)}class TEe extends sae{constructor(){super(...arguments),this.type="html",this.renderInstance=uae}readValueFromInstance(t,n){var r;if(u0.has(n))return(r=this.projection)!=null&&r.isProjecting?xF(n):oNe(t,n);{const i=EEe(t),s=(bse(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return cae(t,n)}build(t,n,r){d6(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return h6(t,n,r)}}const PEe={offset:"stroke-dashoffset",array:"stroke-dasharray"},IEe={offset:"strokeDashoffset",array:"strokeDasharray"};function OEe(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?PEe:IEe;e[s.offset]=`${-r}`,e[s.array]=`${t} ${n}`}const FEe=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function hae(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:s=1,pathOffset:a=0,...o},c,u,d){if(d6(e,o,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:A}=e;h.transform&&(A.transform=h.transform,delete h.transform),(A.transform||h.transformOrigin)&&(A.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),A.transform&&(A.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete h.transformBox);for(const f of FEe)h[f]!==void 0&&(A[f]=h[f],delete h[f]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),i!==void 0&&OEe(h,i,s,a,!1)}const fae=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Aae=e=>typeof e=="string"&&e.toLowerCase()==="svg";function MEe(e,t,n,r){uae(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(fae.has(i)?i:s6(i),t.attrs[i])}function pae(e,t,n){const r=h6(e,t,n);for(const i in e)if(Zs(e[i])||Zs(t[i])){const s=c0.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}class LEe extends sae{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Di}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(u0.has(n)){const r=qse(n);return r&&r.default||0}return n=fae.has(n)?n:s6(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return pae(t,n,r)}build(t,n,r){hae(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){MEe(t,n,r,i)}mount(t){this.isSVGTag=Aae(t.tagName),super.mount(t)}}const REe=u6.length;function mae(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?mae(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<REe;n++){const r=u6[n],i=e.props[r];(Qb(i)||i===!1)&&(t[r]=i)}return t}function gae(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const DEe=[...c6].reverse(),UEe=c6.length;function HEe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>XNe(e,n,r)))}function QEe(e){let t=HEe(e),n=qz(),r=!0;const i=c=>(u,d)=>{var A;const h=by(e,d,c==="exit"?(A=e.presenceContext)==null?void 0:A.custom:void 0);if(h){const{transition:f,transitionEnd:p,...m}=h;u={...u,...m,...p}}return u};function s(c){t=c(e)}function a(c){const{props:u}=e,d=mae(e.parent)||{},h=[],A=new Set;let f={},p=1/0;for(let g=0;g<UEe;g++){const y=DEe[g],v=n[y],x=u[y]!==void 0?u[y]:d[y],w=Qb(x),b=y===c?v.isActive:null;b===!1&&(p=g);let k=x===d[y]&&x!==u[y]&&w;if(k&&r&&e.manuallyAnimateOnMount&&(k=!1),v.protectedKeys={...f},!v.isActive&&b===null||!x&&!v.prevProp||jE(x)||typeof x=="boolean")continue;const j=$Ee(v.prevProp,x);let B=j||y===c&&v.isActive&&!k&&w||g>p&&w,E=!1;const I=Array.isArray(x)?x:[x];let T=I.reduce(i(y),{});b===!1&&(T={});const{prevResolvedValues:N={}}=v,F={...N,...T},L=K=>{B=!0,A.has(K)&&(E=!0,A.delete(K)),v.needsAnimating[K]=!0;const $=e.getValue(K);$&&($.liveStyle=!1)};for(const K in F){const $=T[K],z=N[K];if(f.hasOwnProperty(K))continue;let Q=!1;_F($)&&_F(z)?Q=!gae($,z):Q=$!==z,Q?$!=null?L(K):A.add(K):$!==void 0&&A.has(K)?L(K):v.protectedKeys[K]=!0}v.prevProp=x,v.prevResolvedValues=T,v.isActive&&(f={...f,...T}),r&&e.blockInitialAnimation&&(B=!1);const U=k&&j;B&&(!U||E)&&h.push(...I.map(K=>{const $={type:y};if(typeof K=="string"&&r&&!U&&e.manuallyAnimateOnMount&&e.parent){const{parent:z}=e,Q=by(z,K);if(z.enteringChildren&&Q){const{delayChildren:oe}=Q.transition||{};$.delay=Dse(z.enteringChildren,e,oe)}}return{animation:K,options:$}}))}if(A.size){const g={};if(typeof u.initial!="boolean"){const y=by(e,Array.isArray(u.initial)?u.initial[0]:u.initial);y&&y.transition&&(g.transition=y.transition)}A.forEach(y=>{const v=e.getBaseTarget(y),x=e.getValue(y);x&&(x.liveStyle=!0),g[y]=v??null}),h.push({animation:g})}let m=!!h.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(h):Promise.resolve()}function o(c,u){var h;if(n[c].isActive===u)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(A=>{var f;return(f=A.animationState)==null?void 0:f.setActive(c,u)}),n[c].isActive=u;const d=a(c);for(const A in n)n[A].protectedKeys={};return d}return{animateChanges:a,setActive:o,setAnimateFunction:s,getState:()=>n,reset:()=>{n=qz()}}}function $Ee(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!gae(t,e):!1}function kA(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qz(){return{animate:kA(!0),whileInView:kA(),whileHover:kA(),whileTap:kA(),whileDrag:kA(),whileFocus:kA(),exit:kA()}}function Wz(e,t){e.min=t.min,e.max=t.max}function $l(e,t){Wz(e.x,t.x),Wz(e.y,t.y)}function Gz(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const yae=1e-4,zEe=1-yae,VEe=1+yae,vae=.01,KEe=0-vae,qEe=0+vae;function xa(e){return e.max-e.min}function WEe(e,t,n){return Math.abs(e-t)<=n}function Yz(e,t,n,r=.5){e.origin=r,e.originPoint=zr(t.min,t.max,e.origin),e.scale=xa(n)/xa(t),e.translate=zr(n.min,n.max,e.origin)-e.originPoint,(e.scale>=zEe&&e.scale<=VEe||isNaN(e.scale))&&(e.scale=1),(e.translate>=KEe&&e.translate<=qEe||isNaN(e.translate))&&(e.translate=0)}function Iw(e,t,n,r){Yz(e.x,t.x,n.x,r?r.originX:void 0),Yz(e.y,t.y,n.y,r?r.originY:void 0)}function Xz(e,t,n){e.min=n.min+t.min,e.max=e.min+xa(t)}function GEe(e,t,n){Xz(e.x,t.x,n.x),Xz(e.y,t.y,n.y)}function Jz(e,t,n){e.min=t.min-n.min,e.max=e.min+xa(t)}function xj(e,t,n){Jz(e.x,t.x,n.x),Jz(e.y,t.y,n.y)}function Zz(e,t,n,r,i){return e-=t,e=vj(e,1/n,r),i!==void 0&&(e=vj(e,1/i,r)),e}function YEe(e,t=0,n=1,r=.5,i,s=e,a=e){if(su.test(t)&&(t=parseFloat(t),t=zr(a.min,a.max,t/100)-a.min),typeof t!="number")return;let o=zr(s.min,s.max,r);e===s&&(o-=t),e.min=Zz(e.min,t,n,o,i),e.max=Zz(e.max,t,n,o,i)}function e9(e,t,[n,r,i],s,a){YEe(e,t[n],t[r],t[i],t.scale,s,a)}const XEe=["x","scaleX","originX"],JEe=["y","scaleY","originY"];function t9(e,t,n,r){e9(e.x,t,XEe,n?n.x:void 0,r?r.x:void 0),e9(e.y,t,JEe,n?n.y:void 0,r?r.y:void 0)}function n9(e){return e.translate===0&&e.scale===1}function xae(e){return n9(e.x)&&n9(e.y)}function r9(e,t){return e.min===t.min&&e.max===t.max}function ZEe(e,t){return r9(e.x,t.x)&&r9(e.y,t.y)}function i9(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function wae(e,t){return i9(e.x,t.x)&&i9(e.y,t.y)}function s9(e){return xa(e.x)/xa(e.y)}function a9(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Jo(e){return[e("x"),e("y")]}function e5e(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((i||s||a)&&(r=`translate3d(${i}px, ${s}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:h,rotateY:A,skewX:f,skewY:p}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotateX(${h}deg) `),A&&(r+=`rotateY(${A}deg) `),f&&(r+=`skewX(${f}deg) `),p&&(r+=`skewY(${p}deg) `)}const o=e.x.scale*t.x,c=e.y.scale*t.y;return(o!==1||c!==1)&&(r+=`scale(${o}, ${c})`),r||"none"}const bae=["TopLeft","TopRight","BottomLeft","BottomRight"],t5e=bae.length,o9=e=>typeof e=="string"?parseFloat(e):e,l9=e=>typeof e=="number"||xt.test(e);function n5e(e,t,n,r,i,s){i?(e.opacity=zr(0,n.opacity??1,r5e(r)),e.opacityExit=zr(t.opacity??1,0,i5e(r))):s&&(e.opacity=zr(t.opacity??1,n.opacity??1,r));for(let a=0;a<t5e;a++){const o=`border${bae[a]}Radius`;let c=c9(t,o),u=c9(n,o);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||l9(c)===l9(u)?(e[o]=Math.max(zr(o9(c),o9(u),r),0),(su.test(u)||su.test(c))&&(e[o]+="%")):e[o]=u}(t.rotate||n.rotate)&&(e.rotate=zr(t.rotate||0,n.rotate||0,r))}function c9(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const r5e=Cae(0,.5,mse),i5e=Cae(.5,.95,vl);function Cae(e,t,n){return r=>r<e?0:r>t?1:n(Db(e,t,r))}function s5e(e,t,n){const r=Zs(e)?e:dv(e);return r.start(r6("",r,t,n)),r.animation}function $b(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const a5e=(e,t)=>e.depth-t.depth;class o5e{constructor(){this.children=[],this.isDirty=!1}add(t){HU(this.children,t),this.isDirty=!0}remove(t){QU(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(a5e),this.isDirty=!1,this.children.forEach(t)}}function l5e(e,t){const n=va.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(Bf(r),e(s-t))};return jr.setup(r,!0),()=>Bf(r)}function o_(e){return Zs(e)?e.get():e}class c5e{constructor(){this.members=[]}add(t){HU(this.members,t),t.scheduleRender()}remove(t){if(QU(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender();const i=r.options.layoutDependency,s=t.options.layoutDependency;i!==void 0&&s!==void 0&&i===s||(t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0));const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const l_={hasAnimatedSinceResize:!0,hasEverUpdated:!1},tI=["","X","Y","Z"],u5e=1e3;let d5e=0;function nI(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Sae(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=$se(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",jr,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Sae(r)}function kae({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},o=t==null?void 0:t()){this.id=d5e++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(A5e),this.nodes.forEach(y5e),this.nodes.forEach(v5e),this.nodes.forEach(p5e)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new o5e)}addEventListener(a,o){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new zU),this.eventHandlers.get(a).add(o)}notifyListeners(a,...o){const c=this.eventHandlers.get(a);c&&c.notify(...o)}hasListeners(a){return this.eventHandlers.has(a)}mount(a){if(this.instance)return;this.isSVG=tae(a)&&!fEe(a),this.instance=a;const{layoutId:o,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||o)&&(this.isLayoutDirty=!0),e){let d,h=0;const A=()=>this.root.updateBlockedByResize=!1;jr.read(()=>{h=window.innerWidth}),e(a,()=>{const f=window.innerWidth;f!==h&&(h=f,this.root.updateBlockedByResize=!0,d&&d(),d=l5e(A,250),l_.hasAnimatedSinceResize&&(l_.hasAnimatedSinceResize=!1,this.nodes.forEach(h9)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&u&&(o||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeLayoutChanged:A,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||S5e,{onLayoutAnimationStart:m,onLayoutAnimationComplete:g}=u.getProps(),y=!this.targetLayout||!wae(this.targetLayout,f),v=!h&&A;if(this.options.layoutRoot||this.resumeFrom||v||h&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...n6(p,"layout"),onPlay:m,onComplete:g};(u.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(d,v)}else h||h9(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Bf(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(x5e),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Sae(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const h=this.path[d];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:o,layout:c}=this.options;if(o===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(u9);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(d9);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(g5e),this.nodes.forEach(h5e),this.nodes.forEach(f5e)):this.nodes.forEach(d9),this.clearAllSnapshots();const o=va.now();Cs.delta=du(0,1e3/60,o-Cs.timestamp),Cs.timestamp=o,Cs.isProcessing=!0,qP.update.process(Cs),qP.preRender.process(Cs),qP.render.process(Cs),Cs.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,o6.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(m5e),this.sharedNodes.forEach(w5e)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,jr.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){jr.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!xa(this.snapshot.measuredBox.x)&&!xa(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Di(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(o=!1),o&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!xae(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;a&&this.instance&&(o||FA(this.latestValues)||d)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const o=this.measurePageBox();let c=this.removeElementScroll(o);return a&&(c=this.removeTransform(c)),k5e(c),{animationId:this.root.animationId,measuredBox:o,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:a}=this.options;if(!a)return Di();const o=a.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(_5e))){const{scroll:d}=this.root;d&&(ry(o.x,d.offset.x),ry(o.y,d.offset.y))}return o}removeElementScroll(a){var c;const o=Di();if($l(o,a),(c=this.scroll)!=null&&c.wasRoot)return o;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:h,options:A}=d;d!==this.root&&h&&A.layoutScroll&&(h.wasRoot&&$l(o,a),ry(o.x,h.offset.x),ry(o.y,h.offset.y))}return o}applyTransform(a,o=!1){const c=Di();$l(c,a);for(let u=0;u<this.path.length;u++){const d=this.path[u];!o&&d.options.layoutScroll&&d.scroll&&d!==d.root&&iy(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),FA(d.latestValues)&&iy(c,d.latestValues)}return FA(this.latestValues)&&iy(c,this.latestValues),c}removeTransform(a){const o=Di();$l(o,a);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!FA(u.latestValues))continue;PF(u.latestValues)&&u.updateSnapshot();const d=Di(),h=u.measurePageBox();$l(d,h),t9(o,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return FA(this.latestValues)&&t9(o,this.latestValues),o}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Cs.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var f;const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==o;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(f=this.parent)!=null&&f.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:h}=this.options;if(!this.layout||!(d||h))return;this.resolvedRelativeTargetAt=Cs.timestamp;const A=this.getClosestProjectingParent();A&&this.linkedParentVersion!==A.layoutVersion&&!A.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(A&&A.layout?this.createRelativeTarget(A,this.layout.layoutBox,A.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Di(),this.targetWithTransforms=Di()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),GEe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):$l(this.target,this.layout.layoutBox),lae(this.target,this.targetDelta)):$l(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,A&&!!A.resumingFrom==!!this.resumingFrom&&!A.options.layoutScroll&&A.target&&this.animationProgress!==1?this.createRelativeTarget(A,this.target,A.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||PF(this.parent.latestValues)||oae(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(a,o,c){this.relativeParent=a,this.linkedParentVersion=a.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Di(),this.relativeTargetOrigin=Di(),xj(this.relativeTargetOrigin,o,c),$l(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var p;const a=this.getLead(),o=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty)&&(c=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Cs.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;$l(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,A=this.treeScale.y;SEe(this.layoutCorrected,this.treeScale,this.path,o),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Di());const{target:f}=a;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Gz(this.prevProjectionDelta.x,this.projectionDelta.x),Gz(this.prevProjectionDelta.y,this.projectionDelta.y)),Iw(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==A||!a9(this.projectionDelta.x,this.prevProjectionDelta.x)||!a9(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var o;if((o=this.options.visualElement)==null||o.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ny(),this.projectionDelta=ny(),this.projectionDeltaWithTransform=ny()}setAnimationOrigin(a,o=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},h=ny();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const A=Di(),f=c?c.source:void 0,p=this.layout?this.layout.source:void 0,m=f!==p,g=this.getStack(),y=!g||g.members.length<=1,v=!!(m&&!y&&this.options.crossfade===!0&&!this.path.some(C5e));this.animationProgress=0;let x;this.mixTargetDelta=w=>{const b=w/1e3;f9(h.x,a.x,b),f9(h.y,a.y,b),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(xj(A,this.layout.layoutBox,this.relativeParent.layout.layoutBox),b5e(this.relativeTarget,this.relativeTargetOrigin,A,b),x&&ZEe(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Di()),$l(x,this.relativeTarget)),m&&(this.animationValues=d,n5e(d,u,this.latestValues,b,v,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var o,c,u;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Bf(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=jr.update(()=>{l_.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=dv(0)),this.currentAnimation=s5e(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),a.onUpdate&&a.onUpdate(d)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(u5e),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:o,target:c,layout:u,latestValues:d}=a;if(!(!o||!c||!u)){if(this!==a&&this.layout&&u&&_ae(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Di();const h=xa(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+h;const A=xa(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+A}$l(o,c),iy(o,d),Iw(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(a,o){this.sharedNodes.has(a)||this.sharedNodes.set(a,new c5e),this.sharedNodes.get(a).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:o,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let o=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(o=!0),!o)return;const u={};c.z&&nI("z",a,u,this.animationValues);for(let d=0;d<tI.length;d++)nI(`rotate${tI[d]}`,a,u,this.animationValues),nI(`skew${tI[d]}`,a,u,this.animationValues);a.render();for(const d in u)a.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);a.scheduleRender()}applyProjectionStyles(a,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){a.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,a.visibility="",a.opacity="",a.pointerEvents=o_(o==null?void 0:o.pointerEvents)||"",a.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(a.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,a.pointerEvents=o_(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!FA(this.latestValues)&&(a.transform=c?c({},""):"none",this.hasProjected=!1);return}a.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let h=e5e(this.projectionDeltaWithTransform,this.treeScale,d);c&&(h=c(d,h)),a.transform=h;const{x:A,y:f}=this.projectionDelta;a.transformOrigin=`${A.origin*100}% ${f.origin*100}% 0`,u.animationValues?a.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:a.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const p in OF){if(d[p]===void 0)continue;const{correct:m,applyTo:g,isCSSVariable:y}=OF[p],v=h==="none"?d[p]:m(d[p],u);if(g){const x=g.length;for(let w=0;w<x;w++)a[g[w]]=v}else y?this.options.visualElement.renderState.vars[p]=v:a[p]=v}this.options.layoutId&&(a.pointerEvents=u===this?o_(o==null?void 0:o.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var o;return(o=a.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(u9),this.root.sharedNodes.clear()}}}function h5e(e){e.updateLayout()}function f5e(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,a=t.source!==e.layout.source;s==="size"?Jo(h=>{const A=a?t.measuredBox[h]:t.layoutBox[h],f=xa(A);A.min=r[h].min,A.max=A.min+f}):_ae(s,t.layoutBox,r)&&Jo(h=>{const A=a?t.measuredBox[h]:t.layoutBox[h],f=xa(r[h]);A.max=A.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+f)});const o=ny();Iw(o,r,t.layoutBox);const c=ny();a?Iw(c,e.applyTransform(i,!0),t.measuredBox):Iw(c,r,t.layoutBox);const u=!xae(o);let d=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:A,layout:f}=h;if(A&&f){const p=Di();xj(p,t.layoutBox,A.layoutBox);const m=Di();xj(m,r,f.layoutBox),wae(p,m)||(d=!0),h.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:o,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function A5e(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function p5e(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function m5e(e){e.clearSnapshot()}function u9(e){e.clearMeasurements()}function d9(e){e.isLayoutDirty=!1}function g5e(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function h9(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function y5e(e){e.resolveTargetDelta()}function v5e(e){e.calcProjection()}function x5e(e){e.resetSkewAndRotation()}function w5e(e){e.removeLeadSnapshot()}function f9(e,t,n){e.translate=zr(t.translate,0,n),e.scale=zr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function A9(e,t,n,r){e.min=zr(t.min,n.min,r),e.max=zr(t.max,n.max,r)}function b5e(e,t,n,r){A9(e.x,t.x,n.x,r),A9(e.y,t.y,n.y,r)}function C5e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const S5e={duration:.45,ease:[.4,0,.1,1]},p9=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),m9=p9("applewebkit/")&&!p9("chrome/")?Math.round:vl;function g9(e){e.min=m9(e.min),e.max=m9(e.max)}function k5e(e){g9(e.x),g9(e.y)}function _ae(e,t,n){return e==="position"||e==="preserve-aspect"&&!WEe(s9(t),s9(n),.2)}function _5e(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const j5e=kae({attachResizeListener:(e,t)=>$b(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),rI={current:void 0},jae=kae({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!rI.current){const e=new j5e({});e.mount(window),e.setOptions({layoutScroll:!0}),rI.current=e}return rI.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),f6=C.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function y9(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function B5e(...e){return t=>{let n=!1;const r=e.map(i=>{const s=y9(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():y9(e[i],null)}}}}function N5e(...e){return C.useCallback(B5e(...e),e)}class E5e extends C.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=n.offsetParent,i=EF(r)&&r.offsetWidth||0,s=EF(r)&&r.offsetHeight||0,a=this.props.sizeRef.current;a.height=n.offsetHeight||0,a.width=n.offsetWidth||0,a.top=n.offsetTop,a.left=n.offsetLeft,a.right=i-a.width-a.left,a.bottom=s-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function T5e({children:e,isPresent:t,anchorX:n,anchorY:r,root:i}){var h;const s=C.useId(),a=C.useRef(null),o=C.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=C.useContext(f6),u=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),d=N5e(a,u);return C.useInsertionEffect(()=>{const{width:A,height:f,top:p,left:m,right:g,bottom:y}=o.current;if(t||!a.current||!A||!f)return;const v=n==="left"?`left: ${m}`:`right: ${g}`,x=r==="bottom"?`bottom: ${y}`:`top: ${p}`;a.current.dataset.motionPopId=s;const w=document.createElement("style");c&&(w.nonce=c);const b=i??document.head;return b.appendChild(w),w.sheet&&w.sheet.insertRule(`
          [data-motion-pop-id="${s}"] {
            position: absolute !important;
            width: ${A}px !important;
            height: ${f}px !important;
            ${v}px !important;
            ${x}px !important;
          }
        `),()=>{b.contains(w)&&b.removeChild(w)}},[t]),l.jsx(E5e,{isPresent:t,childRef:a,sizeRef:o,children:C.cloneElement(e,{ref:d})})}const P5e=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:a,anchorX:o,anchorY:c,root:u})=>{const d=UU(I5e),h=C.useId();let A=!0,f=C.useMemo(()=>(A=!1,{id:h,initial:t,isPresent:n,custom:i,onExitComplete:p=>{d.set(p,!0);for(const m of d.values())if(!m)return;r&&r()},register:p=>(d.set(p,!1),()=>d.delete(p))}),[n,d,r]);return s&&A&&(f={...f}),C.useMemo(()=>{d.forEach((p,m)=>d.set(m,!1))},[n]),C.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),a==="popLayout"&&(e=l.jsx(T5e,{isPresent:n,anchorX:o,anchorY:c,root:u,children:e})),l.jsx(kE.Provider,{value:f,children:e})};function I5e(){return new Map}function Bae(e=!0){const t=C.useContext(kE);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=C.useId();C.useEffect(()=>{if(e)return i(s)},[e]);const a=C.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,a]:[!0]}const AS=e=>e.key||"";function v9(e){const t=[];return C.Children.forEach(e,n=>{C.isValidElement(n)&&t.push(n)}),t}const Cy=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:a=!1,anchorX:o="left",anchorY:c="top",root:u})=>{const[d,h]=Bae(a),A=C.useMemo(()=>v9(e),[e]),f=a&&!d?[]:A.map(AS),p=C.useRef(!0),m=C.useRef(A),g=UU(()=>new Map),y=C.useRef(new Set),[v,x]=C.useState(A),[w,b]=C.useState(A);sse(()=>{p.current=!1,m.current=A;for(let B=0;B<w.length;B++){const E=AS(w[B]);f.includes(E)?(g.delete(E),y.current.delete(E)):g.get(E)!==!0&&g.set(E,!1)}},[w,f.length,f.join("-")]);const k=[];if(A!==v){let B=[...A];for(let E=0;E<w.length;E++){const I=w[E],T=AS(I);f.includes(T)||(B.splice(E,0,I),k.push(I))}return s==="wait"&&k.length&&(B=k),b(v9(B)),x(A),null}const{forceRender:j}=C.useContext(DU);return l.jsx(l.Fragment,{children:w.map(B=>{const E=AS(B),I=a&&!d?!1:A===w||f.includes(E),T=()=>{if(y.current.has(E))return;if(y.current.add(E),g.has(E))g.set(E,!0);else return;let N=!0;g.forEach(F=>{F||(N=!1)}),N&&(j==null||j(),b(m.current),a&&(h==null||h()),r&&r())};return l.jsx(P5e,{isPresent:I,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:s,root:u,onExitComplete:I?void 0:T,anchorX:o,anchorY:c,children:B},E)})})},Nae=C.createContext({strict:!1}),x9={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let w9=!1;function O5e(){if(w9)return;const e={};for(const t in x9)e[t]={isEnabled:n=>x9[t].some(r=>!!n[r])};iae(e),w9=!0}function Eae(){return O5e(),xEe()}function F5e(e){const t=Eae();for(const n in e)t[n]={...t[n],...e[n]};iae(t)}const M5e=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function wj(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||M5e.has(e)}let Tae=e=>!wj(e);function L5e(e){typeof e=="function"&&(Tae=t=>t.startsWith("on")?!wj(t):e(t))}try{L5e(require("@emotion/is-prop-valid").default)}catch{}function R5e(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(Tae(i)||n===!0&&wj(i)||!t&&!wj(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}const NE=C.createContext({});function D5e(e,t){if(BE(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Qb(n)?n:void 0,animate:Qb(r)?r:void 0}}return e.inherit!==!1?t:{}}function U5e(e){const{initial:t,animate:n}=D5e(e,C.useContext(NE));return C.useMemo(()=>({initial:t,animate:n}),[b9(t),b9(n)])}function b9(e){return Array.isArray(e)?e.join(" "):e}const A6=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Pae(e,t,n){for(const r in t)!Zs(t[r])&&!dae(r,n)&&(e[r]=t[r])}function H5e({transformTemplate:e},t){return C.useMemo(()=>{const n=A6();return d6(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Q5e(e,t){const n=e.style||{},r={};return Pae(r,n,e),Object.assign(r,H5e(e,t)),r}function $5e(e,t){const n={},r=Q5e(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Iae=()=>({...A6(),attrs:{}});function z5e(e,t,n,r){const i=C.useMemo(()=>{const s=Iae();return hae(s,t,Aae(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};Pae(s,e.style,e),i.style={...s,...i.style}}return i}const V5e=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function p6(e){return typeof e!="string"||e.includes("-")?!1:!!(V5e.indexOf(e)>-1||/[A-Z]/u.test(e))}function K5e(e,t,n,{latestValues:r},i,s=!1,a){const c=(a??p6(e)?z5e:$5e)(t,r,i,e),u=R5e(t,typeof e=="string",s),d=e!==C.Fragment?{...u,...c,ref:n}:{},{children:h}=t,A=C.useMemo(()=>Zs(h)?h.get():h,[h]);return C.createElement(e,{...d,children:A})}function q5e({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:W5e(n,r,i,e),renderState:t()}}function W5e(e,t,n,r){const i={},s=r(e,{});for(const A in s)i[A]=o_(s[A]);let{initial:a,animate:o}=e;const c=BE(e),u=rae(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),o===void 0&&(o=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const h=d?o:a;if(h&&typeof h!="boolean"&&!jE(h)){const A=Array.isArray(h)?h:[h];for(let f=0;f<A.length;f++){const p=i6(e,A[f]);if(p){const{transitionEnd:m,transition:g,...y}=p;for(const v in y){let x=y[v];if(Array.isArray(x)){const w=d?x.length-1:0;x=x[w]}x!==null&&(i[v]=x)}for(const v in m)i[v]=m[v]}}}return i}const Oae=e=>(t,n)=>{const r=C.useContext(NE),i=C.useContext(kE),s=()=>q5e(e,t,r,i);return n?s():UU(s)},G5e=Oae({scrapeMotionValuesFromProps:h6,createRenderState:A6}),Y5e=Oae({scrapeMotionValuesFromProps:pae,createRenderState:Iae}),X5e=Symbol.for("motionComponentSymbol");function J5e(e,t,n){const r=C.useRef(n);C.useInsertionEffect(()=>{r.current=n});const i=C.useRef(null);return C.useCallback(s=>{var o;s&&((o=e.onMount)==null||o.call(e,s)),t&&(s?t.mount(s):t.unmount());const a=r.current;if(typeof a=="function")if(s){const c=a(s);typeof c=="function"&&(i.current=c)}else i.current?(i.current(),i.current=null):a(s);else a&&(a.current=s)},[t])}const Fae=C.createContext({});function tw(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Z5e(e,t,n,r,i,s){var y,v;const{visualElement:a}=C.useContext(NE),o=C.useContext(Nae),c=C.useContext(kE),u=C.useContext(f6).reducedMotion,d=C.useRef(null),h=C.useRef(!1);r=r||o.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,isSVG:s}),h.current&&d.current&&(d.current.manuallyAnimateOnMount=!0));const A=d.current,f=C.useContext(Fae);A&&!A.projection&&i&&(A.type==="html"||A.type==="svg")&&eTe(d.current,n,i,f);const p=C.useRef(!1);C.useInsertionEffect(()=>{A&&p.current&&A.update(n,c)});const m=n[Qse],g=C.useRef(!!m&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,m))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,m)));return sse(()=>{h.current=!0,A&&(p.current=!0,window.MotionIsMounted=!0,A.updateFeatures(),A.scheduleRenderMicrotask(),g.current&&A.animationState&&A.animationState.animateChanges())}),C.useEffect(()=>{A&&(!g.current&&A.animationState&&A.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)==null||x.call(window,m)}),g.current=!1),A.enteringChildren=void 0)}),A}function eTe(e,t,n,r){const{layoutId:i,layout:s,drag:a,dragConstraints:o,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Mae(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!a||o&&tw(o),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function Mae(e){if(e)return e.options.allowProjection!==!1?e.projection:Mae(e.parent)}function iI(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&F5e(r);const s=n?n==="svg":p6(e),a=s?Y5e:G5e;function o(u,d){let h;const A={...C.useContext(f6),...u,layoutId:tTe(u)},{isStatic:f}=A,p=U5e(u),m=a(u,f);if(!f&&ise){nTe();const g=rTe(A);h=g.MeasureLayout,p.visualElement=Z5e(e,m,A,i,g.ProjectionNode,s)}return l.jsxs(NE.Provider,{value:p,children:[h&&p.visualElement?l.jsx(h,{visualElement:p.visualElement,...A}):null,K5e(e,u,J5e(m,p.visualElement,d),m,f,t,s)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=C.forwardRef(o);return c[X5e]=e,c}function tTe({layoutId:e}){const t=C.useContext(DU).id;return t&&e!==void 0?t+"-"+e:e}function nTe(e,t){C.useContext(Nae).strict}function rTe(e){const t=Eae(),{drag:n,layout:r}=t;if(!n&&!r)return{};const i={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function iTe(e,t){if(typeof Proxy>"u")return iI;const n=new Map,r=(s,a)=>iI(s,a,e,t),i=(s,a)=>r(s,a);return new Proxy(i,{get:(s,a)=>a==="create"?r:(n.has(a)||n.set(a,iI(a,void 0,e,t)),n.get(a))})}const sTe=(e,t)=>t.isSVG??p6(e)?new LEe(t):new TEe(t,{allowProjection:e!==C.Fragment});class aTe extends zf{constructor(t){super(t),t.animationState||(t.animationState=QEe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();jE(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let oTe=0;class lTe extends zf{constructor(){super(...arguments),this.id=oTe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const cTe={animation:{Feature:aTe},exit:{Feature:lTe}};function N2(e){return{point:{x:e.pageX,y:e.pageY}}}const uTe=e=>t=>l6(t)&&e(t,N2(t));function Ow(e,t,n,r){return $b(e,t,uTe(n),r)}const Lae=({current:e})=>e?e.ownerDocument.defaultView:null,C9=(e,t)=>Math.abs(e-t);function dTe(e,t){const n=C9(e.x,t.x),r=C9(e.y,t.y);return Math.sqrt(n**2+r**2)}const S9=new Set(["auto","scroll"]);class Rae{constructor(t,n,{transformPagePoint:r,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=f=>{this.handleScroll(f.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=aI(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=dTe(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:g}=f,{timestamp:y}=Cs;this.history.push({...g,timestamp:y});const{onStart:v,onMove:x}=this.handlers;p||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=sI(p,this.transformPagePoint),jr.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:m,onSessionEnd:g,resumeAnimation:y}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&y&&y(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=aI(f.type==="pointercancel"?this.lastMoveEventInfo:sI(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),g&&g(f,v)},!l6(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=i||window;const c=N2(t),u=sI(c,this.transformPagePoint),{point:d}=u,{timestamp:h}=Cs;this.history=[{...d,timestamp:h}];const{onSessionStart:A}=n;A&&A(t,aI(u,this.history)),this.removeListeners=_2(Ow(this.contextWindow,"pointermove",this.handlePointerMove),Ow(this.contextWindow,"pointerup",this.handlePointerUp),Ow(this.contextWindow,"pointercancel",this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(S9.has(r.overflowX)||S9.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,i=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:i.x-n.x,y:i.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,i),jr.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Bf(this.updatePoint)}}function sI(e,t){return t?{point:t(e.point)}:e}function k9(e,t){return{x:e.x-t.x,y:e.y-t.y}}function aI({point:e},t){return{point:e,delta:k9(e,Dae(t)),offset:k9(e,hTe(t)),velocity:fTe(t,.1)}}function hTe(e){return e[0]}function Dae(e){return e[e.length-1]}function fTe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=Dae(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>iu(t)));)n--;if(!r)return{x:0,y:0};const s=fl(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const a={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function ATe(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?zr(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?zr(n,e,r.max):Math.min(e,n)),e}function _9(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function pTe(e,{top:t,left:n,bottom:r,right:i}){return{x:_9(e.x,n,i),y:_9(e.y,t,r)}}function j9(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function mTe(e,t){return{x:j9(e.x,t.x),y:j9(e.y,t.y)}}function gTe(e,t){let n=.5;const r=xa(e),i=xa(t);return i>r?n=Db(t.min,t.max-r,e.min):r>i&&(n=Db(e.min,e.max-i,t.min)),du(0,1,n)}function yTe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const FF=.35;function vTe(e=FF){return e===!1?e=0:e===!0&&(e=FF),{x:B9(e,"left","right"),y:B9(e,"top","bottom")}}function B9(e,t,n){return{min:N9(e,t),max:N9(e,n)}}function N9(e,t){return typeof e=="number"?e:e[t]||0}const xTe=new WeakMap;class wTe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Di(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const s=h=>{n?(this.stopAnimation(),this.snapToCursor(N2(h).point)):this.pauseAnimation()},a=(h,A)=>{this.stopAnimation();const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=lEe(f),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=A,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Jo(y=>{let v=this.getAxisMotionValue(y).get()||0;if(su.test(v)){const{projection:x}=this.visualElement;if(x&&x.layout){const w=x.layout.layoutBox[y];w&&(v=xa(w)*(parseFloat(v)/100))}}this.originPoint[y]=v}),m&&jr.postRender(()=>m(h,A)),jF(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(h,A)=>{this.latestPointerEvent=h,this.latestPanInfo=A;const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:m,onDrag:g}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:y}=A;if(p&&this.currentDirection===null){this.currentDirection=bTe(y),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",A.point,y),this.updateAxis("y",A.point,y),this.visualElement.render(),g&&g(h,A)},c=(h,A)=>{this.latestPointerEvent=h,this.latestPanInfo=A,this.stop(h,A),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>Jo(h=>{var A;return this.getAnimationState(h)==="paused"&&((A=this.getAxisMotionValue(h).animation)==null?void 0:A.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new Rae(t,{onSessionStart:s,onStart:a,onMove:o,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:Lae(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,i=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!r)return;const{velocity:a}=i;this.startAnimation(a);const{onDragEnd:o}=this.getProps();o&&jr.postRender(()=>o(r,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!pS(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=ATe(a,this.constraints[t],this.elastic[t])),s.set(a)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&tw(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=pTe(r.layoutBox,t):this.constraints=!1,this.elastic=vTe(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Jo(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=yTe(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!tw(t))return!1;const r=t.current;uv(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=kEe(r,i.root,this.visualElement.getTransformPagePoint());let a=mTe(i.layout.layoutBox,s);if(n){const o=n(bEe(a));this.hasMutatedConstraints=!!o,o&&(a=aae(o))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),c=this.constraints||{},u=Jo(d=>{if(!pS(d,n,this.currentDirection))return;let h=c&&c[d]||{};a&&(h={min:0,max:0});const A=i?200:1e6,f=i?40:1e7,p={type:"inertia",velocity:r?t[d]:0,bounceStiffness:A,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...s,...h};return this.startAxisValueAnimation(d,p)});return Promise.all(u).then(o)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return jF(this.visualElement,t),r.start(r6(t,r,0,n,this.visualElement,!1))}stopAnimation(){Jo(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Jo(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Jo(n=>{const{drag:r}=this.getProps();if(!pS(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:o}=i.layout.layoutBox[n],c=s.get()||0;s.set(t[n]-zr(a,o,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!tw(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Jo(a=>{const o=this.getAxisMotionValue(a);if(o&&this.constraints!==!1){const c=o.get();i[a]=gTe({min:c,max:c},this.constraints[a])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Jo(a=>{if(!pS(a,t,null))return;const o=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];o.set(zr(c,u,i[a]))})}addListeners(){if(!this.visualElement.current)return;xTe.set(this.visualElement,this);const t=this.visualElement.current,n=Ow(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps(),h=c.target,A=h!==t&&eae(h);u&&d&&!A&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();tw(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),jr.read(r);const a=$b(window,"resize",()=>this.scalePositionWithinConstraints()),o=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Jo(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=c[d].translate,h.set(h.get()+c[d].translate))}),this.visualElement.render())});return()=>{a(),n(),s(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:a=FF,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:a,dragMomentum:o}}}function pS(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function bTe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class CTe extends zf{constructor(t){super(t),this.removeGroupControls=vl,this.removeListeners=vl,this.controls=new wTe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vl}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const E9=e=>(t,n)=>{e&&jr.postRender(()=>e(t,n))};class STe extends zf{constructor(){super(...arguments),this.removePointerDownListener=vl}onPointerDown(t){this.session=new Rae(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Lae(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:E9(t),onStart:E9(n),onMove:r,onEnd:(s,a)=>{delete this.session,i&&jr.postRender(()=>i(s,a))}}}mount(){this.removePointerDownListener=Ow(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let oI=!1;class kTe extends C.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),oI&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),l_.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,{projection:a}=r;return a&&(a.isPresent=s,t.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),oI=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==s?a.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?a.promote():a.relegate()||jr.postRender(()=>{const o=a.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),o6.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;oI=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Uae(e){const[t,n]=Bae(),r=C.useContext(DU);return l.jsx(kTe,{...e,layoutGroup:r,switchLayoutGroup:C.useContext(Fae),isPresent:t,safeToRemove:n})}const _Te={pan:{Feature:STe},drag:{Feature:CTe,ProjectionNode:jae,MeasureLayout:Uae}};function T9(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&jr.postRender(()=>s(t,N2(t)))}class jTe extends zf{mount(){const{current:t}=this.node;t&&(this.unmount=cEe(t,(n,r)=>(T9(this.node,r,"Start"),i=>T9(this.node,i,"End"))))}unmount(){}}class BTe extends zf{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=_2($b(this.node.current,"focus",()=>this.onFocus()),$b(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function P9(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&jr.postRender(()=>s(t,N2(t)))}class NTe extends zf{mount(){const{current:t}=this.node;t&&(this.unmount=hEe(t,(n,r)=>(P9(this.node,r,"Start"),(i,{success:s})=>P9(this.node,i,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const MF=new WeakMap,lI=new WeakMap,ETe=e=>{const t=MF.get(e.target);t&&t(e)},TTe=e=>{e.forEach(ETe)};function PTe({root:e,...t}){const n=e||document;lI.has(n)||lI.set(n,{});const r=lI.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(TTe,{root:e,...t})),r[i]}function ITe(e,t,n){const r=PTe(t);return MF.set(e,n),r.observe(e),()=>{MF.delete(e),r.unobserve(e)}}const OTe={some:0,all:1};class FTe extends zf{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:OTe[i]},o=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),A=u?d:h;A&&A(c)};return ITe(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(MTe(t,n))&&this.startObserver()}unmount(){}}function MTe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const LTe={inView:{Feature:FTe},tap:{Feature:NTe},focus:{Feature:BTe},hover:{Feature:jTe}},RTe={layout:{ProjectionNode:jae,MeasureLayout:Uae}},DTe={...cTe,...LTe,..._Te,...RTe},hi=iTe(DTe,sTe),UTe={some:0,all:1};function HTe(e,t,{root:n,margin:r,amount:i="some"}={}){const s=Gse(e),a=new WeakMap,o=u=>{u.forEach(d=>{const h=a.get(d.target);if(d.isIntersecting!==!!h)if(d.isIntersecting){const A=t(d.target,d);typeof A=="function"?a.set(d.target,A):c.unobserve(d.target)}else typeof h=="function"&&(h(d),a.delete(d.target))})},c=new IntersectionObserver(o,{root:n,rootMargin:r,threshold:typeof i=="number"?i:UTe[i]});return s.forEach(u=>c.observe(u)),()=>c.disconnect()}function QTe(e,{root:t,margin:n,amount:r,once:i=!1,initial:s=!1}={}){const[a,o]=C.useState(s);return C.useEffect(()=>{if(!e.current||i&&a)return;const c=()=>(o(!0),i?void 0:()=>o(!1)),u={root:t&&t.current||void 0,margin:n,amount:r};return HTe(e.current,c,u)},[t,e,n,i,r]),a}var Gc=function(){return Gc=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Gc.apply(this,arguments)};function d0(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function $Te(e,t,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function o(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?s(d.value):i(d.value).then(o,c)}u((r=r.apply(e,t||[])).next())})}function zTe(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}const VTe=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class m6 extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}}class KTe extends m6{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class I9 extends m6{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class O9 extends m6{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var LF;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(LF||(LF={}));class qTe{constructor(t,{headers:n={},customFetch:r,region:i=LF.Any}={}){this.url=t,this.headers=n,this.region=i,this.fetch=VTe(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return $Te(this,arguments,void 0,function*(n,r={}){var i;let s,a;try{const{headers:o,method:c,body:u,signal:d,timeout:h}=r;let A={},{region:f}=r;f||(f=this.region);const p=new URL(`${this.url}/${n}`);f&&f!=="any"&&(A["x-region"]=f,p.searchParams.set("forceFunctionRegion",f));let m;u&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(A["Content-Type"]="application/octet-stream",m=u):typeof u=="string"?(A["Content-Type"]="text/plain",m=u):typeof FormData<"u"&&u instanceof FormData?m=u:(A["Content-Type"]="application/json",m=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?m=JSON.stringify(u):m=u;let g=d;h&&(a=new AbortController,s=setTimeout(()=>a.abort(),h),d?(g=a.signal,d.addEventListener("abort",()=>a.abort())):g=a.signal);const y=yield this.fetch(p.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},A),this.headers),o),body:m,signal:g}).catch(b=>{throw new KTe(b)}),v=y.headers.get("x-relay-error");if(v&&v==="true")throw new I9(y);if(!y.ok)throw new O9(y);let x=((i=y.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),w;return x==="application/json"?w=yield y.json():x==="application/octet-stream"||x==="application/pdf"?w=yield y.blob():x==="text/event-stream"?w=y:x==="multipart/form-data"?w=yield y.formData():w=yield y.text(),{data:w,error:null,response:y}}catch(o){return{data:null,error:o,response:o instanceof O9||o instanceof I9?o.context:void 0}}finally{s&&clearTimeout(s)}})}}var WTe=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},GTe=class{constructor(e){var t,n;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var n=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const r=this.fetch;let i=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async s=>{let a=null,o=null,c=null,u=s.status,d=s.statusText;if(s.ok){var h,A;if(n.method!=="HEAD"){var f;const y=await s.text();y===""||(n.headers.get("Accept")==="text/csv"||n.headers.get("Accept")&&(!((f=n.headers.get("Accept"))===null||f===void 0)&&f.includes("application/vnd.pgrst.plan+text"))?o=y:o=JSON.parse(y))}const m=(h=n.headers.get("Prefer"))===null||h===void 0?void 0:h.match(/count=(exact|planned|estimated)/),g=(A=s.headers.get("content-range"))===null||A===void 0?void 0:A.split("/");m&&g&&g.length>1&&(c=parseInt(g[1])),n.isMaybeSingle&&n.method==="GET"&&Array.isArray(o)&&(o.length>1?(a={code:"PGRST116",details:`Results contain ${o.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},o=null,c=null,u=406,d="Not Acceptable"):o.length===1?o=o[0]:o=null)}else{var p;const m=await s.text();try{a=JSON.parse(m),Array.isArray(a)&&s.status===404&&(o=[],a=null,u=200,d="OK")}catch{s.status===404&&m===""?(u=204,d="No Content"):a={message:m}}if(a&&n.isMaybeSingle&&(!(a==null||(p=a.details)===null||p===void 0)&&p.includes("0 rows"))&&(a=null,u=200,d="OK"),a&&n.shouldThrowOnError)throw new WTe(a)}return{error:a,data:o,count:c,status:u,statusText:d}});return this.shouldThrowOnError||(i=i.catch(s=>{var a;let o="";const c=s==null?void 0:s.cause;if(c){var u,d,h,A;const p=(u=c==null?void 0:c.message)!==null&&u!==void 0?u:"",m=(d=c==null?void 0:c.code)!==null&&d!==void 0?d:"";o=`${(h=s==null?void 0:s.name)!==null&&h!==void 0?h:"FetchError"}: ${s==null?void 0:s.message}`,o+=`

Caused by: ${(A=c==null?void 0:c.name)!==null&&A!==void 0?A:"Error"}: ${p}`,m&&(o+=` (${m})`),c!=null&&c.stack&&(o+=`
${c.stack}`)}else{var f;o=(f=s==null?void 0:s.stack)!==null&&f!==void 0?f:""}return{error:{message:`${(a=s==null?void 0:s.name)!==null&&a!==void 0?a:"FetchError"}: ${s==null?void 0:s.message}`,details:o,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),i.then(e,t)}returns(){return this}overrideTypes(){return this}},YTe=class extends GTe{select(e){let t=!1;const n=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:i=r}={}){const s=i?`${i}.order`:"order",a=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${a?`${a},`:""}${e}.${t?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const i=typeof r>"u"?"offset":`${r}.offset`,s=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(s,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:i=!1,format:s="text"}={}){var a;const o=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,i?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${s}; for="${c}"; options=${o};`),s==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const F9=new RegExp("[,()]");var Pg=class extends YTe{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&F9.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&F9.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let i="";r==="plain"?i="pl":r==="phrase"?i="ph":r==="websearch"&&(i="w");const s=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${i}fts${s}.${t}`),this}match(e){return Object.entries(e).forEach(([t,n])=>{this.url.searchParams.append(t,`eq.${n}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},XTe=class{constructor(e,{headers:t={},schema:n,fetch:r}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=t??{},i=n?"HEAD":"GET";let s=!1;const a=(e??"*").split("").map(u=>/\s/.test(u)&&!s?"":(u==='"'&&(s=!s),u)).join(""),{url:o,headers:c}=this.cloneRequestState();return o.searchParams.set("select",a),r&&c.append("Prefer",`count=${r}`),new Pg({method:i,url:o,headers:c,schema:this.schema,fetch:this.fetch})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const i="POST",{url:s,headers:a}=this.cloneRequestState();if(t&&a.append("Prefer",`count=${t}`),n||a.append("Prefer","missing=default"),Array.isArray(e)){const o=e.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(o.length>0){const c=[...new Set(o)].map(u=>`"${u}"`);s.searchParams.set("columns",c.join(","))}}return new Pg({method:i,url:s,headers:a,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:i=!0}={}){var s;const a="POST",{url:o,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&o.searchParams.set("on_conflict",t),r&&c.append("Prefer",`count=${r}`),i||c.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((d,h)=>d.concat(Object.keys(h)),[]);if(u.length>0){const d=[...new Set(u)].map(h=>`"${h}"`);o.searchParams.set("columns",d.join(","))}}return new Pg({method:a,url:o,headers:c,schema:this.schema,body:e,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}update(e,{count:t}={}){var n;const r="PATCH",{url:i,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new Pg({method:r,url:i,headers:s,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:e}={}){var t;const n="DELETE",{url:r,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new Pg({method:n,url:r,headers:i,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch})}},JTe=class Hae{constructor(t,{headers:n={},schema:r,fetch:i}={}){this.url=t,this.headers=new Headers(n),this.schemaName=r,this.fetch=i}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new XTe(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new Hae(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,n={},{head:r=!1,get:i=!1,count:s}={}){var a;let o;const c=new URL(`${this.url}/rpc/${t}`);let u;const d=f=>f!==null&&typeof f=="object"&&(!Array.isArray(f)||f.some(d)),h=r&&Object.values(n).some(d);h?(o="POST",u=n):r||i?(o=r?"HEAD":"GET",Object.entries(n).filter(([f,p])=>p!==void 0).map(([f,p])=>[f,Array.isArray(p)?`{${p.join(",")}}`:`${p}`]).forEach(([f,p])=>{c.searchParams.append(f,p)})):(o="POST",u=n);const A=new Headers(this.headers);return h?A.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&A.set("Prefer",`count=${s}`),new Pg({method:o,url:c,headers:A,schema:this.schemaName,body:u,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}};class ZTe{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const n=globalThis.process;if(n){const r=n.versions;if(r&&r.node){const i=r.node,s=parseInt(i.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
import ws from "ws"
new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=`

Suggested solution: ${t.workaround}`),new Error(n)}static createWebSocket(t,n){const r=this.getWebSocketConstructor();return new r(t,n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const ePe="2.93.2",tPe=`realtime-js/${ePe}`,nPe="1.0.0",Qae="2.0.0",M9=Qae,RF=1e4,rPe=1e3,iPe=100;var mh;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(mh||(mh={}));var Ri;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Ri||(Ri={}));var ec;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(ec||(ec={}));var DF;(function(e){e.websocket="websocket"})(DF||(DF={}));var QA;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(QA||(QA={}));class sPe{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,r;const i=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,i)}_encodeJsonUserBroadcastPush(t){var n,r;const i=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},a=new TextEncoder().encode(JSON.stringify(i)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(t,n,r){var i,s;const a=t.topic,o=(i=t.ref)!==null&&i!==void 0?i:"",c=(s=t.join_ref)!==null&&s!==void 0?s:"",u=t.payload.event,d=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},h=Object.keys(d).length===0?"":JSON.stringify(d);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const A=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+o.length+a.length+u.length+h.length,f=new ArrayBuffer(this.HEADER_LENGTH+A);let p=new DataView(f),m=0;p.setUint8(m++,this.KINDS.userBroadcastPush),p.setUint8(m++,c.length),p.setUint8(m++,o.length),p.setUint8(m++,a.length),p.setUint8(m++,u.length),p.setUint8(m++,h.length),p.setUint8(m++,n),Array.from(c,y=>p.setUint8(m++,y.charCodeAt(0))),Array.from(o,y=>p.setUint8(m++,y.charCodeAt(0))),Array.from(a,y=>p.setUint8(m++,y.charCodeAt(0))),Array.from(u,y=>p.setUint8(m++,y.charCodeAt(0))),Array.from(h,y=>p.setUint8(m++,y.charCodeAt(0)));var g=new Uint8Array(f.byteLength+r.byteLength);return g.set(new Uint8Array(f),0),g.set(new Uint8Array(r),f.byteLength),g.buffer}decode(t,n){if(this._isArrayBuffer(t)){let r=this._binaryDecode(t);return n(r)}if(typeof t=="string"){const r=JSON.parse(t),[i,s,a,o,c]=r;return n({join_ref:i,ref:s,topic:a,event:o,payload:c})}return n({})}_binaryDecode(t){const n=new DataView(t),r=n.getUint8(0),i=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,i)}}_decodeUserBroadcast(t,n,r){const i=n.getUint8(1),s=n.getUint8(2),a=n.getUint8(3),o=n.getUint8(4);let c=this.HEADER_LENGTH+4;const u=r.decode(t.slice(c,c+i));c=c+i;const d=r.decode(t.slice(c,c+s));c=c+s;const h=r.decode(t.slice(c,c+a));c=c+a;const A=t.slice(c,t.byteLength),f=o===this.JSON_ENCODING?JSON.parse(r.decode(A)):A,p={type:this.BROADCAST_EVENT,event:d,payload:f};return a>0&&(p.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:p}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t==null?void 0:t.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)))}}class $ae{constructor(t,n){this.callback=t,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var hr;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(hr||(hr={}));const L9=(e,t,n={})=>{var r;const i=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((s,a)=>(s[a]=aPe(a,e,t,i),s),{}):{}},aPe=(e,t,n,r)=>{const i=t.find(o=>o.name===e),s=i==null?void 0:i.type,a=n[e];return s&&!r.includes(s)?zae(s,a):UF(a)},zae=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return uPe(t,n)}switch(e){case hr.bool:return oPe(t);case hr.float4:case hr.float8:case hr.int2:case hr.int4:case hr.int8:case hr.numeric:case hr.oid:return lPe(t);case hr.json:case hr.jsonb:return cPe(t);case hr.timestamp:return dPe(t);case hr.abstime:case hr.date:case hr.daterange:case hr.int4range:case hr.int8range:case hr.money:case hr.reltime:case hr.text:case hr.time:case hr.timestamptz:case hr.timetz:case hr.tsrange:case hr.tstzrange:return UF(t);default:return UF(t)}},UF=e=>e,oPe=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},lPe=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},cPe=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},uPe=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let s;const a=e.slice(1,n);try{s=JSON.parse("["+a+"]")}catch{s=a?a.split(","):[]}return s.map(o=>zae(t,o))}return e},dPe=e=>typeof e=="string"?e.replace(" ","T"):e,Vae=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class cI{constructor(t,n,r={},i=RF){this.channel=t,this.event=n,this.payload=r,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,n){var r;return this._hasReceived(t)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:t,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(n))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var R9;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(R9||(R9={}));class Fw{constructor(t,n){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},i=>{const{onJoin:s,onLeave:a,onSync:o}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Fw.syncState(this.state,i,s,a),this.pendingDiffs.forEach(c=>{this.state=Fw.syncDiff(this.state,c,s,a)}),this.pendingDiffs=[],o()}),this.channel._on(r.diff,{},i=>{const{onJoin:s,onLeave:a,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=Fw.syncDiff(this.state,i,s,a),o())}),this.onJoin((i,s,a)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:s,newPresences:a})}),this.onLeave((i,s,a)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:s,leftPresences:a})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,n,r,i){const s=this.cloneDeep(t),a=this.transformState(n),o={},c={};return this.map(s,(u,d)=>{a[u]||(c[u]=d)}),this.map(a,(u,d)=>{const h=s[u];if(h){const A=d.map(g=>g.presence_ref),f=h.map(g=>g.presence_ref),p=d.filter(g=>f.indexOf(g.presence_ref)<0),m=h.filter(g=>A.indexOf(g.presence_ref)<0);p.length>0&&(o[u]=p),m.length>0&&(c[u]=m)}else o[u]=d}),this.syncDiff(s,{joins:o,leaves:c},r,i)}static syncDiff(t,n,r,i){const{joins:s,leaves:a}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),i||(i=()=>{}),this.map(s,(o,c)=>{var u;const d=(u=t[o])!==null&&u!==void 0?u:[];if(t[o]=this.cloneDeep(c),d.length>0){const h=t[o].map(f=>f.presence_ref),A=d.filter(f=>h.indexOf(f.presence_ref)<0);t[o].unshift(...A)}r(o,d,c)}),this.map(a,(o,c)=>{let u=t[o];if(!u)return;const d=c.map(h=>h.presence_ref);u=u.filter(h=>d.indexOf(h.presence_ref)<0),t[o]=u,i(o,u,c),u.length===0&&delete t[o]}),t}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const i=t[r];return"metas"in i?n[r]=i.metas.map(s=>(s.presence_ref=s.phx_ref,delete s.phx_ref,delete s.phx_ref_prev,s)):n[r]=i,n},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var D9;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(D9||(D9={}));var Mw;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Mw||(Mw={}));var Ku;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Ku||(Ku={}));class sy{constructor(t,n={config:{}},r){var i,s;if(this.topic=t,this.params=n,this.socket=r,this.bindings={},this.state=Ri.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new cI(this,ec.join,this.params,this.timeout),this.rejoinTimer=new $ae(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Ri.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Ri.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Ri.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Ri.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Ri.errored,this.rejoinTimer.scheduleTimeout())}),this._on(ec.reply,{},(a,o)=>{this._trigger(this._replyEventName(o),a)}),this.presence=new Fw(this),this.broadcastEndpointURL=Vae(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((s=(i=this.params.config)===null||i===void 0?void 0:i.broadcast)===null||s===void 0)&&s.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,n=this.timeout){var r,i,s;if(this.socket.isConnected()||this.socket.connect(),this.state==Ri.closed){const{config:{broadcast:a,presence:o,private:c}}=this.params,u=(i=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(f=>f.filter))!==null&&i!==void 0?i:[],d=!!this.bindings[Mw.PRESENCE]&&this.bindings[Mw.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,h={},A={broadcast:a,presence:Object.assign(Object.assign({},o),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(f=>t==null?void 0:t(Ku.CHANNEL_ERROR,f)),this._onClose(()=>t==null?void 0:t(Ku.CLOSED)),this.updateJoinPayload(Object.assign({config:A},h)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:f})=>{var p;if(this.socket._isManualToken()||this.socket.setAuth(),f===void 0){t==null||t(Ku.SUBSCRIBED);return}else{const m=this.bindings.postgres_changes,g=(p=m==null?void 0:m.length)!==null&&p!==void 0?p:0,y=[];for(let v=0;v<g;v++){const x=m[v],{filter:{event:w,schema:b,table:k,filter:j}}=x,B=f&&f[v];if(B&&B.event===w&&sy.isFilterValueEqual(B.schema,b)&&sy.isFilterValueEqual(B.table,k)&&sy.isFilterValueEqual(B.filter,j))y.push(Object.assign(Object.assign({},x),{id:B.id}));else{this.unsubscribe(),this.state=Ri.errored,t==null||t(Ku.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=y,t&&t(Ku.SUBSCRIBED);return}}).receive("error",f=>{this.state=Ri.errored,t==null||t(Ku.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(f).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Ku.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,r){return this.state===Ri.joined&&t===Mw.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(t,n,r)}async httpSend(t,n,r={}){var i;if(n==null)return Promise.reject("Payload is required for httpSend()");const s={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(s.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a={method:"POST",headers:s,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:n,private:this.private}]})},o=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(i=r.timeout)!==null&&i!==void 0?i:this.timeout);if(o.status===202)return{success:!0};let c=o.statusText;try{const u=await o.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(t,n={}){var r,i;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:s,payload:a}=t,o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:a,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((i=u.body)===null||i===void 0?void 0:i.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var a,o,c;const u=this._push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(o=(a=this.params)===null||a===void 0?void 0:a.config)===null||o===void 0?void 0:o.broadcast)===null||c===void 0)&&c.ack)&&s("ok"),u.receive("ok",()=>s("ok")),u.receive("error",()=>s("error")),u.receive("timeout",()=>s("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Ri.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(ec.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(i=>{r=new cI(this,ec.leave,{},t),r.receive("ok",()=>{n(),i("ok")}).receive("timeout",()=>{n(),i("timed out")}).receive("error",()=>{i("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Ri.closed,this.bindings={}}async _fetchWithTimeout(t,n,r){const i=new AbortController,s=setTimeout(()=>i.abort(),r),a=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:i.signal}));return clearTimeout(s),a}_push(t,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new cI(this,t,n,r);return this._canPush()?i.send():this._addToPushBuffer(i),i}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>iPe){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(t,n,r){return n}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,n,r){var i,s;const a=t.toLocaleLowerCase(),{close:o,error:c,leave:u,join:d}=ec;if(r&&[o,c,u,d].indexOf(a)>=0&&r!==this._joinRef())return;let A=this._onMessage(a,n,r);if(n&&!A)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(a)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(f=>{var p,m,g;return((p=f.filter)===null||p===void 0?void 0:p.event)==="*"||((g=(m=f.filter)===null||m===void 0?void 0:m.event)===null||g===void 0?void 0:g.toLocaleLowerCase())===a}).map(f=>f.callback(A,r)):(s=this.bindings[a])===null||s===void 0||s.filter(f=>{var p,m,g,y,v,x;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in f){const w=f.id,b=(p=f.filter)===null||p===void 0?void 0:p.event;return w&&((m=n.ids)===null||m===void 0?void 0:m.includes(w))&&(b==="*"||(b==null?void 0:b.toLocaleLowerCase())===((g=n.data)===null||g===void 0?void 0:g.type.toLocaleLowerCase()))}else{const w=(v=(y=f==null?void 0:f.filter)===null||y===void 0?void 0:y.event)===null||v===void 0?void 0:v.toLocaleLowerCase();return w==="*"||w===((x=n==null?void 0:n.event)===null||x===void 0?void 0:x.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===a}).map(f=>{if(typeof A=="object"&&"ids"in A){const p=A.data,{schema:m,table:g,commit_timestamp:y,type:v,errors:x}=p;A=Object.assign(Object.assign({},{schema:m,table:g,commit_timestamp:y,eventType:v,new:{},old:{},errors:x}),this._getPayloadRecords(p))}f.callback(A,r)})}_isClosed(){return this.state===Ri.closed}_isJoined(){return this.state===Ri.joined}_isJoining(){return this.state===Ri.joining}_isLeaving(){return this.state===Ri.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,n,r){const i=t.toLocaleLowerCase(),s={type:i,filter:n,callback:r};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],this}_off(t,n){const r=t.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(i=>{var s;return!(((s=i.type)===null||s===void 0?void 0:s.toLocaleLowerCase())===r&&sy.isEqual(i.filter,n))})),this}static isEqual(t,n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(const r in t)if(t[r]!==n[r])return!1;return!0}static isFilterValueEqual(t,n){return(t??void 0)===(n??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(ec.close,{},t)}_onError(t){this._on(ec.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Ri.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=L9(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=L9(t.columns,t.old_record)),n}}const uI=()=>{},mS={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},hPe=[1e3,2e3,5e3,1e4],fPe=1e4,APe=`
  addEventListener("message", (e) => {
    if (e.data.event === "start") {
      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
    }
  });`;class pPe{constructor(t,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=RF,this.transport=null,this.heartbeatIntervalMs=mS.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=uI,this.ref=0,this.reconnectTimer=null,this.vsn=M9,this.logger=uI,this.conn=null,this.sendBuffer=[],this.serializer=new sPe,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=i=>i?(...s)=>i(...s):(...s)=>fetch(...s),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey,this.endPoint=`${t}/${DF.websocket}`,this.httpEndpoint=Vae(t),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=ZTe.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const n=t.message;throw n.includes("Node.js")?new Error(`${n}

To use Realtime in Node.js, you need to provide a WebSocket implementation:

Option 1: Use Node.js 22+ which has native WebSocket support
Option 2: Install and provide the "ws" package:

  npm install ws

  import ws from "ws"
  const client = new RealtimeClient(url, {
    ...options,
    transport: ws
  })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,n??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,n,r){this.logger(t,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case mh.connecting:return QA.Connecting;case mh.open:return QA.Open;case mh.closing:return QA.Closing;default:return QA.Closed}}isConnected(){return this.connectionState()===QA.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,n={config:{}}){const r=`realtime:${t}`,i=this.getChannels().find(s=>s.topic===r);if(i)return i;{const s=new sy(`realtime:${t}`,n,this);return this.channels.push(s),s}}push(t){const{topic:n,event:r,payload:i,ref:s}=t,a=()=>{this.encode(t,o=>{var c;(c=this.conn)===null||c===void 0||c.send(o)})};this.log("push",`${n} ${r} (${s})`,i),this.isConnected()?a():this.sendBuffer.push(a)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(rPe,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},mS.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let n=this.channels.find(r=>r.topic===t&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${t}"`),n.unsubscribe())}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,n=>{if(n.topic==="phoenix"&&n.event==="phx_reply"&&n.ref&&n.ref===this.pendingHeartbeatRef){const u=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error",u)}catch(d){this.log("error","error in heartbeat callback",d)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:r,event:i,payload:s,ref:a}=n,o=a?`(${a})`:"",c=s.status||"";this.log("receive",`${c} ${r} ${i} ${o}`.trim(),s),this.channels.filter(u=>u._isMember(r)).forEach(u=>u._trigger(i,s,a)),this._triggerStateCallbacks("message",n)})}_clearTimer(t){var n;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t),this.conn.readyState===mh.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===mh.open||this.conn.readyState===mh.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(n=>{this.log("error","error waiting for auth on connect",n),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(t){var n;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t);try{this.heartbeatCallback("error")}catch(n){this.log("error","error in heartbeat callback",n)}}_triggerChanError(){this.channels.forEach(t=>t._trigger(ec.error))}_appendParams(t,n){if(Object.keys(n).length===0)return t;const r=t.match(/\?/)?"&":"?",i=new URLSearchParams(n);return`${t}${r}${i}`}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([APe],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(t,n=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(t=null){let n,r=!1;if(t)n=t,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(i){this.log("error","Error fetching access token from callback",i),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(i=>{const s={access_token:n,version:tPe};n&&i.updateJoinPayload(s),i.joinedOnce&&i._isJoined()&&i._push(ec.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${t}`,n)})}_triggerStateCallbacks(t,n){try{this.stateChangeCallbacks[t].forEach(r=>{try{r(n)}catch(i){this.log("error",`error in ${t} callback`,i)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new $ae(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},mS.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var n,r,i,s,a,o,c,u,d,h,A,f;switch(this.transport=(n=t==null?void 0:t.transport)!==null&&n!==void 0?n:null,this.timeout=(r=t==null?void 0:t.timeout)!==null&&r!==void 0?r:RF,this.heartbeatIntervalMs=(i=t==null?void 0:t.heartbeatIntervalMs)!==null&&i!==void 0?i:mS.HEARTBEAT_INTERVAL,this.worker=(s=t==null?void 0:t.worker)!==null&&s!==void 0?s:!1,this.accessToken=(a=t==null?void 0:t.accessToken)!==null&&a!==void 0?a:null,this.heartbeatCallback=(o=t==null?void 0:t.heartbeatCallback)!==null&&o!==void 0?o:uI,this.vsn=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:M9,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:p=>hPe[p-1]||fPe,this.vsn){case nPe:this.encode=(d=t==null?void 0:t.encode)!==null&&d!==void 0?d:(p,m)=>m(JSON.stringify(p)),this.decode=(h=t==null?void 0:t.decode)!==null&&h!==void 0?h:(p,m)=>m(JSON.parse(p));break;case Qae:this.encode=(A=t==null?void 0:t.encode)!==null&&A!==void 0?A:this.serializer.encode.bind(this.serializer),this.decode=(f=t==null?void 0:t.decode)!==null&&f!==void 0?f:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}var zb=class extends Error{constructor(e,t){var n;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((n=t.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function mPe(e,t,n){const r=new URL(t,e);if(n)for(const[i,s]of Object.entries(n))s!==void 0&&r.searchParams.set(i,s);return r.toString()}async function gPe(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function yPe(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:i,body:s,headers:a}){const o=mPe(e.baseUrl,r,i),c=await gPe(e.auth),u=await t(o,{method:n,headers:{...s?{"Content-Type":"application/json"}:{},...c,...a},body:s?JSON.stringify(s):void 0}),d=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),A=h&&d?JSON.parse(d):d;if(!u.ok){const f=h?A:void 0,p=f==null?void 0:f.error;throw new zb((p==null?void 0:p.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:p==null?void 0:p.type,icebergCode:p==null?void 0:p.code,details:f})}return{status:u.status,headers:u.headers,data:A}}}}function gS(e){return e.join("")}var vPe=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:gS(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${gS(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${gS(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${gS(e.namespace)}`}),!0}catch(t){if(t instanceof zb&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof zb&&n.status===409)return;throw n}}};function tg(e){return e.join("")}var xPe=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${tg(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${tg(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${tg(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${tg(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${tg(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${tg(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof zb&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof zb&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},wPe=class{constructor(e){var r;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=yPe({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(r=e.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new vPe(this.client,t),this.tableOps=new xPe(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},EE=class extends Error{constructor(e,t="storage",n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}};function TE(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var yS=class extends EE{constructor(e,t,n,r="storage"){super(e,r,t,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},Kae=class extends EE{constructor(e,t,n="storage"){super(e,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const bPe=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),CPe=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},HF=e=>{if(Array.isArray(e))return e.map(n=>HF(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const i=n.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));t[i]=HF(r)}),t},SPe=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function Vb(e){"@babel/helpers - typeof";return Vb=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},Vb(e)}function kPe(e,t){if(Vb(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Vb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _Pe(e){var t=kPe(e,"string");return Vb(t)=="symbol"?t:t+""}function jPe(e,t,n){return(t=_Pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U9(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U9(Object(n),!0).forEach(function(r){jPe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U9(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const H9=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},BPe=async(e,t,n,r)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(n!=null&&n.noResolveJson)){const i=e,s=i.status||500;if(typeof i.json=="function")i.json().then(a=>{const o=(a==null?void 0:a.statusCode)||(a==null?void 0:a.code)||s+"";t(new yS(H9(a),s,o,r))}).catch(()=>{if(r==="vectors"){const a=s+"";t(new yS(i.statusText||`HTTP ${s} error`,s,a,r))}else{const a=s+"";t(new yS(i.statusText||`HTTP ${s} error`,s,a,r))}});else{const a=s+"";t(new yS(i.statusText||`HTTP ${s} error`,s,a,r))}}else t(new Kae(H9(e),e,r))},NPe=(e,t,n,r)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||e==="HEAD"||!r?Kt(Kt({},i),n):(CPe(r)?(i.headers=Kt({"Content-Type":"application/json"},t==null?void 0:t.headers),i.body=JSON.stringify(r)):i.body=r,t!=null&&t.duplex&&(i.duplex=t.duplex),Kt(Kt({},i),n))};async function wx(e,t,n,r,i,s,a){return new Promise((o,c)=>{e(n,NPe(t,r,i,s)).then(u=>{if(!u.ok)throw u;if(r!=null&&r.noResolveJson)return u;if(a==="vectors"){const d=u.headers.get("content-type");if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>o(u)).catch(u=>BPe(u,c,r,a))})}function EPe(e="storage"){return{get:async(t,n,r,i)=>wx(t,"GET",n,r,i,void 0,e),post:async(t,n,r,i,s)=>wx(t,"POST",n,i,s,r,e),put:async(t,n,r,i,s)=>wx(t,"PUT",n,i,s,r,e),head:async(t,n,r,i)=>wx(t,"HEAD",n,Kt(Kt({},r),{},{noResolveJson:!0}),i,void 0,e),remove:async(t,n,r,i,s)=>wx(t,"DELETE",n,i,s,r,e)}}const TPe=EPe("storage"),{get:Kb,post:Ir,put:QF,head:PPe,remove:g6}=TPe;var h0=class{constructor(e,t={},n,r="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.fetch=bPe(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(TE(n))return{data:null,error:n};throw n}}},IPe=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(TE(t))return{data:null,error:t};throw t}}};let qae;qae=Symbol.toStringTag;var OPe=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[qae]="BlobDownloadBuilder",this.promise=null}asStream(){return new IPe(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(TE(t))return{data:null,error:t};throw t}}};const FPe={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Q9={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var MPe=class extends h0{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var i=this;return i.handleOperation(async()=>{let s;const a=Kt(Kt({},Q9),r);let o=Kt(Kt({},i.headers),e==="POST"&&{"x-upsert":String(a.upsert)});const c=a.metadata;typeof Blob<"u"&&n instanceof Blob?(s=new FormData,s.append("cacheControl",a.cacheControl),c&&s.append("metadata",i.encodeMetadata(c)),s.append("",n)):typeof FormData<"u"&&n instanceof FormData?(s=n,s.has("cacheControl")||s.append("cacheControl",a.cacheControl),c&&!s.has("metadata")&&s.append("metadata",i.encodeMetadata(c))):(s=n,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,c&&(o["x-metadata"]=i.toBase64(i.encodeMetadata(c))),(typeof ReadableStream<"u"&&s instanceof ReadableStream||s&&typeof s=="object"&&"pipe"in s&&typeof s.pipe=="function")&&!a.duplex&&(a.duplex="half")),r!=null&&r.headers&&(o=Kt(Kt({},o),r.headers));const u=i._removeEmptyFolders(t),d=i._getFinalPath(u),h=await(e=="PUT"?QF:Ir)(i.fetch,`${i.url}/object/${d}`,s,Kt({headers:o},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{path:u,id:h.Id,fullPath:h.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var i=this;const s=i._removeEmptyFolders(e),a=i._getFinalPath(s),o=new URL(i.url+`/object/upload/sign/${a}`);return o.searchParams.set("token",t),i.handleOperation(async()=>{let c;const u=Kt({upsert:Q9.upsert},r),d=Kt(Kt({},i.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.append("cacheControl",u.cacheControl)):(c=n,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType),{path:s,fullPath:(await QF(i.fetch,o.toString(),c,{headers:d})).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const i=Kt({},n.headers);t!=null&&t.upsert&&(i["x-upsert"]="true");const s=await Ir(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:i}),a=new URL(n.url+s.url),o=a.searchParams.get("token");if(!o)throw new EE("No token returned by API");return{signedUrl:a.toString(),path:e,token:o}})}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await Ir(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await Ir(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let i=r._getFinalPath(e),s=await Ir(r.fetch,`${r.url}/object/sign/${i}`,Kt({expiresIn:t},n!=null&&n.transform?{transform:n.transform}:{}),{headers:r.headers});const a=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{signedUrl:encodeURI(`${r.url}${s.signedURL}${a}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{const i=await Ir(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),s=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return i.map(a=>Kt(Kt({},a),{},{signedUrl:a.signedURL?encodeURI(`${r.url}${a.signedURL}${s}`):null}))})}download(e,t){const n=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",r=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),i=r?`?${r}`:"",s=this._getFinalPath(e),a=()=>Kb(this.fetch,`${this.url}/${n}/${s}${i}`,{headers:this.headers,noResolveJson:!0});return new OPe(a,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>HF(await Kb(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await PPe(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(TE(r)&&r instanceof Kae){const i=r.originalError;if([400,404].includes(i==null?void 0:i.status))return{data:!1,error:r}}throw r}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=[],i=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";i!==""&&r.push(i);const s=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",a=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});a!==""&&r.push(a);let o=r.join("&");return o!==""&&(o=`?${o}`),{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${n}${o}`)}}}async remove(e){var t=this;return t.handleOperation(async()=>await g6(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{const i=Kt(Kt(Kt({},FPe),t),{},{prefix:e||""});return await Ir(r.fetch,`${r.url}/object/list/${r.bucketId}`,i,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const r=Kt({},e);return await Ir(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const LPe="2.93.2",E2={"X-Client-Info":`storage-js/${LPe}`};var RPe=class extends h0{constructor(e,t={},n,r){const i=new URL(e);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase."));const s=i.href.replace(/\/$/,""),a=Kt(Kt({},E2),t);super(s,a,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await Kb(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Kb(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await Ir(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await QF(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Ir(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await g6(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},DPe=class extends h0{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=Kt(Kt({},E2),t);super(r,i,n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Ir(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const r=n.toString(),i=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await Kb(t.fetch,i,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await g6(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!SPe(e))throw new EE("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new wPe({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(i,s){const a=i[s];return typeof a!="function"?a:async(...o)=>{try{return{data:await a.apply(i,o),error:null}}catch(c){if(r)throw c;return{data:null,error:c}}}}})}},UPe=class extends h0{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=Kt(Kt({},E2),{},{"Content-Type":"application/json"},t);super(r,i,n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Ir(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await Ir(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Ir(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await Ir(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},HPe=class extends h0{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=Kt(Kt({},E2),{},{"Content-Type":"application/json"},t);super(r,i,n,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Ir(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Ir(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await Ir(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Ir(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Ir(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},QPe=class extends h0{constructor(e,t={},n){const r=e.replace(/\/$/,""),i=Kt(Kt({},E2),{},{"Content-Type":"application/json"},t);super(r,i,n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Ir(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Ir(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Ir(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Ir(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},$Pe=class extends QPe{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new zPe(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},zPe=class extends UPe{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,Kt(Kt({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,Kt(Kt({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new VPe(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},VPe=class extends HPe{constructor(e,t,n,r,i){super(e,t,i),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,Kt(Kt({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,Kt(Kt({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,Kt(Kt({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,Kt(Kt({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,Kt(Kt({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},KPe=class extends RPe{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new MPe(this.url,this.headers,e,this.fetch)}get vectors(){return new $Pe(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new DPe(this.url+"/iceberg",this.headers,this.fetch)}};const Wae="2.93.2",Ig=30*1e3,$F=3,dI=$F*Ig,qPe="http://localhost:9999",WPe="supabase.auth.token",GPe={"X-Client-Info":`gotrue-js/${Wae}`},zF="X-Supabase-Api-Version",Gae={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},YPe=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,XPe=10*60*1e3;class qb extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function Tt(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class JPe extends qb{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function ZPe(e){return Tt(e)&&e.name==="AuthApiError"}class $A extends qb{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class Nd extends qb{constructor(t,n,r,i){super(t,r,i),this.name=n,this.status=r}}class go extends Nd{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function hI(e){return Tt(e)&&e.name==="AuthSessionMissingError"}class ng extends Nd{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class vS extends Nd{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class xS extends Nd{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function eIe(e){return Tt(e)&&e.name==="AuthImplicitGrantRedirectError"}class $9 extends Nd{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class tIe extends Nd{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class VF extends Nd{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function fI(e){return Tt(e)&&e.name==="AuthRetryableFetchError"}class z9 extends Nd{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class KF extends Nd{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const bj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),V9=` 	
\r=`.split(""),nIe=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<V9.length;t+=1)e[V9[t].charCodeAt(0)]=-2;for(let t=0;t<bj.length;t+=1)e[bj[t].charCodeAt(0)]=t;return e})();function K9(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(bj[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(bj[r]),t.queuedBits-=6}}function Yae(e,t,n){const r=nIe[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function q9(e){const t=[],n=a=>{t.push(String.fromCodePoint(a))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},s=a=>{sIe(a,r,n)};for(let a=0;a<e.length;a+=1)Yae(e.charCodeAt(a),i,s);return t.join("")}function rIe(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function iIe(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const i=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|i)+65536,n+=1}rIe(r,t)}}function sIe(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function Sy(e){const t=[],n={queue:0,queuedBits:0},r=i=>{t.push(i)};for(let i=0;i<e.length;i+=1)Yae(e.charCodeAt(i),n,r);return new Uint8Array(t)}function aIe(e){const t=[];return iIe(e,n=>t.push(n)),new Uint8Array(t)}function ZA(e){const t=[],n={queue:0,queuedBits:0},r=i=>{t.push(i)};return e.forEach(i=>K9(i,n,r)),K9(null,n,r),t.join("")}function oIe(e){return Math.round(Date.now()/1e3)+e}function lIe(){return Symbol("auth-callback")}const ys=()=>typeof window<"u"&&typeof document<"u",_A={tested:!1,writable:!1},Xae=()=>{if(!ys())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(_A.tested)return _A.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),_A.tested=!0,_A.writable=!0}catch{_A.tested=!0,_A.writable=!1}return _A.writable};function cIe(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((i,s)=>{t[s]=i})}catch{}return n.searchParams.forEach((r,i)=>{t[i]=r}),t}const Jae=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),uIe=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Og=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},jA=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},gs=async(e,t)=>{await e.removeItem(t)};class PE{constructor(){this.promise=new PE.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}PE.promiseConstructor=Promise;function wS(e){const t=e.split(".");if(t.length!==3)throw new KF("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!YPe.test(t[r]))throw new KF("JWT not in base64url format");return{header:JSON.parse(q9(t[0])),payload:JSON.parse(q9(t[1])),signature:Sy(t[2]),raw:{header:t[0],payload:t[1]}}}async function dIe(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function hIe(e,t){return new Promise((r,i)=>{(async()=>{for(let s=0;s<1/0;s++)try{const a=await e(s);if(!t(s,null,a)){r(a);return}}catch(a){if(!t(s,a)){i(a);return}}})()})}function fIe(e){return("0"+e.toString(16)).substr(-2)}function AIe(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let i="";for(let s=0;s<56;s++)i+=n.charAt(Math.floor(Math.random()*r));return i}return crypto.getRandomValues(t),Array.from(t,fIe).join("")}async function pIe(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(r);return Array.from(i).map(s=>String.fromCharCode(s)).join("")}async function mIe(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=await pIe(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function rg(e,t,n=!1){const r=AIe();let i=r;n&&(i+="/PASSWORD_RECOVERY"),await Og(e,`${t}-code-verifier`,i);const s=await mIe(r);return[s,r===s?"plain":"s256"]}const gIe=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function yIe(e){const t=e.headers.get(zF);if(!t||!t.match(gIe))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function vIe(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function xIe(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const wIe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function ig(e){if(!wIe.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function AI(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function bIe(e,t){return new Proxy(e,{get:(n,r,i)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const s=r.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)"||s==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,i)}return!t.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(n,r,i)}})}function W9(e){return JSON.parse(JSON.stringify(e))}const MA=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),CIe=[502,503,504];async function G9(e){var t;if(!uIe(e))throw new VF(MA(e),0);if(CIe.includes(e.status))throw new VF(MA(e),e.status);let n;try{n=await e.json()}catch(s){throw new $A(MA(s),s)}let r;const i=yIe(e);if(i&&i.getTime()>=Gae["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new z9(MA(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new go}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((s,a)=>s&&typeof a=="string",!0))throw new z9(MA(n),e.status,n.weak_password.reasons);throw new JPe(MA(n),e.status||500,r)}const SIe=(e,t,n,r)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function Vt(e,t,n,r){var i;const s=Object.assign({},r==null?void 0:r.headers);s[zF]||(s[zF]=Gae["2024-01-01"].name),r!=null&&r.jwt&&(s.Authorization=`Bearer ${r.jwt}`);const a=(i=r==null?void 0:r.query)!==null&&i!==void 0?i:{};r!=null&&r.redirectTo&&(a.redirect_to=r.redirectTo);const o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",c=await kIe(e,t,n+o,{headers:s,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(c):{data:Object.assign({},c),error:null}}async function kIe(e,t,n,r,i,s){const a=SIe(t,r,i,s);let o;try{o=await e(n,Object.assign({},a))}catch(c){throw console.error(c),new VF(MA(c),0)}if(o.ok||await G9(o),r!=null&&r.noResolveJson)return o;try{return await o.json()}catch(c){await G9(c)}}function Kl(e){var t;let n=null;BIe(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=oIe(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function Y9(e){const t=Kl(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Sh(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function _Ie(e){return{data:e,error:null}}function jIe(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s}=e,a=d0(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s},c=Object.assign({},a);return{data:{properties:o,user:c},error:null}}function X9(e){return e}function BIe(e){return e.access_token&&e.refresh_token&&e.expires_in}const pI=["global","local","others"];class NIe{constructor({url:t="",headers:n={},fetch:r}){this.url=t,this.headers=n,this.fetch=Jae(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,n=pI[0]){if(pI.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${pI.join(", ")}`);try{return await Vt(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Tt(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await Vt(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Sh})}catch(r){if(Tt(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=d0(t,["options"]),i=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(i.new_email=r==null?void 0:r.newEmail,delete i.newEmail),await Vt(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:i,headers:this.headers,xform:jIe,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(Tt(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await Vt(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Sh})}catch(n){if(Tt(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,i,s,a,o,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Vt(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:X9});if(d.error)throw d.error;const h=await d.json(),A=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,f=(c=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&c!==void 0?c:[];return f.length>0&&(f.forEach(p=>{const m=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(p.split(";")[1].split("=")[1]);u[`${g}Page`]=m}),u.total=parseInt(A)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(Tt(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){ig(t);try{return await Vt(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Sh})}catch(n){if(Tt(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){ig(t);try{return await Vt(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:Sh})}catch(r){if(Tt(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){ig(t);try{return await Vt(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:Sh})}catch(r){if(Tt(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){ig(t.userId);try{const{data:n,error:r}=await Vt(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:n,error:r}}catch(n){if(Tt(n))return{data:null,error:n};throw n}}async _deleteFactor(t){ig(t.userId),ig(t.id);try{return{data:await Vt(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(Tt(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,i,s,a,o,c;try{const u={nextPage:null,lastPage:0,total:0},d=await Vt(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(i=t==null?void 0:t.perPage)===null||i===void 0?void 0:i.toString())!==null&&s!==void 0?s:""},xform:X9});if(d.error)throw d.error;const h=await d.json(),A=(a=d.headers.get("x-total-count"))!==null&&a!==void 0?a:0,f=(c=(o=d.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&c!==void 0?c:[];return f.length>0&&(f.forEach(p=>{const m=parseInt(p.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(p.split(";")[1].split("=")[1]);u[`${g}Page`]=m}),u.total=parseInt(A)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(Tt(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await Vt(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Tt(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await Vt(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Tt(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await Vt(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Tt(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await Vt(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Tt(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await Vt(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Tt(n))return{data:null,error:n};throw n}}}function J9(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const sg={debug:!!(globalThis&&Xae()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Zae extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class EIe extends Zae{}async function TIe(e,t,n){sg.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),sg.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async i=>{if(i){sg.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,i.name);try{return await n()}finally{sg.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,i.name)}}else{if(t===0)throw sg.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new EIe(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(sg.debug)try{const s=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(s,null,"  "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}}))}function PIe(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function eoe(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function IIe(e){return parseInt(e,16)}function OIe(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function FIe(e){var t;const{chainId:n,domain:r,expirationTime:i,issuedAt:s=new Date,nonce:a,notBefore:o,requestId:c,resources:u,scheme:d,uri:h,version:A}=e;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(A!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${A}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const f=eoe(e.address),p=d?`${d}://${r}`:r,m=e.statement?`${e.statement}
`:"",g=`${p} wants you to sign in with your Ethereum account:
${f}

${m}`;let y=`URI: ${h}
Version: ${A}
Chain ID: ${n}${a?`
Nonce: ${a}`:""}
Issued At: ${s.toISOString()}`;if(i&&(y+=`
Expiration Time: ${i.toISOString()}`),o&&(y+=`
Not Before: ${o.toISOString()}`),c&&(y+=`
Request ID: ${c}`),u){let v=`
Resources:`;for(const x of u){if(!x||typeof x!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${x}`);v+=`
- ${x}`}y+=v}return`${g}
${y}`}class ki extends Error{constructor({message:t,code:n,cause:r,name:i}){var s;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(s=i??(r instanceof Error?r.name:void 0))!==null&&s!==void 0?s:"Unknown Error",this.code=n}}class Cj extends ki{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function MIe({error:e,options:t}){var n,r,i;const{publicKey:s}=t;if(!s)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new ki({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=s.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new ki({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((r=s.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new ki({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((i=s.authenticatorSelection)===null||i===void 0?void 0:i.userVerification)==="required")return new ki({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new ki({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new ki({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return s.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new ki({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new ki({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const a=window.location.hostname;if(toe(a)){if(s.rp.id!==a)return new ki({message:`The RP ID "${s.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new ki({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new ki({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new ki({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new ki({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function LIe({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new ki({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new ki({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(toe(r)){if(n.rpId!==r)return new ki({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new ki({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new ki({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new ki({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class RIe{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const DIe=new RIe;function UIe(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:r}=e,i=d0(e,["challenge","user","excludeCredentials"]),s=Sy(t).buffer,a=Object.assign(Object.assign({},n),{id:Sy(n.id).buffer}),o=Object.assign(Object.assign({},i),{challenge:s,user:a});if(r&&r.length>0){o.excludeCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const u=r[c];o.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:Sy(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return o}function HIe(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,r=d0(e,["challenge","allowCredentials"]),i=Sy(t).buffer,s=Object.assign(Object.assign({},r),{challenge:i});if(n&&n.length>0){s.allowCredentials=new Array(n.length);for(let a=0;a<n.length;a++){const o=n[a];s.allowCredentials[a]=Object.assign(Object.assign({},o),{id:Sy(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return s}function QIe(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:ZA(new Uint8Array(e.response.attestationObject)),clientDataJSON:ZA(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function $Ie(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,r=e.getClientExtensionResults(),i=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:ZA(new Uint8Array(i.authenticatorData)),clientDataJSON:ZA(new Uint8Array(i.clientDataJSON)),signature:ZA(new Uint8Array(i.signature)),userHandle:i.userHandle?ZA(new Uint8Array(i.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function toe(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Z9(){var e,t;return!!(ys()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function zIe(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Cj("Browser returned unexpected credential type",t)}:{data:null,error:new Cj("Empty credential response",t)}}catch(t){return{data:null,error:MIe({error:t,options:e})}}}async function VIe(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Cj("Browser returned unexpected credential type",t)}:{data:null,error:new Cj("Empty credential response",t)}}catch(t){return{data:null,error:LIe({error:t,options:e})}}}const KIe={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},qIe={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Sj(...e){const t=i=>i!==null&&typeof i=="object"&&!Array.isArray(i),n=i=>i instanceof ArrayBuffer||ArrayBuffer.isView(i),r={};for(const i of e)if(i)for(const s in i){const a=i[s];if(a!==void 0)if(Array.isArray(a))r[s]=a;else if(n(a))r[s]=a;else if(t(a)){const o=r[s];t(o)?r[s]=Sj(o,a):r[s]=Sj(a)}else r[s]=a}return r}function WIe(e,t){return Sj(KIe,e,t||{})}function GIe(e,t){return Sj(qIe,e,t||{})}class YIe{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:n,friendlyName:r,signal:i},s){try{const{data:a,error:o}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!a)return{data:null,error:o};const c=i??DIe.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:u}=a.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${r}`),u.displayName||(u.displayName=u.name)}switch(a.webauthn.type){case"create":{const u=WIe(a.webauthn.credential_options.publicKey,s==null?void 0:s.create),{data:d,error:h}=await zIe({publicKey:u,signal:c});return d?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}case"request":{const u=GIe(a.webauthn.credential_options.publicKey,s==null?void 0:s.request),{data:d,error:h}=await VIe(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:u,signal:c}));return d?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}}}catch(a){return Tt(a)?{data:null,error:a}:{data:null,error:new $A("Unexpected error in challenge",a)}}}async _verify({challengeId:t,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:r})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},s){if(!n)return{data:null,error:new qb("rpId is required for WebAuthn authentication")};try{if(!Z9())return{data:null,error:new $A("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:i},{request:s});if(!a)return{data:null,error:o};const{webauthn:c}=a;return this._verify({factorId:t,challengeId:a.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(a){return Tt(a)?{data:null,error:a}:{data:null,error:new $A("Unexpected error in authenticate",a)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:i}={}},s){if(!n)return{data:null,error:new qb("rpId is required for WebAuthn registration")};try{if(!Z9())return{data:null,error:new $A("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this._enroll({friendlyName:t});if(!a)return await this.client.mfa.listFactors().then(d=>{var h;return(h=d.data)===null||h===void 0?void 0:h.all.find(A=>A.factor_type==="webauthn"&&A.friendly_name===t&&A.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:o};const{data:c,error:u}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:i},{create:s});return c?this._verify({factorId:a.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(a){return Tt(a)?{data:null,error:a}:{data:null,error:new $A("Unexpected error in register",a)}}}}PIe();const XIe={url:qPe,storageKey:WPe,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:GPe,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function eV(e,t,n){return await n()}const ag={};class Wb{get jwks(){var t,n;return(n=(t=ag[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){ag[this.storageKey]=Object.assign(Object.assign({},ag[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=ag[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){ag[this.storageKey]=Object.assign(Object.assign({},ag[this.storageKey]),{cachedAt:t})}constructor(t){var n,r,i;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const s=Object.assign(Object.assign({},XIe),t);if(this.storageKey=s.storageKey,this.instanceID=(n=Wb.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,Wb.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.instanceID>0&&ys()){const a=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.admin=new NIe({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=Jae(s.fetch),this.lock=s.lock||eV,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,this.lockAcquireTimeout=s.lockAcquireTimeout,s.lock?this.lock=s.lock:this.persistSession&&ys()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=TIe:this.lock=eV,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new YIe(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:Xae()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=J9(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=J9(this.memoryStorage)),ys()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a);try{await this._notifyAllSubscribers(a.data.event,a.data.session,!1)}catch(o){this._debug("#broadcastChannel","error",o)}})}this.initialize().catch(a=>{this._debug("#initialize()","error",a)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Wae}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let n={},r="none";if(ys()&&(n=cIe(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),ys()&&this.detectSessionInUrl&&r!=="none"){const{data:i,error:s}=await this._getSessionFromURL(n,r);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),eIe(s)){const c=(t=s.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:s}}return{error:s}}const{session:a,redirectType:o}=i;return this._debug("#_initialize()","detected session in URL",a,"redirect type",o),await this._saveSession(a),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return Tt(n)?this._returnResult({error:n}):this._returnResult({error:new $A("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,i;try{const s=await Vt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(i=t==null?void 0:t.options)===null||i===void 0?void 0:i.captchaToken}},xform:Kl}),{data:a,error:o}=s;if(o||!a)return this._returnResult({data:{user:null,session:null},error:o});const c=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(s){if(Tt(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(t){var n,r,i;try{let s;if("email"in t){const{email:d,password:h,options:A}=t;let f=null,p=null;this.flowType==="pkce"&&([f,p]=await rg(this.storage,this.storageKey)),s=await Vt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:A==null?void 0:A.emailRedirectTo,body:{email:d,password:h,data:(n=A==null?void 0:A.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:A==null?void 0:A.captchaToken},code_challenge:f,code_challenge_method:p},xform:Kl})}else if("phone"in t){const{phone:d,password:h,options:A}=t;s=await Vt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:h,data:(r=A==null?void 0:A.data)!==null&&r!==void 0?r:{},channel:(i=A==null?void 0:A.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:A==null?void 0:A.captchaToken}},xform:Kl})}else throw new vS("You must provide either an email or phone number and a password");const{data:a,error:o}=s;if(o||!a)return await gs(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const c=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(s){if(await gs(this.storage,`${this.storageKey}-code-verifier`),Tt(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(t){try{let n;if("email"in t){const{email:s,password:a,options:o}=t;n=await Vt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Y9})}else if("phone"in t){const{phone:s,password:a,options:o}=t;n=await Vt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Y9})}else throw new vS("You must provide either an email or phone number and a password");const{data:r,error:i}=n;if(i)return this._returnResult({data:{user:null,session:null},error:i});if(!r||!r.session||!r.user){const s=new ng;return this._returnResult({data:{user:null,session:null},error:s})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:i})}catch(n){if(Tt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,r,i,s;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(i=t.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(s=t.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,r,i,s,a,o,c,u,d,h,A;let f,p;if("message"in t)f=t.message,p=t.signature;else{const{chain:m,wallet:g,statement:y,options:v}=t;let x;if(ys())if(typeof g=="object")x=g;else{const E=window;if("ethereum"in E&&typeof E.ethereum=="object"&&"request"in E.ethereum&&typeof E.ethereum.request=="function")x=E.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof g!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");x=g}const w=new URL((n=v==null?void 0:v.url)!==null&&n!==void 0?n:window.location.href),b=await x.request({method:"eth_requestAccounts"}).then(E=>E).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!b||b.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const k=eoe(b[0]);let j=(r=v==null?void 0:v.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!j){const E=await x.request({method:"eth_chainId"});j=IIe(E)}const B={domain:w.host,address:k,statement:y,uri:w.href,version:"1",chainId:j,nonce:(i=v==null?void 0:v.signInWithEthereum)===null||i===void 0?void 0:i.nonce,issuedAt:(a=(s=v==null?void 0:v.signInWithEthereum)===null||s===void 0?void 0:s.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(o=v==null?void 0:v.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(c=v==null?void 0:v.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=v==null?void 0:v.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=v==null?void 0:v.signInWithEthereum)===null||d===void 0?void 0:d.resources};f=FIe(B),p=await x.request({method:"personal_sign",params:[OIe(f),k]})}try{const{data:m,error:g}=await Vt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:f,signature:p},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(A=t.options)===null||A===void 0?void 0:A.captchaToken}}:null),xform:Kl});if(g)throw g;if(!m||!m.session||!m.user){const y=new ng;return this._returnResult({data:{user:null,session:null},error:y})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:Object.assign({},m),error:g})}catch(m){if(Tt(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async signInWithSolana(t){var n,r,i,s,a,o,c,u,d,h,A,f;let p,m;if("message"in t)p=t.message,m=t.signature;else{const{chain:g,wallet:y,statement:v,options:x}=t;let w;if(ys())if(typeof y=="object")w=y;else{const k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))w=k.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!(x!=null&&x.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=y}const b=new URL((n=x==null?void 0:x.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in w&&w.signIn){const k=await w.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},x==null?void 0:x.signInWithSolana),{version:"1",domain:b.host,uri:b.href}),v?{statement:v}:null));let j;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")j=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)j=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in j&&"signature"in j&&(typeof j.signedMessage=="string"||j.signedMessage instanceof Uint8Array)&&j.signature instanceof Uint8Array)p=typeof j.signedMessage=="string"?j.signedMessage:new TextDecoder().decode(j.signedMessage),m=j.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in w)||typeof w.signMessage!="function"||!("publicKey"in w)||typeof w!="object"||!w.publicKey||!("toBase58"in w.publicKey)||typeof w.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");p=[`${b.host} wants you to sign in with your Solana account:`,w.publicKey.toBase58(),...v?["",v,""]:[""],"Version: 1",`URI: ${b.href}`,`Issued At: ${(i=(r=x==null?void 0:x.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((s=x==null?void 0:x.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${x.signInWithSolana.notBefore}`]:[],...!((a=x==null?void 0:x.signInWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${x.signInWithSolana.expirationTime}`]:[],...!((o=x==null?void 0:x.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${x.signInWithSolana.chainId}`]:[],...!((c=x==null?void 0:x.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${x.signInWithSolana.nonce}`]:[],...!((u=x==null?void 0:x.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${x.signInWithSolana.requestId}`]:[],...!((h=(d=x==null?void 0:x.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||h===void 0)&&h.length?["Resources",...x.signInWithSolana.resources.map(j=>`- ${j}`)]:[]].join(`
`);const k=await w.signMessage(new TextEncoder().encode(p),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=k}}try{const{data:g,error:y}=await Vt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:p,signature:ZA(m)},!((A=t.options)===null||A===void 0)&&A.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:Kl});if(y)throw y;if(!g||!g.session||!g.user){const v=new ng;return this._returnResult({data:{user:null,session:null},error:v})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:y})}catch(g){if(Tt(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async _exchangeCodeForSession(t){const n=await jA(this.storage,`${this.storageKey}-code-verifier`),[r,i]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new tIe;const{data:s,error:a}=await Vt(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Kl});if(await gs(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!s||!s.session||!s.user){const o=new ng;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign(Object.assign({},s),{redirectType:i??null}),error:a})}catch(s){if(await gs(this.storage,`${this.storageKey}-code-verifier`),Tt(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(t){try{const{options:n,provider:r,token:i,access_token:s,nonce:a}=t,o=await Vt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:i,access_token:s,nonce:a,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:Kl}),{data:c,error:u}=o;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new ng;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(n){if(Tt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,r,i,s,a;try{if("email"in t){const{email:o,options:c}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await rg(this.storage,this.storageKey));const{error:h}=await Vt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in t){const{phone:o,options:c}=t,{data:u,error:d}=await Vt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(i=c==null?void 0:c.data)!==null&&i!==void 0?i:{},create_user:(s=c==null?void 0:c.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(a=c==null?void 0:c.channel)!==null&&a!==void 0?a:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new vS("You must provide either an email or phone number.")}catch(o){if(await gs(this.storage,`${this.storageKey}-code-verifier`),Tt(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(t){var n,r;try{let i,s;"options"in t&&(i=(n=t.options)===null||n===void 0?void 0:n.redirectTo,s=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:a,error:o}=await Vt(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:s}}),redirectTo:i,xform:Kl});if(o)throw o;if(!a)throw new Error("An error occurred on token verification.");const c=a.session,u=a.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(Tt(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithSSO(t){var n,r,i,s,a;try{let o=null,c=null;this.flowType==="pkce"&&([o,c]=await rg(this.storage,this.storageKey));const u=await Vt(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((i=t==null?void 0:t.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:c}),headers:this.headers,xform:_Ie});return!((s=u.data)===null||s===void 0)&&s.url&&ys()&&!(!((a=t.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(o){if(await gs(this.storage,`${this.storageKey}-code-verifier`),Tt(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)throw r;if(!n)throw new go;const{error:i}=await Vt(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:i})})}catch(t){if(Tt(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:i,options:s}=t,{error:a}=await Vt(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},redirectTo:s==null?void 0:s.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in t){const{phone:r,type:i,options:s}=t,{data:a,error:o}=await Vt(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:o})}throw new vS("You must provide either an email or phone number and a type")}catch(n){if(Tt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const n=await jA(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<dI:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const a=await jA(this.userStorage,this.storageKey+"-user");a!=null&&a.user?t.user=a.user:t.user=AI()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const a={value:this.suppressGetSessionWarning};t.user=bIe(t.user,a),a.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:i,error:s}=await this._callRefreshToken(t.refresh_token);return s?this._returnResult({data:{session:null},error:s}):this._returnResult({data:{session:i},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await Vt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Sh}):await this._useSession(async n=>{var r,i,s;const{data:a,error:o}=n;if(o)throw o;return!(!((r=a.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new go}:await Vt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(i=a.session)===null||i===void 0?void 0:i.access_token)!==null&&s!==void 0?s:void 0,xform:Sh})})}catch(n){if(Tt(n))return hI(n)&&(await this._removeSession(),await gs(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:i,error:s}=r;if(s)throw s;if(!i.session)throw new go;const a=i.session;let o=null,c=null;this.flowType==="pkce"&&t.email!=null&&([o,c]=await rg(this.storage,this.storageKey));const{data:u,error:d}=await Vt(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:o,code_challenge_method:c}),jwt:a.access_token,xform:Sh});if(d)throw d;return a.user=u.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),this._returnResult({data:{user:a.user},error:null})})}catch(r){if(await gs(this.storage,`${this.storageKey}-code-verifier`),Tt(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new go;const n=Date.now()/1e3;let r=n,i=!0,s=null;const{payload:a}=wS(t.access_token);if(a.exp&&(r=a.exp,i=r<=n),i){const{data:o,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!o)return{data:{user:null,session:null},error:null};s=o}else{const{data:o,error:c}=await this._getUser(t.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});s={access_token:t.access_token,refresh_token:t.refresh_token,user:o.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(n){if(Tt(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:a,error:o}=n;if(o)throw o;t=(r=a.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new go;const{data:i,error:s}=await this._callRefreshToken(t.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):i?this._returnResult({data:{user:i.user,session:i},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(Tt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){try{if(!ys())throw new xS("No browser detected.");if(t.error||t.error_description||t.error_code)throw new xS(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new $9("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new xS("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new $9("No code detected.");const{data:v,error:x}=await this._exchangeCodeForSession(t.code);if(x)throw x;const w=new URL(window.location.href);return w.searchParams.delete("code"),window.history.replaceState(window.history.state,"",w.toString()),{data:{session:v.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:i,access_token:s,refresh_token:a,expires_in:o,expires_at:c,token_type:u}=t;if(!s||!o||!a||!u)throw new xS("No session defined in URL");const d=Math.round(Date.now()/1e3),h=parseInt(o);let A=d+h;c&&(A=parseInt(c));const f=A-d;f*1e3<=Ig&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${h}s`);const p=A-h;d-p>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",p,A,d):d-p<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",p,A,d);const{data:m,error:g}=await this._getUser(s);if(g)throw g;const y={provider_token:r,provider_refresh_token:i,access_token:s,expires_in:h,expires_at:A,refresh_token:a,token_type:u,user:m.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:y,redirectType:t.type},error:null})}catch(r){if(Tt(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await jA(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s&&!hI(s))return this._returnResult({error:s});const a=(r=i.session)===null||r===void 0?void 0:r.access_token;if(a){const{error:o}=await this.admin.signOut(a,t);if(o&&!(ZPe(o)&&(o.status===404||o.status===401||o.status===403)||hI(o)))return this._returnResult({error:o})}return t!=="others"&&(await this._removeSession(),await gs(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=lIe(),r={id:n,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,i;try{const{data:{session:s},error:a}=n;if(a)throw a;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",t,"session",s)}catch(s){await((i=this.stateChangeEmitters.get(t))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",s),console.error(s)}})}async resetPasswordForEmail(t,n={}){let r=null,i=null;this.flowType==="pkce"&&([r,i]=await rg(this.storage,this.storageKey,!0));try{return await Vt(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:i,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(s){if(await gs(this.storage,`${this.storageKey}-code-verifier`),Tt(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:r,error:i}=await this._useSession(async s=>{var a,o,c,u,d;const{data:h,error:A}=s;if(A)throw A;const f=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(a=t.options)===null||a===void 0?void 0:a.redirectTo,scopes:(o=t.options)===null||o===void 0?void 0:o.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await Vt(this.fetch,"GET",f,{headers:this.headers,jwt:(d=(u=h.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(i)throw i;return ys()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:t.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(Tt(r))return this._returnResult({data:{provider:t.provider,url:null},error:r});throw r}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var r;try{const{error:i,data:{session:s}}=n;if(i)throw i;const{options:a,provider:o,token:c,access_token:u,nonce:d}=t,h=await Vt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=s==null?void 0:s.access_token)!==null&&r!==void 0?r:void 0,body:{provider:o,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:Kl}),{data:A,error:f}=h;return f?this._returnResult({data:{user:null,session:null},error:f}):!A||!A.session||!A.user?this._returnResult({data:{user:null,session:null},error:new ng}):(A.session&&(await this._saveSession(A.session),await this._notifyAllSubscribers("USER_UPDATED",A.session)),this._returnResult({data:A,error:f}))}catch(i){if(await gs(this.storage,`${this.storageKey}-code-verifier`),Tt(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,i;const{data:s,error:a}=n;if(a)throw a;return await Vt(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(i=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0})})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await hIe(async i=>(i>0&&await dIe(200*Math.pow(2,i-1)),this._debug(n,"refreshing attempt",i),await Vt(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Kl})),(i,s)=>{const a=200*Math.pow(2,i);return s&&fI(s)&&Date.now()+a-r<Ig})}catch(r){if(this._debug(n,"error",r),Tt(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",r),ys()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const i=await jA(this.storage,this.storageKey);if(i&&this.userStorage){let a=await jA(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:i.user},await Og(this.userStorage,this.storageKey+"-user",a)),i.user=(t=a==null?void 0:a.user)!==null&&t!==void 0?t:AI()}else if(i&&!i.user&&!i.user){const a=await jA(this.storage,this.storageKey+"-user");a&&(a!=null&&a.user)?(i.user=a.user,await gs(this.storage,this.storageKey+"-user"),await Og(this.storage,this.storageKey,i)):i.user=AI()}if(this._debug(r,"session from storage",i),!this._isValidSession(i)){this._debug(r,"session is not valid"),i!==null&&await this._removeSession();return}const s=((n=i.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<dI;if(this._debug(r,`session has${s?"":" not"} expired with margin of ${dI}s`),s){if(this.autoRefreshToken&&i.refresh_token){const{error:a}=await this._callRefreshToken(i.refresh_token);a&&(console.error(a),fI(a)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",a),await this._removeSession()))}}else if(i.user&&i.user.__isUserNotAvailableProxy===!0)try{const{data:a,error:o}=await this._getUser(i.access_token);!o&&(a!=null&&a.user)?(i.user=a.user,await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(a){console.error("Error getting user data:",a),this._debug(r,"error getting user data, skipping SIGNED_IN notification",a)}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(r,"error",i),console.error(i);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new go;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const i=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(i,"begin");try{this.refreshingDeferred=new PE;const{data:s,error:a}=await this._refreshAccessToken(t);if(a)throw a;if(!s.session)throw new go;await this._saveSession(s.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",s.session);const o={data:s.session,error:null};return this.refreshingDeferred.resolve(o),o}catch(s){if(this._debug(i,"error",s),Tt(s)){const a={data:null,error:s};return fI(s)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(a),a}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(s),s}finally{this.refreshingDeferred=null,this._debug(i,"end")}}async _notifyAllSubscribers(t,n,r=!0){const i=`#_notifyAllSubscribers(${t})`;this._debug(i,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const s=[],a=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(t,n)}catch(c){s.push(c)}});if(await Promise.all(a),s.length>0){for(let o=0;o<s.length;o+=1)console.error(s[o]);throw s[0]}}finally{this._debug(i,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await gs(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},t),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Og(this.userStorage,this.storageKey+"-user",{user:n.user});const i=Object.assign({},n);delete i.user;const s=W9(i);await Og(this.storage,this.storageKey,s)}else{const i=W9(n);await Og(this.storage,this.storageKey,i)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await gs(this.storage,this.storageKey),await gs(this.storage,this.storageKey+"-code-verifier"),await gs(this.storage,this.storageKey+"-user"),this.userStorage&&await gs(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ys()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Ig);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((r.expires_at*1e3-t)/Ig);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Ig}ms, refresh threshold is ${$F} ticks`),i<=$F&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof Zae)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ys()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,n,r){const i=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&i.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&i.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[s,a]=await rg(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(a)}`});i.push(o.toString())}if(r!=null&&r.queryParams){const s=new URLSearchParams(r.queryParams);i.push(s.toString())}return r!=null&&r.skipBrowserRedirect&&i.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${i.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;return s?this._returnResult({data:null,error:s}):await Vt(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,i;const{data:s,error:a}=n;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:u}=await Vt(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&c.type==="totp"&&(!((i=c==null?void 0:c.totp)===null||i===void 0)&&i.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return this._returnResult({data:null,error:s});const a=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?QIe(t.webauthn.credential_response):$Ie(t.webauthn.credential_response)})}:{code:t.code}),{data:o,error:c}=await Vt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:a,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),this._returnResult({data:o,error:c}))})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return this._returnResult({data:null,error:s});const a=await Vt(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});if(a.error)return a;const{data:o}=a;if(o.type!=="webauthn")return{data:o,error:null};switch(o.webauthn.type){case"create":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:UIe(o.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},o),{webauthn:Object.assign(Object.assign({},o.webauthn),{credential_options:Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:HIe(o.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const i={all:[],phone:[],totp:[],webauthn:[]};for(const s of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])i.all.push(s),s.status==="verified"&&i[s.factor_type].push(s);return{data:i,error:null}}async _getAuthenticatorAssuranceLevel(t){var n,r,i,s;if(t)try{const{payload:f}=wS(t);let p=null;f.aal&&(p=f.aal);let m=p;const{data:{user:g},error:y}=await this.getUser(t);if(y)return this._returnResult({data:null,error:y});((r=(n=g==null?void 0:g.factors)===null||n===void 0?void 0:n.filter(w=>w.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(m="aal2");const x=f.amr||[];return{data:{currentLevel:p,nextLevel:m,currentAuthenticationMethods:x},error:null}}catch(f){if(Tt(f))return this._returnResult({data:null,error:f});throw f}const{data:{session:a},error:o}=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=wS(a.access_token);let u=null;c.aal&&(u=c.aal);let d=u;((s=(i=a.user.factors)===null||i===void 0?void 0:i.filter(f=>f.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(d="aal2");const A=c.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:A},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:r},error:i}=n;return i?this._returnResult({data:null,error:i}):r?await Vt(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new go})})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:i},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new go});const a=await Vt(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&ys()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(Tt(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:i},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!i)return this._returnResult({data:null,error:new go});const a=await Vt(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:i.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&ys()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(r){if(Tt(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await Vt(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new go})})}catch(t){if(Tt(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:r},error:i}=n;return i?this._returnResult({data:null,error:i}):r?(await Vt(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new go})})}catch(n){if(Tt(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(o=>o.kid===t);if(r)return r;const i=Date.now();if(r=this.jwks.keys.find(o=>o.kid===t),r&&this.jwks_cached_at+XPe>i)return r;const{data:s,error:a}=await Vt(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=i,r=s.keys.find(o=>o.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:f,error:p}=await this.getSession();if(p||!f.session)return this._returnResult({data:null,error:p});r=f.session.access_token}const{header:i,payload:s,signature:a,raw:{header:o,payload:c}}=wS(r);n!=null&&n.allowExpired||vIe(s.exp);const u=!i.alg||i.alg.startsWith("HS")||!i.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(i.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!u){const{error:f}=await this.getUser(r);if(f)throw f;return{data:{claims:s,header:i,signature:a},error:null}}const d=xIe(i.alg),h=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,h,a,aIe(`${o}.${c}`)))throw new KF("Invalid JWT signature");return{data:{claims:s,header:i,signature:a},error:null}}catch(r){if(Tt(r))return this._returnResult({data:null,error:r});throw r}}}Wb.nextInstanceID={};const JIe=Wb,ZIe="2.93.2";let nw="";typeof Deno<"u"?nw="deno":typeof document<"u"?nw="web":typeof navigator<"u"&&navigator.product==="ReactNative"?nw="react-native":nw="node";const e4e={"X-Client-Info":`supabase-js-${nw}/${ZIe}`},t4e={headers:e4e},n4e={schema:"public"},r4e={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},i4e={};function Gb(e){"@babel/helpers - typeof";return Gb=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},Gb(e)}function s4e(e,t){if(Gb(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Gb(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function a4e(e){var t=s4e(e,"string");return Gb(t)=="symbol"?t:t+""}function o4e(e,t,n){return(t=a4e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tV(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ti(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tV(Object(n),!0).forEach(function(r){o4e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tV(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const l4e=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),c4e=()=>Headers,u4e=(e,t,n)=>{const r=l4e(n),i=c4e();return async(s,a)=>{var o;const c=(o=await t())!==null&&o!==void 0?o:e;let u=new i(a==null?void 0:a.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),r(s,ti(ti({},a),{},{headers:u}))}};function d4e(e){return e.endsWith("/")?e:e+"/"}function h4e(e,t){var n,r;const{db:i,auth:s,realtime:a,global:o}=e,{db:c,auth:u,realtime:d,global:h}=t,A={db:ti(ti({},c),i),auth:ti(ti({},u),s),realtime:ti(ti({},d),a),storage:{},global:ti(ti(ti({},h),o),{},{headers:ti(ti({},(n=h==null?void 0:h.headers)!==null&&n!==void 0?n:{}),(r=o==null?void 0:o.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return e.accessToken?A.accessToken=e.accessToken:delete A.accessToken,A}function f4e(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(d4e(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var A4e=class extends JIe{constructor(e){super(e)}},p4e=class{constructor(e,t,n){var r,i;this.supabaseUrl=e,this.supabaseKey=t;const s=f4e(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);const a=`sb-${s.hostname.split(".")[0]}-auth-token`,o={db:n4e,realtime:i4e,auth:ti(ti({},r4e),{},{storageKey:a}),global:t4e},c=h4e(n??{},o);if(this.storageKey=(r=c.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(i=c.global.headers)!==null&&i!==void 0?i:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,h)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(h)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=c.auth)!==null&&u!==void 0?u:{},this.headers,c.global.fetch)}this.fetch=u4e(t,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(ti({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new JTe(new URL("rest/v1",s).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new KPe(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new qTe(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,n;if(e.accessToken)return await e.accessToken();const{data:r}=await e.auth.getSession();return(t=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,storageKey:s,flowType:a,lock:o,debug:c,throwOnError:u},d,h){const A={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new A4e({url:this.authUrl.href,headers:ti(ti({},A),d),storageKey:s,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:i,flowType:a,lock:o,debug:c,throwOnError:u,fetch:h,hasCustomAuthorizationHeader:Object.keys(this.headers).some(f=>f.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new pPe(this.realtimeUrl.href,ti(ti({},e),{},{params:ti(ti({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const m4e=(e,t,n)=>new p4e(e,t,n);function g4e(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}g4e()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const y4e="https://khmmwvmdbhaplcfcndjx.supabase.co",v4e="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",Me=m4e(y4e,v4e,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}});function noe(){return gr({queryKey:["nav-categories"],queryFn:async()=>{const{data:e,error:t}=await Me.from("aeo_categories").select("id, name, slug, icon, display_order").eq("enabled",!0).is("parent_id",null).order("display_order");if(t)throw t;const n=new Set(["buyers","sellers","about"]);return e.filter(i=>!n.has(i.slug.toLowerCase().trim()))},staleTime:1e3*60*5})}const nV="/wordmark-compact-on-dark-transparent.svg",x4e=new Set(["buyers","sellers","about"]),bS=({label:e,items:t,align:n="center",widthClassName:r="min-w-[250px]",isActive:i,onNavigate:s})=>{const[a,o]=C.useState(!1),c=C.useRef(),u=C.useRef(null),d=n==="start"?"left-0":n==="end"?"right-0":"left-1/2 -translate-x-1/2",h=()=>{clearTimeout(c.current),o(!0)},A=()=>{c.current=setTimeout(()=>o(!1),150)};return l.jsxs("div",{ref:u,className:"relative",onMouseEnter:h,onMouseLeave:A,children:[l.jsxs("button",{className:"flex h-10 items-center gap-1.5 px-3 text-[11px] font-medium uppercase tracking-[0.2em] text-primary-foreground/75 transition-all duration-300 hover:bg-primary-foreground/[0.06] hover:text-primary-foreground",onClick:()=>o(f=>!f),children:[e,l.jsx(hc,{size:11,className:`text-primary-foreground/40 transition-transform duration-200 ${a?"rotate-180":""}`})]}),l.jsx(Cy,{children:a&&l.jsxs(hi.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:6},transition:{duration:.2,ease:[.22,1,.36,1]},className:`absolute top-full z-[70] ${d} ${r}`,children:[l.jsx("div",{className:"h-3"}),l.jsxs("div",{className:"overflow-hidden border border-primary-foreground/[0.08]",style:{background:"hsl(var(--primary) / 0.96)",backdropFilter:"blur(40px) saturate(1.4)",WebkitBackdropFilter:"blur(40px) saturate(1.4)",boxShadow:"0 8px 32px hsl(var(--primary) / 0.45), inset 0 1px 0 hsl(var(--primary-foreground) / 0.06)"},children:[l.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-gold/60 to-transparent"}),l.jsx("div",{className:"p-2",children:t.map(f=>l.jsx(At,{to:f.href,onClick:()=>{o(!1),s()},className:`flex min-h-[40px] items-center px-3.5 py-2.5 text-[11px] font-medium uppercase tracking-[0.18em] transition-colors duration-150 ${i(f.href)?"text-gold bg-primary-foreground/[0.04]":"text-primary-foreground/80 hover:bg-primary-foreground/[0.06] hover:text-primary-foreground"}`,children:f.name},f.href))})]})]})})]})},IE=()=>{const[e,t]=C.useState(!1),[n,r]=C.useState(null),[i,s]=C.useState(!1),a=C.useRef(null),o=ro(),{data:c}=noe(),u=c==null?void 0:c.find(w=>w.slug.toLowerCase()==="neighborhoods"),{data:d}=gr({queryKey:["nav-neighborhood-pages",u==null?void 0:u.id],enabled:!!u,queryFn:async()=>{const{data:w,error:b}=await Me.from("aeo_pages").select("id, title, slug, h1, display_order").eq("category_id",u.id).eq("status","published").eq("is_parent",!0).order("display_order");if(b)throw b;return w},staleTime:1e3*60*5}),h=C.useMemo(()=>(c||[]).filter(w=>!x4e.has(w.slug.toLowerCase().trim())).filter(w=>w.slug.toLowerCase()!=="neighborhoods").map(w=>({name:w.name,href:`/${w.slug}`})),[c]),A=C.useMemo(()=>{if(!u)return null;const w=(d||[]).map(b=>({name:b.h1||b.title,href:`/neighborhoods/${b.slug}`}));return{name:"Neighborhoods",href:"/neighborhoods",children:w.length>0?w:void 0}},[u,d]),f=C.useMemo(()=>[{name:"Buyers",href:"/buyers"},{name:"Sellers",href:"/sellers"},...h],[h]),p=C.useMemo(()=>[...A?[{name:"Neighborhoods",href:"/neighborhoods"}]:[],{name:"Search Homes",href:"/idx"},{name:"Market Pulse",href:"/market-pulse"}],[A]),m=[{name:"About Holden",href:"/about"},{name:"Testimonials",href:"/about/testimonials"},{name:"Contact",href:"/contact"}],g=[{name:"Blog",href:"/blog"},{name:"News & Press",href:"/news"},{name:"Ask Holden (FAQ)",href:"/faq"}],y=C.useMemo(()=>[{label:"Home",items:[{name:"Home",href:"/"}]},{label:"Buying & Selling",items:[{name:"Buyers",href:"/buyers"},{name:"Sellers",href:"/sellers"},...h]},{label:"Explore",items:[...A?[A]:[],{name:"Search Homes",href:"/idx"},{name:"Market Pulse",href:"/market-pulse"}]},{label:"Insights",items:[{name:"Blog",href:"/blog"},{name:"News & Press",href:"/news"},{name:"Ask Holden (FAQ)",href:"/faq"}]},{label:"About",items:[{name:"About Holden",href:"/about"},{name:"Testimonials",href:"/about/testimonials"},{name:"Contact",href:"/contact"}]}],[h,A]);C.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),C.useEffect(()=>{const w=()=>s(window.scrollY>40);return window.addEventListener("scroll",w,{passive:!0}),()=>window.removeEventListener("scroll",w)},[]),C.useEffect(()=>{t(!1),r(null)},[o.pathname]);const v=w=>o.pathname===w,x=w=>{r(b=>b===w?null:w)};return l.jsxs(l.Fragment,{children:[l.jsxs("header",{ref:a,className:"fixed top-0 left-0 right-0 z-50 transition-all duration-500",style:{background:i?"hsl(var(--primary) / 0.94)":"hsl(var(--primary) / 0.78)",backdropFilter:"blur(28px) saturate(1.3)",WebkitBackdropFilter:"blur(28px) saturate(1.3)",boxShadow:i?"0 8px 32px hsl(var(--primary) / 0.4)":"none",borderBottom:`1px solid hsl(var(--primary-foreground) / ${i?"0.08":"0.04"})`},children:[l.jsx("nav",{className:"w-full px-3 md:px-6",children:l.jsxs("div",{className:"flex items-center justify-between h-20",children:[l.jsx(At,{to:"/",className:"shrink-0 relative z-[60] group",children:l.jsx("img",{src:nV,alt:"HoldenGR — Grand Rapids Area Real Estate",className:"h-8 lg:h-10 w-auto max-w-[220px] lg:max-w-[280px] object-contain transition-all duration-500 group-hover:opacity-90"})}),l.jsxs("div",{className:"hidden lg:flex items-center gap-6 xl:gap-8",children:[l.jsx(bS,{label:"Buying & Selling",items:f,align:"start",widthClassName:"w-[280px]",isActive:v,onNavigate:()=>{}}),l.jsx(bS,{label:"Explore",items:p,align:"center",widthClassName:"w-[230px]",isActive:v,onNavigate:()=>{}}),l.jsx(bS,{label:"Insights",items:g,align:"center",widthClassName:"w-[230px]",isActive:v,onNavigate:()=>{}}),l.jsx(bS,{label:"About",items:m,align:"end",widthClassName:"w-[240px]",isActive:v,onNavigate:()=>{}}),l.jsxs("a",{href:"sms:6164036393",className:"flex items-center gap-2 ml-2 px-4 py-2 border border-gold/60 text-gold hover:bg-gold hover:text-primary transition-all duration-300 group",children:[l.jsx(aj,{size:14,className:"group-hover:scale-110 transition-transform"}),l.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] font-medium",children:"Text Holden"})]}),l.jsx("button",{onClick:()=>t(!e),className:"relative z-[60] p-2 text-primary-foreground/80 hover:text-gold transition-colors duration-300","aria-label":"Toggle menu",children:e?l.jsx(ta,{size:24}):l.jsx(T7,{size:24})})]}),l.jsxs("div",{className:"flex lg:hidden items-center gap-3",children:[l.jsxs("a",{href:"sms:6164036393",className:"flex items-center gap-1.5 px-3 py-1.5 border border-gold/60 text-gold",children:[l.jsx(aj,{size:12}),l.jsx("span",{className:"text-[9px] uppercase tracking-[0.15em] font-medium",children:"Text Holden"})]}),l.jsx("button",{onClick:()=>t(!e),className:"relative z-[60] p-2 text-primary-foreground/80 hover:text-gold transition-colors duration-300","aria-label":"Toggle menu",children:e?l.jsx(ta,{size:24}):l.jsx(T7,{size:24})})]})]})}),l.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-gold/70 to-transparent"})]}),Hf.createPortal(l.jsx(Cy,{children:e&&l.jsxs(hi.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.5,ease:[.22,1,.36,1]},className:"fixed inset-0 z-[9999] flex flex-col",children:[l.jsxs(hi.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.4},className:"absolute inset-0",style:{background:"hsl(var(--primary) / 0.86)",backdropFilter:"blur(32px) saturate(1.5)",WebkitBackdropFilter:"blur(32px) saturate(1.5)"},children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-white/[0.04] via-transparent to-black/25"}),l.jsx("div",{className:"absolute inset-[1px] border border-white/[0.06] pointer-events-none"}),l.jsx("div",{className:"absolute top-0 left-0 right-0 h-32 bg-gradient-to-b from-gold/[0.04] to-transparent pointer-events-none"})]}),l.jsx("button",{onClick:()=>t(!1),className:"absolute top-6 right-6 md:top-8 md:right-12 lg:right-16 text-white/50 hover:text-white p-2 transition-colors duration-300 z-10",children:l.jsx(ta,{size:22})}),l.jsx("div",{className:"relative w-full h-20 md:h-24 flex items-center px-6 md:px-12 shrink-0",children:l.jsx(At,{to:"/",onClick:()=>t(!1),className:"flex items-center",children:l.jsx("img",{src:nV,alt:"HoldenGR",className:"h-12 md:h-14 w-auto"})})}),l.jsx("div",{className:"relative px-6 md:px-12",children:l.jsx("div",{className:"h-px bg-gradient-to-r from-gold/40 via-gold/20 to-transparent"})}),l.jsx("div",{className:"relative flex-1 overflow-y-auto min-h-0",children:l.jsxs("div",{className:"max-w-7xl mx-auto w-full px-6 md:px-12 py-6 md:py-10",children:[l.jsxs("div",{className:"hidden lg:flex gap-16",children:[l.jsx("nav",{className:"flex-1 flex flex-col gap-8",children:y.map((w,b)=>l.jsxs("div",{children:[l.jsx(hi.p,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:.1+b*.06,duration:.4},className:"text-[9px] uppercase tracking-[0.35em] font-semibold text-gold/60 mb-4",children:w.label}),l.jsx("div",{className:"flex flex-col gap-0.5",children:w.items.map((k,j)=>l.jsx(hi.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.15+b*.06+j*.03,duration:.4,ease:[.22,1,.36,1]},children:k.children?l.jsxs("button",{onClick:()=>x(k.name),className:`group flex items-center gap-2 py-2.5 transition-colors duration-300 w-full text-left ${n===k.name?"text-gold":"text-white/70 hover:text-white"}`,children:[l.jsx("span",{className:"text-[13px] uppercase tracking-[0.25em] font-medium",children:k.name}),l.jsx(fc,{size:14,className:`transition-transform duration-300 text-gold/50 ${n===k.name?"rotate-90":""}`})]}):l.jsx(At,{to:k.href,onClick:()=>t(!1),className:`group flex items-center py-2.5 transition-colors duration-300 ${v(k.href)?"text-gold":"text-white/70 hover:text-white"}`,children:l.jsx("span",{className:"text-[13px] uppercase tracking-[0.25em] font-medium",children:k.name})})},k.name+k.href))}),b<y.length-1&&l.jsx("div",{className:"mt-5 h-px bg-gradient-to-r from-white/[0.06] via-white/[0.03] to-transparent"})]},w.label))}),l.jsx(Cy,{mode:"wait",children:n&&l.jsxs(hi.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{duration:.3,ease:[.22,1,.36,1]},className:"w-72 pt-8",children:[l.jsx("p",{className:"text-[9px] uppercase tracking-[0.35em] font-semibold text-gold/50 mb-4",children:n}),l.jsx("div",{className:"flex flex-col gap-0.5",children:y.flatMap(w=>w.items).filter(w=>w.name===n&&w.children).map(w=>l.jsxs("div",{children:[l.jsx(At,{to:w.href,onClick:()=>t(!1),className:`flex items-center py-2 transition-colors duration-300 ${v(w.href)?"text-gold":"text-white/50 hover:text-white/80"}`,children:l.jsxs("span",{className:"text-[11px] uppercase tracking-[0.2em] font-medium",children:["View All ",w.name]})}),l.jsx("div",{className:"h-px bg-white/[0.04] my-2"}),w.children.map((b,k)=>l.jsx(hi.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{delay:k*.03,duration:.3},children:l.jsx(At,{to:b.href,onClick:()=>t(!1),className:`flex items-center py-2 transition-colors duration-300 ${v(b.href)?"text-gold":"text-white/60 hover:text-white"}`,children:l.jsx("span",{className:"text-[12px] uppercase tracking-[0.15em] font-medium",children:b.name})})},b.href))]},w.href))})]},n)})]}),l.jsx("nav",{className:"lg:hidden flex flex-col gap-6",children:y.map((w,b)=>l.jsxs("div",{children:[l.jsx(hi.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.1+b*.06,duration:.4},className:"text-[9px] uppercase tracking-[0.35em] font-semibold text-gold/60 mb-3",children:w.label}),l.jsx("div",{className:"flex flex-col",children:w.items.map((k,j)=>l.jsx(hi.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.12+b*.06+j*.03,duration:.4,ease:[.22,1,.36,1]},children:k.children?l.jsxs(l.Fragment,{children:[l.jsxs("button",{onClick:()=>x(k.name),className:`group flex items-center gap-2 py-2 transition-colors duration-300 w-full text-left ${n===k.name?"text-gold":"text-white/70 hover:text-white"}`,children:[l.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] font-medium",children:k.name}),l.jsx(fc,{size:13,className:`transition-transform duration-300 text-gold/50 ${n===k.name?"rotate-90":""}`})]}),l.jsx(Cy,{children:n===k.name&&l.jsxs(hi.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25},className:"overflow-hidden pl-4 border-l border-gold/20",children:[l.jsx(At,{to:k.href,onClick:()=>t(!1),className:"flex items-center py-1.5 text-white/40 hover:text-white/70 transition-colors",children:l.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] font-medium",children:"View All"})}),k.children.map(B=>l.jsx(At,{to:B.href,onClick:()=>t(!1),className:`flex items-center py-1.5 transition-colors duration-300 ${v(B.href)?"text-gold":"text-white/55 hover:text-white"}`,children:l.jsx("span",{className:"text-[10px] uppercase tracking-[0.15em] font-medium",children:B.name})},B.href))]})})]}):l.jsx(At,{to:k.href,onClick:()=>t(!1),className:`group flex items-center py-2 transition-colors duration-300 ${v(k.href)?"text-gold":"text-white/70 hover:text-white"}`,children:l.jsx("span",{className:"text-[11px] uppercase tracking-[0.25em] font-medium",children:k.name})})},k.name+k.href))}),b<y.length-1&&l.jsx("div",{className:"mt-4 h-px bg-gradient-to-r from-white/[0.06] via-white/[0.03] to-transparent"})]},w.label))})]})}),l.jsx(hi.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.6,duration:.5},className:"relative shrink-0 border-t border-white/[0.08]",children:l.jsx("div",{className:"max-w-7xl mx-auto w-full px-6 md:px-12 py-5",children:l.jsxs("div",{className:"flex flex-row items-center gap-8 md:gap-12",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[9px] uppercase tracking-[0.3em] font-medium text-white/25 mb-1",children:"Phone"}),l.jsx("a",{href:"tel:6164036393",className:"text-white/50 hover:text-white text-sm font-light tracking-wide transition-colors",children:"(616) 403-6393"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-[9px] uppercase tracking-[0.3em] font-medium text-white/25 mb-1",children:"Email"}),l.jsx("a",{href:"mailto:holden@holdengr.com",className:"text-white/50 hover:text-white text-sm font-light tracking-wide transition-colors",children:"holden@holdengr.com"})]})]})})})]})}),document.body)]})},roe="/assets/agent-portrait-DcetkHNl.jpg",w4e="/assets/eho-realtor-logo-NaFA1neB.jpg";function b4e(){return gr({queryKey:["site-config"],queryFn:async()=>{const{data:e,error:t}=await Me.from("site_config").select("*").order("key");if(t)throw t;return e}})}function Os(){const e=b4e(),t=(e.data||[]).reduce((n,r)=>(n[r.key]=r.value||"",n),{});return{...e,configMap:t}}function ioe(){const e=cs();return Is({mutationFn:async t=>{const{error:n}=await Me.from("site_config").upsert(t,{onConflict:"key"});if(n)throw n},onSuccess:()=>e.invalidateQueries({queryKey:["site-config"]})})}const C4e=()=>l.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-[22px] h-[22px]",children:l.jsx("path",{d:"M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-2.88 2.5 2.89 2.89 0 0 1-2.89-2.89 2.89 2.89 0 0 1 2.89-2.89c.28 0 .54.04.79.1V9.01a6.27 6.27 0 0 0-.79-.05 6.34 6.34 0 0 0-6.34 6.34 6.34 6.34 0 0 0 6.34 6.34 6.34 6.34 0 0 0 6.34-6.34V8.73a8.19 8.19 0 0 0 4.76 1.52V6.81a4.83 4.83 0 0 1-1-.12z"})}),S4e=()=>l.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-[22px] h-[22px]",children:l.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),k4e=()=>l.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-[22px] h-[22px]",children:l.jsx("path",{d:"M12 1.5C6.202 1.5 1.5 6.202 1.5 12S6.202 22.5 12 22.5 22.5 17.798 22.5 12 17.798 1.5 12 1.5zm5.836 11.1l-5.54 5.232a.45.45 0 0 1-.592 0L6.164 12.6a.45.45 0 0 1 .296-.792h3.24V7.5a.45.45 0 0 1 .45-.45h3.7a.45.45 0 0 1 .45.45v4.308h3.24a.45.45 0 0 1 .296.792z"})}),_4e=()=>l.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-[22px] h-[22px]",children:l.jsx("path",{d:"M12 2L3 9v12a1 1 0 001 1h5a1 1 0 001-1v-5a2 2 0 014 0v5a1 1 0 001 1h5a1 1 0 001-1V9l-9-7z"})}),j4e=[{key:"about_website",label:"Website",icon:l.jsx(C2,{className:"w-[22px] h-[22px]"}),hoverColor:"#D4AF37"},{key:"about_google_business",label:"Google",icon:l.jsx(ov,{className:"w-[22px] h-[22px]"}),hoverColor:"#4285F4"},{key:"about_facebook",label:"Facebook",icon:l.jsx(k2e,{className:"w-[22px] h-[22px]"}),hoverColor:"#1877F2"},{key:"about_instagram",label:"Instagram",icon:l.jsx(L3,{className:"w-[22px] h-[22px]"}),hoverColor:"#E1306C",hoverStyle:{background:"linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}},{key:"about_linkedin",label:"LinkedIn",icon:l.jsx(F2e,{className:"w-[22px] h-[22px]"}),hoverColor:"#0A66C2"},{key:"about_youtube",label:"YouTube",icon:l.jsx(Qre,{className:"w-[22px] h-[22px]"}),hoverColor:"#FF0000"},{key:"about_x",label:"X",icon:l.jsx(S4e,{}),hoverColor:"#FFFFFF"},{key:"about_tiktok",label:"TikTok",icon:l.jsx(C4e,{}),hoverColor:"#00F2EA"},{key:"about_zillow",label:"Zillow",icon:l.jsx(k4e,{}),hoverColor:"#006AFF"},{key:"about_realtor",label:"Realtor",icon:l.jsx(_4e,{}),hoverColor:"#D92228"}],B4e=()=>{const{configMap:e,isLoading:t}=Os(),[n,r]=C.useState(null);if(t)return null;const i=j4e.filter(s=>e[s.key]);return i.length===0?null:l.jsxs("div",{className:"relative bg-primary-foreground/[0.03]",children:[l.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-accent/60 to-transparent"}),l.jsx("div",{className:"py-10 md:py-14",children:l.jsxs("div",{className:"container-page flex flex-col items-center gap-7 md:gap-8",children:[l.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("div",{className:"w-12 h-px bg-accent/40"}),l.jsx("span",{className:"text-[10px] tracking-[0.35em] uppercase text-accent/80 font-semibold",children:"Connect With Holden"}),l.jsx("div",{className:"w-12 h-px bg-accent/40"})]}),l.jsx("p",{className:"text-[13px] md:text-sm text-primary-foreground/55 max-w-md leading-relaxed",children:"Follow along for Grand Rapids market updates, listings, and behind-the-scenes from the field."})]}),l.jsx("div",{className:"flex items-center gap-2 md:gap-4 flex-wrap justify-center",children:i.map(s=>{const a=n===s.key;return l.jsxs("a",{href:e[s.key],target:"_blank",rel:"noopener noreferrer",className:"group flex flex-col items-center gap-2.5 transition-all duration-300","aria-label":s.label,onMouseEnter:()=>r(s.key),onMouseLeave:()=>r(null),children:[l.jsx("span",{className:"flex items-center justify-center w-14 h-14 md:w-16 md:h-16 border border-primary-foreground/15 transition-all duration-300",style:{color:a?s.hoverColor:"hsl(var(--primary-foreground) / 0.7)",backgroundColor:a?`${s.hoverColor}1F`:"hsl(var(--primary-foreground) / 0.04)",borderColor:a?`${s.hoverColor}66`:"hsl(var(--primary-foreground) / 0.15)",transform:a?"translateY(-3px)":"translateY(0)",...a&&s.hoverStyle?s.hoverStyle:{}},children:s.icon}),l.jsx("span",{className:"text-[9px] md:text-[10px] tracking-[0.2em] uppercase font-medium transition-all duration-300",style:{color:a?s.hoverColor:"hsl(var(--primary-foreground) / 0.45)"},children:s.label})]},s.key)})})]})}),l.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-accent/60 to-transparent"})]})},N4e="/wordmark-on-dark-transparent.svg",E4e=[{name:"Search Homes",href:"/idx"},{name:"Market Pulse",href:"/market-pulse"},{name:"Buyers",href:"/buyers"},{name:"Sellers",href:"/sellers"},{name:"About",href:"/about"},{name:"Contact",href:"/contact"}],T4e=new Set(["buyers","sellers","about"]),y6=()=>{const{data:e}=noe(),t=(e||[]).filter(r=>!T4e.has(r.slug.toLowerCase().trim())).map(r=>({name:r.name,href:`/${r.slug}`})),n=[...E4e,...t];return l.jsxs("footer",{className:"bg-primary text-primary-foreground",children:[l.jsx(B4e,{}),l.jsx("div",{className:"h-px bg-gradient-to-r from-transparent via-accent/20 to-transparent"}),l.jsx("div",{className:"py-12 md:py-16",children:l.jsxs("div",{className:"container-page",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-8 md:gap-6",children:[l.jsxs("div",{className:"md:col-span-4",children:[l.jsxs("div",{className:"flex items-center gap-4 mb-5",children:[l.jsx("img",{src:roe,alt:"Holden Richardson",className:"w-14 h-14 rounded-full object-cover object-top border-2 border-accent/30 shrink-0"}),l.jsx("img",{src:N4e,alt:"@HoldenGR",className:"h-8 w-auto"})]}),l.jsx("p",{className:"text-primary-foreground/45 text-[13px] leading-[1.7] max-w-sm",children:"Holden Richardson of 616 Realty LLC specializes in residential properties across the Grand Rapids area's most sought-after communities."})]}),l.jsxs("div",{className:"md:col-span-2",children:[l.jsx("h4",{className:"text-[10px] uppercase tracking-[0.25em] text-accent/50 mb-4 font-medium",children:"Quick Links"}),l.jsx("ul",{className:"space-y-2",children:n.map(r=>l.jsx("li",{children:l.jsx(At,{to:r.href,className:"text-[13px] text-primary-foreground/45 hover:text-accent transition-colors duration-300",children:r.name})},r.href))})]}),l.jsxs("div",{className:"md:col-span-3",children:[l.jsx("h4",{className:"text-[10px] uppercase tracking-[0.25em] text-accent/50 mb-4 font-medium",children:"Contact"}),l.jsxs("ul",{className:"space-y-1.5 text-[13px] text-primary-foreground/45",children:[l.jsx("li",{children:l.jsx("a",{href:"tel:+16164036393",className:"hover:text-accent transition-colors",children:"(616) 403-6393"})}),l.jsx("li",{children:l.jsx("a",{href:"mailto:holden@holdengr.com",className:"hover:text-accent transition-colors",children:"holden@holdengr.com"})}),l.jsx("li",{className:"text-primary-foreground/30 text-[11px] pt-1",children:"License #6501392389"})]}),l.jsx("h4",{className:"text-[10px] uppercase tracking-[0.25em] text-accent/50 mt-6 mb-3 font-medium",children:"Brokerage"}),l.jsxs("ul",{className:"space-y-1 text-[13px] text-primary-foreground/45",children:[l.jsx("li",{className:"font-medium text-primary-foreground/55",children:"616 Realty LLC"}),l.jsx("li",{children:"1171 Plainfield Ave NE"}),l.jsx("li",{children:"Grand Rapids, MI 49503"}),l.jsx("li",{children:"(616) 272-3707"})]})]}),l.jsxs("div",{className:"md:col-span-3",children:[l.jsx("div",{className:"bg-primary-foreground/10 rounded p-2 w-fit mb-4",children:l.jsx("img",{src:w4e,alt:"Equal Housing Opportunity & Realtor",className:"h-10 w-auto"})}),l.jsx("p",{className:"text-[11px] text-primary-foreground/30 leading-relaxed mb-4",children:"We are committed to the letter and spirit of U.S. policy for equal housing opportunity. We support an affirmative marketing program with no barriers to housing because of race, color, religion, sex, handicap, familial status, or national origin."}),l.jsx("p",{className:"text-[11px] text-primary-foreground/30 leading-relaxed",children:"Information provided is for general purposes only. Listing data is sourced from third parties and may not reflect real-time availability or pricing. Always verify details independently."})]})]}),l.jsxs("div",{className:"border-t border-primary-foreground/[0.06] mt-10 pt-6 flex flex-col md:flex-row justify-between items-center gap-3",children:[l.jsxs("div",{className:"flex flex-col md:flex-row items-center gap-2 md:gap-3",children:[l.jsxs("p",{className:"text-[11px] text-primary-foreground/25",children:["© ",new Date().getFullYear()," Holden Richardson | 616 Realty LLC. All rights reserved."]}),l.jsx("span",{className:"hidden md:inline text-primary-foreground/15",children:"•"}),l.jsx("a",{href:"https://realsavvy.com",target:"_blank",rel:"noopener noreferrer",className:"text-[11px] text-primary-foreground/25 hover:text-accent transition-colors",children:"Site built by RealSavvy"})]}),l.jsxs("div",{className:"flex gap-5",children:[l.jsx(At,{to:"/privacy-policy",className:"text-[11px] text-primary-foreground/25 hover:text-accent transition-colors",children:"Privacy Policy"}),l.jsx(At,{to:"/terms-of-service",className:"text-[11px] text-primary-foreground/25 hover:text-accent transition-colors",children:"Terms of Service"}),l.jsx(At,{to:"/accessibility",className:"text-[11px] text-primary-foreground/25 hover:text-accent transition-colors",children:"Accessibility"})]})]})]})})]})},P4e=()=>{const{configMap:e}=Os(),[t,n]=C.useState(!1),r=e.booking_url,i=e.agent_phone,s=i?`sms:${i.replace(/[^+\d]/g,"")}`:null;return!r&&!s?null:l.jsxs("div",{className:"fixed right-0 bottom-24 z-50 flex flex-col gap-3",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),onClick:()=>n(a=>!a),children:[r&&l.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"flex items-center bg-foreground text-background border-l border-y border-gold/40 shadow-xl rounded-none overflow-hidden transition-all duration-300 hover:bg-foreground/90",children:[l.jsx("div",{className:"flex items-center justify-center w-12 h-12 shrink-0",children:l.jsx(Oo,{className:"w-5 h-5"})}),l.jsx(Cy,{children:t&&l.jsx(hi.span,{initial:{width:0,opacity:0},animate:{width:"auto",opacity:1},exit:{width:0,opacity:0},transition:{duration:.3,ease:[.25,.1,.25,1]},className:"whitespace-nowrap text-sm font-semibold tracking-wide pr-5 overflow-hidden",children:"Book Virtual Meeting With Holden"})})]}),s&&l.jsxs("a",{href:s,className:"flex items-center bg-foreground text-background border-l border-y border-gold/40 shadow-xl rounded-none overflow-hidden transition-all duration-300 hover:bg-foreground/90",children:[l.jsx("div",{className:"flex items-center justify-center w-12 h-12 shrink-0",children:l.jsx(lf,{className:"w-5 h-5"})}),l.jsx(Cy,{children:t&&l.jsx(hi.span,{initial:{width:0,opacity:0},animate:{width:"auto",opacity:1},exit:{width:0,opacity:0},transition:{duration:.3,ease:[.25,.1,.25,1],delay:.05},className:"whitespace-nowrap text-sm font-semibold tracking-wide pr-5 overflow-hidden",children:"Text Holden — Instant Answers"})})]})]})},ln=({children:e})=>l.jsxs("div",{className:"min-h-screen flex flex-col",children:[l.jsx(IE,{}),l.jsx("main",{className:"flex-1 pt-20",children:e}),l.jsx(y6,{}),l.jsx(P4e,{})]}),I4e={49503:{city:"Grand Rapids",area:"Heritage Hill / Downtown / Eastown edge",county:"Kent",state:"MI"},49504:{city:"Grand Rapids",area:"West Side / John Ball Park",county:"Kent",state:"MI"},49505:{city:"Grand Rapids",area:"Creston / Northeast",county:"Kent",state:"MI"},49506:{city:"East Grand Rapids",area:"EGR / Eastown / Ottawa Hills",county:"Kent",state:"MI"},49507:{city:"Grand Rapids",area:"Garfield Park / Alger Heights",county:"Kent",state:"MI"},49508:{city:"Grand Rapids",area:"South / Kentwood border",county:"Kent",state:"MI"},49509:{city:"Wyoming",area:"Wyoming",county:"Kent",state:"MI"},49512:{city:"Kentwood",area:"Kentwood / SE",county:"Kent",state:"MI"},49519:{city:"Wyoming",area:"Wyoming SW",county:"Kent",state:"MI"},49525:{city:"Grand Rapids",area:"Northview / North Park",county:"Kent",state:"MI"},49544:{city:"Grand Rapids",area:"Walker / NW",county:"Kent",state:"MI"},49546:{city:"Grand Rapids",area:"Cascade / Forest Hills",county:"Kent",state:"MI"},49548:{city:"Wyoming",area:"Wyoming SE",county:"Kent",state:"MI"},49301:{city:"Ada",area:"Ada / Forest Hills",county:"Kent",state:"MI"},49302:{city:"Alto",area:"Alto",county:"Kent",state:"MI"},49306:{city:"Belmont",area:"Belmont / Rockford edge",county:"Kent",state:"MI"},49315:{city:"Byron Center",area:"Byron Center",county:"Kent",state:"MI"},49316:{city:"Caledonia",area:"Caledonia",county:"Kent",state:"MI"},49321:{city:"Comstock Park",area:"Comstock Park",county:"Kent",state:"MI"},49326:{city:"Cedar Springs",area:"Cedar Springs",county:"Kent",state:"MI"},49331:{city:"Lowell",area:"Lowell",county:"Kent",state:"MI"},49341:{city:"Rockford",area:"Rockford",county:"Kent",state:"MI"},49345:{city:"Sparta",area:"Sparta",county:"Kent",state:"MI"},49351:{city:"Rockford",area:"Rockford",county:"Kent",state:"MI"},49355:{city:"Grand Rapids",area:"Amway HQ area",county:"Kent",state:"MI"},49401:{city:"Allendale",area:"Allendale / GVSU",county:"Ottawa",state:"MI"},49417:{city:"Grand Haven",area:"Grand Haven",county:"Ottawa",state:"MI"},49418:{city:"Allendale Charter Twp",area:"Hudsonville / Allendale",county:"Ottawa",state:"MI"},49423:{city:"Holland",area:"Holland South",county:"Ottawa/Allegan",state:"MI"},49424:{city:"Holland",area:"Holland North",county:"Ottawa",state:"MI"},49426:{city:"Hudsonville",area:"Hudsonville / Jamestown",county:"Ottawa",state:"MI"},49428:{city:"Jenison",area:"Jenison / Georgetown Twp",county:"Ottawa",state:"MI"},49431:{city:"Ludington",area:"Ludington",county:"Mason",state:"MI"},49435:{city:"Marne",area:"Marne",county:"Ottawa",state:"MI"},49441:{city:"Muskegon",area:"Muskegon South",county:"Muskegon",state:"MI"},49442:{city:"Muskegon",area:"Muskegon East",county:"Muskegon",state:"MI"},49445:{city:"North Muskegon",area:"North Muskegon",county:"Muskegon",state:"MI"},49456:{city:"Spring Lake",area:"Spring Lake / Ferrysburg",county:"Ottawa",state:"MI"},49460:{city:"West Olive",area:"West Olive",county:"Ottawa",state:"MI"},49464:{city:"Zeeland",area:"Zeeland",county:"Ottawa",state:"MI"},49010:{city:"Allegan",area:"Allegan",county:"Allegan",state:"MI"},49348:{city:"Shelbyville",area:"Shelbyville / Wayland edge",county:"Allegan",state:"MI"},49323:{city:"Dorr",area:"Dorr",county:"Allegan",state:"MI"},49328:{city:"Hopkins",area:"Hopkins",county:"Allegan",state:"MI"},49344:{city:"Plainwell",area:"Plainwell / Otsego",county:"Allegan",state:"MI"}};function O4e(e){return I4e[e.trim()]??null}function soe(e){return/^\d{5}$/.test(e.trim())}function v6({compact:e=!1}){const[t,n]=C.useState(""),[r,i]=C.useState("seller"),[s,a]=C.useState(""),o=El(),c=u=>{if(u.preventDefault(),!soe(t)){a("Enter a valid 5-digit ZIP");return}a(""),o(`/market-pulse/${t}?lens=${r}&run=1&t=${Date.now()}`)};return l.jsxs("form",{onSubmit:c,className:`bg-background/95 backdrop-blur-xl border border-border ${e?"p-4":"p-5 md:p-6"} text-foreground shadow-2xl`,children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx(sj,{size:14,className:"text-primary"}),l.jsx("span",{className:"text-[10px] uppercase tracking-[0.3em] font-semibold text-primary",children:"Market Pulse"})]}),l.jsx("div",{className:"text-sm text-foreground/80 mb-4",children:"Your ZIP. My take. Real numbers — instant."}),l.jsxs("div",{className:"flex border border-border mb-3",children:[l.jsx("button",{type:"button",onClick:()=>i("seller"),className:`flex-1 px-3 py-2 text-[10px] uppercase tracking-[0.2em] font-medium transition-colors ${r==="seller"?"bg-foreground text-background":"text-foreground/70 hover:bg-muted"}`,children:"I'm a Seller"}),l.jsx("button",{type:"button",onClick:()=>i("buyer"),className:`flex-1 px-3 py-2 text-[10px] uppercase tracking-[0.2em] font-medium transition-colors ${r==="buyer"?"bg-foreground text-background":"text-foreground/70 hover:bg-muted"}`,children:"I'm a Buyer"})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{type:"text",inputMode:"numeric",pattern:"\\d{5}",maxLength:5,value:t,onChange:u=>n(u.target.value.replace(/\D/g,"")),placeholder:"49506",className:"flex-1 bg-background border border-border px-3 py-2.5 text-base tabular-nums focus:outline-none focus:ring-1 focus:ring-primary","aria-label":"ZIP code"}),l.jsxs("button",{type:"submit",className:"inline-flex items-center gap-2 px-4 py-2.5 bg-primary text-primary-foreground text-[10px] uppercase tracking-[0.2em] font-medium hover:bg-primary/90 transition-colors",children:["Get Report ",l.jsx(Va,{size:14})]})]}),s&&l.jsx("p",{className:"text-[11px] text-destructive mt-2",children:s}),l.jsx("p",{className:"text-[10px] text-muted-foreground mt-3",children:"Free · No login · Instant report with calculator + AI chat"})]})}const F4e=()=>{const[e,t]=C.useState(!1);return l.jsxs("section",{className:"relative w-full overflow-hidden bg-secondary",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-secondary via-background to-secondary"}),l.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top_right,hsl(var(--gold)/0.08),transparent_60%)]"}),l.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_bottom_left,hsl(var(--foreground)/0.04),transparent_55%)]"}),l.jsx("div",{className:"relative z-10 mx-auto max-w-[1400px] px-6 md:px-10 lg:px-14 py-16 md:py-20 lg:py-24",children:l.jsxs("div",{className:"grid lg:grid-cols-12 gap-8 lg:gap-12 items-center",children:[l.jsxs("div",{className:"lg:col-span-7",children:[l.jsxs(hi.div,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},transition:{duration:.7,ease:[.5,0,0,1]},children:[l.jsx("div",{className:"text-[10px] md:text-[11px] uppercase tracking-[0.35em] text-accent font-medium mb-5",children:"Grand Rapids Realtor®"}),l.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl xl:text-[5rem] font-bold text-foreground leading-[1.05] mb-6 tracking-tight",children:"Holden Richardson"}),l.jsx("p",{className:"text-base md:text-lg text-muted-foreground font-light max-w-xl mb-8 leading-relaxed",children:"Buyer & seller guides · dynamic home search · personal market reports for every Grand Rapids ZIP."})]}),l.jsx(hi.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.7,delay:.15,ease:[.5,0,0,1]},className:"max-w-md",children:l.jsx(v6,{})}),l.jsxs(hi.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.6,delay:.3,ease:[.5,0,0,1]},className:"flex flex-wrap gap-3 mt-6",children:[l.jsxs(At,{to:"/idx",className:"inline-flex items-center justify-center gap-2 px-5 py-3 border border-foreground/25 text-foreground text-[10px] uppercase tracking-[0.25em] font-medium hover:bg-foreground hover:text-background transition-colors",children:[l.jsx(hE,{size:14})," Search Homes"]}),l.jsxs(At,{to:"/home-valuation",className:"inline-flex items-center justify-center gap-2 px-5 py-3 border border-foreground/25 text-foreground text-[10px] uppercase tracking-[0.25em] font-medium hover:bg-foreground hover:text-background transition-colors",children:[l.jsx(T2e,{size:14})," Home Valuation"]})]})]}),l.jsx("div",{className:"lg:col-span-5",children:l.jsxs(hi.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{duration:.9,ease:[.5,0,0,1]},className:"relative",children:[l.jsx("div",{className:"absolute -top-2 -right-2 w-16 h-16 border-t-2 border-r-2 border-accent/60 z-10 pointer-events-none"}),l.jsx("div",{className:"absolute -bottom-2 -left-2 w-16 h-16 border-b-2 border-l-2 border-accent/60 z-10 pointer-events-none"}),l.jsxs("div",{className:"relative aspect-[4/5] lg:aspect-[3/4] w-full overflow-hidden bg-primary border border-border shadow-2xl",children:[l.jsx("video",{autoPlay:!0,muted:!0,loop:!0,playsInline:!0,preload:"auto",onCanPlay:()=>t(!0),className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-1000 ${e?"opacity-100":"opacity-0"}`,children:l.jsx("source",{src:"/videos/hero-video.mp4",type:"video/mp4"})}),l.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-primary/40 via-transparent to-transparent pointer-events-none"})]}),l.jsxs("div",{className:"mt-3 flex items-center justify-between text-[10px] uppercase tracking-[0.25em] text-muted-foreground",children:[l.jsx("span",{children:"Grand Rapids · Michigan"}),l.jsx("span",{className:"text-accent",children:"— On the ground"})]})]})})]})}),l.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-accent/50 to-transparent"})]})},M4e={up:{y:50,x:0},down:{y:-50,x:0},left:{x:60,y:0},right:{x:-60,y:0}},L4e=(e,t)=>{const n=M4e[t];switch(e){case"slide":return{hidden:{opacity:0,...n,scale:.97},visible:{opacity:1,x:0,y:0,scale:1}};case"scale":return{hidden:{opacity:0,scale:.88},visible:{opacity:1,scale:1}};case"blur":return{hidden:{opacity:0,filter:"blur(10px)",y:30},visible:{opacity:1,filter:"blur(0px)",y:0}};case"lift":return{hidden:{opacity:0,y:60,rotateX:8},visible:{opacity:1,y:0,rotateX:0}};case"fade":default:return{hidden:{opacity:0,...n},visible:{opacity:1,x:0,y:0}}}},_e=({children:e,className:t="",delay:n=0,direction:r="up",variant:i="fade"})=>{const s=C.useRef(null),a=QTe(s,{once:!0,margin:"-80px"}),o=L4e(i,r);return l.jsx(hi.div,{ref:s,initial:"hidden",animate:a?"visible":"hidden",variants:o,transition:{duration:.8,delay:n,ease:[.25,.1,.25,1]},className:t,children:e})},aoe=[{quote:"Holden is a go getter and very responsive. He found us our home in a competitive market. Very knowledgeable and helped us negotiate a home that fit our needs and wants. I recommend Holden to anyone that is selling or wanting to buy a home because of his knowledge and determination to get the job done!",author:"Elvis Hadzalic",role:"Home Buyer"},{quote:"My partner and I were advised by one of our old neighbors to go to 616 Realty when we were ready to purchase a home, and I am so glad that we listened. Holden, Jayda and Beth were all so helpful during the entire process and were always there when we had questions. I am happy to say we have purchased our home and we couldn't have done that without their help!",author:"Idaris Cruz",role:"Home Buyer"},{quote:"Working with Holden was incredibly seamless and efficient. Wonderful advice and feedback to help me reach my ultimate goal! Would easily recommend to anyone who is anxious going into the housing market.",author:"Aleatha Ostrander",role:"Home Buyer"},{quote:"Holden was a pleasure working with on this transaction, his communication was prompt and professional, and they handled every detail with expertise and integrity. A true team player who kept the process smooth from start to finish — I look forward to working together again.",author:"Tristan Seeley",role:"Transaction Partner"},{quote:"This is the first transaction that I have worked with Holden on and I really appreciate his commitment to communication throughout the process. He was very open to what his clients goals were as buyers and allowed me to do the same for the sellers. Together we were able to work through some weather related issues to get to the closing table with minimal fuss. This is what real estate is all about. No ego. No flex. Just being good stewards for our clients.",author:"Julie Reisner",role:"Collaborating Agent"},{quote:"Holden is so helpful and knowledgeable. He really knows how to get stuff done!",author:"Katie T.",role:"Client"}],c_=3,CS=Math.ceil(aoe.length/c_),R4e=()=>{const[e,t]=C.useState(0),n=aoe.slice(e*c_,e*c_+c_);return l.jsx("section",{className:"section-padding bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsxs("div",{className:"flex flex-col md:flex-row md:items-end md:justify-between mb-12 md:mb-16",children:[l.jsxs("div",{children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption mb-4 text-xl font-semibold text-accent",children:"Client Stories"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section text-5xl",children:"What Clients Say"})})]}),CS>1&&l.jsxs("div",{className:"flex gap-2 mt-6 md:mt-0",children:[l.jsx("button",{onClick:()=>t(r=>r-1),disabled:e===0,className:"w-10 h-10 flex items-center justify-center border border-border hover:border-accent hover:text-accent transition-colors disabled:opacity-25 disabled:cursor-not-allowed","aria-label":"Previous reviews",children:l.jsx(_re,{size:20})}),l.jsx("button",{onClick:()=>t(r=>r+1),disabled:e>=CS-1,className:"w-10 h-10 flex items-center justify-center border border-border hover:border-accent hover:text-accent transition-colors disabled:opacity-25 disabled:cursor-not-allowed","aria-label":"Next reviews",children:l.jsx(fc,{size:20})})]})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:n.map((r,i)=>l.jsx(_e,{delay:i*.1,children:l.jsxs("div",{className:"bg-background p-8 md:p-10 h-full flex flex-col",children:[l.jsx("div",{className:"flex gap-1 mb-6",children:[...Array(5)].map((s,a)=>l.jsx(D3,{size:16,className:"fill-gold text-gold"},a))}),l.jsxs("blockquote",{className:"text-lg font-serif text-foreground mb-8 flex-1",children:['"',r.quote,'"']}),l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-foreground",children:r.author}),l.jsx("p",{className:"text-sm text-muted-foreground",children:r.role})]})]})},r.author))}),l.jsxs("div",{className:"flex flex-col items-center gap-6 mt-10",children:[CS>1&&l.jsx("div",{className:"flex justify-center gap-2",children:Array.from({length:CS}).map((r,i)=>l.jsx("button",{onClick:()=>t(i),className:`w-2 h-2 rounded-full transition-colors ${i===e?"bg-accent":"bg-border"}`,"aria-label":`Go to page ${i+1}`},i))}),l.jsx(_e,{delay:.3,children:l.jsxs("a",{href:"https://www.google.com/maps?cid=17099657301143231027",target:"_blank",rel:"noopener noreferrer",className:"btn-outline-primary inline-flex items-center gap-2",children:["See All Reviews on Google ",l.jsx(eo,{className:"w-4 h-4"})]})})]})]})})};function lt({className:e,...t}){return l.jsx("div",{className:it("animate-pulse rounded-md bg-muted",e),...t})}const D4e=async()=>{const{data:e,error:t}=await Me.functions.invoke("instagram-feed",{body:{limit:12}});if(t)throw t;return e.media||[]},U4e=()=>{const{data:e,isLoading:t,error:n}=gr({queryKey:["instagram-feed"],queryFn:D4e,staleTime:6e5,retry:0,enabled:!0});return n?(console.error("Instagram feed error:",n),null):l.jsx("section",{className:"section-padding bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsxs("div",{className:"flex flex-col md:flex-row md:items-end md:justify-between mb-12",children:[l.jsxs("div",{children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Follow Along"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section",children:"On Instagram"})})]}),l.jsx(_e,{delay:.2,children:l.jsxs("a",{href:"https://instagram.com/holdengr.re",target:"_blank",rel:"noopener noreferrer",className:"mt-6 md:mt-0 inline-flex items-center gap-2 text-caption text-foreground hover:text-gold transition-colors",children:[l.jsx(L3,{size:18}),"@holdengr.re"]})})]}),l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4",children:t?Array.from({length:12}).map((r,i)=>l.jsx(lt,{className:"aspect-square w-full"},i)):e==null?void 0:e.map((r,i)=>{var s;return l.jsx(_e,{delay:i*.05,children:l.jsxs("a",{href:r.permalink,target:"_blank",rel:"noopener noreferrer",className:"block aspect-square overflow-hidden group relative",children:[r.media_type==="VIDEO"&&l.jsx("div",{className:"absolute top-3 right-3 z-10 bg-background/80 backdrop-blur-sm rounded-full p-2",children:l.jsx(R3,{size:16,className:"text-foreground fill-foreground"})}),r.media_type==="VIDEO"?l.jsx("video",{src:r.media_url,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105",muted:!0,playsInline:!0}):l.jsx("img",{src:r.media_url,alt:((s=r.caption)==null?void 0:s.slice(0,100))||"Instagram post",className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105",loading:"lazy"}),l.jsx("div",{className:"absolute inset-0 bg-foreground/0 group-hover:bg-foreground/20 transition-colors duration-300 flex items-center justify-center",children:l.jsx(L3,{size:28,className:"text-background opacity-0 group-hover:opacity-100 transition-opacity duration-300"})})]})},r.id)})})]})})},H4e="https://khmmwvmdbhaplcfcndjx.supabase.co",OE=`${H4e}/functions/v1/blog-api`;async function FE(){const{data:{session:e}}=await Me.auth.getSession(),t={"Content-Type":"application/json"};return e!=null&&e.access_token&&(t.Authorization=`Bearer ${e.access_token}`),t}function ooe(e){return gr({queryKey:["blog-posts","published",e],queryFn:async()=>{let t=Me.from("blog_posts").select("*").eq("published",!0).order("published_at",{ascending:!1});e&&(t=t.limit(e));const{data:n,error:r}=await t;if(r)throw r;return n}})}function Q4e(e){return gr({queryKey:["blog-post",e],queryFn:async()=>{const{data:t,error:n}=await Me.from("blog_posts").select("*").eq("slug",e).eq("published",!0).maybeSingle();if(n)throw n;return t},enabled:!!e})}function $4e(){return gr({queryKey:["blog-posts","all"],queryFn:async()=>{const e=await FE(),t=await fetch(OE,{headers:e});if(!t.ok)throw new Error("Failed to fetch posts");return t.json()}})}function z4e(){const e=cs();return Is({mutationFn:async t=>{const n=await FE(),r=await fetch(OE,{method:"POST",headers:n,body:JSON.stringify(t)});if(!r.ok){const i=await r.json();throw new Error(i.error||"Failed to create post")}return r.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["blog-posts"]})}})}function V4e(){const e=cs();return Is({mutationFn:async({slug:t,data:n})=>{const r=await FE(),i=await fetch(`${OE}/${t}`,{method:"PUT",headers:r,body:JSON.stringify(n)});if(!i.ok){const s=await i.json();throw new Error(s.error||"Failed to update post")}return i.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["blog-posts"]}),e.invalidateQueries({queryKey:["blog-post"]})}})}function K4e(){const e=cs();return Is({mutationFn:async t=>{const n=await FE(),r=await fetch(`${OE}/${t}`,{method:"DELETE",headers:n});if(!r.ok){const i=await r.json();throw new Error(i.error||"Failed to delete post")}return r.json()},onSuccess:()=>{e.invalidateQueries({queryKey:["blog-posts"]})}})}const q4e=()=>{const{data:e,isLoading:t}=ooe(3);return t?l.jsx("section",{className:"section-padding bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsxs("div",{className:"text-center mb-12",children:[l.jsx(lt,{className:"h-4 w-32 mx-auto mb-4"}),l.jsx(lt,{className:"h-12 w-64 mx-auto"})]}),l.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:[...Array(3)].map((n,r)=>l.jsxs("div",{className:"bg-card border border-border",children:[l.jsx(lt,{className:"aspect-[16/10] w-full"}),l.jsxs("div",{className:"p-6 space-y-3",children:[l.jsx(lt,{className:"h-4 w-24"}),l.jsx(lt,{className:"h-6 w-3/4"}),l.jsx(lt,{className:"h-16 w-full"})]})]},r))})]})}):!e||e.length===0?null:l.jsx("section",{className:"section-padding bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsxs("div",{className:"text-center mb-12 md:mb-16",children:[l.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Latest Insights"}),l.jsx("h2",{className:"heading-section",children:"From the Blog"})]})}),l.jsx("div",{className:"grid md:grid-cols-3 gap-8",children:e.map((n,r)=>{const i=n.published_at?new Date(n.published_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"";return l.jsx(_e,{delay:r*.1,children:l.jsx(At,{to:`/blog/${n.slug}`,className:"group block h-full",children:l.jsxs("article",{className:"bg-card border border-border h-full flex flex-col transition-all duration-500 hover:shadow-lg",children:[n.featured_image&&l.jsx("div",{className:"aspect-[16/10] overflow-hidden",children:l.jsx("img",{src:n.featured_image,alt:n.title,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105"})}),l.jsxs("div",{className:"p-6 flex flex-col flex-1",children:[i&&l.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground mb-3",children:[l.jsx(Oo,{className:"w-3 h-3"}),i]}),l.jsx("h3",{className:"heading-card text-lg mb-3 group-hover:text-accent transition-colors line-clamp-2",children:n.title}),n.excerpt&&l.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3 flex-1",children:n.excerpt}),l.jsx("div",{className:"mt-4 pt-4 border-t border-border",children:l.jsxs("span",{className:"inline-flex items-center gap-2 text-xs uppercase tracking-wider font-medium text-foreground group-hover:text-accent transition-colors",children:["Read More",l.jsx(Va,{className:"w-3 h-3 transition-transform group-hover:translate-x-1"})]})})]})]})})},n.id)})}),l.jsx(_e,{children:l.jsx("div",{className:"text-center mt-12",children:l.jsx(At,{to:"/blog",className:"btn-outline-primary",children:"View All Posts"})})})]})})},W4e=["EfQb_jBmqmA","tiZKi3zaFLQ","HMci7juGyhQ"],G4e=()=>l.jsx("section",{className:"py-16 md:py-24 bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{variant:"blur",children:l.jsx("p",{className:"text-caption mb-4 text-center text-accent text-xl font-semibold",children:"Video"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section text-center mb-4 text-5xl",children:"Holden's Youtube Content"})}),l.jsx(_e,{delay:.15,children:l.jsx("p",{className:"text-body text-muted-foreground text-center max-w-2xl mx-auto mb-10",children:"Quick, straight-to-the-point videos covering real estate tips, market updates, home-buying advice, and everything you need to know about making your next move in Grand Rapids."})}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-6 max-w-5xl mx-auto",children:W4e.map((e,t)=>l.jsx(_e,{delay:.15+t*.1,variant:"scale",children:l.jsx("div",{className:"aspect-[9/16] w-full overflow-hidden rounded-md",children:l.jsx("iframe",{src:`https://www.youtube.com/embed/${e}`,title:`YouTube Short ${t+1}`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-full border-0",loading:"lazy"})})},e))}),l.jsx(_e,{delay:.5,children:l.jsx("div",{className:"text-center mt-10",children:l.jsxs("a",{href:"https://www.youtube.com/@HoldenGR.Michigan/shorts",target:"_blank",rel:"noopener noreferrer",className:"btn-outline-primary inline-flex items-center gap-2",children:["See More on YouTube ",l.jsx(eo,{className:"w-4 h-4"})]})})})]})}),Y4e="/assets/agent-portrait-DcetkHNl.jpg";var ME="Collapsible",[X4e,loe]=Wi(ME),[J4e,x6]=X4e(ME),coe=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:s,onOpenChange:a,...o}=e,[c,u]=ja({prop:r,defaultProp:i??!1,onChange:a,caller:ME});return l.jsx(J4e,{scope:n,disabled:s,contentId:yl(),open:c,onOpenToggle:C.useCallback(()=>u(d=>!d),[u]),children:l.jsx(ut.div,{"data-state":S6(c),"data-disabled":s?"":void 0,...o,ref:t})})});coe.displayName=ME;var uoe="CollapsibleTrigger",w6=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=x6(uoe,n);return l.jsx(ut.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":S6(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:et(e.onClick,i.onOpenToggle)})});w6.displayName=uoe;var b6="CollapsibleContent",C6=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=x6(b6,e.__scopeCollapsible);return l.jsx(ia,{present:n||i.open,children:({present:s})=>l.jsx(Z4e,{...r,ref:t,present:s})})});C6.displayName=b6;var Z4e=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...s}=e,a=x6(b6,n),[o,c]=C.useState(r),u=C.useRef(null),d=Qt(t,u),h=C.useRef(0),A=h.current,f=C.useRef(0),p=f.current,m=a.open||o,g=C.useRef(m),y=C.useRef(void 0);return C.useEffect(()=>{const v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),qi(()=>{const v=u.current;if(v){y.current=y.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const x=v.getBoundingClientRect();h.current=x.height,f.current=x.width,g.current||(v.style.transitionDuration=y.current.transitionDuration,v.style.animationName=y.current.animationName),c(r)}},[a.open,r]),l.jsx(ut.div,{"data-state":S6(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!m,...s,ref:d,style:{"--radix-collapsible-content-height":A?`${A}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style},children:m&&i})});function S6(e){return e?"open":"closed"}var doe=coe,eOe=w6,tOe=C6,nOe=C.createContext(void 0);function gm(e){const t=C.useContext(nOe);return e||t||"ltr"}var wc="Accordion",rOe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[k6,iOe,sOe]=y2(wc),[LE,iPt]=Wi(wc,[sOe,loe]),_6=loe(),hoe=re.forwardRef((e,t)=>{const{type:n,...r}=e,i=r,s=r;return l.jsx(k6.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?l.jsx(cOe,{...s,ref:t}):l.jsx(lOe,{...i,ref:t})})});hoe.displayName=wc;var[foe,aOe]=LE(wc),[Aoe,oOe]=LE(wc,{collapsible:!1}),lOe=re.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:s=!1,...a}=e,[o,c]=ja({prop:n,defaultProp:r??"",onChange:i,caller:wc});return l.jsx(foe,{scope:e.__scopeAccordion,value:re.useMemo(()=>o?[o]:[],[o]),onItemOpen:c,onItemClose:re.useCallback(()=>s&&c(""),[s,c]),children:l.jsx(Aoe,{scope:e.__scopeAccordion,collapsible:s,children:l.jsx(poe,{...a,ref:t})})})}),cOe=re.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...s}=e,[a,o]=ja({prop:n,defaultProp:r??[],onChange:i,caller:wc}),c=re.useCallback(d=>o((h=[])=>[...h,d]),[o]),u=re.useCallback(d=>o((h=[])=>h.filter(A=>A!==d)),[o]);return l.jsx(foe,{scope:e.__scopeAccordion,value:a,onItemOpen:c,onItemClose:u,children:l.jsx(Aoe,{scope:e.__scopeAccordion,collapsible:!0,children:l.jsx(poe,{...s,ref:t})})})}),[uOe,RE]=LE(wc),poe=re.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:i,orientation:s="vertical",...a}=e,o=re.useRef(null),c=Qt(o,t),u=iOe(n),h=gm(i)==="ltr",A=et(e.onKeyDown,f=>{var B;if(!rOe.includes(f.key))return;const p=f.target,m=u().filter(E=>{var I;return!((I=E.ref.current)!=null&&I.disabled)}),g=m.findIndex(E=>E.ref.current===p),y=m.length;if(g===-1)return;f.preventDefault();let v=g;const x=0,w=y-1,b=()=>{v=g+1,v>w&&(v=x)},k=()=>{v=g-1,v<x&&(v=w)};switch(f.key){case"Home":v=x;break;case"End":v=w;break;case"ArrowRight":s==="horizontal"&&(h?b():k());break;case"ArrowDown":s==="vertical"&&b();break;case"ArrowLeft":s==="horizontal"&&(h?k():b());break;case"ArrowUp":s==="vertical"&&k();break}const j=v%y;(B=m[j].ref.current)==null||B.focus()});return l.jsx(uOe,{scope:n,disabled:r,direction:i,orientation:s,children:l.jsx(k6.Slot,{scope:n,children:l.jsx(ut.div,{...a,"data-orientation":s,ref:c,onKeyDown:r?void 0:A})})})}),kj="AccordionItem",[dOe,j6]=LE(kj),moe=re.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...i}=e,s=RE(kj,n),a=aOe(kj,n),o=_6(n),c=yl(),u=r&&a.value.includes(r)||!1,d=s.disabled||e.disabled;return l.jsx(dOe,{scope:n,open:u,disabled:d,triggerId:c,children:l.jsx(doe,{"data-orientation":s.orientation,"data-state":boe(u),...o,...i,ref:t,disabled:d,open:u,onOpenChange:h=>{h?a.onItemOpen(r):a.onItemClose(r)}})})});moe.displayName=kj;var goe="AccordionHeader",yoe=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=RE(wc,n),s=j6(goe,n);return l.jsx(ut.h3,{"data-orientation":i.orientation,"data-state":boe(s.open),"data-disabled":s.disabled?"":void 0,...r,ref:t})});yoe.displayName=goe;var qF="AccordionTrigger",voe=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=RE(wc,n),s=j6(qF,n),a=oOe(qF,n),o=_6(n);return l.jsx(k6.ItemSlot,{scope:n,children:l.jsx(eOe,{"aria-disabled":s.open&&!a.collapsible||void 0,"data-orientation":i.orientation,id:s.triggerId,...o,...r,ref:t})})});voe.displayName=qF;var xoe="AccordionContent",woe=re.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,i=RE(wc,n),s=j6(xoe,n),a=_6(n);return l.jsx(tOe,{role:"region","aria-labelledby":s.triggerId,"data-orientation":i.orientation,...a,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});woe.displayName=xoe;function boe(e){return e?"open":"closed"}var hOe=hoe,fOe=moe,AOe=yoe,Coe=voe,Soe=woe;const Gp=hOe,Ef=C.forwardRef(({className:e,...t},n)=>l.jsx(fOe,{ref:n,className:it("border-b",e),...t}));Ef.displayName="AccordionItem";const Tf=C.forwardRef(({className:e,children:t,...n},r)=>l.jsx(AOe,{className:"flex",children:l.jsxs(Coe,{ref:r,className:it("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,l.jsx(hc,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Tf.displayName=Coe.displayName;const Pf=C.forwardRef(({className:e,children:t,...n},r)=>l.jsx(Soe,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:l.jsx("div",{className:it("pb-4 pt-0",e),children:t})}));Pf.displayName=Soe.displayName;const rV=[{question:"Who is Holden Richardson?",answer:"Holden Richardson is a licensed Realtor® with 616 Realty LLC, serving the Grand Rapids area. With over 11 years in the business and more than 150 homes sold, Holden is known for his honest, direct approach and deep knowledge of the local market."},{question:"What areas does Holden serve?",answer:"Holden primarily serves the greater Grand Rapids area, including East Grand Rapids, Ada, Cascade, Forest Hills, Rockford, Kentwood, Wyoming, and the surrounding West Michigan communities."},{question:"Does Holden work with both buyers and sellers?",answer:"Yes. Whether you're buying your first home, upgrading to a larger space, downsizing, or selling a property, Holden provides full-service representation tailored to your situation and goals."},{question:"What makes Holden different from other real estate agents?",answer:"Holden takes an education-first approach. He focuses on giving clients the information and market knowledge they need to make confident decisions — without pressure or sales tactics. His deep local expertise means he can often identify the right fit for a client even before they fully see it themselves."},{question:"How can I get a free home valuation?",answer:"You can get a complimentary, AI-powered home valuation through Holden's Homebot portal. Just enter your address on the Home Valuation page, and you'll receive an instant estimate plus ongoing monthly updates on your home's value, equity, and local market trends."},{question:"Does Holden offer virtual consultations?",answer:"Absolutely. You can book a virtual meeting directly through Holden's website. He also offers phone consultations, email support, and in-person meetings — whichever works best for you."},{question:"What should I expect when working with Holden?",answer:"Expect straightforward communication, market insights backed by real data, and a hands-on approach from start to close. Holden keeps his clients informed at every step and is known for being highly responsive and easy to reach."},{question:"How do I get started?",answer:"The easiest way to get started is to reach out through the Contact page, book a virtual meeting, or give Holden a call at (616) 403-6393. There's no pressure — even if you're just exploring your options, Holden is happy to help."}],pOe=()=>l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Holden Richardson | Grand Rapids Real Estate Agent"}),l.jsx("meta",{name:"description",content:"Holden Richardson — Grand Rapids area real estate agent. Buy or sell homes in Grand Rapids, East Grand Rapids, Ada, and beyond."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/"}),l.jsx("meta",{property:"og:title",content:"Holden Richardson | Grand Rapids Real Estate Agent"}),l.jsx("meta",{property:"og:description",content:"Grand Rapids area real estate — buy or sell homes with Holden Richardson."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Holden Richardson | Grand Rapids Real Estate Agent"}),l.jsx("meta",{name:"twitter:description",content:"Grand Rapids area real estate — buy or sell homes with Holden Richardson."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"FAQPage","@id":"https://www.holdengr.com/#faq",mainEntityOfPage:{"@type":"WebPage","@id":"https://www.holdengr.com/"},about:{"@id":"https://www.holdengr.com/#agent"},mainEntity:rV.map(e=>({"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}))})})]}),l.jsxs("div",{children:[l.jsx("div",{className:"-mt-20",children:l.jsx(F4e,{})}),l.jsx("section",{className:"py-12 md:py-16 bg-secondary border-y border-border",children:l.jsx("div",{className:"container-page",children:l.jsx(_e,{children:l.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-6",children:[l.jsxs("div",{className:"max-w-2xl",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-2 text-xs font-semibold",children:"Save More. Get More."}),l.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-semibold text-foreground mb-2",children:"1% Listing Fee · 1% Buyer Rebate"}),l.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:"Sellers list for 1% instead of 3%. Buyers get 1% of the purchase price back toward closing costs. Same full-service representation — just a smarter operation behind it."})]}),l.jsx("div",{className:"flex gap-3 shrink-0",children:l.jsx(At,{to:"/savings-program",className:"inline-flex items-center justify-center px-6 py-3 bg-accent text-accent-foreground text-sm font-medium uppercase tracking-widest hover:opacity-90 transition-opacity",children:"See How Much You Save"})})]})})})}),l.jsx("section",{className:"py-12 md:py-16 bg-background border-b border-border",children:l.jsx("div",{className:"container-page",children:l.jsx(_e,{children:l.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-6",children:[l.jsxs("div",{className:"max-w-2xl",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-2 text-xs font-semibold",children:"Members Only"}),l.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-semibold text-foreground mb-2",children:"The Off-Market List"}),l.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:"An invite-only network for buyers and sellers who want first look at off-market opportunities in Grand Rapids — before they ever hit the MLS."})]}),l.jsxs("div",{className:"flex gap-3 shrink-0",children:[l.jsx(At,{to:"/list/benefits",className:"btn-outline-primary",children:"Learn More"}),l.jsx(At,{to:"/list",className:"inline-flex items-center justify-center px-6 py-3 bg-accent text-accent-foreground text-sm font-medium uppercase tracking-widest hover:opacity-90 transition-opacity",children:"Join the List"})]})]})})})}),l.jsx("section",{className:"section-padding bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_auto] gap-8 lg:gap-12 items-center",children:[l.jsxs("div",{className:"text-left lg:max-w-xl",children:[l.jsx(_e,{variant:"blur",children:l.jsx("p",{className:"text-caption mb-6 text-xl text-accent text-left font-semibold",children:"GRAND RAPIDS AREA REAL ESTATE"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section mb-8 text-5xl",children:"Helping You Make Your Next Move in Grand Rapids"})}),l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-body text-muted-foreground mb-4",children:"Grand Rapids is a city of neighborhoods — each with its own character, charm, and sense of community. Whether you've outgrown your first home and are ready for more space, or you're looking to simplify and find the perfect fit for your next chapter, Holden Richardson is here to help you navigate the move with confidence."})}),l.jsx(_e,{delay:.25,children:l.jsx("p",{className:"text-body text-muted-foreground mb-10",children:"With deep knowledge of communities across the greater Grand Rapids area — from established city neighborhoods to growing suburbs — Holden understands that the right home isn't just about square footage. It's about finding the neighborhood, the lifestyle, and the future that fits you. That personal, hands-on approach is what sets him apart."})}),l.jsx(_e,{delay:.3,children:l.jsx(At,{to:"/about",className:"btn-outline-primary",children:"Learn More About Holden"})})]}),l.jsx(_e,{delay:.2,variant:"blur",children:l.jsx("div",{className:"hidden lg:block",children:l.jsx("img",{alt:"Grand Rapids cityscape",className:"w-80 h-80 xl:w-96 xl:h-96 rounded-full shadow-lg border-4 border-accent/20 object-cover",loading:"lazy",src:"/lovable-uploads/8cc794d4-fc62-47ec-a9e1-a66c0728adf0.png"})})})]})})}),l.jsx(G4e,{}),l.jsxs("div",{className:"flex items-center justify-center py-2 bg-background",children:[l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"}),l.jsx("div",{className:"w-2 h-2 rotate-45 border border-accent/50 mx-4"}),l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"})]}),l.jsx("section",{className:"py-16 md:py-24 bg-background",children:l.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[l.jsx(_e,{children:l.jsxs("div",{className:"text-center mb-10",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3 text-xl font-semibold",children:"Common Questions"}),l.jsx("h2",{className:"font-serif text-2xl text-foreground md:text-5xl font-semibold",children:"What You Need to Know"})]})}),l.jsx(_e,{delay:.1,children:l.jsx(Gp,{type:"single",collapsible:!0,className:"space-y-4 max-w-4xl mx-auto",children:rV.map((e,t)=>l.jsxs(Ef,{value:`faq-${t}`,className:"border border-border/60 px-6 md:px-8 transition-all duration-300 bg-background shadow-md shadow-foreground/[0.06] hover:shadow-lg hover:shadow-foreground/[0.08]",children:[l.jsx(Tf,{className:"text-left text-sm md:text-base font-medium hover:no-underline py-4 text-foreground/85 hover:text-foreground",children:e.question}),l.jsx(Pf,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1",children:e.answer})]},t))})})]})}),l.jsx(R4e,{}),l.jsx("section",{className:"section-padding bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 lg:gap-20 items-center",children:[l.jsx(_e,{direction:"left",variant:"slide",children:l.jsx("div",{className:"relative",children:l.jsx("img",{src:Y4e,alt:"Holden Richardson",className:"w-full aspect-[3/4] object-cover",loading:"lazy"})})}),l.jsxs("div",{children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption mb-4 text-xl font-semibold text-accent",children:"Meet Holden Richardson"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section mb-6 text-5xl",children:"Local Roots. Personal Approach. Real Results."})}),l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-body text-muted-foreground mb-6",children:"Holden Richardson isn't just a Realtor® — he's someone who genuinely knows Grand Rapids. Born and raised in the area, he brings a firsthand understanding of what makes each community unique, from the energy of downtown to the quiet streets of the surrounding suburbs. That local perspective means he doesn't just help you find a house — he helps you find your neighborhood."})}),l.jsx(_e,{delay:.3,children:l.jsx("p",{className:"text-body text-muted-foreground mb-8",children:"Licensed with 616 Realty LLC, Holden is known for his responsiveness, straightforward communication, and a hands-on approach that keeps clients informed and confident at every step. Whether you're a first-time buyer stepping up, a growing family looking for more space, or ready to downsize into something that fits your next chapter — Holden makes the process feel simple, personal, and stress-free."})}),l.jsx(_e,{delay:.4,children:l.jsx(At,{to:"/about",className:"btn-outline-primary",children:"Read Full Bio"})})]})]})})}),l.jsx(q4e,{}),l.jsx(U4e,{}),l.jsx("section",{className:"py-24 md:py-32 bg-foreground text-background",children:l.jsxs("div",{className:"container-page text-center",children:[l.jsx(_e,{variant:"lift",children:l.jsx("p",{className:"text-caption text-background/60 mb-4",children:"Ready to Find Your Dream Home?"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section text-background mb-8 text-5xl",children:"Let's Start the Conversation"})}),l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-body text-background/70 max-w-2xl mx-auto mb-10",children:"Whether you're buying, selling, or simply exploring the market, Holden is here to guide you every step of the way."})}),l.jsx(_e,{delay:.3,children:l.jsx(At,{to:"/contact",className:"btn-outline-inverse",children:"Contact Holden"})})]})})]})]}),mOe=({image:e,title:t,location:n,price:r,status:i="For Sale",beds:s,baths:a,sqft:o,index:c=0,listingId:u,photos:d,description:h})=>{const A=u?`/properties/${u}`:"/properties",f={image:e,title:t,location:n,price:r,status:i,beds:s,baths:a,sqft:o,photos:d,description:h};return l.jsx(hi.div,{initial:{opacity:0,y:40},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-50px"},transition:{duration:.8,delay:c*.1,ease:[.5,0,0,1]},children:l.jsxs(At,{to:A,state:f,className:"property-card block",children:[l.jsxs("div",{className:"relative overflow-hidden aspect-[4/3]",children:[l.jsx(hi.img,{src:e,alt:t,className:"w-full h-full object-cover",whileHover:{scale:1.05},transition:{duration:.6,ease:[.5,0,0,1]}}),l.jsx("div",{className:"property-card-overlay"}),l.jsx("div",{className:"absolute top-4 left-4",children:l.jsx("span",{className:"text-caption px-3 py-1.5 bg-background/90 text-foreground text-xs",children:i})})]}),l.jsxs("div",{className:"pt-5",children:[l.jsx("p",{className:"text-gold text-lg md:text-xl font-serif mb-1",children:r}),l.jsx("h3",{className:"heading-card text-foreground mb-1",children:t}),l.jsx("p",{className:"text-muted-foreground text-sm",children:n}),(s>0||a>0||o)&&l.jsxs("div",{className:"flex gap-4 mt-3 text-sm text-muted-foreground",children:[s>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(bre,{className:"w-4 h-4"}),s," Beds"]}),a>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(lU,{className:"w-4 h-4"}),a," Baths"]}),o&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Lre,{className:"w-4 h-4"}),o," Sq Ft"]})]})]})]})})};var mI="rovingFocusGroup.onEntryFocus",gOe={bubbles:!1,cancelable:!0},T2="RovingFocusGroup",[WF,koe,yOe]=y2(T2),[vOe,DE]=Wi(T2,[yOe]),[xOe,wOe]=vOe(T2),_oe=C.forwardRef((e,t)=>l.jsx(WF.Provider,{scope:e.__scopeRovingFocusGroup,children:l.jsx(WF.Slot,{scope:e.__scopeRovingFocusGroup,children:l.jsx(bOe,{...e,ref:t})})}));_oe.displayName=T2;var bOe=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=e,A=C.useRef(null),f=Qt(t,A),p=gm(s),[m,g]=ja({prop:a,defaultProp:o??null,onChange:c,caller:T2}),[y,v]=C.useState(!1),x=$i(u),w=koe(n),b=C.useRef(!1),[k,j]=C.useState(0);return C.useEffect(()=>{const B=A.current;if(B)return B.addEventListener(mI,x),()=>B.removeEventListener(mI,x)},[x]),l.jsx(xOe,{scope:n,orientation:r,dir:p,loop:i,currentTabStopId:m,onItemFocus:C.useCallback(B=>g(B),[g]),onItemShiftTab:C.useCallback(()=>v(!0),[]),onFocusableItemAdd:C.useCallback(()=>j(B=>B+1),[]),onFocusableItemRemove:C.useCallback(()=>j(B=>B-1),[]),children:l.jsx(ut.div,{tabIndex:y||k===0?-1:0,"data-orientation":r,...h,ref:f,style:{outline:"none",...e.style},onMouseDown:et(e.onMouseDown,()=>{b.current=!0}),onFocus:et(e.onFocus,B=>{const E=!b.current;if(B.target===B.currentTarget&&E&&!y){const I=new CustomEvent(mI,gOe);if(B.currentTarget.dispatchEvent(I),!I.defaultPrevented){const T=w().filter(H=>H.focusable),N=T.find(H=>H.active),F=T.find(H=>H.id===m),U=[N,F,...T].filter(Boolean).map(H=>H.ref.current);Noe(U,d)}}b.current=!1}),onBlur:et(e.onBlur,()=>v(!1))})})}),joe="RovingFocusGroupItem",Boe=C.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:a,...o}=e,c=yl(),u=s||c,d=wOe(joe,n),h=d.currentTabStopId===u,A=koe(n),{onFocusableItemAdd:f,onFocusableItemRemove:p,currentTabStopId:m}=d;return C.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),l.jsx(WF.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:l.jsx(ut.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...o,ref:t,onMouseDown:et(e.onMouseDown,g=>{r?d.onItemFocus(u):g.preventDefault()}),onFocus:et(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:et(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){d.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const y=kOe(g,d.orientation,d.dir);if(y!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let x=A().filter(w=>w.focusable).map(w=>w.ref.current);if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const w=x.indexOf(g.currentTarget);x=d.loop?_Oe(x,w+1):x.slice(w+1)}setTimeout(()=>Noe(x))}}),children:typeof a=="function"?a({isCurrentTabStop:h,hasTabStop:m!=null}):a})})});Boe.displayName=joe;var COe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function SOe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function kOe(e,t,n){const r=SOe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return COe[r]}function Noe(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function _Oe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Eoe=_oe,Toe=Boe,UE="Tabs",[jOe,sPt]=Wi(UE,[DE]),Poe=DE(),[BOe,B6]=jOe(UE),Ioe=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:o,activationMode:c="automatic",...u}=e,d=gm(o),[h,A]=ja({prop:r,onChange:i,defaultProp:s??"",caller:UE});return l.jsx(BOe,{scope:n,baseId:yl(),value:h,onValueChange:A,orientation:a,dir:d,activationMode:c,children:l.jsx(ut.div,{dir:d,"data-orientation":a,...u,ref:t})})});Ioe.displayName=UE;var Ooe="TabsList",Foe=C.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,s=B6(Ooe,n),a=Poe(n);return l.jsx(Eoe,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:r,children:l.jsx(ut.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:t})})});Foe.displayName=Ooe;var Moe="TabsTrigger",Loe=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...s}=e,a=B6(Moe,n),o=Poe(n),c=Uoe(a.baseId,r),u=Hoe(a.baseId,r),d=r===a.value;return l.jsx(Toe,{asChild:!0,...o,focusable:!i,active:d,children:l.jsx(ut.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:t,onMouseDown:et(e.onMouseDown,h=>{!i&&h.button===0&&h.ctrlKey===!1?a.onValueChange(r):h.preventDefault()}),onKeyDown:et(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&a.onValueChange(r)}),onFocus:et(e.onFocus,()=>{const h=a.activationMode!=="manual";!d&&!i&&h&&a.onValueChange(r)})})})});Loe.displayName=Moe;var Roe="TabsContent",Doe=C.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:s,...a}=e,o=B6(Roe,n),c=Uoe(o.baseId,r),u=Hoe(o.baseId,r),d=r===o.value,h=C.useRef(d);return C.useEffect(()=>{const A=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(A)},[]),l.jsx(ia,{present:i||d,children:({present:A})=>l.jsx(ut.div,{"data-state":d?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!A,id:u,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:A&&s})})});Doe.displayName=Roe;function Uoe(e,t){return`${e}-trigger-${t}`}function Hoe(e,t){return`${e}-content-${t}`}var NOe=Ioe,Qoe=Foe,$oe=Loe,zoe=Doe;const ym=NOe,Vf=C.forwardRef(({className:e,...t},n)=>l.jsx(Qoe,{ref:n,className:it("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Vf.displayName=Qoe.displayName;const Hn=C.forwardRef(({className:e,...t},n)=>l.jsx($oe,{ref:n,className:it("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));Hn.displayName=$oe.displayName;const Qn=C.forwardRef(({className:e,...t},n)=>l.jsx(zoe,{ref:n,className:it("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Qn.displayName=zoe.displayName;const EOe="https://api.realsavvy.com/api/v3/listings/search",TOe="https://api.realsavvy.com/api/v3/suggestions",N6="eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiIwMTdkZTg1ZTVkNmYyN2U1ZWVlNDQ0MTkyYmQ2OWFlOWE1YWQ1NmZkMzk5ZWViYjhmZTk5ZWQ5NzE1YmY0NzBiIiwiYXVkIjoiZ2lkOi8vcmVhbC1zYXZ2eS9TaXRlLzE3NjEiLCJzdWIiOiJnaWQ6Ly9yZWFsLXNhdnZ5L1NpdGUvMTc2MSIsInNjb3BlcyI6WyJhZG1pbiJdfQ.o3UL0ih_XwYtfFKjMO1rkNX84RcRVpL11s-WY6zlH0bZAfxgofDa933-GmRS0JezLJyGPrER9PYRmKtgukPl4VYEW0xDaDdVGmHtvavX2iNiAlXQscNMieJtvXT0TszFgDDqk0tsCsx0v9JIdUrBVyPYa6Zneu3rdg_Gvu4ocRy-UsXntMtW9WBs_CPZcKoSxMWOZZjxj1vGWB9VceRg62puKNN_EsxWK26JDBqwPqM8HMRac6yaECH9nvjtgmMasmybtXVeIDVbjuXx3fOfbeDFrCix1rbSGgs1H5-U8hN7AHvJijxqrHgNoofPPz5PSp2MsB-4fV7iuFE4dFZEbQ",POe=async e=>{const t=await fetch(`${TOe}?ids[]=${e}`,{method:"GET",headers:{Authorization:`Bearer ${N6}`,"Content-Type":"application/json"}});return t.ok?t.json():(console.error(`Failed to fetch suggestion data: ${t.status}`),null)},IOe=e=>{if(!(e!=null&&e.data)||e.data.length===0)return null;const t=e.data[0],n=t.attributes||{};return[{resource_type:t.type||"areas",resource_id:t.id,resource_label:n.name||n.label||"",resource_sub_type:n.sub_type||"place",type:"geo_shape",value:{suggestion_id:t.id,geometry:n.geometry,bounding_box:n.bounding_box}}]},OOe=async e=>{const t=await fetch(EOe,{method:"POST",headers:{Authorization:`Bearer ${N6}`,"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`API error: ${t.status}`);return t.json()},FOe=async(e,t)=>{if(t){const n=await POe(t),r=IOe(n);r&&(e={...e,filter:{...e.filter,suggestion:{value:r}}})}return OOe(e)},MOe=(e,t=1,n=12,r)=>{const i={filter:e,market_id:null,page:{number:t,size:n},sort:"+price_in_dollars"};return gr({queryKey:["listings",JSON.stringify(e),t,n,r],queryFn:()=>FOe(i,r),staleTime:5*60*1e3})},LOe=async e=>{const t=await fetch(`https://api.realsavvy.com/api/v3/listings/${e}`,{method:"GET",headers:{Authorization:`Bearer ${N6}`,"Content-Type":"application/json"}});if(!t.ok)throw new Error(`API error: ${t.status}`);return t.json()},ROe=e=>gr({queryKey:["listing",e],queryFn:()=>LOe(e),enabled:!!e,staleTime:5*60*1e3}),Voe=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e),_j=e=>new Intl.NumberFormat("en-US").format(e),iV=({filter:e,suggestionId:t})=>{var s;const{data:n,isLoading:r,error:i}=MOe(e,1,12,t);return r?l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 md:gap-10",children:Array.from({length:6}).map((a,o)=>l.jsxs("div",{className:"space-y-4",children:[l.jsx(lt,{className:"aspect-[4/3] w-full"}),l.jsx(lt,{className:"h-6 w-3/4"}),l.jsx(lt,{className:"h-4 w-1/2"})]},o))}):i?l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-muted-foreground",children:"Failed to load properties. Please try again later."})}):(s=n==null?void 0:n.data)!=null&&s.length?l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 md:gap-10",children:n.data.map((a,o)=>{const c=a.attributes,u=c.square_feet?_j(c.square_feet):c.lot_square_feet?_j(parseFloat(c.lot_square_feet)):void 0;return l.jsx(mOe,{listingId:a.id,image:c.photo_urls[0]||"/placeholder.svg",title:c.title,location:c.subtitle,price:Voe(c.price_in_dollars),status:c.listing_status,beds:c.bedrooms,baths:c.bathrooms,sqft:u,index:o,photos:c.photo_urls,description:c.description||void 0},a.id)})}):l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-muted-foreground",children:"No properties found."})})},DOe=()=>l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Properties | Grand Rapids Homes for Sale | Holden Richardson"}),l.jsx("meta",{name:"description",content:"Browse exclusive Grand Rapids area properties — homes for sale in East Grand Rapids, Ada, Cascade, and beyond with Holden Richardson."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/properties"}),l.jsx("meta",{property:"og:title",content:"Properties | Grand Rapids Homes for Sale"}),l.jsx("meta",{property:"og:description",content:"Browse Grand Rapids area properties with Holden Richardson."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/properties"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Properties | Grand Rapids Homes for Sale"}),l.jsx("meta",{name:"twitter:description",content:"Browse Grand Rapids area properties with Holden Richardson."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx("section",{className:"-mt-20 pt-32 md:pt-40 pb-20 md:pb-28 bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Exclusive Portfolio"})}),l.jsx(_e,{delay:.1,children:l.jsx("h1",{className:"heading-display max-w-4xl",children:"Properties"})}),l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-body text-muted-foreground max-w-2xl mt-6",children:"Explore our curated collection of the finest properties in the Grand Rapids area's most desirable neighborhoods."})})]})}),l.jsx("section",{className:"section-padding bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs(ym,{defaultValue:"active",className:"w-full",children:[l.jsx(_e,{children:l.jsxs(Vf,{className:"bg-transparent h-auto p-0 border-b border-border rounded-none w-full justify-start gap-8 mb-12 md:mb-16",children:[l.jsx(Hn,{value:"active",className:"text-caption text-muted-foreground data-[state=active]:text-foreground data-[state=active]:border-b-2 data-[state=active]:border-foreground bg-transparent rounded-none pb-4 px-0 data-[state=active]:shadow-none",children:"Current"}),l.jsx(Hn,{value:"sold",className:"text-caption text-muted-foreground data-[state=active]:text-foreground data-[state=active]:border-b-2 data-[state=active]:border-foreground bg-transparent rounded-none pb-4 px-0 data-[state=active]:shadow-none",children:"Past Transactions"})]})}),l.jsx(Qn,{value:"active",className:"mt-0",children:l.jsx(iV,{filter:{listing_status:{value:["Active"]},agent_profile:{"michigan-regional-information-center-llc":{key:["grich2990"],relationships:["listing"]}}}})}),l.jsx(Qn,{value:"sold",className:"mt-0",children:l.jsx(iV,{filter:{listing_status:{value:["Sold"]},agent_profile:{"michigan-regional-information-center-llc":{key:["grich2990"],relationships:["listing"]}}}})})]})})}),l.jsx("section",{className:"py-20 md:py-28 bg-secondary",children:l.jsxs("div",{className:"container-page text-center",children:[l.jsx(_e,{children:l.jsx("h2",{className:"heading-section mb-6",children:"Looking for Something Specific?"})}),l.jsx(_e,{delay:.1,children:l.jsx("p",{className:"text-body text-muted-foreground max-w-2xl mx-auto mb-8",children:"Many of our finest properties are sold privately. Contact Holden to discuss your specific requirements and gain access to exclusive off-market listings."})}),l.jsx(_e,{delay:.2,children:l.jsx("a",{href:"/contact",className:"btn-outline-primary",children:"Contact Holden"})})]})})]}),E6=w2("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),xe=C.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const a=r?C1e:"button";return l.jsx(a,{className:it(E6({variant:t,size:n,className:e})),ref:s,...i})});xe.displayName="Button";const UOe=()=>{var A,f;const{id:e}=mm(),n=ro().state,{data:r,isLoading:i,error:s}=ROe(e),{configMap:a}=Os(),o=a.booking_url;if(i)return l.jsxs(ln,{children:[l.jsx("section",{className:"pt-8 pb-4 bg-background",children:l.jsx("div",{className:"container-page",children:l.jsx(lt,{className:"h-6 w-32"})})}),l.jsx("section",{className:"pb-8 bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx(lt,{className:"aspect-[4/3]"}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(lt,{className:"aspect-[4/3]"}),l.jsx(lt,{className:"aspect-[4/3]"}),l.jsx(lt,{className:"aspect-[4/3]"}),l.jsx(lt,{className:"aspect-[4/3]"})]})]})})}),l.jsx("section",{className:"py-12 bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-12",children:[l.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[l.jsx(lt,{className:"h-8 w-24"}),l.jsx(lt,{className:"h-10 w-3/4"}),l.jsx(lt,{className:"h-6 w-1/2"}),l.jsx(lt,{className:"h-12 w-48"}),l.jsx(lt,{className:"h-40 w-full"})]}),l.jsx("div",{children:l.jsx(lt,{className:"h-64 w-full"})})]})})})]});const c=(A=r==null?void 0:r.data)==null?void 0:A.attributes,u=c?{id:r.data.id,title:c.title,subtitle:c.subtitle,price:Voe(c.price_in_dollars),status:c.listing_status,bedrooms:c.bedrooms,bathrooms:c.bathrooms,squareFeet:c.square_feet?_j(c.square_feet):null,lotSize:c.lot_acre?`${c.lot_acre} acres`:c.lot_square_feet?`${_j(Number(c.lot_square_feet))} sq ft`:null,yearBuilt:c.year_built,propertyType:c.type?c.type.charAt(0).toUpperCase()+c.type.slice(1):"Residential",mlsNumber:c.mls_number,description:c.description,images:c.photo_urls||[],agent:{name:c.listing_agent||"Holden Richardson",phone:c.office_phone||"(616) 403-6393",broker:c.listing_broker||"616 Realty LLC"},realstaqSections:((f=c.realstaq_details)==null?void 0:f.sections)||[],fromState:!1}:n?{id:e||"",title:n.title,subtitle:n.location,price:n.price,status:n.status,bedrooms:n.beds||0,bathrooms:n.baths||0,squareFeet:n.sqft||null,lotSize:null,yearBuilt:null,propertyType:"Residential",mlsNumber:null,description:n.description||null,images:n.photos||(n.image?[n.image]:[]),agent:{name:"Holden Richardson",phone:"(616) 403-6393",broker:"616 Realty LLC"},realstaqSections:[],fromState:!0}:null;if(!u)return l.jsx(ln,{children:l.jsx("section",{className:"py-20 bg-background",children:l.jsxs("div",{className:"container-page text-center",children:[l.jsx("h1",{className:"heading-section mb-4",children:"Listing Not Found"}),l.jsx("p",{className:"text-muted-foreground mb-8",children:"The property you're looking for could not be found."}),l.jsx(At,{to:"/properties",children:l.jsx(xe,{className:"btn-outline-primary",children:"Back to Properties"})})]})})});const d=`${u.title} | Holden Richardson — Grand Rapids Real Estate`,h=u.description?u.description.slice(0,160):`${u.title} — ${u.price}, ${u.bedrooms} bed, ${u.bathrooms} bath in Grand Rapids area.`;return l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:d}),l.jsx("meta",{name:"description",content:h}),l.jsx("link",{rel:"canonical",href:`https://www.holdengr.com/properties/${e}`}),l.jsx("meta",{property:"og:title",content:d}),l.jsx("meta",{property:"og:description",content:h}),l.jsx("meta",{property:"og:url",content:`https://www.holdengr.com/properties/${e}`}),l.jsx("meta",{property:"og:image",content:u.images[0]||"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:d}),l.jsx("meta",{name:"twitter:description",content:h}),l.jsx("meta",{name:"twitter:image",content:u.images[0]||"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx("section",{className:"pt-8 pb-4 bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs(At,{to:"/properties",className:"inline-flex items-center gap-2 text-muted-foreground hover:text-foreground transition-colors",children:[l.jsx(pm,{className:"w-4 h-4"}),l.jsx("span",{className:"text-sm",children:"Back to Properties"})]})})}),l.jsx("section",{className:"pb-8 bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx("div",{className:"aspect-[4/3] overflow-hidden",children:u.images[0]&&l.jsx("img",{src:u.images[0],alt:u.title,className:"w-full h-full object-cover"})}),l.jsx("div",{className:"grid grid-cols-2 gap-4",children:u.images.slice(1,5).map((p,m)=>l.jsx("div",{className:"aspect-[4/3] overflow-hidden",children:l.jsx("img",{src:p,alt:`${u.title} - ${m+2}`,className:"w-full h-full object-cover"})},m))})]})})}),l.jsx("section",{className:"py-12 md:py-16 bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-12",children:[l.jsxs("div",{className:"lg:col-span-2",children:[l.jsx(_e,{children:l.jsxs("div",{className:"flex items-start justify-between mb-6",children:[l.jsxs("div",{children:[l.jsx("span",{className:"inline-block text-caption px-3 py-1.5 bg-secondary text-foreground text-xs mb-4",children:u.status}),l.jsx("h1",{className:"heading-section mb-2",children:u.title}),l.jsxs("p",{className:"text-muted-foreground flex items-center gap-2",children:[l.jsx(ov,{className:"w-4 h-4"}),u.subtitle]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(xe,{variant:"outline",size:"icon",children:l.jsx(V2e,{className:"w-4 h-4"})}),l.jsx(xe,{variant:"outline",size:"icon",children:l.jsx(Ere,{className:"w-4 h-4"})})]})]})}),l.jsx(_e,{delay:.1,children:l.jsx("p",{className:"text-gold text-3xl md:text-4xl font-serif mb-8",children:u.price})}),l.jsx(_e,{delay:.2,children:l.jsxs("div",{className:"flex flex-wrap gap-6 py-6 border-y border-border mb-8",children:[u.bedrooms>0&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(bre,{className:"w-5 h-5 text-muted-foreground"}),l.jsx("span",{className:"text-foreground font-medium",children:u.bedrooms}),l.jsx("span",{className:"text-muted-foreground",children:"Beds"})]}),u.bathrooms>0&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(lU,{className:"w-5 h-5 text-muted-foreground"}),l.jsx("span",{className:"text-foreground font-medium",children:u.bathrooms}),l.jsx("span",{className:"text-muted-foreground",children:"Baths"})]}),u.squareFeet&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Lre,{className:"w-5 h-5 text-muted-foreground"}),l.jsx("span",{className:"text-foreground font-medium",children:u.squareFeet}),l.jsx("span",{className:"text-muted-foreground",children:"Sq Ft"})]})]})}),u.description&&l.jsx(_e,{delay:.3,children:l.jsxs("div",{className:"mb-10",children:[l.jsx("h2",{className:"heading-card mb-4",children:"Description"}),l.jsx("p",{className:"text-muted-foreground whitespace-pre-line leading-relaxed",children:u.description})]})}),u.fromState&&l.jsx(_e,{delay:.3,children:l.jsx("div",{className:"p-4 bg-secondary rounded-sm mb-10",children:l.jsx("p",{className:"text-muted-foreground text-sm",children:"This listing has been sold. Limited details are available from the original search results."})})}),u.realstaqSections.map((p,m)=>l.jsx(_e,{delay:.4+m*.1,children:l.jsxs("div",{className:"mb-10",children:[l.jsx("h2",{className:"heading-card mb-4",children:p.title}),l.jsx("div",{className:`grid gap-4 ${p.style==="third"?"grid-cols-2 md:grid-cols-3":"grid-cols-1 md:grid-cols-2"}`,children:p.fields.map((g,y)=>l.jsxs("div",{className:"p-4 bg-secondary rounded-sm",children:[l.jsx("p",{className:"text-caption text-muted-foreground mb-1",children:g.label}),l.jsx("p",{className:"text-foreground font-medium",children:g.value!==null&&g.value!==void 0?String(g.value):"N/A"})]},`${p.title}-${y}`))})]})},p.title))]}),l.jsx("div",{className:"lg:col-span-1",children:l.jsx(_e,{delay:.2,children:l.jsxs("div",{className:"sticky top-24 p-6 bg-secondary rounded-sm",children:[l.jsx("h3",{className:"heading-card mb-4",children:"Contact Agent"}),l.jsxs("div",{className:"mb-6",children:[l.jsx("p",{className:"text-foreground font-medium",children:u.agent.name}),l.jsx("p",{className:"text-muted-foreground text-sm",children:u.agent.broker}),l.jsx("p",{className:"text-muted-foreground text-sm",children:u.agent.phone})]}),l.jsxs("div",{className:"space-y-3",children:[o?l.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"block",children:l.jsx(xe,{className:"w-full btn-outline-primary",children:"Schedule a Showing"})}):l.jsx(xe,{className:"w-full btn-outline-primary",disabled:!0,children:"Schedule a Showing"}),l.jsx(At,{to:"/contact",className:"block",children:l.jsx(xe,{variant:"outline",className:"w-full",children:"Request More Info"})})]})]})})})]})})})]})},HOe="/assets/holden-about-BFemenAp.jpg",f0=e=>gr({queryKey:["site-media",e],queryFn:async()=>{let t=Me.from("site_media").select("*").order("created_at",{ascending:!1});e&&(t=t.eq("media_type",e));const{data:n,error:r}=await t;if(r)throw r;return n||[]}}),QOe=()=>{const e=cs();return Is({mutationFn:async({file:t,tags:n,mediaType:r,altText:i})=>{const s=t.name.split(".").pop(),a=`${r}/${Date.now()}-${Math.random().toString(36).slice(2)}.${s}`,{error:o}=await Me.storage.from("site-media").upload(a,t);if(o)throw o;const{error:c}=await Me.from("site_media").insert({file_path:a,file_name:t.name,tags:n,media_type:r,alt_text:i||null,file_size:t.size});if(c)throw c},onSuccess:()=>e.invalidateQueries({queryKey:["site-media"]})})},$Oe=()=>{const e=cs();return Is({mutationFn:async({id:t,...n})=>{const{error:r}=await Me.from("site_media").update(n).eq("id",t);if(r)throw r},onSuccess:()=>e.invalidateQueries({queryKey:["site-media"]})})},zOe=()=>{const e=cs();return Is({mutationFn:async({id:t,filePath:n})=>{await Me.storage.from("site-media").remove([n]);const{error:r}=await Me.from("site_media").delete().eq("id",t);if(r)throw r},onSuccess:()=>e.invalidateQueries({queryKey:["site-media"]})})},vc=e=>{if(e.startsWith("http"))return e;const{data:t}=Me.storage.from("site-media").getPublicUrl(e);return t.publicUrl},VOe="https://res.cloudinary.com/dofjjlc6d/image/upload/v1769540628/user-uploads/2160/wrbvjojilgzlvn1u2hnw.jpg",KOe=[{value:"$50M+",label:"Real Estate Sold"},{value:"150+",label:"Homes Sold"},{value:"11+",label:"Years in the Business"}],qOe=()=>{const{data:e}=gr({queryKey:["about-pages"],queryFn:async()=>{const{data:t}=await Me.from("aeo_categories").select("id").eq("slug","about").maybeSingle();if(!t)return[];const{data:n,error:r}=await Me.from("aeo_pages").select("id, title, slug, h1, subheadline, intro_text, display_order").eq("category_id",t.id).eq("status","published").eq("is_parent",!0).order("display_order");if(r)throw r;return n||[]}});return l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"About Holden Richardson | Grand Rapids Realtor"}),l.jsx("meta",{name:"description",content:"Meet Holden Richardson — a dedicated Grand Rapids area real estate agent. Deep local expertise, client-first approach."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/about"}),l.jsx("meta",{property:"og:title",content:"About Holden Richardson | Grand Rapids Realtor"}),l.jsx("meta",{property:"og:description",content:"Meet Holden Richardson — a dedicated Grand Rapids area real estate agent."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/about"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"profile"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"About Holden Richardson | Grand Rapids Realtor"}),l.jsx("meta",{name:"twitter:description",content:"Meet Holden Richardson — a dedicated Grand Rapids area real estate agent."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"AboutPage",url:"https://www.holdengr.com/about",name:"About Holden Richardson",description:"About page for Grand Rapids Realtor Holden Richardson.",isPartOf:{"@id":"https://www.holdengr.com/#website"},mainEntity:{"@id":"https://www.holdengr.com/#agent"},about:{"@id":"https://www.holdengr.com/#agent"}})}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://www.holdengr.com/"},{"@type":"ListItem",position:2,name:"About",item:"https://www.holdengr.com/about"}]})})]}),l.jsxs("section",{className:"relative -mt-20 pt-32 md:pt-40 pb-20 md:pb-28 overflow-hidden",children:[l.jsxs("div",{className:"absolute inset-0",children:[l.jsx("img",{src:vc("stock_photo/1772747249479-34tk12ax6yg.jpeg"),alt:"Grand Rapids area real estate",className:"w-full h-full object-cover"}),l.jsx("div",{className:"absolute inset-0 bg-black/40"})]}),l.jsxs("div",{className:"container-page relative z-10",children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-white/60 mb-4",children:"About"})}),l.jsxs(_e,{delay:.1,children:[l.jsx("h1",{className:"heading-display max-w-4xl text-white",children:"Holden Richardson"}),l.jsx("div",{className:"w-16 h-[2px] bg-accent mt-6 mb-6"})]}),l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-body text-white/80 max-w-2xl",children:"Setting the standard for real estate in the Grand Rapids area."})})]})]}),l.jsx("section",{className:"section-padding bg-background",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 lg:gap-20 items-start",children:[l.jsx(_e,{direction:"left",variant:"slide",children:l.jsx("div",{className:"relative sticky top-32",children:l.jsx("img",{src:HOe,alt:"Holden Richardson",className:"w-full aspect-[3/4] object-cover",loading:"lazy"})})}),l.jsxs("div",{children:[l.jsx(_e,{children:l.jsx("h2",{className:"heading-section mb-8",children:"A Reputation Built on Results"})}),l.jsxs("div",{className:"space-y-6 text-body text-muted-foreground",children:[l.jsx(_e,{delay:.1,children:l.jsx("p",{children:"Holden Richardson is a Grand Rapids area Realtor® with 616 Realty LLC who believes real estate doesn't have to be complicated. His approach is straightforward — give people the information they need, cut through the noise, and let them make confident decisions without the pressure."})}),l.jsx(_e,{delay:.2,children:l.jsx("p",{children:"That philosophy shows up in everything he does. From short-form videos breaking down market updates and buyer tips to comprehensive guides on his website, Holden is focused on making real estate knowledge accessible — not gatekept. He'd rather educate a client who isn't ready to buy for another two years than push someone into a deal that doesn't make sense."})}),l.jsx(_e,{delay:.3,children:l.jsx("p",{children:"Holden's deep familiarity with the Grand Rapids market — from East Grand Rapids and Ada to Cascade and the surrounding communities — means his clients get hyper-local insight backed by real data, not generic advice. He stays plugged into pricing trends, neighborhood shifts, and inventory changes so his clients don't have to."})}),l.jsx(_e,{delay:.4,children:l.jsx("p",{children:"Whether you're buying your first home, selling a property, or just trying to understand what your home is worth, Holden's goal is simple: be the most useful resource you have in Grand Rapids real estate."})})]}),l.jsx(_e,{delay:.5,children:l.jsx("div",{className:"mt-10",children:l.jsx(At,{to:"/contact",className:"btn-outline-primary",children:"Get in Touch"})})})]})]})})}),l.jsx("section",{className:"section-padding bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Track Record"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section mb-12 md:mb-16",children:"By the Numbers"})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 md:gap-12",children:KOe.map((t,n)=>l.jsx(_e,{delay:n*.1,children:l.jsxs("div",{className:"text-center md:text-left",children:[l.jsx("span",{className:"text-gold font-serif text-5xl md:text-6xl font-light",children:t.value}),l.jsx("p",{className:"text-muted-foreground mt-3 text-sm uppercase tracking-widest",children:t.label})]})},t.label))})]})}),e&&e.length>0&&l.jsx("section",{className:"section-padding bg-background",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Learn More"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section mb-12 md:mb-16",children:"Common Questions"})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:e.map((t,n)=>l.jsx(_e,{delay:n*.1,children:l.jsxs(At,{to:`/about/${t.slug}`,className:"group block p-8 border border-border hover:border-accent bg-secondary/30 hover:bg-secondary/60 transition-all duration-300",children:[l.jsx("h3",{className:"font-serif text-xl md:text-2xl mb-3 group-hover:text-accent transition-colors leading-snug",children:t.h1||t.title}),t.subheadline&&l.jsx("p",{className:"text-sm text-muted-foreground mb-4 line-clamp-2",children:t.subheadline}),t.intro_text&&l.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-4",children:t.intro_text}),l.jsxs("span",{className:"inline-flex items-center gap-1.5 text-caption text-foreground group-hover:text-accent transition-colors",children:["Read More ",l.jsx(Va,{size:14})]})]})},t.id))})]})}),l.jsxs("section",{className:"relative",children:[l.jsxs("div",{className:"absolute inset-0",children:[l.jsx("img",{src:VOe,alt:"Grand Rapids area property",className:"w-full h-full object-cover"}),l.jsx("div",{className:"absolute inset-0 bg-black/70"})]}),l.jsx("div",{className:"relative section-padding",children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:"max-w-3xl",children:[l.jsx(_e,{variant:"blur",children:l.jsx("p",{className:"text-caption text-gold mb-4",children:"Philosophy"})}),l.jsx(_e,{delay:.1,children:l.jsx("h2",{className:"heading-section text-background mb-8",children:`"I'd rather be honest about what I see than tell you what you want to hear. That's how the right deal actually happens."`})}),l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-lg text-background/80",children:"Most people know what they want — but sometimes they haven't found the words for it yet. My job is to listen closely enough to understand what you're really looking for, even when it's a feeling more than a checklist. That deep understanding, paired with honest, direct advice, is what turns a house hunt into finding home."})})]})})})]})]})},WOe="/assets/testimonials-hero-D_OW3dCz.jpg",HE=[{quote:"Holden is a go getter and very responsive. He found us our home in a competitive market. Very knowledgeable and helped us negotiate a home that fit our needs and wants. I recommend Holden to anyone that is selling or wanting to buy a home because of his knowledge and determination to get the job done!",author:"Elvis Hadzalic",role:"Home Buyer",date:"2025",rating:5,source:"google"},{quote:"My partner and I were advised by one of our old neighbors to go to 616 Realty when we were ready to purchase a home, and I am so glad that we listened. Holden, Jayda and Beth were all so helpful during the entire process and were always there when we had questions. I am happy to say we have purchased our home and we couldn't have done that without their help!",author:"Idaris Cruz",role:"Home Buyer",date:"2025",rating:5,source:"google"},{quote:"Working with Holden was incredibly seamless and efficient. Wonderful advice and feedback to help me reach my ultimate goal! Would easily recommend to anyone who is anxious going into the housing market.",author:"Aleatha Ostrander",role:"Home Buyer",date:"2025",rating:5,source:"google"},{quote:"Holden was a pleasure working with on this transaction, his communication was prompt and professional, and they handled every detail with expertise and integrity. A true team player who kept the process smooth from start to finish — I look forward to working together again.",author:"Tristan Seeley",role:"Transaction Partner",date:"2025",rating:5,source:"google"},{quote:"This is the first transaction that I have worked with Holden on and I really appreciate his commitment to communication throughout the process. He was very open to what his clients goals were as buyers and allowed me to do the same for the sellers. Together we were able to work through some weather related issues to get to the closing table with minimal fuss. This is what real estate is all about. No ego. No flex. Just being good stewards for our clients. Thanks for working with me on this sale! I look forward to a few more!",author:"Julie Reisner",role:"Collaborating Agent",date:"2025",rating:5,source:"google"},{quote:"Holden is so helpful and knowledgeable. He really knows how to get stuff done!",author:"Katie T.",role:"Client",date:"2025",rating:5,source:"google"},{quote:"I've used Holden as my listing and buying agent 3 times and each experience has been amazing! He is a responsive and effective communicator and will go to the mat for you!",author:"Lisa Menezes",role:"Repeat Client",date:"2025",rating:5,source:"google"},{quote:"Working with HoldenGR was a really positive experience. From start to finish, everything was handled with professionalism, transparency, and attention to detail. Questions were answered quickly, the process was explained clearly, and nothing felt rushed or overlooked. It's easy to see how much pride is taken in the work and the level of service provided. Highly recommend!",author:"Brittany Richardson",role:"Client",date:"2025",rating:5,source:"google"},{quote:"Holden is a very capable to work through issues and solve problems. You need someone that can help you when surprises and challenges take place in the process. Most people don't have the experience to work through those so that everyone is aligned to get the deal done. I think that is a unique skill set he has to close deals.",author:"Russ Richardson",role:"Client",date:"2025",rating:5,source:"google"},{quote:"Very knowledgeable about the housing market and works hard for his clients.",author:"Marian Richardson",role:"Client",date:"2025",rating:5,source:"google"},{quote:"Holden made my first home buying experience seamless and easy!!",author:"Daphne Shears",role:"First-Time Home Buyer",date:"2025",rating:5,source:"google"},{quote:"The best!",author:"Tyler Hayek",role:"Client",date:"2025",rating:5,source:"google"},{quote:"We recently bought our dream home, and we couldn't have done it without Holden. From day one, he was incredibly patient, understanding, and committed to helping us find the right place — not just any place. What we appreciated the most was that he was never pushy. He let us take our time, answered every question honestly, and always looked out for our best interest rather than trying to rush a decision. Holden really listened to what we wanted and refined the search based on our needs, our priorities, and even the things we didn't say out loud. Throughout the process, he guided us with knowledge, confidence, and absolute professionalism. When things got stressful, he stayed calm and steady, making sure we felt supported at every step. If you're looking for a realtor who is trustworthy, thoughtful, and genuinely invested in helping you find the right home, Holden is the person you want by your side.",author:"Anu & Sam",role:"Home Buyer",date:"November 2025",rating:5,source:"zillow",location:"Grandville, MI"},{quote:"Holden helped us buy our retirement home. He went above and beyond to help us examine different possibilities and then to guide us from offer to closing on the house we chose. We couldn't be more pleased with his responsiveness and his knowledge of the market and the process. We would turn to him again in a heartbeat and wish him every continued success as a real estate professional.",author:"lwhall449",role:"Home Buyer",date:"June 2022",rating:5,source:"zillow",location:"San Marcos, TX"},{quote:"Sweet, smart and great. Recommended highly. Helped me through an entire deal that was incredibly stressful. Educated me on homes, gave advise, even gave me a ride home after closing lol, great guy.",author:"pennysleith",role:"Home Buyer",date:"October 2019",rating:5,source:"zillow",location:"Plainwell, MI"},{quote:"Holden did an outstanding job helping secure the perfect home for me. He put a great deal of effort into searching places that I might like. The end result was that I found a home that is perfect for me.",author:"Robert Teszlewicz",role:"Home Buyer",date:"June 2019",rating:5,source:"zillow",location:"MI"},{quote:"Holden was by far the most helpful realtor I could have asked for. I was able to call and text anytime of the day and always had a very quick response. He jumped on every home I wanted to view and was very knowledgable of the entire process. He even set me up with an amazing mortgage company. I will absolutely recommend him to my family, friends and all others!",author:"kmatthews6693",role:"Home Buyer",date:"April 2019",rating:5,source:"zillow",location:"Bellevue, MI"},{quote:"Holden is a very friendly, knowledgeable real estate agent. I would definitely refer him to anyone looking for a home. He helped us buy a new house and at the same time sell our existing home. Thanks",author:"Rita Lopez",role:"Buyer & Seller",date:"February 2019",rating:4,source:"zillow",location:"Holland, MI"},{quote:"Holden is very professional and I wouldn't hesitate to work with him again or refer him to others. I spoke to a few realtors prior to listing my condo and I went with Holden because he was organized and provided me everything I needed to know the first meeting. He made me feel comfortable with the process of selling my first home. Within a few days, I had a stylist and a photographer at my house. Just over a week after meeting Holden, my house was listed and sold. Do not overlook him due to him being younger and limited years of experience. He knows what he is doing and he will work hard to get you the sale.",author:"vlwalli88",role:"Home Seller",date:"July 2018",rating:5,source:"zillow",location:"Grand Rapids, MI"},{quote:"Holden is great. He worked with us to find the right home for us. He was easy to communicate with and always available. Very helpful in working through the process from beginning to end. We would recommend Holden to anyone looking for a new home.",author:"zuser20160707063703253",role:"Home Buyer",date:"June 2018",rating:5,source:"zillow",location:"Kent City, MI"},{quote:"Holden was very quick to respond. I actually just liked his status on facebook, so I could find him later when I was interested in starting to look for a house. He contacted me and gave me some references for a mortgage broker. He apparently works closely with the loan officers because he was told before I was officially told that I was approved. It's nice that everyone is working as a team to help my wife, myself, and our new born baby our first home.",author:"Eric Wheeler",role:"Home Buyer",date:"November 2017",rating:5,source:"zillow",location:"Caledonia, MI"},{quote:"Holden was extremely helpful and listened to our needs. He put us first and kept us updated through the offer process and was very prompt on his responses. Would recommend him to everyone I know.",author:"John Pasquinelli",role:"Home Buyer",date:"November 2017",rating:5,source:"zillow",location:"Holland, MI"},{quote:"Goes above and beyond to find the right fit. Willing to work around anyones schedule night or day. Very professional and invested in each client. Would highly recommend to anyone looking to both buy or sell.",author:"Dylan Bouchie",role:"Home Buyer",date:"August 2017",rating:5,source:"zillow",location:"NE"},{quote:"When deciding to buy a home my husband and I had a certain vision and were very particular in our wants and needs. Holden Richardson was able to work with us and assist us in finding our dream home. Buying a house while living in a different part of the state has its challenges but Holden made the process very easy and enjoyable. There were challenges but he was always available to help and did so in a professional manner.",author:"user7690907",role:"Home Buyer",date:"December 2016",rating:5,source:"zillow",location:"Holland, MI"},{quote:"Holden was very professional, personable, and punctual while helping us search for, and secure our home. Being first time homebuyers, we weren't sure how to navigate the real estate world, but Holden diligently explained every step of the way (sometimes multiple times when necessary). He made us feel comfortable and confident in our decisions and made sure we were aware of our options. Holden made sure we saw every house on our lists. He was diligent in answering all of our questions, regardless of the time of day or night and consulted other professionals when necessary. He helped us secure a home that fit everything we were looking for and more. We will be referring our friends and family to Holden for their real estate needs.",author:"Breanna Bellingar",role:"First-Time Home Buyer",date:"October 2016",rating:5,source:"zillow"}],jj=HE.length,GOe=HE.reduce((e,t)=>e+t.rating,0)/jj,Koe=+GOe.toFixed(2),YOe={january:"01",february:"02",march:"03",april:"04",may:"05",june:"06",july:"07",august:"08",september:"09",october:"10",november:"11",december:"12"};function XOe(e){const t=e.trim();if(/^\d{4}$/.test(t))return t;const n=t.match(/^([A-Za-z]+)\s+(\d{4})$/);if(n){const r=YOe[n[1].toLowerCase()];return r?`${n[2]}-${r}`:t}return t}const JOe={"@context":"https://schema.org","@type":"RealEstateAgent","@id":"https://www.holdengr.com/#agent",name:"Holden Richardson",url:"https://www.holdengr.com",telephone:"+1-616-403-6393",email:"holden@holdengr.com",address:{"@type":"PostalAddress",streetAddress:"1171 Plainfield Ave NE",addressLocality:"Grand Rapids",addressRegion:"MI",postalCode:"49503",addressCountry:"US"},sameAs:["https://www.instagram.com/holdengr.re","https://www.facebook.com/holden.m.richardson","https://www.google.com/maps?cid=17099657301143231027","https://www.linkedin.com/in/holdenrichardson","https://www.youtube.com/@holdengr.michigan","https://x.com/realholdengr","https://www.tiktok.com/@realholdengr.re","https://www.zillow.com/profile/Holden%20Richardson","https://www.realtor.com/realestateagents/59939fae1bb6a60010b0b9c6"],aggregateRating:{"@type":"AggregateRating",ratingValue:Koe,bestRating:5,worstRating:1,reviewCount:jj},review:HE.map(e=>({"@type":"Review",itemReviewed:{"@id":"https://www.holdengr.com/#agent"},author:{"@type":"Person",name:e.author},datePublished:XOe(e.date),reviewBody:e.quote,reviewRating:{"@type":"Rating",ratingValue:e.rating,bestRating:5,worstRating:1},...e.source&&{publisher:{"@type":"Organization",name:e.source==="google"?"Google":"Zillow"}}}))},ZOe=()=>l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Client Testimonials | Holden Richardson | Grand Rapids Realtor"}),l.jsx("meta",{name:"description",content:`Read real reviews from Holden Richardson's clients across Google and Zillow. ${jj} reviews from buyers, sellers, and industry partners in the Grand Rapids area.`}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/about/testimonials"}),l.jsx("meta",{property:"og:title",content:"Client Testimonials | Holden Richardson"}),l.jsx("meta",{property:"og:description",content:"Real reviews from real clients — see why Grand Rapids homeowners trust Holden Richardson."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/about/testimonials"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Client Testimonials | Holden Richardson"}),l.jsx("meta",{name:"twitter:description",content:"Real reviews from real clients — see why Grand Rapids homeowners trust Holden Richardson."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify(JOe)})]}),l.jsxs("section",{className:"relative -mt-20 pt-32 md:pt-40 pb-20 md:pb-28 overflow-hidden",children:[l.jsxs("div",{className:"absolute inset-0",children:[l.jsx("img",{src:WOe,alt:"Elegant living space",className:"w-full h-full object-cover"}),l.jsx("div",{className:"absolute inset-0 bg-black/50"})]}),l.jsxs("div",{className:"container-page relative z-10",children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-white/60 mb-4",children:"About"})}),l.jsxs(_e,{delay:.1,children:[l.jsx("h1",{className:"heading-display max-w-4xl text-white",children:"Client Testimonials"}),l.jsx("div",{className:"w-16 h-[2px] bg-accent mt-6 mb-6"})]}),l.jsx(_e,{delay:.2,children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex gap-0.5",children:[...Array(5)].map((e,t)=>l.jsx(D3,{size:20,className:"fill-gold text-gold"},t))}),l.jsxs("span",{className:"text-white/80 text-lg font-light",children:[Koe," average · ",jj," reviews"]})]})})]})]}),l.jsx("section",{className:"section-padding bg-background",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsxs("div",{className:"flex flex-wrap gap-4 mb-12",children:[l.jsxs("a",{href:"https://www.google.com/maps?cid=17099657301143231027",target:"_blank",rel:"noopener noreferrer",className:"btn-outline-primary inline-flex items-center gap-2 text-sm",children:["Google Reviews ",l.jsx(eo,{className:"w-3.5 h-3.5"})]}),l.jsxs("a",{href:"https://www.zillow.com/profile/Holden%20Richardson",target:"_blank",rel:"noopener noreferrer",className:"btn-outline-primary inline-flex items-center gap-2 text-sm",children:["Zillow Reviews ",l.jsx(eo,{className:"w-3.5 h-3.5"})]})]})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:HE.map((e,t)=>l.jsx(_e,{delay:t%3*.1,children:l.jsxs("div",{className:"bg-secondary p-8 h-full flex flex-col border border-border",children:[l.jsx("div",{className:"flex gap-0.5 mb-4",children:[...Array(5)].map((n,r)=>l.jsx(D3,{size:14,className:r<e.rating?"fill-gold text-gold":"text-border"},r))}),l.jsxs("blockquote",{className:"text-sm font-serif text-foreground mb-6 flex-1 leading-relaxed",children:['"',e.quote,'"']}),l.jsxs("div",{className:"border-t border-border pt-4 mt-auto",children:[l.jsx("p",{className:"font-medium text-foreground text-sm",children:e.author}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.role,e.location?` · ${e.location}`:""," · ",e.date]}),l.jsx("span",{className:`inline-block mt-2 text-[10px] uppercase tracking-widest font-medium ${e.source==="google"?"text-accent":"text-muted-foreground"}`,children:e.source==="google"?"Google":"Zillow"})]})]})},e.author))})]})}),l.jsx("section",{className:"section-padding bg-primary text-center",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsx("h2",{className:"heading-section text-white mb-6",children:"Ready to Write Your Own Story?"})}),l.jsx(_e,{delay:.1,children:l.jsx("p",{className:"text-white/70 max-w-xl mx-auto mb-8",children:"Whether you're buying, selling, or just exploring — Holden is here to help you make a confident move."})}),l.jsx(_e,{delay:.2,children:l.jsx("a",{href:"/contact",className:"inline-block px-8 py-4 bg-accent text-accent-foreground font-medium text-sm uppercase tracking-widest hover:bg-accent/90 transition-colors duration-300",children:"Get in Touch"})})]})})]}),Xe=C.forwardRef(({className:e,type:t,...n},r)=>l.jsx("input",{type:t,className:it("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Xe.displayName="Input";const Vi=C.forwardRef(({className:e,...t},n)=>l.jsx("textarea",{className:it("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Vi.displayName="Textarea";const e3e="https://crm.realsavvy.com/api/form_submissions",t3e="eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiIwMTdkZTg1ZTVkNmYyN2U1ZWVlNDQ0MTkyYmQ2OWFlOWE1YWQ1NmZkMzk5ZWViYjhmZTk5ZWQ5NzE1YmY0NzBiIiwiYXVkIjoiZ2lkOi8vcmVhbC1zYXZ2eS9TaXRlLzE3NjEiLCJzdWIiOiJnaWQ6Ly9yZWFsLXNhdnZ5L1NpdGUvMTc2MSIsInNjb3BlcyI6WyJhZG1pbiJdfQ.o3UL0ih_XwYtfFKjMO1rkNX84RcRVpL11s-WY6zlH0bZAfxgofDa933-GmRS0JezLJyGPrER9PYRmKtgukPl4VYEW0xDaDdVGmHtvavX2iNiAlXQscNMieJtvXT0TszFgDDqk0tsCsx0v9JIdUrBVyPYa6Zneu3rdg_Gvu4ocRy-UsXntMtW9WBs_CPZcKoSxMWOZZjxj1vGWB9VceRg62puKNN_EsxWK26JDBqwPqM8HMRac6yaECH9nvjtgmMasmybtXVeIDVbjuXx3fOfbeDFrCix1rbSGgs1H5-U8hN7AHvJijxqrHgNoofPPz5PSp2MsB-4fV7iuFE4dFZEbQ",n3e="3qgHnU6N5RTJVQ";async function r3e(e){var s;const t=crypto.randomUUID(),n=new FormData;n.append("cyclum_vid",n3e),n.append("cyclum_submission_id",t),n.append("form_name",e.formName||"contact-form-with-image"),n.append("first_name",e.firstName.trim()),n.append("last_name",e.lastName.trim()),n.append("email",e.email.trim()),e.phone&&n.append("phone",e.phone.trim()),e.message&&n.append("message",e.message.trim());const r=(s=e.tags)!=null&&s.length?e.tags:["website-lead"];for(const a of r)n.append("tag[]",a);const i=await fetch(e3e,{method:"POST",headers:{Authorization:`Bearer ${t3e}`},body:n});if(!i.ok)throw new Error(`RealSavvy submission failed (${i.status})`)}const i3e="/assets/holden-brittany-BNfOpbGb.jpg",s3e=()=>{const{toast:e}=Qf(),{configMap:t}=Os(),[n,r]=C.useState(!1),[i,s]=C.useState({firstName:"",lastName:"",email:"",phone:"",message:"",interest:"buying"}),a=t.agent_phone,o=t.booking_url,c=async h=>{h.preventDefault(),r(!0);try{await r3e({firstName:i.firstName,lastName:i.lastName,email:i.email,phone:i.phone,message:i.message||i.interest,tags:["contact-us-form"],formName:"contact-form-with-image"}),e({title:"Message Sent",description:"Thank you for reaching out. Holden will be in touch shortly."}),s({firstName:"",lastName:"",email:"",phone:"",message:"",interest:"buying"})}catch(A){console.error("Form submission error:",A),e({title:"Error",description:"There was a problem sending your message. Please try again.",variant:"destructive"})}finally{r(!1)}},u=h=>{s({...i,[h.target.name]:h.target.value})},d=a?`sms:${a.replace(/[^+\d]/g,"")}`:null;return l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Contact Holden Richardson | Grand Rapids Real Estate"}),l.jsx("meta",{name:"description",content:"Get in touch with Holden Richardson for buying, selling, or real estate consultation in the Grand Rapids area."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/contact"}),l.jsx("meta",{property:"og:title",content:"Contact Holden Richardson | Grand Rapids Real Estate"}),l.jsx("meta",{property:"og:description",content:"Get in touch with Holden Richardson for buying, selling, or real estate consultation in Grand Rapids."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/contact"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Contact Holden Richardson | Grand Rapids Real Estate"}),l.jsx("meta",{name:"twitter:description",content:"Get in touch with Holden Richardson for real estate in Grand Rapids."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"ContactPage",url:"https://www.holdengr.com/contact",name:"Contact Holden Richardson",description:"Contact form, phone, text, and virtual meeting options for Grand Rapids Realtor Holden Richardson.",isPartOf:{"@id":"https://www.holdengr.com/#website"},mainEntity:{"@type":"RealEstateAgent","@id":"https://www.holdengr.com/#agent",name:"Holden Richardson",url:"https://www.holdengr.com",contactPoint:[{"@type":"ContactPoint",contactType:"sales",telephone:"+1-616-403-6393",email:"holden@holdengr.com",areaServed:"US-MI",availableLanguage:["English"]},{"@type":"ContactPoint",contactType:"customer support",email:"holden@holdengr.com",areaServed:"US-MI",availableLanguage:["English"]}]}})}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://www.holdengr.com/"},{"@type":"ListItem",position:2,name:"Contact",item:"https://www.holdengr.com/contact"}]})})]}),l.jsx("section",{className:"bg-secondary pt-28 md:pt-32 pb-10 md:pb-14",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsxs("div",{className:"mb-8 md:mb-10",children:[l.jsx("p",{className:"text-caption text-muted-foreground mb-2",children:"Get in Touch"}),l.jsx("h1",{className:"font-serif text-2xl md:text-3xl font-light text-foreground",children:"Let's Start the Conversation"})]})}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-10 lg:gap-16 items-stretch",children:[l.jsx("div",{className:"flex items-center justify-center order-2 lg:order-1",children:l.jsx(_e,{variant:"scale",children:l.jsx("img",{src:i3e,alt:"Holden and Brittany Richardson",className:"w-full h-auto object-cover"})})}),l.jsx(_e,{delay:.1,className:"order-1 lg:order-2",children:l.jsxs("form",{onSubmit:c,className:"space-y-5 border border-border/60 p-6 md:p-8 bg-background shadow-sm",children:[l.jsx("h3",{className:"font-serif text-xl font-light mb-2",children:"Send a Message"}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"firstName",className:"text-caption text-muted-foreground mb-1.5 block",children:"First Name *"}),l.jsx(Xe,{id:"firstName",name:"firstName",value:i.firstName,onChange:u,required:!0,className:"bg-secondary border-0 h-11 rounded-none focus:ring-1 focus:ring-accent"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"lastName",className:"text-caption text-muted-foreground mb-1.5 block",children:"Last Name *"}),l.jsx(Xe,{id:"lastName",name:"lastName",value:i.lastName,onChange:u,required:!0,className:"bg-secondary border-0 h-11 rounded-none focus:ring-1 focus:ring-accent"})]})]}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{htmlFor:"email",className:"text-caption text-muted-foreground mb-1.5 block",children:"Email *"}),l.jsx(Xe,{id:"email",name:"email",type:"email",value:i.email,onChange:u,required:!0,className:"bg-secondary border-0 h-11 rounded-none focus:ring-1 focus:ring-accent"})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"phone",className:"text-caption text-muted-foreground mb-1.5 block",children:"Phone"}),l.jsx(Xe,{id:"phone",name:"phone",type:"tel",value:i.phone,onChange:u,className:"bg-secondary border-0 h-11 rounded-none focus:ring-1 focus:ring-accent"})]})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"interest",className:"text-caption text-muted-foreground mb-1.5 block",children:"I'm Interested In"}),l.jsxs("select",{id:"interest",name:"interest",value:i.interest,onChange:u,className:"w-full bg-secondary border-0 h-11 px-4 text-foreground focus:ring-1 focus:ring-accent appearance-none cursor-pointer",children:[l.jsx("option",{value:"buying",children:"Buying a Property"}),l.jsx("option",{value:"selling",children:"Selling a Property"}),l.jsx("option",{value:"both",children:"Both Buying and Selling"}),l.jsx("option",{value:"consultation",children:"General Consultation"})]})]}),l.jsxs("div",{children:[l.jsx("label",{htmlFor:"message",className:"text-caption text-muted-foreground mb-1.5 block",children:"Message"}),l.jsx(Vi,{id:"message",name:"message",value:i.message,onChange:u,rows:4,className:"bg-secondary border-0 rounded-none focus:ring-1 focus:ring-accent resize-none",placeholder:"Tell me about your real estate goals..."})]}),l.jsx("button",{type:"submit",className:"btn-outline-primary w-full disabled:opacity-50",disabled:n,children:n?"Sending...":"Send Message"})]})})]})]})}),l.jsx("section",{className:"py-10 md:py-14 bg-background",children:l.jsx("div",{className:"container-page",children:l.jsx(_e,{children:l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 max-w-3xl mx-auto",children:[a&&l.jsx("a",{href:`tel:${a}`,children:l.jsxs(xe,{size:"lg",className:"w-full bg-foreground text-background hover:bg-foreground/90 rounded-none font-semibold h-14 text-base",children:[l.jsx(lf,{className:"w-5 h-5 mr-2"}),"Call"]})}),d&&l.jsx("a",{href:d,children:l.jsxs(xe,{size:"lg",className:"w-full bg-foreground text-background hover:bg-foreground/90 rounded-none font-semibold h-14 text-base",children:[l.jsx(ad,{className:"w-5 h-5 mr-2"}),"Text"]})}),o&&l.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:l.jsxs(xe,{size:"lg",className:"w-full bg-foreground text-background hover:bg-foreground/90 rounded-none font-semibold h-14 text-base",children:[l.jsx(Oo,{className:"w-5 h-5 mr-2"}),"Book Virtual Meeting"]})})]})})})})]})},a3e=[{icon:Dre,title:"Real-Time Home Value",description:"Receive a personalized, data-driven estimate of your home's current market value — updated monthly so you always know where you stand."},{icon:p2e,title:"Monthly Market Updates",description:"Get a detailed digest delivered straight to your inbox with local market trends, comparable sales, and how your home's value is changing over time."},{icon:H2e,title:"Equity & Financial Insights",description:"See how much equity you've built, explore cash-out refinance scenarios, and understand your home's role in your overall financial picture."},{icon:Sre,title:"Neighborhood Intelligence",description:"Track what's selling in your neighborhood, average days on market, and pricing trends — the same data agents use to advise their clients."}],o3e=()=>(C.useEffect(()=>{const e=window;e.__hb_namespace="Homebot",e.Homebot=e.Homebot||function(){(e.Homebot.q=e.Homebot.q||[]).push(arguments)};const t=document.createElement("script");return t.async=!0,t.src="https://embed.homebotapp.com/lgw/v1/widget.js",document.head.appendChild(t),t.onload=()=>{e.Homebot("#homebot_homeowner","52a1cb8f2e41fb10e76903941d59cb3e4cb15eb38090f697")},()=>{t.parentNode&&t.parentNode.removeChild(t)}},[]),l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Home Valuation | What's Your Home Worth? | Holden Richardson"}),l.jsx("meta",{name:"description",content:"Get a free, AI-powered home valuation plus monthly updates on your home's value, equity, and Grand Rapids market trends."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/home-valuation"}),l.jsx("meta",{property:"og:title",content:"Home Valuation | What's Your Home Worth?"}),l.jsx("meta",{property:"og:description",content:"Get a free home valuation plus monthly market updates from Holden Richardson."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/home-valuation"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Home Valuation | What's Your Home Worth?"}),l.jsx("meta",{name:"twitter:description",content:"Get a free home valuation plus monthly market updates from Holden Richardson."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsxs("section",{className:"relative -mt-20 pt-32 md:pt-40 pb-14 md:pb-20 bg-secondary overflow-hidden",children:[l.jsxs("div",{className:"absolute inset-0",children:[l.jsx("img",{src:vc("stock_photo/1772747048679-xrqvfil905k.jpeg"),alt:"Grand Rapids home exterior",className:"w-full h-full object-cover"}),l.jsx("div",{className:"absolute inset-0 bg-black/40"})]}),l.jsxs("div",{className:"container-page text-center relative z-10",children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-white/70 mb-3",children:"Powered by Homebot"})}),l.jsx(_e,{delay:.1,children:l.jsx("h1",{className:"heading-section max-w-4xl mx-auto text-white",children:"What's Your Home Worth?"})}),l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-body text-white/80 max-w-2xl mx-auto mt-4",children:"Enter your address below for a complimentary home valuation — plus ongoing monthly updates on your home's value, equity, and local market trends."})})]})]}),l.jsx("section",{className:"py-12 md:py-16 bg-background",children:l.jsx("div",{className:"container-page max-w-3xl",children:l.jsx("div",{id:"homebot_homeowner",className:"w-full min-h-[200px]"})})}),l.jsx("section",{className:"py-12 md:py-16 bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsxs("div",{className:"text-center mb-10",children:[l.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"Why Homebot?"}),l.jsx("h2",{className:"heading-section max-w-3xl mx-auto",children:"Your Home's Financial Dashboard — Free, Forever"}),l.jsx("p",{className:"text-body text-muted-foreground max-w-2xl mx-auto mt-6",children:"When you sign up through my Homebot portal, you don't just get a one-time estimate. You get a powerful, ongoing tool that keeps you informed and in control of your biggest investment."})]})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 md:gap-8",children:a3e.map((e,t)=>l.jsx(_e,{delay:t*.1,children:l.jsxs(hi.div,{className:"flex gap-5",whileHover:{x:4},transition:{duration:.3},children:[l.jsx("div",{className:"w-12 h-12 bg-accent/10 flex items-center justify-center shrink-0",children:l.jsx(e.icon,{size:22,className:"text-accent"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-semibold text-foreground mb-2",children:e.title}),l.jsx("p",{className:"text-body text-muted-foreground text-sm leading-relaxed",children:e.description})]})]})},e.title))})]})})]}));var qoe={exports:{}};/*! pym.js - v1.3.2 - 2018-02-13 */(function(e){(function(t){e.exports?e.exports=t():window.pym=t.call(this)})(function(){var t="xPYMx",n={},r=function(A){var f=document.createEvent("Event");f.initEvent("pym:"+A,!0,!0),document.dispatchEvent(f)},i=function(A){var f=new RegExp("[\\?&]"+A.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]")+"=([^&#]*)"),p=f.exec(location.search);return p===null?"":decodeURIComponent(p[1].replace(/\+/g," "))},s=function(A,f){if(!(f.xdomain!=="*"&&!A.origin.match(new RegExp(f.xdomain+"$")))&&typeof A.data=="string")return!0},a=function(A){var f=/^(?:(?:https?|mailto|ftp):|[^&:/?#]*(?:[/?#]|$))/gi;if(A.match(f))return!0},o=function(A,f,p){var m=["pym",A,f,p];return m.join(t)},c=function(A){var f=["pym",A,"(\\S+)","(.*)"];return new RegExp("^"+f.join(t)+"$")},u=Date.now||function(){return new Date().getTime()},d=function(A,f,p){var m,g,y,v=null,x=0;p||(p={});var w=function(){x=p.leading===!1?0:u(),v=null,y=A.apply(m,g),v||(m=g=null)};return function(){var b=u();!x&&p.leading===!1&&(x=b);var k=f-(b-x);return m=this,g=arguments,k<=0||k>f?(v&&(clearTimeout(v),v=null),x=b,y=A.apply(m,g),v||(m=g=null)):!v&&p.trailing!==!1&&(v=setTimeout(w,k)),y}},h=function(){for(var A=n.autoInitInstances.length,f=A-1;f>=0;f--){var p=n.autoInitInstances[f];p.el.getElementsByTagName("iframe").length&&p.el.getElementsByTagName("iframe")[0].contentWindow||n.autoInitInstances.splice(f,1)}};return n.autoInitInstances=[],n.autoInit=function(A){var f=document.querySelectorAll("[data-pym-src]:not([data-pym-auto-initialized])"),p=f.length;h();for(var m=0;m<p;++m){var g=f[m];g.setAttribute("data-pym-auto-initialized",""),g.id===""&&(g.id="pym-"+m+"-"+Math.random().toString(36).substr(2,5));var y=g.getAttribute("data-pym-src"),v={xdomain:"string",title:"string",name:"string",id:"string",sandbox:"string",allowfullscreen:"boolean",parenturlparam:"string",parenturlvalue:"string",optionalparams:"boolean",trackscroll:"boolean",scrollwait:"number"},x={};for(var w in v)if(g.getAttribute("data-pym-"+w)!==null)switch(v[w]){case"boolean":x[w]=g.getAttribute("data-pym-"+w)!=="false";break;case"string":x[w]=g.getAttribute("data-pym-"+w);break;case"number":var b=Number(g.getAttribute("data-pym-"+w));isNaN(b)||(x[w]=b);break;default:console.err("unrecognized attribute type")}var k=new n.Parent(g.id,y,x);n.autoInitInstances.push(k)}return A||r("pym-initialized"),n.autoInitInstances},n.Parent=function(A,f,p){this.id=A,this.url=f,this.el=document.getElementById(A),this.iframe=null,this.settings={xdomain:"*",optionalparams:!0,parenturlparam:"parentUrl",parenturlvalue:window.location.href,trackscroll:!1,scrollwait:100},this.messageRegex=c(this.id),this.messageHandlers={},p=p||{},this._constructIframe=function(){var g=this.el.offsetWidth.toString();this.iframe=document.createElement("iframe");var y="",v=this.url.indexOf("#");for(v>-1&&(y=this.url.substring(v,this.url.length),this.url=this.url.substring(0,v)),this.url.indexOf("?")<0?this.url+="?":this.url+="&",this.iframe.src=this.url+"initialWidth="+g+"&childId="+this.id,this.settings.optionalparams&&(this.iframe.src+="&parentTitle="+encodeURIComponent(document.title),this.iframe.src+="&"+this.settings.parenturlparam+"="+encodeURIComponent(this.settings.parenturlvalue)),this.iframe.src+=y,this.iframe.setAttribute("width","100%"),this.iframe.setAttribute("scrolling","no"),this.iframe.setAttribute("marginheight","0"),this.iframe.setAttribute("frameborder","0"),this.settings.title&&this.iframe.setAttribute("title",this.settings.title),this.settings.allowfullscreen!==void 0&&this.settings.allowfullscreen!==!1&&this.iframe.setAttribute("allowfullscreen",""),this.settings.sandbox!==void 0&&typeof this.settings.sandbox=="string"&&this.iframe.setAttribute("sandbox",this.settings.sandbox),this.settings.id&&(document.getElementById(this.settings.id)||this.iframe.setAttribute("id",this.settings.id)),this.settings.name&&this.iframe.setAttribute("name",this.settings.name);this.el.firstChild;)this.el.removeChild(this.el.firstChild);this.el.appendChild(this.iframe),window.addEventListener("resize",this._onResize),this.settings.trackscroll&&window.addEventListener("scroll",this._throttleOnScroll)},this._onResize=(function(){this.sendWidth(),this.settings.trackscroll&&this.sendViewportAndIFramePosition()}).bind(this),this._onScroll=(function(){this.sendViewportAndIFramePosition()}).bind(this),this._fire=function(g,y){if(g in this.messageHandlers)for(var v=0;v<this.messageHandlers[g].length;v++)this.messageHandlers[g][v].call(this,y)},this.remove=function(){window.removeEventListener("message",this._processMessage),window.removeEventListener("resize",this._onResize),this.el.removeChild(this.iframe),h()},this._processMessage=(function(g){if(s(g,this.settings)&&typeof g.data=="string"){var y=g.data.match(this.messageRegex);if(!y||y.length!==3)return!1;var v=y[1],x=y[2];this._fire(v,x)}}).bind(this),this._onHeightMessage=function(g){var y=parseInt(g);this.iframe.setAttribute("height",y+"px")},this._onNavigateToMessage=function(g){a(g)&&(document.location.href=g)},this._onScrollToChildPosMessage=function(g){var y=document.getElementById(this.id).getBoundingClientRect().top+window.pageYOffset,v=y+parseInt(g);window.scrollTo(0,v)},this.onMessage=function(g,y){g in this.messageHandlers||(this.messageHandlers[g]=[]),this.messageHandlers[g].push(y)},this.sendMessage=function(g,y){this.el.getElementsByTagName("iframe").length&&(this.el.getElementsByTagName("iframe")[0].contentWindow?this.el.getElementsByTagName("iframe")[0].contentWindow.postMessage(o(this.id,g,y),"*"):this.remove())},this.sendWidth=function(){var g=this.el.offsetWidth.toString();this.sendMessage("width",g)},this.sendViewportAndIFramePosition=function(){var g=this.iframe.getBoundingClientRect(),y=window.innerWidth||document.documentElement.clientWidth,v=window.innerHeight||document.documentElement.clientHeight,x=y+" "+v;x+=" "+g.top+" "+g.left,x+=" "+g.bottom+" "+g.right,this.sendMessage("viewport-iframe-position",x)};for(var m in p)this.settings[m]=p[m];return this._throttleOnScroll=d(this._onScroll.bind(this),this.settings.scrollwait),this.onMessage("height",this._onHeightMessage),this.onMessage("navigateTo",this._onNavigateToMessage),this.onMessage("scrollToChildPos",this._onScrollToChildPosMessage),this.onMessage("parentPositionInfo",this.sendViewportAndIFramePosition),window.addEventListener("message",this._processMessage,!1),this._constructIframe(),this},n.Child=function(A){this.parentWidth=null,this.id=null,this.parentTitle=null,this.parentUrl=null,this.settings={renderCallback:null,xdomain:"*",polling:0,parenturlparam:"parentUrl"},this.timerId=null,this.messageRegex=null,this.messageHandlers={},A=A||{},this.onMessage=function(g,y){g in this.messageHandlers||(this.messageHandlers[g]=[]),this.messageHandlers[g].push(y)},this._fire=function(g,y){if(g in this.messageHandlers)for(var v=0;v<this.messageHandlers[g].length;v++)this.messageHandlers[g][v].call(this,y)},this._processMessage=(function(g){if(s(g,this.settings)&&typeof g.data=="string"){var y=g.data.match(this.messageRegex);if(!(!y||y.length!==3)){var v=y[1],x=y[2];this._fire(v,x)}}}).bind(this),this._onWidthMessage=function(g){var y=parseInt(g);y!==this.parentWidth&&(this.parentWidth=y,this.settings.renderCallback&&this.settings.renderCallback(y),this.sendHeight())},this.sendMessage=function(g,y){window.parent.postMessage(o(this.id,g,y),"*")},this.sendHeight=(function(){var g=document.getElementsByTagName("body")[0].offsetHeight.toString();return this.sendMessage("height",g),g}).bind(this),this.getParentPositionInfo=function(){this.sendMessage("parentPositionInfo")},this.scrollParentTo=function(g){this.sendMessage("navigateTo","#"+g)},this.navigateParentTo=function(g){this.sendMessage("navigateTo",g)},this.scrollParentToChildEl=function(g){var y=document.getElementById(g).getBoundingClientRect().top+window.pageYOffset;this.scrollParentToChildPos(y)},this.scrollParentToChildPos=function(g){this.sendMessage("scrollToChildPos",g.toString())};var f=function(g){var y=document.getElementsByTagName("html")[0],v,x=y.className;try{window.self!==window.top?v="embedded":v="not-embedded"}catch{v="embedded"}x.indexOf(v)<0&&(y.className=x?x+" "+v:v,g&&g(v),r("marked-embedded"))};this.remove=function(){window.removeEventListener("message",this._processMessage),this.timerId&&clearInterval(this.timerId)};for(var p in A)this.settings[p]=A[p];this.id=i("childId")||A.id,this.messageRegex=new RegExp("^pym"+t+this.id+t+"(\\S+)"+t+"(.*)$");var m=parseInt(i("initialWidth"));return this.parentUrl=i(this.settings.parenturlparam),this.parentTitle=i("parentTitle"),this.onMessage("width",this._onWidthMessage),window.addEventListener("message",this._processMessage,!1),this.settings.renderCallback&&this.settings.renderCallback(m),this.sendHeight(),this.settings.polling&&(this.timerId=window.setInterval(this.sendHeight,this.settings.polling)),f(A.onMarkedEmbeddedStatus),this},typeof document<"u"&&n.autoInit(!0),n})})(qoe);var l3e=qoe.exports;const c3e=In(l3e),rw={iframeDomain:"https://holdenrichardson-realsavvy.realsavvy.co",idxRedirectPath:"/idx",idxPrefix:"/app",siteId:null,clientId:"eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiIwMTdkZTg1ZTVkNmYyN2U1ZWVlNDQ0MTkyYmQ2OWFlOWE1YWQ1NmZkMzk5ZWViYjhmZTk5ZWQ5NzE1YmY0NzBiIiwiYXVkIjoiZ2lkOi8vcmVhbC1zYXZ2eS9TaXRlLzE3NjEiLCJzdWIiOiJnaWQ6Ly9yZWFsLXNhdnZ5L1NpdGUvMTc2MSIsInNjb3BlcyI6WyJhZG1pbiJdfQ.o3UL0ih_XwYtfFKjMO1rkNX84RcRVpL11s-WY6zlH0bZAfxgofDa933-GmRS0JezLJyGPrER9PYRmKtgukPl4VYEW0xDaDdVGmHtvavX2iNiAlXQscNMieJtvXT0TszFgDDqk0tsCsx0v9JIdUrBVyPYa6Zneu3rdg_Gvu4ocRy-UsXntMtW9WBs_CPZcKoSxMWOZZjxj1vGWB9VceRg62puKNN_EsxWK26JDBqwPqM8HMRac6yaECH9nvjtgmMasmybtXVeIDVbjuXx3fOfbeDFrCix1rbSGgs1H5-U8hN7AHvJijxqrHgNoofPPz5PSp2MsB-4fV7iuFE4dFZEbQ",style:{mainFont:"Inter"}},sV={idxPath:"/",marketId:"2319",map:!0,query:{},suggestions:[],height:"100vh",idxRedirect:!0},Woe=(e,t)=>{const n=[];for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const i=t?`${t}[${r}]`:r,s=e[r];s!=null&&n.push(s!==null&&typeof s=="object"?Woe(s,i):`${encodeURIComponent(i)}=${encodeURIComponent(s)}`)}return n.join("&")},u3e=(e={})=>{const{path:t="/",marketId:n=sV.marketId,map:r=sV.map,query:i={},cycagt:s=null,vid:a=null,magicLink:o=null,magicAuth:c=null}=e;let u=n;const d=localStorage.getItem("_market_v3");if(d)try{u=JSON.parse(d).id}catch{}const h={market_id:u,map:r,...i};h.client_id=rw.clientId,h.font=rw.style.mainFont,s&&(h._cycagt=s),a&&(h._vid=a),o&&(h.magic_link=o),c&&(h.magic_auth=c.replace(/ /g,"+")),typeof window<"u"&&window.matchMedia("(max-width: 768px)").matches&&(h.map=!1);let A=rw.iframeDomain;/^https?:\/\//i.test(A)||(A=`https://${A}`),A=A.replace(/\/+$/,"");const f=Woe(h);return`${A}${rw.idxPrefix}${t}${f?`?${f}`:""}`},d3e=e=>{const t=n=>{var s;if(!n.origin.includes("realsavvy"))return;const r=n.data;if(!r||!r.postal)return;const i=r.packingSlip;if(i){if(i.type==="federation.ping"){(s=n.source)==null||s.postMessage({postal:!0,packingSlip:{type:"federation.pong"}},{targetOrigin:n.origin});return}if(i.type==="federation.message"){const a=i.envelope;if(!a)return;if(a.channel==="idx"&&a.topic==="router.didTransition"){const o=a.data;if(!o||!o.currentURL)return;const c=o.currentURL.split("?"),u=c[0],d=new URLSearchParams(c[1]||"");e&&d.set("_cycagt",e);const h=d.toString(),A=h===""?u:`${u}?${h}`;window.history.replaceState(o,document.title,`${rw.idxRedirectPath}${A}`)}}}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},h3e=(e,t)=>{const n=e.startsWith("?")?e.slice(1):e;for(const r of n.split("&")){if(!r)continue;const[i,...s]=r.split("=");if(decodeURIComponent(i)===t)return s.join("=")}return null},Ur=()=>{const e=C.useRef(null),t=ro();return C.useEffect(()=>{const n=new URLSearchParams(t.search),r=n.get("_cycagt"),i=n.get("_vid"),s=n.get("magic_link"),a=h3e(t.search,"magic_auth")??n.get("magic_auth");r&&localStorage.setItem("cycagt",r),i&&localStorage.setItem("_vid",i);const o=localStorage.getItem("cycagt"),c=localStorage.getItem("_vid"),u=d3e(o),d=t.pathname.startsWith("/idx")?t.pathname.replace(/^\/idx/,"")||"/":t.pathname,h=u3e({path:d,cycagt:o,vid:c,magicLink:s,magicAuth:a});e.current=new c3e.Parent("idx-frame",h,{});const A=()=>{var g;const f=document.querySelector("header"),p=(f==null?void 0:f.offsetHeight)||80,m=window.innerHeight-p;(g=e.current)!=null&&g.iframe&&(e.current.iframe.setAttribute("height",`${m}px`),e.current.iframe.style.height=`${m}px`)};return A(),window.addEventListener("resize",A),()=>{u(),window.removeEventListener("resize",A)}},[t.pathname,t.search]),l.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Home Search | Grand Rapids Homes | Holden Richardson"}),l.jsx("meta",{name:"description",content:"Search homes for sale in Grand Rapids, East Grand Rapids, Ada, and West Michigan with Holden Richardson."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/idx"}),l.jsx("meta",{property:"og:title",content:"Home Search | Grand Rapids Homes for Sale"}),l.jsx("meta",{property:"og:description",content:"Search homes for sale in Grand Rapids and West Michigan with Holden Richardson."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/idx"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Home Search | Grand Rapids Homes for Sale"}),l.jsx("meta",{name:"twitter:description",content:"Search homes for sale in Grand Rapids and West Michigan with Holden Richardson."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx(IE,{}),l.jsxs("main",{className:"flex-1 pt-[80px]",children:[l.jsx("div",{id:"idx-frame",className:"w-full [&>iframe]:w-full [&>iframe]:border-0"}),l.jsxs("div",{className:"text-center py-3 text-xs text-muted-foreground",children:["Powered by"," ",l.jsx("a",{href:"https://www.realsavvy.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"RealSavvy"})]})]})]})};var f3e="Label",Goe=C.forwardRef((e,t)=>l.jsx(ut.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Goe.displayName=f3e;var Yoe=Goe;const A3e=w2("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ht=C.forwardRef(({className:e,...t},n)=>l.jsx(Yoe,{ref:n,className:it(A3e(),e),...t}));ht.displayName=Yoe.displayName;const Xt=C.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:it("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Xt.displayName="Card";const wa=C.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:it("flex flex-col space-y-1.5 p-6",e),...t}));wa.displayName="CardHeader";const ba=C.forwardRef(({className:e,...t},n)=>l.jsx("h3",{ref:n,className:it("text-2xl font-semibold leading-none tracking-tight",e),...t}));ba.displayName="CardTitle";const kp=C.forwardRef(({className:e,...t},n)=>l.jsx("p",{ref:n,className:it("text-sm text-muted-foreground",e),...t}));kp.displayName="CardDescription";const Jt=C.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:it("p-6 pt-0",e),...t}));Jt.displayName="CardContent";const p3e=C.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:it("flex items-center p-6 pt-0",e),...t}));p3e.displayName="CardFooter";function A0(){const[e,t]=C.useState(null),[n,r]=C.useState(null),[i,s]=C.useState(!0),[a,o]=C.useState(!1);return C.useEffect(()=>{const h=async f=>{const{data:p}=await Me.from("user_roles").select("role").eq("user_id",f).eq("role","admin").maybeSingle();o(!!p)},{data:{subscription:A}}=Me.auth.onAuthStateChange((f,p)=>{r(p),t((p==null?void 0:p.user)??null),p!=null&&p.user?setTimeout(()=>h(p.user.id).then(()=>s(!1)),0):(o(!1),s(!1))});return Me.auth.getSession().then(({data:{session:f}})=>{r(f),t((f==null?void 0:f.user)??null),f!=null&&f.user?h(f.user.id).then(()=>s(!1)):s(!1)}),()=>A.unsubscribe()},[]),{user:e,session:n,isLoading:i,isAdmin:a,signIn:async(h,A)=>{const{error:f}=await Me.auth.signInWithPassword({email:h,password:A});return{error:f}},signUp:async(h,A)=>{const{error:f}=await Me.auth.signUp({email:h,password:A,options:{emailRedirectTo:window.location.origin}});return{error:f}},signOut:async()=>{await Me.auth.signOut(),t(null),r(null),o(!1)}}}const m3e=()=>{const e=El(),{toast:t}=Qf(),{user:n,isLoading:r,isAdmin:i,signIn:s,signUp:a}=A0(),[o,c]=C.useState("signin"),[u,d]=C.useState(""),[h,A]=C.useState(""),[f,p]=C.useState(""),[m,g]=C.useState(""),[y,v]=C.useState(""),[x,w]=C.useState(""),[b,k]=C.useState(!1),[j,B]=C.useState(!1);C.useEffect(()=>{!r&&n&&i&&e("/admin")},[n,r,i,e]);const E=async N=>{N.preventDefault(),k(!0);const{error:F}=await s(u,h);t(F?{variant:"destructive",title:"Login failed",description:F.message}:{title:"Welcome back!",description:"You have successfully logged in."}),k(!1)},I=async N=>{if(N.preventDefault(),m!==y){t({variant:"destructive",title:"Passwords don't match",description:"Please make sure your passwords match."});return}if(m.length<6){t({variant:"destructive",title:"Password too short",description:"Password must be at least 6 characters."});return}k(!0);const{error:F}=await a(f,m);t(F?{variant:"destructive",title:"Registration failed",description:F.message}:{title:"Registration successful!",description:"Please check your email to verify your account."}),k(!1)},T=async N=>{N.preventDefault(),k(!0);const{error:F}=await Me.auth.resetPasswordForEmail(x,{redirectTo:`${window.location.origin}/reset-password`});F?t({variant:"destructive",title:"Failed to send reset link",description:F.message}):(B(!0),t({title:"Check your email",description:"A password reset link has been sent to your email."})),k(!1)};return r?l.jsx(ln,{children:l.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:l.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})})}):l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Sign In | Holden Richardson | 616 Realty"}),l.jsx("meta",{name:"description",content:"Sign in to access your account."}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsx("div",{className:"section-padding",children:l.jsx("div",{className:"container-page max-w-md",children:l.jsxs(Xt,{className:"border-border",children:[l.jsxs(wa,{className:"text-center",children:[l.jsx(ba,{className:"heading-card",children:"Welcome"}),l.jsx(kp,{children:o==="forgot"?"Reset your password":"Sign in to access the admin dashboard"})]}),l.jsx(Jt,{children:o==="forgot"?l.jsx("div",{className:"space-y-4",children:j?l.jsxs("div",{className:"text-center space-y-4",children:[l.jsx("p",{className:"text-muted-foreground",children:"Check your email for a password reset link."}),l.jsx(xe,{variant:"outline",className:"w-full",onClick:()=>{c("signin"),B(!1)},children:"Back to Sign In"})]}):l.jsxs("form",{onSubmit:T,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"forgot-email",children:"Email"}),l.jsx(Xe,{id:"forgot-email",type:"email",placeholder:"you@example.com",value:x,onChange:N=>w(N.target.value),required:!0})]}),l.jsx(xe,{type:"submit",className:"w-full",disabled:b,children:b?"Sending…":"Send Reset Link"}),l.jsx(xe,{type:"button",variant:"ghost",className:"w-full",onClick:()=>c("signin"),children:"Back to Sign In"})]})}):l.jsxs(ym,{value:o,onValueChange:N=>c(N),className:"w-full",children:[l.jsxs(Vf,{className:"grid w-full grid-cols-2",children:[l.jsx(Hn,{value:"signin",children:"Sign In"}),l.jsx(Hn,{value:"signup",children:"Sign Up"})]}),l.jsx(Qn,{value:"signin",className:"mt-6",children:l.jsxs("form",{onSubmit:E,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"login-email",children:"Email"}),l.jsx(Xe,{id:"login-email",type:"email",placeholder:"you@example.com",value:u,onChange:N=>d(N.target.value),required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"login-password",children:"Password"}),l.jsx(Xe,{id:"login-password",type:"password",placeholder:"••••••••",value:h,onChange:N=>A(N.target.value),required:!0})]}),l.jsx(xe,{type:"submit",className:"w-full",disabled:b,children:b?"Signing in…":"Sign In"}),l.jsx(xe,{type:"button",variant:"link",className:"w-full text-sm",onClick:()=>c("forgot"),children:"Forgot password?"})]})}),l.jsx(Qn,{value:"signup",className:"mt-6",children:l.jsxs("form",{onSubmit:I,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"register-email",children:"Email"}),l.jsx(Xe,{id:"register-email",type:"email",placeholder:"you@example.com",value:f,onChange:N=>p(N.target.value),required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"register-password",children:"Password"}),l.jsx(Xe,{id:"register-password",type:"password",placeholder:"••••••••",value:m,onChange:N=>g(N.target.value),required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"confirm-password",children:"Confirm Password"}),l.jsx(Xe,{id:"confirm-password",type:"password",placeholder:"••••••••",value:y,onChange:N=>v(N.target.value),required:!0})]}),l.jsx(xe,{type:"submit",className:"w-full",disabled:b,children:b?"Creating account…":"Create Account"})]})})]})})]})})})]})};function g3e(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}function Xoe(){return gr({queryKey:["fallback-image-pool"],queryFn:async()=>{const{data:e,error:t}=await Me.from("site_media").select("file_path, alt_text, file_name").in("media_type",["stock_photo","photo"]).order("created_at",{ascending:!1});if(t)throw t;return(e||[]).map(n=>{const{data:r}=Me.storage.from("site-media").getPublicUrl(n.file_path);return{url:r.publicUrl,alt:n.alt_text||n.file_name||"Photo"}})},staleTime:1e3*60*30})}function Joe(e,t){if(!e||e.length===0)return null;const n=g3e(t)%e.length;return e[n]}const y3e=({post:e,fallbackPool:t})=>{const n=Joe(t,e.slug),r=e.featured_image||(n==null?void 0:n.url),i=e.title||(n==null?void 0:n.alt)||"Featured post",s=e.published_at?new Date(e.published_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"";return l.jsx(At,{to:`/blog/${e.slug}`,className:"group block mb-16",children:l.jsxs("article",{className:"grid md:grid-cols-2 gap-0 border border-border bg-card overflow-hidden hover:shadow-lg transition-all duration-500",children:[r&&l.jsx("div",{className:"aspect-[16/10] md:aspect-auto md:h-full overflow-hidden bg-secondary",children:l.jsx("img",{src:r,alt:i,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105",loading:"eager"})}),l.jsxs("div",{className:"p-6 md:p-10 flex flex-col justify-center",children:[l.jsx("p",{className:"text-[10px] uppercase tracking-[0.25em] text-gold mb-4 font-medium",children:"Featured"}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs uppercase tracking-wider text-muted-foreground mb-4",children:[e.category&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(fE,{className:"w-3 h-3"}),e.category]}),s&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Oo,{className:"w-3 h-3"}),s]})]}),l.jsx("h2",{className:"heading-section mb-4 group-hover:text-accent transition-colors",children:e.title}),e.excerpt&&l.jsx("p",{className:"text-body text-muted-foreground line-clamp-3 mb-6",children:e.excerpt}),l.jsxs("div",{className:"flex items-center gap-2 text-sm uppercase tracking-wider text-foreground group-hover:text-accent transition-colors font-medium",children:["Read article",l.jsx(Va,{size:14,className:"group-hover:translate-x-1 transition-transform"})]})]})]})})},v3e=({categories:e,active:t,onChange:n})=>{const r=C.useMemo(()=>[...e].sort((i,s)=>i.localeCompare(s)),[e]);return r.length===0?null:l.jsxs("div",{className:"flex flex-wrap gap-2 mb-10",children:[l.jsx("button",{onClick:()=>n(null),className:`px-4 py-2 text-xs uppercase tracking-[0.18em] font-medium border transition-colors ${t===null?"border-gold text-gold bg-gold/5":"border-border text-muted-foreground hover:border-gold/50 hover:text-foreground"}`,children:"All"}),r.map(i=>l.jsx("button",{onClick:()=>n(i),className:`px-4 py-2 text-xs uppercase tracking-[0.18em] font-medium border transition-colors ${t===i?"border-gold text-gold bg-gold/5":"border-border text-muted-foreground hover:border-gold/50 hover:text-foreground"}`,children:i},i))]})},x3e=({post:e,fallbackPool:t})=>{const n=Joe(t,e.slug),r=e.featured_image||(n==null?void 0:n.url),i=e.title||(n==null?void 0:n.alt)||"Blog post",s=e.published_at?new Date(e.published_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"";return l.jsx(_e,{children:l.jsx(At,{to:`/blog/${e.slug}`,className:"group block h-full",children:l.jsxs("article",{className:"border border-border bg-card overflow-hidden transition-all duration-500 hover:shadow-lg h-full flex flex-col",children:[r&&l.jsx("div",{className:"aspect-[16/10] overflow-hidden bg-secondary",children:l.jsx("img",{src:r,alt:i,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105",loading:"lazy"})}),l.jsxs("div",{className:"p-6 md:p-7 flex-1 flex flex-col",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs uppercase tracking-wider text-muted-foreground mb-3",children:[e.category&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(fE,{className:"w-3 h-3"}),e.category]}),s&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Oo,{className:"w-3 h-3"}),s]}),e.author&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(AE,{className:"w-3 h-3"}),e.author]})]}),l.jsx("h2",{className:"heading-card mb-3 group-hover:text-accent transition-colors",children:e.title}),e.excerpt&&l.jsx("p",{className:"text-body text-muted-foreground line-clamp-3",children:e.excerpt}),l.jsx("div",{className:"mt-auto pt-5",children:l.jsx("span",{className:"text-caption text-foreground group-hover:text-accent transition-colors",children:"Read More →"})})]})]})})})},w3e=()=>l.jsxs("div",{className:"border border-border bg-card overflow-hidden",children:[l.jsx(lt,{className:"aspect-[16/10] w-full"}),l.jsxs("div",{className:"p-6 md:p-7 space-y-4",children:[l.jsxs("div",{className:"flex gap-4",children:[l.jsx(lt,{className:"h-4 w-20"}),l.jsx(lt,{className:"h-4 w-24"})]}),l.jsx(lt,{className:"h-8 w-3/4"}),l.jsx(lt,{className:"h-16 w-full"}),l.jsx(lt,{className:"h-4 w-24"})]})]}),b3e=()=>{const{data:e,isLoading:t,error:n}=ooe(),{data:r}=Xoe(),[i,s]=C.useState(null),a=C.useMemo(()=>{if(!e)return[];const h=new Set;return e.forEach(A=>A.category&&h.add(A.category)),Array.from(h)},[e]),o=e==null?void 0:e[0],c=(e==null?void 0:e.slice(1))||[],u=i?c.filter(h=>h.category===i):c,d=i?(e==null?void 0:e.filter(h=>h.category===i))||[]:u;return l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Blog | Grand Rapids Real Estate Insights | Holden Richardson"}),l.jsx("meta",{name:"description",content:"Real estate insights, market trends, and expert tips from Holden Richardson — Grand Rapids Realtor at 616 Realty LLC."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/blog"}),l.jsx("meta",{property:"og:title",content:"Blog | Grand Rapids Real Estate Insights"}),l.jsx("meta",{property:"og:description",content:"Real estate insights, market trends, and tips from Holden Richardson."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/blog"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Blog | Grand Rapids Real Estate Insights"}),l.jsx("meta",{name:"twitter:description",content:"Real estate insights, market trends, and tips from Holden Richardson."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://www.holdengr.com/"},{"@type":"ListItem",position:2,name:"Blog",item:"https://www.holdengr.com/blog"}]})}),e&&e.length>0&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"CollectionPage","@id":"https://www.holdengr.com/blog",url:"https://www.holdengr.com/blog",name:"Blog | Grand Rapids Real Estate Insights",description:"Insights, market trends, and real estate tips from Holden Richardson.",isPartOf:{"@id":"https://www.holdengr.com/#website"},about:{"@id":"https://www.holdengr.com/#agent"},mainEntity:{"@type":"ItemList",numberOfItems:e.length,itemListElement:e.map((h,A)=>({"@type":"ListItem",position:A+1,url:`https://www.holdengr.com/blog/${h.slug}`,name:h.title}))}})})]}),l.jsx("section",{className:"bg-background -mt-20 pt-28 md:pt-32 pb-6 md:pb-8 border-b border-border",children:l.jsx("div",{className:"container-page",children:l.jsxs(_e,{children:[l.jsxs("div",{className:"flex items-center justify-between gap-4 pb-4 border-b border-border/60",children:[l.jsx("p",{className:"text-[10px] md:text-[11px] uppercase tracking-[0.3em] text-muted-foreground font-medium",children:"The Journal"}),l.jsx("p",{className:"hidden sm:block text-[10px] md:text-[11px] uppercase tracking-[0.3em] text-muted-foreground font-medium",children:e&&e.length>0?`Vol. 01 · ${e.length} ${e.length===1?"Story":"Stories"}`:"Vol. 01"})]}),l.jsxs("div",{className:"pt-6 md:pt-8 pb-2 md:pb-3 grid md:grid-cols-12 gap-6 md:gap-10 items-end",children:[l.jsxs("h1",{className:"md:col-span-7 heading-display leading-[0.95] tracking-tight",children:["Insights from",l.jsx("br",{className:"hidden md:block"})," the field."]}),l.jsx("p",{className:"md:col-span-5 text-body text-muted-foreground md:text-right md:border-l md:border-border md:pl-6",children:"Market reports, neighborhood breakdowns, and the lessons we keep learning from selling Grand Rapids real estate."})]})]})})}),l.jsx("section",{className:"pt-10 md:pt-14 pb-16 md:pb-20 bg-background",children:l.jsxs("div",{className:"container-page",children:[n&&l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-destructive",children:"Failed to load posts. Please try again later."})}),t&&l.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:[...Array(6)].map((h,A)=>l.jsx(w3e,{},A))}),!t&&e&&e.length===0&&l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-muted-foreground",children:"No posts published yet. Check back soon!"})}),!t&&e&&e.length>0&&l.jsxs(l.Fragment,{children:[!i&&o&&l.jsx(y3e,{post:o,fallbackPool:r}),a.length>0&&l.jsx(v3e,{categories:a,active:i,onChange:s}),d.length===0&&l.jsx("p",{className:"text-center py-8 text-muted-foreground",children:"No posts in this category yet."}),l.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:d.map(h=>l.jsx(x3e,{post:h,fallbackPool:r},h.id))})]})]})})]})},C3e=()=>{const{slug:e}=mm(),{data:t,isLoading:n,error:r}=Q4e(e||"");if(Xoe(),n)return l.jsx(ln,{children:l.jsx("div",{className:"section-padding",children:l.jsxs("div",{className:"container-page max-w-4xl",children:[l.jsx(lt,{className:"h-8 w-32 mb-8"}),l.jsx(lt,{className:"h-12 w-3/4 mb-4"}),l.jsxs("div",{className:"flex gap-4 mb-8",children:[l.jsx(lt,{className:"h-4 w-24"}),l.jsx(lt,{className:"h-4 w-24"})]}),l.jsx(lt,{className:"aspect-[16/9] w-full mb-8"}),l.jsxs("div",{className:"space-y-4",children:[l.jsx(lt,{className:"h-4 w-full"}),l.jsx(lt,{className:"h-4 w-full"}),l.jsx(lt,{className:"h-4 w-3/4"})]})]})})});if(r||!t)return l.jsxs(ln,{children:[l.jsx(Ln,{children:l.jsx("title",{children:"Post Not Found | Holden Richardson"})}),l.jsx("div",{className:"section-padding",children:l.jsxs("div",{className:"container-page text-center",children:[l.jsx("h1",{className:"heading-section mb-4",children:"Post Not Found"}),l.jsx("p",{className:"text-body text-muted-foreground mb-8",children:"The blog post you're looking for doesn't exist or has been removed."}),l.jsx(At,{to:"/blog",className:"btn-outline-primary",children:"Back to Blog"})]})})]});const i=t.published_at?new Date(t.published_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"";return l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsxs("title",{children:[t.meta_title||t.title," | Holden Richardson"]}),l.jsx("meta",{name:"description",content:t.meta_description||t.excerpt||""}),l.jsx("link",{rel:"canonical",href:`https://www.holdengr.com/blog/${e}`}),l.jsx("meta",{property:"og:image",content:t.featured_image||"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:title",content:t.meta_title||t.title}),l.jsx("meta",{property:"og:description",content:t.meta_description||t.excerpt||""}),l.jsx("meta",{property:"og:url",content:`https://www.holdengr.com/blog/${e}`}),l.jsx("meta",{property:"og:type",content:"article"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:t.meta_title||t.title}),l.jsx("meta",{name:"twitter:description",content:t.meta_description||t.excerpt||""}),l.jsx("meta",{name:"twitter:image",content:t.featured_image||"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BlogPosting",headline:t.title,...t.featured_image&&{image:[t.featured_image]},author:{"@type":"Person",name:t.author||"Holden Richardson",url:"https://www.holdengr.com/about"},publisher:{"@id":"https://www.holdengr.com/#agent"},datePublished:t.published_at,dateModified:t.updated_at||t.published_at,description:t.excerpt||t.meta_description||"",url:`https://www.holdengr.com/blog/${e}`,mainEntityOfPage:{"@type":"WebPage","@id":`https://www.holdengr.com/blog/${e}`},isPartOf:{"@id":"https://www.holdengr.com/#website"},inLanguage:"en-US"})}),t.faq_json&&Array.isArray(t.faq_json)&&t.faq_json.length>0&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntityOfPage:{"@id":`https://www.holdengr.com/blog/${e}`},about:{"@id":"https://www.holdengr.com/#agent"},mainEntity:t.faq_json.map(s=>({"@type":"Question",name:s.question,acceptedAnswer:{"@type":"Answer",text:s.answer}}))})})]}),l.jsx("article",{className:"section-padding",children:l.jsxs("div",{className:"container-page max-w-4xl",children:[l.jsx(_e,{children:l.jsxs(At,{to:"/blog",className:"inline-flex items-center gap-2 text-caption text-muted-foreground hover:text-foreground transition-colors mb-8",children:[l.jsx(pm,{className:"w-4 h-4"}),"Back to Blog"]})}),l.jsx(_e,{children:l.jsxs("header",{className:"mb-8",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-xs uppercase tracking-wider text-muted-foreground mb-4",children:[t.category&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(fE,{className:"w-3 h-3"}),t.category]}),i&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Oo,{className:"w-3 h-3"}),i]}),t.author&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(AE,{className:"w-3 h-3"}),t.author]})]}),l.jsx("h1",{className:"heading-section",children:t.title})]})}),t.featured_image&&l.jsx(_e,{children:l.jsx("div",{className:"aspect-[16/9] overflow-hidden mb-8",children:l.jsx("img",{src:t.featured_image,alt:t.title,className:"w-full h-full object-cover",loading:"lazy"})})}),l.jsx(_e,{children:l.jsx("div",{className:`prose prose-lg max-w-none 
                         prose-headings:font-serif prose-headings:font-medium
                         prose-p:text-body prose-p:text-muted-foreground
                         prose-a:text-accent prose-a:no-underline hover:prose-a:underline
                         prose-strong:text-foreground
                         prose-blockquote:border-l-accent prose-blockquote:text-muted-foreground
                         prose-ul:text-muted-foreground prose-ol:text-muted-foreground`,dangerouslySetInnerHTML:{__html:t.content}})}),t.tags&&t.tags.length>0&&l.jsx(_e,{children:l.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:l.jsx("div",{className:"flex flex-wrap gap-2",children:t.tags.map(s=>l.jsx("span",{className:"px-3 py-1 text-xs uppercase tracking-wider bg-secondary text-muted-foreground",children:s},s))})})})]})})]})};function S3e(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const k3e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_3e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,j3e={};function aV(e,t){return(j3e.jsx?_3e:k3e).test(e)}const B3e=/[ \t\n\f\r]/g;function N3e(e){return typeof e=="object"?e.type==="text"?oV(e.value):!1:oV(e)}function oV(e){return e.replace(B3e,"")===""}let P2=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};P2.prototype.normal={};P2.prototype.property={};P2.prototype.space=void 0;function Zoe(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new P2(n,r,t)}function GF(e){return e.toLowerCase()}class io{constructor(t,n){this.attribute=n,this.property=t}}io.prototype.attribute="";io.prototype.booleanish=!1;io.prototype.boolean=!1;io.prototype.commaOrSpaceSeparated=!1;io.prototype.commaSeparated=!1;io.prototype.defined=!1;io.prototype.mustUseProperty=!1;io.prototype.number=!1;io.prototype.overloadedBoolean=!1;io.prototype.property="";io.prototype.spaceSeparated=!1;io.prototype.space=void 0;let E3e=0;const fn=vm(),Ci=vm(),YF=vm(),We=vm(),fr=vm(),ky=vm(),yo=vm();function vm(){return 2**++E3e}const XF=Object.freeze(Object.defineProperty({__proto__:null,boolean:fn,booleanish:Ci,commaOrSpaceSeparated:yo,commaSeparated:ky,number:We,overloadedBoolean:YF,spaceSeparated:fr},Symbol.toStringTag,{value:"Module"})),gI=Object.keys(XF);class T6 extends io{constructor(t,n,r,i){let s=-1;if(super(t,n),lV(this,"space",i),typeof r=="number")for(;++s<gI.length;){const a=gI[s];lV(this,gI[s],(r&XF[a])===XF[a])}}}T6.prototype.defined=!0;function lV(e,t,n){n&&(e[t]=n)}function p0(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new T6(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[GF(r)]=r,n[GF(s.attribute)]=r}return new P2(t,n,e.space)}const ele=p0({properties:{ariaActiveDescendant:null,ariaAtomic:Ci,ariaAutoComplete:null,ariaBusy:Ci,ariaChecked:Ci,ariaColCount:We,ariaColIndex:We,ariaColSpan:We,ariaControls:fr,ariaCurrent:null,ariaDescribedBy:fr,ariaDetails:null,ariaDisabled:Ci,ariaDropEffect:fr,ariaErrorMessage:null,ariaExpanded:Ci,ariaFlowTo:fr,ariaGrabbed:Ci,ariaHasPopup:null,ariaHidden:Ci,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:fr,ariaLevel:We,ariaLive:null,ariaModal:Ci,ariaMultiLine:Ci,ariaMultiSelectable:Ci,ariaOrientation:null,ariaOwns:fr,ariaPlaceholder:null,ariaPosInSet:We,ariaPressed:Ci,ariaReadOnly:Ci,ariaRelevant:null,ariaRequired:Ci,ariaRoleDescription:fr,ariaRowCount:We,ariaRowIndex:We,ariaRowSpan:We,ariaSelected:Ci,ariaSetSize:We,ariaSort:null,ariaValueMax:We,ariaValueMin:We,ariaValueNow:We,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function tle(e,t){return t in e?e[t]:t}function nle(e,t){return tle(e,t.toLowerCase())}const T3e=p0({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ky,acceptCharset:fr,accessKey:fr,action:null,allow:null,allowFullScreen:fn,allowPaymentRequest:fn,allowUserMedia:fn,alt:null,as:null,async:fn,autoCapitalize:null,autoComplete:fr,autoFocus:fn,autoPlay:fn,blocking:fr,capture:null,charSet:null,checked:fn,cite:null,className:fr,cols:We,colSpan:null,content:null,contentEditable:Ci,controls:fn,controlsList:fr,coords:We|ky,crossOrigin:null,data:null,dateTime:null,decoding:null,default:fn,defer:fn,dir:null,dirName:null,disabled:fn,download:YF,draggable:Ci,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:fn,formTarget:null,headers:fr,height:We,hidden:YF,high:We,href:null,hrefLang:null,htmlFor:fr,httpEquiv:fr,id:null,imageSizes:null,imageSrcSet:null,inert:fn,inputMode:null,integrity:null,is:null,isMap:fn,itemId:null,itemProp:fr,itemRef:fr,itemScope:fn,itemType:fr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:fn,low:We,manifest:null,max:null,maxLength:We,media:null,method:null,min:null,minLength:We,multiple:fn,muted:fn,name:null,nonce:null,noModule:fn,noValidate:fn,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:fn,optimum:We,pattern:null,ping:fr,placeholder:null,playsInline:fn,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:fn,referrerPolicy:null,rel:fr,required:fn,reversed:fn,rows:We,rowSpan:We,sandbox:fr,scope:null,scoped:fn,seamless:fn,selected:fn,shadowRootClonable:fn,shadowRootDelegatesFocus:fn,shadowRootMode:null,shape:null,size:We,sizes:null,slot:null,span:We,spellCheck:Ci,src:null,srcDoc:null,srcLang:null,srcSet:null,start:We,step:null,style:null,tabIndex:We,target:null,title:null,translate:null,type:null,typeMustMatch:fn,useMap:null,value:Ci,width:We,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:fr,axis:null,background:null,bgColor:null,border:We,borderColor:null,bottomMargin:We,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:fn,declare:fn,event:null,face:null,frame:null,frameBorder:null,hSpace:We,leftMargin:We,link:null,longDesc:null,lowSrc:null,marginHeight:We,marginWidth:We,noResize:fn,noHref:fn,noShade:fn,noWrap:fn,object:null,profile:null,prompt:null,rev:null,rightMargin:We,rules:null,scheme:null,scrolling:Ci,standby:null,summary:null,text:null,topMargin:We,valueType:null,version:null,vAlign:null,vLink:null,vSpace:We,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:fn,disableRemotePlayback:fn,prefix:null,property:null,results:We,security:null,unselectable:null},space:"html",transform:nle}),P3e=p0({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:yo,accentHeight:We,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:We,amplitude:We,arabicForm:null,ascent:We,attributeName:null,attributeType:null,azimuth:We,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:We,by:null,calcMode:null,capHeight:We,className:fr,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:We,diffuseConstant:We,direction:null,display:null,dur:null,divisor:We,dominantBaseline:null,download:fn,dx:null,dy:null,edgeMode:null,editable:null,elevation:We,enableBackground:null,end:null,event:null,exponent:We,externalResourcesRequired:null,fill:null,fillOpacity:We,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ky,g2:ky,glyphName:ky,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:We,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:We,horizOriginX:We,horizOriginY:We,id:null,ideographic:We,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:We,k:We,k1:We,k2:We,k3:We,k4:We,kernelMatrix:yo,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:We,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:We,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:We,overlineThickness:We,paintOrder:null,panose1:null,path:null,pathLength:We,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:fr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:We,pointsAtY:We,pointsAtZ:We,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:yo,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:yo,rev:yo,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:yo,requiredFeatures:yo,requiredFonts:yo,requiredFormats:yo,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:We,specularExponent:We,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:We,strikethroughThickness:We,string:null,stroke:null,strokeDashArray:yo,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:We,strokeOpacity:We,strokeWidth:null,style:null,surfaceScale:We,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:yo,tabIndex:We,tableValues:null,target:null,targetX:We,targetY:We,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:yo,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:We,underlineThickness:We,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:We,values:null,vAlphabetic:We,vMathematical:We,vectorEffect:null,vHanging:We,vIdeographic:We,version:null,vertAdvY:We,vertOriginX:We,vertOriginY:We,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:We,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tle}),rle=p0({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),ile=p0({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:nle}),sle=p0({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),I3e={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},O3e=/[A-Z]/g,cV=/-[a-z]/g,F3e=/^data[-\w.:]+$/i;function M3e(e,t){const n=GF(t);let r=t,i=io;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&F3e.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(cV,R3e);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!cV.test(s)){let a=s.replace(O3e,L3e);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=T6}return new i(r,t)}function L3e(e){return"-"+e.toLowerCase()}function R3e(e){return e.charAt(1).toUpperCase()}const D3e=Zoe([ele,T3e,rle,ile,sle],"html"),P6=Zoe([ele,P3e,rle,ile,sle],"svg");function U3e(e){return e.join(" ").trim()}var I6={},uV=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,H3e=/\n/g,Q3e=/^\s*/,$3e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,z3e=/^:\s*/,V3e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,K3e=/^[;\s]*/,q3e=/^\s+|\s+$/g,W3e=`
`,dV="/",hV="*",zA="",G3e="comment",Y3e="declaration";function X3e(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var m=p.match(H3e);m&&(n+=m.length);var g=p.lastIndexOf(W3e);r=~g?p.length-g:r+p.length}function s(){var p={line:n,column:r};return function(m){return m.position=new a(p),u(),m}}function a(p){this.start=p,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(p){var m=new Error(t.source+":"+n+":"+r+": "+p);if(m.reason=p,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function c(p){var m=p.exec(e);if(m){var g=m[0];return i(g),e=e.slice(g.length),m}}function u(){c(Q3e)}function d(p){var m;for(p=p||[];m=h();)m!==!1&&p.push(m);return p}function h(){var p=s();if(!(dV!=e.charAt(0)||hV!=e.charAt(1))){for(var m=2;zA!=e.charAt(m)&&(hV!=e.charAt(m)||dV!=e.charAt(m+1));)++m;if(m+=2,zA===e.charAt(m-1))return o("End of comment missing");var g=e.slice(2,m-2);return r+=2,i(g),e=e.slice(m),r+=2,p({type:G3e,comment:g})}}function A(){var p=s(),m=c($3e);if(m){if(h(),!c(z3e))return o("property missing ':'");var g=c(V3e),y=p({type:Y3e,property:fV(m[0].replace(uV,zA)),value:g?fV(g[0].replace(uV,zA)):zA});return c(K3e),y}}function f(){var p=[];d(p);for(var m;m=A();)m!==!1&&(p.push(m),d(p));return p}return u(),f()}function fV(e){return e?e.replace(q3e,zA):zA}var J3e=X3e,Z3e=Dh&&Dh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(I6,"__esModule",{value:!0});I6.default=tFe;const eFe=Z3e(J3e);function tFe(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,eFe.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:a,value:o}=s;i?t(a,o,s):o&&(n=n||{},n[a]=o)}),n}var QE={};Object.defineProperty(QE,"__esModule",{value:!0});QE.camelCase=void 0;var nFe=/^--[a-zA-Z0-9_-]+$/,rFe=/-([a-z])/g,iFe=/^[^-]+$/,sFe=/^-(webkit|moz|ms|o|khtml)-/,aFe=/^-(ms)-/,oFe=function(e){return!e||iFe.test(e)||nFe.test(e)},lFe=function(e,t){return t.toUpperCase()},AV=function(e,t){return"".concat(t,"-")},cFe=function(e,t){return t===void 0&&(t={}),oFe(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(aFe,AV):e=e.replace(sFe,AV),e.replace(rFe,lFe))};QE.camelCase=cFe;var uFe=Dh&&Dh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},dFe=uFe(I6),hFe=QE;function JF(e,t){var n={};return!e||typeof e!="string"||(0,dFe.default)(e,function(r,i){r&&i&&(n[(0,hFe.camelCase)(r,t)]=i)}),n}JF.default=JF;var fFe=JF;const AFe=In(fFe),ale=ole("end"),O6=ole("start");function ole(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function pFe(e){const t=O6(e),n=ale(e);if(t&&n)return{start:t,end:n}}function Lw(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?pV(e.position):"start"in e||"end"in e?pV(e):"line"in e||"column"in e?ZF(e):""}function ZF(e){return mV(e&&e.line)+":"+mV(e&&e.column)}function pV(e){return ZF(e&&e.start)+"-"+ZF(e&&e.end)}function mV(e){return e&&typeof e=="number"?e:1}class sa extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},a=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(a=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?s.ruleId=r:(s.source=r.slice(0,c),s.ruleId=r.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const o=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Lw(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=a&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}sa.prototype.file="";sa.prototype.name="";sa.prototype.reason="";sa.prototype.message="";sa.prototype.stack="";sa.prototype.column=void 0;sa.prototype.line=void 0;sa.prototype.ancestors=void 0;sa.prototype.cause=void 0;sa.prototype.fatal=void 0;sa.prototype.place=void 0;sa.prototype.ruleId=void 0;sa.prototype.source=void 0;const F6={}.hasOwnProperty,mFe=new Map,gFe=/[A-Z]/g,yFe=new Set(["table","tbody","thead","tfoot","tr"]),vFe=new Set(["td","th"]),lle="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function xFe(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=BFe(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=jFe(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?P6:D3e,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=cle(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function cle(e,t,n){if(t.type==="element")return wFe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return bFe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return SFe(e,t,n);if(t.type==="mdxjsEsm")return CFe(e,t);if(t.type==="root")return kFe(e,t,n);if(t.type==="text")return _Fe(e,t)}function wFe(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=P6,e.schema=i),e.ancestors.push(t);const s=dle(e,t.tagName,!1),a=NFe(e,t);let o=L6(e,t);return yFe.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!N3e(c):!0})),ule(e,a,s,t),M6(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function bFe(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Yb(e,t.position)}function CFe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Yb(e,t.position)}function SFe(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=P6,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:dle(e,t.name,!0),a=EFe(e,t),o=L6(e,t);return ule(e,a,s,t),M6(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function kFe(e,t,n){const r={};return M6(r,L6(e,t)),e.create(t,e.Fragment,r,n)}function _Fe(e,t){return t.value}function ule(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function M6(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function jFe(e,t,n){return r;function r(i,s,a,o){const u=Array.isArray(a.children)?n:t;return o?u(s,a,o):u(s,a)}}function BFe(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),c=O6(r);return t(i,s,a,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function NFe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&F6.call(t.properties,i)){const s=TFe(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&vFe.has(t.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function EFe(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Yb(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else Yb(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function L6(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:mFe;for(;++r<t.children.length;){const s=t.children[r];let a;if(e.passKeys){const c=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(c){const u=i.get(c)||0;a=c+"-"+u,i.set(c,u+1)}}const o=cle(e,s,a);o!==void 0&&n.push(o)}return n}function TFe(e,t,n){const r=M3e(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?S3e(n):U3e(n)),r.property==="style"){let i=typeof n=="object"?n:PFe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=IFe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?I3e[r.property]||r.property:r.attribute,n]}}function PFe(e,t){try{return AFe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new sa("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=lle+"#cannot-parse-style-attribute",i}}function dle(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,a;for(;++s<i.length;){const o=aV(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(s&&o.type==="Literal"),optional:!1}:o}r=a}else r=aV(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return F6.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Yb(e)}function Yb(e,t){const n=new sa("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=lle+"#cannot-handle-mdx-estrees-without-createevaluater",n}function IFe(e){const t={};let n;for(n in e)F6.call(e,n)&&(t[OFe(n)]=e[n]);return t}function OFe(e){let t=e.replace(gFe,FFe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function FFe(e){return"-"+e.toLowerCase()}const yI={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},MFe={};function R6(e,t){const n=MFe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return hle(e,r,i)}function hle(e,t,n){if(LFe(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return gV(e.children,t,n)}return Array.isArray(e)?gV(e,t,n):""}function gV(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=hle(e[i],t,n);return r.join("")}function LFe(e){return!!(e&&typeof e=="object")}const yV=document.createElement("i");function D6(e){const t="&"+e+";";yV.innerHTML=t;const n=yV.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Lo(e,t,n,r){const i=e.length;let s=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);s<r.length;)a=r.slice(s,s+1e4),a.unshift(t,0),e.splice(...a),s+=1e4,t+=1e4}function ll(e,t){return e.length>0?(Lo(e,e.length,0,t),e):t}const vV={}.hasOwnProperty;function fle(e){const t={};let n=-1;for(;++n<e.length;)RFe(t,e[n]);return t}function RFe(e,t){let n;for(n in t){const i=(vV.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let a;if(s)for(a in s){vV.call(i,a)||(i[a]=[]);const o=s[a];DFe(i[a],Array.isArray(o)?o:o?[o]:[])}}}function DFe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Lo(e,0,0,r)}function Ale(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ac(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ya=Kf(/[A-Za-z]/),ea=Kf(/[\dA-Za-z]/),UFe=Kf(/[#-'*+\--9=?A-Z^-~]/);function Bj(e){return e!==null&&(e<32||e===127)}const eM=Kf(/\d/),HFe=Kf(/[\dA-Fa-f]/),QFe=Kf(/[!-/:-@[-`{-~]/);function Ut(e){return e!==null&&e<-2}function or(e){return e!==null&&(e<0||e===32)}function xn(e){return e===-2||e===-1||e===32}const $E=Kf(new RegExp("\\p{P}|\\p{S}","u")),Yp=Kf(/\s/);function Kf(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function m0(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let a="";if(s===37&&ea(e.charCodeAt(n+1))&&ea(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(a=String.fromCharCode(s));else if(s>55295&&s<57344){const o=e.charCodeAt(n+1);s<56320&&o>56319&&o<57344?(a=String.fromCharCode(s,o),i=1):a="�"}else a=String.fromCharCode(s);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Tn(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(c){return xn(c)?(e.enter(n),o(c)):t(c)}function o(c){return xn(c)&&s++<i?(e.consume(c),o):(e.exit(n),t(c))}}const $Fe={tokenize:zFe};function zFe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Tn(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),s(o)}function s(o){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return Ut(o)?(e.consume(o),e.exit("chunkText"),s):(e.consume(o),a)}}const VFe={tokenize:KFe},xV={tokenize:qFe};function KFe(e){const t=this,n=[];let r=0,i,s,a;return o;function o(x){if(r<n.length){const w=n[r];return t.containerState=w[1],e.attempt(w[0].continuation,c,u)(x)}return u(x)}function c(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const w=t.events.length;let b=w,k;for(;b--;)if(t.events[b][0]==="exit"&&t.events[b][1].type==="chunkFlow"){k=t.events[b][1].end;break}y(r);let j=w;for(;j<t.events.length;)t.events[j][1].end={...k},j++;return Lo(t.events,b+1,0,t.events.slice(w)),t.events.length=j,u(x)}return o(x)}function u(x){if(r===n.length){if(!i)return A(x);if(i.currentConstruct&&i.currentConstruct.concrete)return p(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(xV,d,h)(x)}function d(x){return i&&v(),y(r),A(x)}function h(x){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,p(x)}function A(x){return t.containerState={},e.attempt(xV,f,p)(x)}function f(x){return r++,n.push([t.currentConstruct,t.containerState]),A(x)}function p(x){if(x===null){i&&v(),y(0),e.consume(x);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),m(x)}function m(x){if(x===null){g(e.exit("chunkFlow"),!0),y(0),e.consume(x);return}return Ut(x)?(e.consume(x),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(x),m)}function g(x,w){const b=t.sliceStream(x);if(w&&b.push(null),x.previous=s,s&&(s.next=x),s=x,i.defineSkip(x.start),i.write(b),t.parser.lazy[x.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<a&&(!i.events[k][1].end||i.events[k][1].end.offset>a))return;const j=t.events.length;let B=j,E,I;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(E){I=t.events[B][1].end;break}E=!0}for(y(r),k=j;k<t.events.length;)t.events[k][1].end={...I},k++;Lo(t.events,B+1,0,t.events.slice(j)),t.events.length=k}}function y(x){let w=n.length;for(;w-- >x;){const b=n[w];t.containerState=b[1],b[0].exit.call(t,e)}n.length=x}function v(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function qFe(e,t,n){return Tn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function hv(e){if(e===null||or(e)||Yp(e))return 1;if($E(e))return 2}function zE(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const tM={name:"attention",resolveAll:WFe,tokenize:GFe};function WFe(e,t){let n=-1,r,i,s,a,o,c,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},A={...e[n][1].start};wV(h,-c),wV(A,c),a={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:A},s={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=ll(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=ll(u,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),u=ll(u,zE(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=ll(u,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=ll(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Lo(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function GFe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=hv(r);let s;return a;function a(c){return s=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===s)return e.consume(c),o;const u=e.exit("attentionSequence"),d=hv(c),h=!d||d===2&&i||n.includes(c),A=!i||i===2&&d||n.includes(r);return u._open=!!(s===42?h:h&&(i||!A)),u._close=!!(s===42?A:A&&(d||!h)),t(c)}}function wV(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const YFe={name:"autolink",tokenize:XFe};function XFe(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(f){return ya(f)?(e.consume(f),a):f===64?n(f):u(f)}function a(f){return f===43||f===45||f===46||ea(f)?(r=1,o(f)):u(f)}function o(f){return f===58?(e.consume(f),r=0,c):(f===43||f===45||f===46||ea(f))&&r++<32?(e.consume(f),o):(r=0,u(f))}function c(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Bj(f)?n(f):(e.consume(f),c)}function u(f){return f===64?(e.consume(f),d):UFe(f)?(e.consume(f),u):n(f)}function d(f){return ea(f)?h(f):n(f)}function h(f){return f===46?(e.consume(f),r=0,d):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):A(f)}function A(f){if((f===45||ea(f))&&r++<63){const p=f===45?A:h;return e.consume(f),p}return n(f)}}const I2={partial:!0,tokenize:JFe};function JFe(e,t,n){return r;function r(s){return xn(s)?Tn(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||Ut(s)?t(s):n(s)}}const ple={continuation:{tokenize:eMe},exit:tMe,name:"blockQuote",tokenize:ZFe};function ZFe(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),s}return n(a)}function s(a){return xn(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function eMe(e,t,n){const r=this;return i;function i(a){return xn(a)?Tn(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):s(a)}function s(a){return e.attempt(ple,t,n)(a)}}function tMe(e){e.exit("blockQuote")}const mle={name:"characterEscape",tokenize:nMe};function nMe(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return QFe(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const gle={name:"characterReference",tokenize:rMe};function rMe(e,t,n){const r=this;let i=0,s,a;return o;function o(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,a=ea,d(h))}function u(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,a=HFe,d):(e.enter("characterReferenceValue"),s=7,a=eM,d(h))}function d(h){if(h===59&&i){const A=e.exit("characterReferenceValue");return a===ea&&!D6(r.sliceSerialize(A))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(h)&&i++<s?(e.consume(h),d):n(h)}}const bV={partial:!0,tokenize:sMe},CV={concrete:!0,name:"codeFenced",tokenize:iMe};function iMe(e,t,n){const r=this,i={partial:!0,tokenize:b};let s=0,a=0,o;return c;function c(k){return u(k)}function u(k){const j=r.events[r.events.length-1];return s=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,o=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(k)}function d(k){return k===o?(a++,e.consume(k),d):a<3?n(k):(e.exit("codeFencedFenceSequence"),xn(k)?Tn(e,h,"whitespace")(k):h(k))}function h(k){return k===null||Ut(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(bV,m,w)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),A(k))}function A(k){return k===null||Ut(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(k)):xn(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Tn(e,f,"whitespace")(k)):k===96&&k===o?n(k):(e.consume(k),A)}function f(k){return k===null||Ut(k)?h(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||Ut(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(k)):k===96&&k===o?n(k):(e.consume(k),p)}function m(k){return e.attempt(i,w,g)(k)}function g(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),y}function y(k){return s>0&&xn(k)?Tn(e,v,"linePrefix",s+1)(k):v(k)}function v(k){return k===null||Ut(k)?e.check(bV,m,w)(k):(e.enter("codeFlowValue"),x(k))}function x(k){return k===null||Ut(k)?(e.exit("codeFlowValue"),v(k)):(e.consume(k),x)}function w(k){return e.exit("codeFenced"),t(k)}function b(k,j,B){let E=0;return I;function I(U){return k.enter("lineEnding"),k.consume(U),k.exit("lineEnding"),T}function T(U){return k.enter("codeFencedFence"),xn(U)?Tn(k,N,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):N(U)}function N(U){return U===o?(k.enter("codeFencedFenceSequence"),F(U)):B(U)}function F(U){return U===o?(E++,k.consume(U),F):E>=a?(k.exit("codeFencedFenceSequence"),xn(U)?Tn(k,L,"whitespace")(U):L(U)):B(U)}function L(U){return U===null||Ut(U)?(k.exit("codeFencedFence"),j(U)):B(U)}}}function sMe(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const vI={name:"codeIndented",tokenize:oMe},aMe={partial:!0,tokenize:lMe};function oMe(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Tn(e,s,"linePrefix",5)(u)}function s(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?a(u):n(u)}function a(u){return u===null?c(u):Ut(u)?e.attempt(aMe,a,c)(u):(e.enter("codeFlowValue"),o(u))}function o(u){return u===null||Ut(u)?(e.exit("codeFlowValue"),a(u)):(e.consume(u),o)}function c(u){return e.exit("codeIndented"),t(u)}}function lMe(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):Ut(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Tn(e,s,"linePrefix",5)(a)}function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):Ut(a)?i(a):n(a)}}const cMe={name:"codeText",previous:dMe,resolve:uMe,tokenize:hMe};function uMe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function dMe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function hMe(e,t,n){let r=0,i,s;return a;function a(h){return e.enter("codeText"),e.enter("codeTextSequence"),o(h)}function o(h){return h===96?(e.consume(h),r++,o):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(s=e.enter("codeTextSequence"),i=0,d(h)):Ut(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||Ut(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),u)}function d(h){return h===96?(e.consume(h),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",u(h))}}class fMe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&bx(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),bx(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),bx(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);bx(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);bx(this.left,n.reverse())}}}function bx(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function yle(e){const t={};let n=-1,r,i,s,a,o,c,u;const d=new fMe(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,s=0,s<c.length&&c[s][1].type==="lineEndingBlank"&&(s+=2),s<c.length&&c[s][1].type==="content"))for(;++s<c.length&&c[s][1].type!=="content";)c[s][1].type==="chunkText"&&(c[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,AMe(d,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(a=d.get(s),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=s);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},o=d.slice(i,n),o.unshift(r),d.splice(i,n-i+1,o))}}return Lo(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function AMe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,c=[],u={};let d,h,A=-1,f=n,p=0,m=0;const g=[m];for(;f;){for(;e.get(++i)[1]!==f;);s.push(i),f._tokenizer||(d=r.sliceStream(f),f.next||d.push(null),h&&a.defineSkip(f.start),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(d),f._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),h=f,f=f.next}for(f=n;++A<o.length;)o[A][0]==="exit"&&o[A-1][0]==="enter"&&o[A][1].type===o[A-1][1].type&&o[A][1].start.line!==o[A][1].end.line&&(m=A+1,g.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(a.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),A=g.length;A--;){const y=o.slice(g[A],g[A+1]),v=s.pop();c.push([v,v+y.length-1]),e.splice(v,2,y)}for(c.reverse(),A=-1;++A<c.length;)u[p+c[A][0]]=p+c[A][1],p+=c[A][1]-c[A][0]-1;return u}const pMe={resolve:gMe,tokenize:yMe},mMe={partial:!0,tokenize:vMe};function gMe(e){return yle(e),e}function yMe(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?s(o):Ut(o)?e.check(mMe,a,s)(o):(e.consume(o),i)}function s(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function vMe(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Tn(e,s,"linePrefix")}function s(a){if(a===null||Ut(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function vle(e,t,n,r,i,s,a,o,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return h;function h(y){return y===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(y),e.exit(s),A):y===null||y===32||y===41||Bj(y)?n(y):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),m(y))}function A(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(o),A(y)):y===null||y===60||Ut(y)?n(y):(e.consume(y),y===92?p:f)}function p(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function m(y){return!d&&(y===null||y===41||or(y))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(y)):d<u&&y===40?(e.consume(y),d++,m):y===41?(e.consume(y),d--,m):y===null||y===32||y===40||Bj(y)?n(y):(e.consume(y),y===92?g:m)}function g(y){return y===40||y===41||y===92?(e.consume(y),m):m(y)}}function xle(e,t,n,r,i,s){const a=this;let o=0,c;return u;function u(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(s),d}function d(f){return o>999||f===null||f===91||f===93&&!c||f===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):Ut(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===null||f===91||f===93||Ut(f)||o++>999?(e.exit("chunkString"),d(f)):(e.consume(f),c||(c=!xn(f)),f===92?A:h)}function A(f){return f===91||f===92||f===93?(e.consume(f),o++,h):h(f)}}function wle(e,t,n,r,i,s){let a;return o;function o(A){return A===34||A===39||A===40?(e.enter(r),e.enter(i),e.consume(A),e.exit(i),a=A===40?41:A,c):n(A)}function c(A){return A===a?(e.enter(i),e.consume(A),e.exit(i),e.exit(r),t):(e.enter(s),u(A))}function u(A){return A===a?(e.exit(s),c(a)):A===null?n(A):Ut(A)?(e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),Tn(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(A))}function d(A){return A===a||A===null||Ut(A)?(e.exit("chunkString"),u(A)):(e.consume(A),A===92?h:d)}function h(A){return A===a||A===92?(e.consume(A),d):d(A)}}function Rw(e,t){let n;return r;function r(i){return Ut(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):xn(i)?Tn(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const xMe={name:"definition",tokenize:bMe},wMe={partial:!0,tokenize:CMe};function bMe(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),a(f)}function a(f){return xle.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function o(f){return i=Ac(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),c):n(f)}function c(f){return or(f)?Rw(e,u)(f):u(f)}function u(f){return vle(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(wMe,h,h)(f)}function h(f){return xn(f)?Tn(e,A,"whitespace")(f):A(f)}function A(f){return f===null||Ut(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function CMe(e,t,n){return r;function r(o){return or(o)?Rw(e,i)(o):n(o)}function i(o){return wle(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return xn(o)?Tn(e,a,"whitespace")(o):a(o)}function a(o){return o===null||Ut(o)?t(o):n(o)}}const SMe={name:"hardBreakEscape",tokenize:kMe};function kMe(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return Ut(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const _Me={name:"headingAtx",resolve:jMe,tokenize:BMe};function jMe(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Lo(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function BMe(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),a(d)}function a(d){return d===35&&r++<6?(e.consume(d),a):d===null||or(d)?(e.exit("atxHeadingSequence"),o(d)):n(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Ut(d)?(e.exit("atxHeading"),t(d)):xn(d)?Tn(e,o,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),o(d))}function u(d){return d===null||d===35||or(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),u)}}const NMe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],SV=["pre","script","style","textarea"],EMe={concrete:!0,name:"htmlFlow",resolveTo:IMe,tokenize:OMe},TMe={partial:!0,tokenize:MMe},PMe={partial:!0,tokenize:FMe};function IMe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function OMe(e,t,n){const r=this;let i,s,a,o,c;return u;function u(M){return d(M)}function d(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),h}function h(M){return M===33?(e.consume(M),A):M===47?(e.consume(M),s=!0,m):M===63?(e.consume(M),i=3,r.interrupt?t:Q):ya(M)?(e.consume(M),a=String.fromCharCode(M),g):n(M)}function A(M){return M===45?(e.consume(M),i=2,f):M===91?(e.consume(M),i=5,o=0,p):ya(M)?(e.consume(M),i=4,r.interrupt?t:Q):n(M)}function f(M){return M===45?(e.consume(M),r.interrupt?t:Q):n(M)}function p(M){const Y="CDATA[";return M===Y.charCodeAt(o++)?(e.consume(M),o===Y.length?r.interrupt?t:N:p):n(M)}function m(M){return ya(M)?(e.consume(M),a=String.fromCharCode(M),g):n(M)}function g(M){if(M===null||M===47||M===62||or(M)){const Y=M===47,X=a.toLowerCase();return!Y&&!s&&SV.includes(X)?(i=1,r.interrupt?t(M):N(M)):NMe.includes(a.toLowerCase())?(i=6,Y?(e.consume(M),y):r.interrupt?t(M):N(M)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):s?v(M):x(M))}return M===45||ea(M)?(e.consume(M),a+=String.fromCharCode(M),g):n(M)}function y(M){return M===62?(e.consume(M),r.interrupt?t:N):n(M)}function v(M){return xn(M)?(e.consume(M),v):I(M)}function x(M){return M===47?(e.consume(M),I):M===58||M===95||ya(M)?(e.consume(M),w):xn(M)?(e.consume(M),x):I(M)}function w(M){return M===45||M===46||M===58||M===95||ea(M)?(e.consume(M),w):b(M)}function b(M){return M===61?(e.consume(M),k):xn(M)?(e.consume(M),b):x(M)}function k(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),c=M,j):xn(M)?(e.consume(M),k):B(M)}function j(M){return M===c?(e.consume(M),c=null,E):M===null||Ut(M)?n(M):(e.consume(M),j)}function B(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||or(M)?b(M):(e.consume(M),B)}function E(M){return M===47||M===62||xn(M)?x(M):n(M)}function I(M){return M===62?(e.consume(M),T):n(M)}function T(M){return M===null||Ut(M)?N(M):xn(M)?(e.consume(M),T):n(M)}function N(M){return M===45&&i===2?(e.consume(M),H):M===60&&i===1?(e.consume(M),K):M===62&&i===4?(e.consume(M),oe):M===63&&i===3?(e.consume(M),Q):M===93&&i===5?(e.consume(M),z):Ut(M)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(TMe,R,F)(M)):M===null||Ut(M)?(e.exit("htmlFlowData"),F(M)):(e.consume(M),N)}function F(M){return e.check(PMe,L,R)(M)}function L(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),U}function U(M){return M===null||Ut(M)?F(M):(e.enter("htmlFlowData"),N(M))}function H(M){return M===45?(e.consume(M),Q):N(M)}function K(M){return M===47?(e.consume(M),a="",$):N(M)}function $(M){if(M===62){const Y=a.toLowerCase();return SV.includes(Y)?(e.consume(M),oe):N(M)}return ya(M)&&a.length<8?(e.consume(M),a+=String.fromCharCode(M),$):N(M)}function z(M){return M===93?(e.consume(M),Q):N(M)}function Q(M){return M===62?(e.consume(M),oe):M===45&&i===2?(e.consume(M),Q):N(M)}function oe(M){return M===null||Ut(M)?(e.exit("htmlFlowData"),R(M)):(e.consume(M),oe)}function R(M){return e.exit("htmlFlow"),t(M)}}function FMe(e,t,n){const r=this;return i;function i(a){return Ut(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):n(a)}function s(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function MMe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(I2,t,n)}}const LMe={name:"htmlText",tokenize:RMe};function RMe(e,t,n){const r=this;let i,s,a;return o;function o(Q){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(Q),c}function c(Q){return Q===33?(e.consume(Q),u):Q===47?(e.consume(Q),b):Q===63?(e.consume(Q),x):ya(Q)?(e.consume(Q),B):n(Q)}function u(Q){return Q===45?(e.consume(Q),d):Q===91?(e.consume(Q),s=0,p):ya(Q)?(e.consume(Q),v):n(Q)}function d(Q){return Q===45?(e.consume(Q),f):n(Q)}function h(Q){return Q===null?n(Q):Q===45?(e.consume(Q),A):Ut(Q)?(a=h,K(Q)):(e.consume(Q),h)}function A(Q){return Q===45?(e.consume(Q),f):h(Q)}function f(Q){return Q===62?H(Q):Q===45?A(Q):h(Q)}function p(Q){const oe="CDATA[";return Q===oe.charCodeAt(s++)?(e.consume(Q),s===oe.length?m:p):n(Q)}function m(Q){return Q===null?n(Q):Q===93?(e.consume(Q),g):Ut(Q)?(a=m,K(Q)):(e.consume(Q),m)}function g(Q){return Q===93?(e.consume(Q),y):m(Q)}function y(Q){return Q===62?H(Q):Q===93?(e.consume(Q),y):m(Q)}function v(Q){return Q===null||Q===62?H(Q):Ut(Q)?(a=v,K(Q)):(e.consume(Q),v)}function x(Q){return Q===null?n(Q):Q===63?(e.consume(Q),w):Ut(Q)?(a=x,K(Q)):(e.consume(Q),x)}function w(Q){return Q===62?H(Q):x(Q)}function b(Q){return ya(Q)?(e.consume(Q),k):n(Q)}function k(Q){return Q===45||ea(Q)?(e.consume(Q),k):j(Q)}function j(Q){return Ut(Q)?(a=j,K(Q)):xn(Q)?(e.consume(Q),j):H(Q)}function B(Q){return Q===45||ea(Q)?(e.consume(Q),B):Q===47||Q===62||or(Q)?E(Q):n(Q)}function E(Q){return Q===47?(e.consume(Q),H):Q===58||Q===95||ya(Q)?(e.consume(Q),I):Ut(Q)?(a=E,K(Q)):xn(Q)?(e.consume(Q),E):H(Q)}function I(Q){return Q===45||Q===46||Q===58||Q===95||ea(Q)?(e.consume(Q),I):T(Q)}function T(Q){return Q===61?(e.consume(Q),N):Ut(Q)?(a=T,K(Q)):xn(Q)?(e.consume(Q),T):E(Q)}function N(Q){return Q===null||Q===60||Q===61||Q===62||Q===96?n(Q):Q===34||Q===39?(e.consume(Q),i=Q,F):Ut(Q)?(a=N,K(Q)):xn(Q)?(e.consume(Q),N):(e.consume(Q),L)}function F(Q){return Q===i?(e.consume(Q),i=void 0,U):Q===null?n(Q):Ut(Q)?(a=F,K(Q)):(e.consume(Q),F)}function L(Q){return Q===null||Q===34||Q===39||Q===60||Q===61||Q===96?n(Q):Q===47||Q===62||or(Q)?E(Q):(e.consume(Q),L)}function U(Q){return Q===47||Q===62||or(Q)?E(Q):n(Q)}function H(Q){return Q===62?(e.consume(Q),e.exit("htmlTextData"),e.exit("htmlText"),t):n(Q)}function K(Q){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(Q),e.exit("lineEnding"),$}function $(Q){return xn(Q)?Tn(e,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Q):z(Q)}function z(Q){return e.enter("htmlTextData"),a(Q)}}const U6={name:"labelEnd",resolveAll:QMe,resolveTo:$Me,tokenize:zMe},DMe={tokenize:VMe},UMe={tokenize:KMe},HMe={tokenize:qMe};function QMe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Lo(e,0,e.length,n),e}function $Me(e,t){let n=e.length,r=0,i,s,a,o;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(a=n);const c={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[a][1].end}},d={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",c,t],["enter",u,t]],o=ll(o,e.slice(s+1,s+r+3)),o=ll(o,[["enter",d,t]]),o=ll(o,zE(t.parser.constructs.insideSpan.null,e.slice(s+r+4,a-3),t)),o=ll(o,[["exit",d,t],e[a-2],e[a-1],["exit",u,t]]),o=ll(o,e.slice(a+1)),o=ll(o,[["exit",c,t]]),Lo(e,s,e.length,o),e}function zMe(e,t,n){const r=this;let i=r.events.length,s,a;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return o;function o(A){return s?s._inactive?h(A):(a=r.parser.defined.includes(Ac(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(A),e.exit("labelMarker"),e.exit("labelEnd"),c):n(A)}function c(A){return A===40?e.attempt(DMe,d,a?d:h)(A):A===91?e.attempt(UMe,d,a?u:h)(A):a?d(A):h(A)}function u(A){return e.attempt(HMe,d,h)(A)}function d(A){return t(A)}function h(A){return s._balanced=!0,n(A)}}function VMe(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return or(h)?Rw(e,s)(h):s(h)}function s(h){return h===41?d(h):vle(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function a(h){return or(h)?Rw(e,c)(h):d(h)}function o(h){return n(h)}function c(h){return h===34||h===39||h===40?wle(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function u(h){return or(h)?Rw(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function KMe(e,t,n){const r=this;return i;function i(o){return xle.call(r,e,s,a,"reference","referenceMarker","referenceString")(o)}function s(o){return r.parser.defined.includes(Ac(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function qMe(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const WMe={name:"labelStartImage",resolveAll:U6.resolveAll,tokenize:GMe};function GMe(e,t,n){const r=this;return i;function i(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),s}function s(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),a):n(o)}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const YMe={name:"labelStartLink",resolveAll:U6.resolveAll,tokenize:XMe};function XMe(e,t,n){const r=this;return i;function i(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),s}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const xI={name:"lineEnding",tokenize:JMe};function JMe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Tn(e,t,"linePrefix")}}const u_={name:"thematicBreak",tokenize:ZMe};function ZMe(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),a(u)}function a(u){return i=u,o(u)}function o(u){return u===i?(e.enter("thematicBreakSequence"),c(u)):r>=3&&(u===null||Ut(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===i?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),xn(u)?Tn(e,o,"whitespace")(u):o(u))}}const La={continuation:{tokenize:rLe},exit:sLe,name:"list",tokenize:nLe},eLe={partial:!0,tokenize:aLe},tLe={partial:!0,tokenize:iLe};function nLe(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(f){const p=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:eM(f)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(u_,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(f)}return n(f)}function c(f){return eM(f)&&++a<10?(e.consume(f),c):(!r.interrupt||a<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(I2,r.interrupt?n:d,e.attempt(eLe,A,h))}function d(f){return r.containerState.initialBlankLine=!0,s++,A(f)}function h(f){return xn(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),A):n(f)}function A(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function rLe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(I2,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Tn(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!xn(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(tLe,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Tn(e,e.attempt(La,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function iLe(e,t,n){const r=this;return Tn(e,i,"listItemIndent",r.containerState.size+1);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(s):n(s)}}function sLe(e){e.exit(this.containerState.type)}function aLe(e,t,n){const r=this;return Tn(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const a=r.events[r.events.length-1];return!xn(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const kV={name:"setextUnderline",resolveTo:oLe,tokenize:lLe};function oLe(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",a,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function lLe(e,t,n){const r=this;let i;return s;function s(u){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=u,a(u)):n(u)}function a(u){return e.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===i?(e.consume(u),o):(e.exit("setextHeadingLineSequence"),xn(u)?Tn(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ut(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const cLe={tokenize:uLe};function uLe(e){const t=this,n=e.attempt(I2,r,e.attempt(this.parser.constructs.flowInitial,i,Tn(e,e.attempt(this.parser.constructs.flow,i,e.attempt(pMe,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const dLe={resolveAll:Cle()},hLe=ble("string"),fLe=ble("text");function ble(e){return{resolveAll:Cle(e==="text"?ALe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(d){return u(d)?s(d):o(d)}function o(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),s(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const h=i[d];let A=-1;if(h)for(;++A<h.length;){const f=h[A];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function Cle(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function ALe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,a=-1,o=0,c;for(;s--;){const u=i[s];if(typeof u=="string"){for(a=u.length;u.charCodeAt(a-1)===32;)o++,a--;if(a)break;a=-1}else if(u===-2)c=!0,o++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const u={type:n===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?a:r.start._bufferIndex+a,_index:r.start._index+s,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const pLe={42:La,43:La,45:La,48:La,49:La,50:La,51:La,52:La,53:La,54:La,55:La,56:La,57:La,62:ple},mLe={91:xMe},gLe={[-2]:vI,[-1]:vI,32:vI},yLe={35:_Me,42:u_,45:[kV,u_],60:EMe,61:kV,95:u_,96:CV,126:CV},vLe={38:gle,92:mle},xLe={[-5]:xI,[-4]:xI,[-3]:xI,33:WMe,38:gle,42:tM,60:[YFe,LMe],91:YMe,92:[SMe,mle],93:U6,95:tM,96:cMe},wLe={null:[tM,dLe]},bLe={null:[42,95]},CLe={null:[]},SLe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:bLe,contentInitial:mLe,disable:CLe,document:pLe,flow:yLe,flowInitial:gLe,insideSpan:wLe,string:vLe,text:xLe},Symbol.toStringTag,{value:"Module"}));function kLe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let a=[],o=[];const c={attempt:j(b),check:j(k),consume:v,enter:x,exit:w,interrupt:j(k,{interrupt:!0})},u={code:null,containerState:{},defineSkip:m,events:[],now:p,parser:e,previous:null,sliceSerialize:A,sliceStream:f,write:h};let d=t.tokenize.call(u,c);return t.resolveAll&&s.push(t),u;function h(T){return a=ll(a,T),g(),a[a.length-1]!==null?[]:(B(t,0),u.events=zE(s,u.events,u),u.events)}function A(T,N){return jLe(f(T),N)}function f(T){return _Le(a,T)}function p(){const{_bufferIndex:T,_index:N,line:F,column:L,offset:U}=r;return{_bufferIndex:T,_index:N,line:F,column:L,offset:U}}function m(T){i[T.line]=T.column,I()}function g(){let T;for(;r._index<a.length;){const N=a[r._index];if(typeof N=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<N.length;)y(N.charCodeAt(r._bufferIndex));else y(N)}}function y(T){d=d(T)}function v(T){Ut(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,I()):T!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=T}function x(T,N){const F=N||{};return F.type=T,F.start=p(),u.events.push(["enter",F,u]),o.push(F),F}function w(T){const N=o.pop();return N.end=p(),u.events.push(["exit",N,u]),N}function b(T,N){B(T,N.from)}function k(T,N){N.restore()}function j(T,N){return F;function F(L,U,H){let K,$,z,Q;return Array.isArray(L)?R(L):"tokenize"in L?R([L]):oe(L);function oe(q){return Z;function Z(de){const ue=de!==null&&q[de],ae=de!==null&&q.null,he=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(ae)?ae:ae?[ae]:[]];return R(he)(de)}}function R(q){return K=q,$=0,q.length===0?H:M(q[$])}function M(q){return Z;function Z(de){return Q=E(),z=q,q.partial||(u.currentConstruct=q),q.name&&u.parser.constructs.disable.null.includes(q.name)?X():q.tokenize.call(N?Object.assign(Object.create(u),N):u,c,Y,X)(de)}}function Y(q){return T(z,Q),U}function X(q){return Q.restore(),++$<K.length?M(K[$]):H}}}function B(T,N){T.resolveAll&&!s.includes(T)&&s.push(T),T.resolve&&Lo(u.events,N,u.events.length-N,T.resolve(u.events.slice(N),u)),T.resolveTo&&(u.events=T.resolveTo(u.events,u))}function E(){const T=p(),N=u.previous,F=u.currentConstruct,L=u.events.length,U=Array.from(o);return{from:L,restore:H};function H(){r=T,u.previous=N,u.currentConstruct=F,u.events.length=L,o=U,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function _Le(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,s)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}s>0&&a.push(e[i].slice(0,s))}return a}function jLe(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let a;if(typeof s=="string")a=s;else switch(s){case-5:{a="\r";break}case-4:{a=`
`;break}case-3:{a=`\r
`;break}case-2:{a=t?" ":"	";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(s)}i=s===-2,r.push(a)}return r.join("")}function BLe(e){const r={constructs:fle([SLe,...(e||{}).extensions||[]]),content:i($Fe),defined:[],document:i(VFe),flow:i(cLe),lazy:{},string:i(hLe),text:i(fLe)};return r;function i(s){return a;function a(o){return kLe(r,s,o)}}}function NLe(e){for(;!yle(e););return e}const _V=/[\0\t\n\r]/g;function ELe(){let e=1,t="",n=!0,r;return i;function i(s,a,o){const c=[];let u,d,h,A,f;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(a||void 0).decode(s)),h=0,t="",n&&(s.charCodeAt(0)===65279&&h++,n=void 0);h<s.length;){if(_V.lastIndex=h,u=_V.exec(s),A=u&&u.index!==void 0?u.index:s.length,f=s.charCodeAt(A),!u){t=s.slice(h);break}if(f===10&&h===A&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),h<A&&(c.push(s.slice(h,A)),e+=A-h),f){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}h=A+1}return o&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const TLe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function PLe(e){return e.replace(TLe,ILe)}function ILe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Ale(n.slice(s?2:1),s?16:10)}return D6(n)||e}const Sle={}.hasOwnProperty;function OLe(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),FLe(n)(NLe(BLe(n).document().write(ELe()(e,t,!0))))}function FLe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Te),autolinkProtocol:E,autolinkEmail:E,atxHeading:s(te),blockQuote:s(ae),characterEscape:E,characterReference:E,codeFenced:s(he),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:s(he,a),codeText:s(ie,a),codeTextData:E,data:E,codeFlowValue:E,definition:s(Ce),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:s(Oe),hardBreakEscape:s(je),hardBreakTrailing:s(je),htmlFlow:s(tt,a),htmlFlowData:E,htmlText:s(tt,a),htmlTextData:E,image:s(nt),label:a,link:s(Te),listItem:s(we),listItemValue:A,listOrdered:s(ct,h),listUnordered:s(ct),paragraph:s($e),reference:M,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:s(te),strong:s(Ve),thematicBreak:s(yt)},exit:{atxHeading:c(),atxHeadingSequence:b,autolink:c(),autolinkEmail:ue,autolinkProtocol:de,blockQuote:c(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:q,characterReference:Z,codeFenced:c(g),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:I,codeIndented:c(y),codeText:c(U),codeTextData:I,data:I,definition:c(),definitionDestinationString:w,definitionLabelString:v,definitionTitleString:x,emphasis:c(),hardBreakEscape:c(N),hardBreakTrailing:c(N),htmlFlow:c(F),htmlFlowData:I,htmlText:c(L),htmlTextData:I,image:c(K),label:z,labelText:$,lineEnding:T,link:c(H),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Y,resourceDestinationString:Q,resourceTitleString:oe,resource:R,setextHeading:c(B),setextHeadingLineSequence:j,setextHeadingText:k,strong:c(),thematicBreak:c()}};kle(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ye){let Be={type:"root",children:[]};const Ge={stack:[Be],tokenStack:[],config:t,enter:o,exit:u,buffer:a,resume:d,data:n},Ue=[];let Ye=-1;for(;++Ye<ye.length;)if(ye[Ye][1].type==="listOrdered"||ye[Ye][1].type==="listUnordered")if(ye[Ye][0]==="enter")Ue.push(Ye);else{const pe=Ue.pop();Ye=i(ye,pe,Ye)}for(Ye=-1;++Ye<ye.length;){const pe=t[ye[Ye][0]];Sle.call(pe,ye[Ye][1].type)&&pe[ye[Ye][1].type].call(Object.assign({sliceSerialize:ye[Ye][2].sliceSerialize},Ge),ye[Ye][1])}if(Ge.tokenStack.length>0){const pe=Ge.tokenStack[Ge.tokenStack.length-1];(pe[1]||jV).call(Ge,void 0,pe[0])}for(Be.position={start:eh(ye.length>0?ye[0][1].start:{line:1,column:1,offset:0}),end:eh(ye.length>0?ye[ye.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye<t.transforms.length;)Be=t.transforms[Ye](Be)||Be;return Be}function i(ye,Be,Ge){let Ue=Be-1,Ye=-1,pe=!1,bt,mt,_t,Rt;for(;++Ue<=Ge;){const Wt=ye[Ue];switch(Wt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Wt[0]==="enter"?Ye++:Ye--,Rt=void 0;break}case"lineEndingBlank":{Wt[0]==="enter"&&(bt&&!Rt&&!Ye&&!_t&&(_t=Ue),Rt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Rt=void 0}if(!Ye&&Wt[0]==="enter"&&Wt[1].type==="listItemPrefix"||Ye===-1&&Wt[0]==="exit"&&(Wt[1].type==="listUnordered"||Wt[1].type==="listOrdered")){if(bt){let vt=Ue;for(mt=void 0;vt--;){const Dt=ye[vt];if(Dt[1].type==="lineEnding"||Dt[1].type==="lineEndingBlank"){if(Dt[0]==="exit")continue;mt&&(ye[mt][1].type="lineEndingBlank",pe=!0),Dt[1].type="lineEnding",mt=vt}else if(!(Dt[1].type==="linePrefix"||Dt[1].type==="blockQuotePrefix"||Dt[1].type==="blockQuotePrefixWhitespace"||Dt[1].type==="blockQuoteMarker"||Dt[1].type==="listItemIndent"))break}_t&&(!mt||_t<mt)&&(bt._spread=!0),bt.end=Object.assign({},mt?ye[mt][1].start:Wt[1].end),ye.splice(mt||Ue,0,["exit",bt,Wt[2]]),Ue++,Ge++}if(Wt[1].type==="listItemPrefix"){const vt={type:"listItem",_spread:!1,start:Object.assign({},Wt[1].start),end:void 0};bt=vt,ye.splice(Ue,0,["enter",vt,Wt[2]]),Ue++,Ge++,_t=void 0,Rt=!0}}}return ye[Be][1]._spread=pe,Ge}function s(ye,Be){return Ge;function Ge(Ue){o.call(this,ye(Ue),Ue),Be&&Be.call(this,Ue)}}function a(){this.stack.push({type:"fragment",children:[]})}function o(ye,Be,Ge){this.stack[this.stack.length-1].children.push(ye),this.stack.push(ye),this.tokenStack.push([Be,Ge||void 0]),ye.position={start:eh(Be.start),end:void 0}}function c(ye){return Be;function Be(Ge){ye&&ye.call(this,Ge),u.call(this,Ge)}}function u(ye,Be){const Ge=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==ye.type&&(Be?Be.call(this,ye,Ue[0]):(Ue[1]||jV).call(this,ye,Ue[0]));else throw new Error("Cannot close `"+ye.type+"` ("+Lw({start:ye.start,end:ye.end})+"): it’s not open");Ge.position.end=eh(ye.end)}function d(){return R6(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function A(ye){if(this.data.expectingFirstListItemValue){const Be=this.stack[this.stack.length-2];Be.start=Number.parseInt(this.sliceSerialize(ye),10),this.data.expectingFirstListItemValue=void 0}}function f(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.lang=ye}function p(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.meta=ye}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.value=ye.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.value=ye.replace(/(\r?\n|\r)$/g,"")}function v(ye){const Be=this.resume(),Ge=this.stack[this.stack.length-1];Ge.label=Be,Ge.identifier=Ac(this.sliceSerialize(ye)).toLowerCase()}function x(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.title=ye}function w(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.url=ye}function b(ye){const Be=this.stack[this.stack.length-1];if(!Be.depth){const Ge=this.sliceSerialize(ye).length;Be.depth=Ge}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function j(ye){const Be=this.stack[this.stack.length-1];Be.depth=this.sliceSerialize(ye).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function E(ye){const Ge=this.stack[this.stack.length-1].children;let Ue=Ge[Ge.length-1];(!Ue||Ue.type!=="text")&&(Ue=$t(),Ue.position={start:eh(ye.start),end:void 0},Ge.push(Ue)),this.stack.push(Ue)}function I(ye){const Be=this.stack.pop();Be.value+=this.sliceSerialize(ye),Be.position.end=eh(ye.end)}function T(ye){const Be=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ge=Be.children[Be.children.length-1];Ge.position.end=eh(ye.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Be.type)&&(E.call(this,ye),I.call(this,ye))}function N(){this.data.atHardBreak=!0}function F(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.value=ye}function L(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.value=ye}function U(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.value=ye}function H(){const ye=this.stack[this.stack.length-1];if(this.data.inReference){const Be=this.data.referenceType||"shortcut";ye.type+="Reference",ye.referenceType=Be,delete ye.url,delete ye.title}else delete ye.identifier,delete ye.label;this.data.referenceType=void 0}function K(){const ye=this.stack[this.stack.length-1];if(this.data.inReference){const Be=this.data.referenceType||"shortcut";ye.type+="Reference",ye.referenceType=Be,delete ye.url,delete ye.title}else delete ye.identifier,delete ye.label;this.data.referenceType=void 0}function $(ye){const Be=this.sliceSerialize(ye),Ge=this.stack[this.stack.length-2];Ge.label=PLe(Be),Ge.identifier=Ac(Be).toLowerCase()}function z(){const ye=this.stack[this.stack.length-1],Be=this.resume(),Ge=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ge.type==="link"){const Ue=ye.children;Ge.children=Ue}else Ge.alt=Be}function Q(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.url=ye}function oe(){const ye=this.resume(),Be=this.stack[this.stack.length-1];Be.title=ye}function R(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function Y(ye){const Be=this.resume(),Ge=this.stack[this.stack.length-1];Ge.label=Be,Ge.identifier=Ac(this.sliceSerialize(ye)).toLowerCase(),this.data.referenceType="full"}function X(ye){this.data.characterReferenceType=ye.type}function q(ye){const Be=this.sliceSerialize(ye),Ge=this.data.characterReferenceType;let Ue;Ge?(Ue=Ale(Be,Ge==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=D6(Be);const Ye=this.stack[this.stack.length-1];Ye.value+=Ue}function Z(ye){const Be=this.stack.pop();Be.position.end=eh(ye.end)}function de(ye){I.call(this,ye);const Be=this.stack[this.stack.length-1];Be.url=this.sliceSerialize(ye)}function ue(ye){I.call(this,ye);const Be=this.stack[this.stack.length-1];Be.url="mailto:"+this.sliceSerialize(ye)}function ae(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function ie(){return{type:"inlineCode",value:""}}function Ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Oe(){return{type:"emphasis",children:[]}}function te(){return{type:"heading",depth:0,children:[]}}function je(){return{type:"break"}}function tt(){return{type:"html",value:""}}function nt(){return{type:"image",title:null,url:"",alt:null}}function Te(){return{type:"link",title:null,url:"",children:[]}}function ct(ye){return{type:"list",ordered:ye.type==="listOrdered",start:null,spread:ye._spread,children:[]}}function we(ye){return{type:"listItem",spread:ye._spread,checked:null,children:[]}}function $e(){return{type:"paragraph",children:[]}}function Ve(){return{type:"strong",children:[]}}function $t(){return{type:"text",value:""}}function yt(){return{type:"thematicBreak"}}}function eh(e){return{line:e.line,column:e.column,offset:e.offset}}function kle(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?kle(e,r):MLe(e,r)}}function MLe(e,t){let n;for(n in t)if(Sle.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function jV(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Lw({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Lw({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Lw({start:t.start,end:t.end})+") is still open")}function LLe(e){const t=this;t.parser=n;function n(r){return OLe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function RLe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function DLe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function ULe(e,t){const n=t.value?t.value+`
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function HLe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function QLe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $Le(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=m0(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let a,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=s+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function zLe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function VLe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function _le(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function KLe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _le(e,t);const i={src:m0(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function qLe(e,t){const n={src:m0(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function WLe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function GLe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return _le(e,t);const i={href:m0(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function YLe(e,t){const n={href:m0(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function XLe(e,t,n){const r=e.all(t),i=n?JLe(n):jle(t),s={},a=[];if(typeof t.checked=="boolean"){const d=r[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o<r.length;){const d=r[o];(i||o!==0||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
`}),d.type==="element"&&d.tagName==="p"&&!i?a.push(...d.children):a.push(d)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&a.push({type:"text",value:`
`});const u={type:"element",tagName:"li",properties:s,children:a};return e.patch(t,u),e.applyData(t,u)}function JLe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=jle(n[r])}return t}function jle(e){const t=e.spread;return t??e.children.length>1}function ZLe(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const a=r[i];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function eRe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tRe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function nRe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rRe(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),i.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=O6(t.children[1]),c=ale(t.children[t.children.length-1]);o&&c&&(a.position={start:o,end:c}),i.push(a)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function iRe(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,o=a?a.length:t.children.length;let c=-1;const u=[];for(;++c<o;){const h=t.children[c],A={},f=a?a[c]:void 0;f&&(A.align=f);let p={type:"element",tagName:s,properties:A,children:[]};h&&(p.children=e.all(h),e.patch(h,p),p=e.applyData(h,p)),u.push(p)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,d),e.applyData(t,d)}function sRe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const BV=9,NV=32;function aRe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(EV(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(EV(t.slice(i),i>0,!1)),s.join("")}function EV(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===BV||s===NV;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===BV||s===NV;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function oRe(e,t){const n={type:"text",value:aRe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function lRe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const cRe={blockquote:RLe,break:DLe,code:ULe,delete:HLe,emphasis:QLe,footnoteReference:$Le,heading:zLe,html:VLe,imageReference:KLe,image:qLe,inlineCode:WLe,linkReference:GLe,link:YLe,listItem:XLe,list:ZLe,paragraph:eRe,root:tRe,strong:nRe,table:rRe,tableCell:sRe,tableRow:iRe,text:oRe,thematicBreak:lRe,toml:SS,yaml:SS,definition:SS,footnoteDefinition:SS};function SS(){}const Ble=-1,VE=0,Dw=1,Nj=2,H6=3,Q6=4,$6=5,z6=6,Nle=7,Ele=8,TV=typeof self=="object"?self:globalThis,uRe=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,a]=t[i];switch(s){case VE:case Ble:return n(a,i);case Dw:{const o=n([],i);for(const c of a)o.push(r(c));return o}case Nj:{const o=n({},i);for(const[c,u]of a)o[r(c)]=r(u);return o}case H6:return n(new Date(a),i);case Q6:{const{source:o,flags:c}=a;return n(new RegExp(o,c),i)}case $6:{const o=n(new Map,i);for(const[c,u]of a)o.set(r(c),r(u));return o}case z6:{const o=n(new Set,i);for(const c of a)o.add(r(c));return o}case Nle:{const{name:o,message:c}=a;return n(new TV[o](c),i)}case Ele:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:o}=new Uint8Array(a);return n(new DataView(o),a)}}return n(new TV[s](a),i)};return r},PV=e=>uRe(new Map,e)(0),og="",{toString:dRe}={},{keys:hRe}=Object,Cx=e=>{const t=typeof e;if(t!=="object"||!e)return[VE,t];const n=dRe.call(e).slice(8,-1);switch(n){case"Array":return[Dw,og];case"Object":return[Nj,og];case"Date":return[H6,og];case"RegExp":return[Q6,og];case"Map":return[$6,og];case"Set":return[z6,og];case"DataView":return[Dw,n]}return n.includes("Array")?[Dw,n]:n.includes("Error")?[Nle,n]:[Nj,n]},kS=([e,t])=>e===VE&&(t==="function"||t==="symbol"),fRe=(e,t,n,r)=>{const i=(a,o)=>{const c=r.push(a)-1;return n.set(o,c),c},s=a=>{if(n.has(a))return n.get(a);let[o,c]=Cx(a);switch(o){case VE:{let d=a;switch(c){case"bigint":o=Ele,d=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([Ble],a)}return i([o,d],a)}case Dw:{if(c){let A=a;return c==="DataView"?A=new Uint8Array(a.buffer):c==="ArrayBuffer"&&(A=new Uint8Array(a)),i([c,[...A]],a)}const d=[],h=i([o,d],a);for(const A of a)d.push(s(A));return h}case Nj:{if(c)switch(c){case"BigInt":return i([c,a.toString()],a);case"Boolean":case"Number":case"String":return i([c,a.valueOf()],a)}if(t&&"toJSON"in a)return s(a.toJSON());const d=[],h=i([o,d],a);for(const A of hRe(a))(e||!kS(Cx(a[A])))&&d.push([s(A),s(a[A])]);return h}case H6:return i([o,a.toISOString()],a);case Q6:{const{source:d,flags:h}=a;return i([o,{source:d,flags:h}],a)}case $6:{const d=[],h=i([o,d],a);for(const[A,f]of a)(e||!(kS(Cx(A))||kS(Cx(f))))&&d.push([s(A),s(f)]);return h}case z6:{const d=[],h=i([o,d],a);for(const A of a)(e||!kS(Cx(A)))&&d.push(s(A));return h}}const{message:u}=a;return i([o,{name:c,message:u}],a)};return s},IV=(e,{json:t,lossy:n}={})=>{const r=[];return fRe(!(t||n),!!t,new Map,r)(e),r},Ej=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?PV(IV(e,t)):structuredClone(e):(e,t)=>PV(IV(e,t));function ARe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function pRe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function mRe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ARe,r=e.options.footnoteBackLabel||pRe,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[c]);if(!u)continue;const d=e.all(u),h=String(u.identifier).toUpperCase(),A=m0(h.toLowerCase());let f=0;const p=[],m=e.footnoteCounts.get(h);for(;m!==void 0&&++f<=m;){p.length>0&&p.push({type:"text",value:" "});let v=typeof n=="string"?n:n(c,f);typeof v=="string"&&(v={type:"text",value:v}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+A+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,f),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const g=d[d.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const v=g.children[g.children.length-1];v&&v.type==="text"?v.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...p)}else d.push(...p);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+A},children:e.wrap(d,!0)};e.patch(u,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Ej(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:`
`}]}}const KE=function(e){if(e==null)return xRe;if(typeof e=="function")return qE(e);if(typeof e=="object")return Array.isArray(e)?gRe(e):yRe(e);if(typeof e=="string")return vRe(e);throw new Error("Expected function, string, or object as test")};function gRe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=KE(e[n]);return qE(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function yRe(e){const t=e;return qE(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function vRe(e){return qE(t);function t(n){return n&&n.type===e}}function qE(e){return t;function t(n,r,i){return!!(wRe(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function xRe(){return!0}function wRe(e){return e!==null&&typeof e=="object"&&"type"in e}const Tle=[],bRe=!0,nM=!1,CRe="skip";function Ple(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=KE(i),a=r?-1:1;o(e,void 0,[])();function o(c,u,d){const h=c&&typeof c=="object"?c:{};if(typeof h.type=="string"){const f=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(A,"name",{value:"node ("+(c.type+(f?"<"+f+">":""))+")"})}return A;function A(){let f=Tle,p,m,g;if((!t||s(c,u,d[d.length-1]||void 0))&&(f=SRe(n(c,d)),f[0]===nM))return f;if("children"in c&&c.children){const y=c;if(y.children&&f[0]!==CRe)for(m=(r?y.children.length:-1)+a,g=d.concat(y);m>-1&&m<y.children.length;){const v=y.children[m];if(p=o(v,m,g)(),p[0]===nM)return p;m=typeof p[1]=="number"?p[1]:m+a}}return f}}}function SRe(e){return Array.isArray(e)?e:typeof e=="number"?[bRe,e]:e==null?Tle:[e]}function V6(e,t,n,r){let i,s,a;typeof t=="function"&&typeof n!="function"?(s=void 0,a=t,i=n):(s=t,a=n,i=r),Ple(e,s,o,i);function o(c,u){const d=u[u.length-1],h=d?d.children.indexOf(c):void 0;return a(c,h,d)}}const rM={}.hasOwnProperty,kRe={};function _Re(e,t){const n=t||kRe,r=new Map,i=new Map,s=new Map,a={...cRe,...n.handlers},o={all:u,applyData:BRe,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:a,one:c,options:n,patch:jRe,wrap:ERe};return V6(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const h=d.type==="definition"?r:i,A=String(d.identifier).toUpperCase();h.has(A)||h.set(A,d)}}),o;function c(d,h){const A=d.type,f=o.handlers[A];if(rM.call(o.handlers,A)&&f)return f(o,d,h);if(o.options.passThrough&&o.options.passThrough.includes(A)){if("children"in d){const{children:m,...g}=d,y=Ej(g);return y.children=o.all(d),y}return Ej(d)}return(o.options.unknownHandler||NRe)(o,d,h)}function u(d){const h=[];if("children"in d){const A=d.children;let f=-1;for(;++f<A.length;){const p=o.one(A[f],d);if(p){if(f&&A[f-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=OV(p.value)),!Array.isArray(p)&&p.type==="element")){const m=p.children[0];m&&m.type==="text"&&(m.value=OV(m.value))}Array.isArray(p)?h.push(...p):h.push(p)}}}return h}}function jRe(e,t){e.position&&(t.position=pFe(e))}function BRe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&s&&Object.assign(n.properties,Ej(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function NRe(e,t){const n=t.data||{},r="value"in t&&!(rM.call(n,"hProperties")||rM.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ERe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
`});++r<e.length;)r&&n.push({type:"text",value:`
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
`}),n}function OV(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function FV(e,t){const n=_Re(e,t),r=n.one(e,void 0),i=mRe(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
`},i),s}function TRe(e,t){return e&&"run"in e?async function(n,r){const i=FV(n,{file:r,...t});await e.run(i,r)}:function(n,r){return FV(n,{file:r,...e||t})}}function MV(e){if(e)throw e}var d_=Object.prototype.hasOwnProperty,Ile=Object.prototype.toString,LV=Object.defineProperty,RV=Object.getOwnPropertyDescriptor,DV=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Ile.call(t)==="[object Array]"},UV=function(t){if(!t||Ile.call(t)!=="[object Object]")return!1;var n=d_.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&d_.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||d_.call(t,i)},HV=function(t,n){LV&&n.name==="__proto__"?LV(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},QV=function(t,n){if(n==="__proto__")if(d_.call(t,n)){if(RV)return RV(t,n).value}else return;return t[n]},PRe=function e(){var t,n,r,i,s,a,o=arguments[0],c=1,u=arguments.length,d=!1;for(typeof o=="boolean"&&(d=o,o=arguments[1]||{},c=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)r=QV(o,n),i=QV(t,n),o!==i&&(d&&i&&(UV(i)||(s=DV(i)))?(s?(s=!1,a=r&&DV(r)?r:[]):a=r&&UV(r)?r:{},HV(o,{name:n,newValue:e(d,a,i)})):typeof i<"u"&&HV(o,{name:n,newValue:i}));return o};const wI=In(PRe);function iM(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function IRe(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const a=i.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);o(null,...i);function o(c,...u){const d=e[++s];let h=-1;if(c){a(c);return}for(;++h<i.length;)(u[h]===null||u[h]===void 0)&&(u[h]=i[h]);i=u,d?ORe(d,o)(...u):a(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function ORe(e,t){let n;return r;function r(...a){const o=e.length>a.length;let c;o&&a.push(i);try{c=e.apply(this,a)}catch(u){const d=u;if(o&&n)throw d;return i(d)}o||(c&&c.then&&typeof c.then=="function"?c.then(s,i):c instanceof Error?i(c):s(c))}function i(a,...o){n||(n=!0,t(a,...o))}function s(a){i(null,a)}}const Qc={basename:FRe,dirname:MRe,extname:LRe,join:RRe,sep:"/"};function FRe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');O2(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,o=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else a<0&&(s=!0,a=i+1),o>-1&&(e.codePointAt(i)===t.codePointAt(o--)?o<0&&(r=i):(o=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function MRe(e){if(O2(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function LRe(e){O2(e);let t=e.length,n=-1,r=0,i=-1,s=0,a;for(;t--;){const o=e.codePointAt(t);if(o===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),o===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function RRe(...e){let t=-1,n;for(;++t<e.length;)O2(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":DRe(n)}function DRe(e){O2(e);const t=e.codePointAt(0)===47;let n=URe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function URe(e,t){let n="",r=0,i=-1,s=0,a=-1,o,c;for(;++a<=e.length;){if(a<e.length)o=e.codePointAt(a);else{if(o===47)break;o=47}if(o===47){if(!(i===a-1||s===1))if(i!==a-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=a,s=0;continue}}else if(n.length>0){n="",r=0,i=a,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,s=0}else o===46&&s>-1?s++:s=-1}return n}function O2(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const HRe={cwd:QRe};function QRe(){return"/"}function sM(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $Re(e){if(typeof e=="string")e=new URL(e);else if(!sM(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return zRe(e)}function zRe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const bI=["history","path","basename","stem","extname","dirname"];class Ole{constructor(t){let n;t?sM(t)?n={path:t}:typeof t=="string"||VRe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":HRe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<bI.length;){const s=bI[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)bI.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Qc.basename(this.path):void 0}set basename(t){SI(t,"basename"),CI(t,"basename"),this.path=Qc.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Qc.dirname(this.path):void 0}set dirname(t){$V(this.basename,"dirname"),this.path=Qc.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Qc.extname(this.path):void 0}set extname(t){if(CI(t,"extname"),$V(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Qc.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){sM(t)&&(t=$Re(t)),SI(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Qc.basename(this.path,this.extname):void 0}set stem(t){SI(t,"stem"),CI(t,"stem"),this.path=Qc.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new sa(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function CI(e,t){if(e&&e.includes(Qc.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Qc.sep+"`")}function SI(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function $V(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function VRe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const KRe=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},qRe={}.hasOwnProperty;class K6 extends KRe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=IRe()}copy(){const t=new K6;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(wI(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(jI("data",this.frozen),this.namespace[t]=n,this):qRe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(jI("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=_S(t),r=this.parser||this.Parser;return kI("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),kI("process",this.parser||this.Parser),_I("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,a){const o=_S(t),c=r.parse(o);r.run(c,o,function(d,h,A){if(d||!h||!A)return u(d);const f=h,p=r.stringify(f,A);YRe(p)?A.value=p:A.result=p,u(d,A)});function u(d,h){d||!h?a(d):s?s(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),kI("processSync",this.parser||this.Parser),_I("processSync",this.compiler||this.Compiler),this.process(t,i),VV("processSync","process",n),r;function i(s,a){n=!0,MV(s),r=a}}run(t,n,r){zV(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(a,o){const c=_S(n);i.run(t,c,u);function u(d,h,A){const f=h||t;d?o(d):a?a(f):r(void 0,f,A)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),VV("runSync","run",r),i;function s(a,o){MV(a),i=o,r=!0}}stringify(t,n){this.freeze();const r=_S(n),i=this.compiler||this.Compiler;return _I("stringify",i),zV(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(jI("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?o(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...h]=u;c(d,h)}else a(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function a(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(u.plugins),u.settings&&(i.settings=wI(!0,i.settings,u.settings))}function o(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const h=u[d];s(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let h=-1,A=-1;for(;++h<r.length;)if(r[h][0]===u){A=h;break}if(A===-1)r.push([u,...d]);else if(d.length>0){let[f,...p]=d;const m=r[A][1];iM(m)&&iM(f)&&(f=wI(!0,m,f)),r[A]=[u,f,...p]}}}}const WRe=new K6().freeze();function kI(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function _I(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function jI(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zV(e){if(!iM(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function VV(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function _S(e){return GRe(e)?e:new Ole(e)}function GRe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function YRe(e){return typeof e=="string"||XRe(e)}function XRe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const JRe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",KV=[],qV={allowDangerousHtml:!0},ZRe=/^(https?|ircs?|mailto|xmpp)$/i,eDe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function q6(e){const t=tDe(e),n=nDe(e);return rDe(t.runSync(t.parse(n),n),e)}function tDe(e){const t=e.rehypePlugins||KV,n=e.remarkPlugins||KV,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...qV}:qV;return WRe().use(LLe).use(n).use(TRe,r).use(t)}function nDe(e){const t=e.children||"",n=new Ole;return typeof t=="string"&&(n.value=t),n}function rDe(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,a=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||iDe;for(const d of eDe)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+JRe+d.id,void 0);return V6(e,u),xFe(e,{Fragment:l.Fragment,components:i,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function u(d,h,A){if(d.type==="raw"&&A&&typeof h=="number")return a?A.children.splice(h,1):A.children[h]={type:"text",value:d.value},h;if(d.type==="element"){let f;for(f in yI)if(Object.hasOwn(yI,f)&&Object.hasOwn(d.properties,f)){const p=d.properties[f],m=yI[f];(m===null||m.includes(d.tagName))&&(d.properties[f]=c(String(p||""),f,d))}}if(d.type==="element"){let f=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!f&&r&&typeof h=="number"&&(f=!r(d,h,A)),f&&A&&typeof h=="number")return o&&d.children?A.children.splice(h,1,...d.children):A.children.splice(h,1),h}}}function iDe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||ZRe.test(e.slice(0,t))?e:""}function WV(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function sDe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function aDe(e,t,n){const i=KE((n||{}).ignore||[]),s=oDe(t);let a=-1;for(;++a<s.length;)Ple(e,"text",o);function o(u,d){let h=-1,A;for(;++h<d.length;){const f=d[h],p=A?A.children:void 0;if(i(f,p?p.indexOf(f):void 0,A))return;A=f}if(A)return c(u,d)}function c(u,d){const h=d[d.length-1],A=s[a][0],f=s[a][1];let p=0;const g=h.children.indexOf(u);let y=!1,v=[];A.lastIndex=0;let x=A.exec(u.value);for(;x;){const w=x.index,b={index:x.index,input:x.input,stack:[...d,u]};let k=f(...x,b);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?A.lastIndex=w+1:(p!==w&&v.push({type:"text",value:u.value.slice(p,w)}),Array.isArray(k)?v.push(...k):k&&v.push(k),p=w+x[0].length,y=!0),!A.global)break;x=A.exec(u.value)}return y?(p<u.value.length&&v.push({type:"text",value:u.value.slice(p)}),h.children.splice(g,1,...v)):v=[u],g+v.length}}function oDe(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([lDe(i[0]),cDe(i[1])])}return t}function lDe(e){return typeof e=="string"?new RegExp(sDe(e),"g"):e}function cDe(e){return typeof e=="function"?e:function(){return e}}const BI="phrasing",NI=["autolink","link","image","label"];function uDe(){return{transforms:[gDe],enter:{literalAutolink:hDe,literalAutolinkEmail:EI,literalAutolinkHttp:EI,literalAutolinkWww:EI},exit:{literalAutolink:mDe,literalAutolinkEmail:pDe,literalAutolinkHttp:fDe,literalAutolinkWww:ADe}}}function dDe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:BI,notInConstruct:NI},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:BI,notInConstruct:NI},{character:":",before:"[ps]",after:"\\/",inConstruct:BI,notInConstruct:NI}]}}function hDe(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function EI(e){this.config.enter.autolinkProtocol.call(this,e)}function fDe(e){this.config.exit.autolinkProtocol.call(this,e)}function ADe(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function pDe(e){this.config.exit.autolinkEmail.call(this,e)}function mDe(e){this.exit(e)}function gDe(e){aDe(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,yDe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),vDe]],{ignore:["link","linkReference"]})}function yDe(e,t,n,r,i){let s="";if(!Fle(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!xDe(n)))return!1;const a=wDe(n+r);if(!a[0])return!1;const o={type:"link",title:null,url:s+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[o,{type:"text",value:a[1]}]:o}function vDe(e,t,n,r){return!Fle(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function xDe(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function wDe(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=WV(e,"(");let s=WV(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Fle(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Yp(n)||$E(n))&&(!t||n!==47)}Mle.peek=EDe;function bDe(){this.buffer()}function CDe(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function SDe(){this.buffer()}function kDe(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function _De(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ac(this.sliceSerialize(e)).toLowerCase(),n.label=t}function jDe(e){this.exit(e)}function BDe(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ac(this.sliceSerialize(e)).toLowerCase(),n.label=t}function NDe(e){this.exit(e)}function EDe(){return"["}function Mle(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const a=n.enter("footnoteReference"),o=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),o(),a(),s+=i.move("]"),s}function TDe(){return{enter:{gfmFootnoteCallString:bDe,gfmFootnoteCall:CDe,gfmFootnoteDefinitionLabelString:SDe,gfmFootnoteDefinition:kDe},exit:{gfmFootnoteCallString:_De,gfmFootnoteCall:jDe,gfmFootnoteDefinitionLabelString:BDe,gfmFootnoteDefinition:NDe}}}function PDe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Mle},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,a){const o=s.createTracker(a);let c=o.move("[^");const u=s.enter("footnoteDefinition"),d=s.enter("label");return c+=o.move(s.safe(s.associationId(r),{before:c,after:"]"})),d(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?`
`:" ")+s.indentLines(s.containerFlow(r,o.current()),t?Lle:IDe))),u(),c}}function IDe(e,t,n){return t===0?e:Lle(e,t,n)}function Lle(e,t,n){return(n?"":"    ")+e}const ODe=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Rle.peek=DDe;function FDe(){return{canContainEols:["delete"],enter:{strikethrough:LDe},exit:{strikethrough:RDe}}}function MDe(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ODe}],handlers:{delete:Rle}}}function LDe(e){this.enter({type:"delete",children:[]},e)}function RDe(e){this.exit(e)}function Rle(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let a=i.move("~~");return a+=n.containerPhrasing(e,{...i.current(),before:a,after:"~"}),a+=i.move("~~"),s(),a}function DDe(){return"~"}function UDe(e){return e.length}function HDe(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||UDe,s=[],a=[],o=[],c=[];let u=0,d=-1;for(;++d<e.length;){const m=[],g=[];let y=-1;for(e[d].length>u&&(u=e[d].length);++y<e[d].length;){const v=QDe(e[d][y]);if(n.alignDelimiters!==!1){const x=i(v);g[y]=x,(c[y]===void 0||x>c[y])&&(c[y]=x)}m.push(v)}a[d]=m,o[d]=g}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<u;)s[h]=GV(r[h]);else{const m=GV(r);for(;++h<u;)s[h]=m}h=-1;const A=[],f=[];for(;++h<u;){const m=s[h];let g="",y="";m===99?(g=":",y=":"):m===108?g=":":m===114&&(y=":");let v=n.alignDelimiters===!1?1:Math.max(1,c[h]-g.length-y.length);const x=g+"-".repeat(v)+y;n.alignDelimiters!==!1&&(v=g.length+v+y.length,v>c[h]&&(c[h]=v),f[h]=v),A[h]=x}a.splice(1,0,A),o.splice(1,0,f),d=-1;const p=[];for(;++d<a.length;){const m=a[d],g=o[d];h=-1;const y=[];for(;++h<u;){const v=m[h]||"";let x="",w="";if(n.alignDelimiters!==!1){const b=c[h]-(g[h]||0),k=s[h];k===114?x=" ".repeat(b):k===99?b%2?(x=" ".repeat(b/2+.5),w=" ".repeat(b/2-.5)):(x=" ".repeat(b/2),w=x):w=" ".repeat(b)}n.delimiterStart!==!1&&!h&&y.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||h)&&y.push(" "),n.alignDelimiters!==!1&&y.push(x),y.push(v),n.alignDelimiters!==!1&&y.push(w),n.padding!==!1&&y.push(" "),(n.delimiterEnd!==!1||h!==u-1)&&y.push("|")}p.push(n.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return p.join(`
`)}function QDe(e){return e==null?"":String(e)}function GV(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function $De(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const a=n.indentLines(n.containerFlow(e,s.current()),zDe);return i(),a}function zDe(e,t,n){return">"+(n?"":" ")+e}function VDe(e,t){return YV(e,t.inConstruct,!0)&&!YV(e,t.notInConstruct,!1)}function YV(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function XV(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
`&&VDe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
`}function KDe(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>a&&(a=s):s=1,i=r+t.length,r=n.indexOf(t,i);return a}function qDe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function WDe(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function GDe(e,t,n,r){const i=WDe(n),s=e.value||"",a=i==="`"?"GraveAccent":"Tilde";if(qDe(e,n)){const h=n.enter("codeIndented"),A=n.indentLines(s,YDe);return h(),A}const o=n.createTracker(r),c=i.repeat(Math.max(KDe(s,i)+1,3)),u=n.enter("codeFenced");let d=o.move(c);if(e.lang){const h=n.enter(`codeFencedLang${a}`);d+=o.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...o.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${a}`);d+=o.move(" "),d+=o.move(n.safe(e.meta,{before:d,after:`
`,encode:["`"],...o.current()})),h()}return d+=o.move(`
`),s&&(d+=o.move(s+`
`)),d+=o.move(c),u(),d}function YDe(e,t,n){return(n?"":"    ")+e}function W6(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function XDe(e,t,n,r){const i=W6(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("definition");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":`
`,...c.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),o()),a(),u}function JDe(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Xb(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Tj(e,t,n){const r=hv(e),i=hv(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Dle.peek=ZDe;function Dle(e,t,n,r){const i=JDe(n),s=n.enter("emphasis"),a=n.createTracker(r),o=a.move(i);let c=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=c.charCodeAt(0),d=Tj(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=Xb(u)+c.slice(1));const h=c.charCodeAt(c.length-1),A=Tj(r.after.charCodeAt(0),h,i);A.inside&&(c=c.slice(0,-1)+Xb(h));const f=a.move(i);return s(),n.attentionEncodeSurroundingInfo={after:A.outside,before:d.outside},o+c+f}function ZDe(e,t,n){return n.options.emphasis||"*"}function eUe(e,t){let n=!1;return V6(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,nM}),!!((!e.depth||e.depth<3)&&R6(e)&&(t.options.setext||n))}function tUe(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(eUe(e,n)){const d=n.enter("headingSetext"),h=n.enter("phrasing"),A=n.containerPhrasing(e,{...s.current(),before:`
`,after:`
`});return h(),d(),A+`
`+(i===1?"=":"-").repeat(A.length-(Math.max(A.lastIndexOf("\r"),A.lastIndexOf(`
`))+1))}const a="#".repeat(i),o=n.enter("headingAtx"),c=n.enter("phrasing");s.move(a+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
`,...s.current()});return/^[\t ]/.test(u)&&(u=Xb(u.charCodeAt(0))+u.slice(1)),u=u?a+" "+u:a,n.options.closeAtx&&(u+=" "+a),c(),o(),u}Ule.peek=nUe;function Ule(e){return e.value||""}function nUe(){return"<"}Hle.peek=rUe;function Hle(e,t,n,r){const i=W6(n),s=i==='"'?"Quote":"Apostrophe",a=n.enter("image");let o=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=n.enter(`title${s}`),u+=c.move(" "+i),u+=c.move(n.safe(e.title,{before:u,after:i,...c.current()})),u+=c.move(i),o()),u+=c.move(")"),a(),u}function rUe(){return"!"}Qle.peek=iUe;function Qle(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const u=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!u||u!==h?c+=o.move(h+"]"):i==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function iUe(){return"!"}$le.peek=sUe;function $le(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const a=n.unsafe[s],o=n.compilePattern(a);let c;if(a.atBreak)for(;c=o.exec(r);){let u=c.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(c.index+1)}}return i+r+i}function sUe(){return"`"}function zle(e,t){const n=R6(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Vle.peek=aUe;function Vle(e,t,n,r){const i=W6(n),s=i==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let o,c;if(zle(e,n)){const d=n.stack;n.stack=[],o=n.enter("autolink");let h=a.move("<");return h+=a.move(n.containerPhrasing(e,{before:h,after:">",...a.current()})),h+=a.move(">"),o(),n.stack=d,h}o=n.enter("link"),c=n.enter("label");let u=a.move("[");return u+=a.move(n.containerPhrasing(e,{before:u,after:"](",...a.current()})),u+=a.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(c=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),c(),e.title&&(c=n.enter(`title${s}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),c()),u+=a.move(")"),o(),u}function aUe(e,t,n){return zle(e,n)?"<":"["}Kle.peek=oUe;function Kle(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let a=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),a();const d=n.stack;n.stack=[],a=n.enter("reference");const h=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return a(),n.stack=d,s(),i==="full"||!u||u!==h?c+=o.move(h+"]"):i==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function oUe(){return"["}function G6(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function lUe(e){const t=G6(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function cUe(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function qle(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function uUe(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let a=e.ordered?cUe(n):G6(n);const o=e.ordered?a==="."?")":".":lUe(n);let c=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),qle(n)===a&&d){let h=-1;for(;++h<e.children.length;){const A=e.children[h];if(A&&A.type==="listItem"&&A.children&&A.children[0]&&A.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(a=o),n.bulletCurrent=a;const u=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=s,i(),u}function dUe(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function hUe(e,t,n,r){const i=dUe(n);let s=n.bulletCurrent||G6(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let a=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const o=n.createTracker(r);o.move(s+" ".repeat(a-s.length)),o.shift(a);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,o.current()),d);return c(),u;function d(h,A,f){return A?(f?"":" ".repeat(a))+h:(f?s:s+" ".repeat(a-s.length))+h}}function fUe(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),a=n.containerPhrasing(e,r);return s(),i(),a}const AUe=KE(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function pUe(e,t,n,r){return(e.children.some(function(a){return AUe(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function mUe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Wle.peek=gUe;function Wle(e,t,n,r){const i=mUe(n),s=n.enter("strong"),a=n.createTracker(r),o=a.move(i+i);let c=a.move(n.containerPhrasing(e,{after:i,before:o,...a.current()}));const u=c.charCodeAt(0),d=Tj(r.before.charCodeAt(r.before.length-1),u,i);d.inside&&(c=Xb(u)+c.slice(1));const h=c.charCodeAt(c.length-1),A=Tj(r.after.charCodeAt(0),h,i);A.inside&&(c=c.slice(0,-1)+Xb(h));const f=a.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:A.outside,before:d.outside},o+c+f}function gUe(e,t,n){return n.options.strong||"*"}function yUe(e,t,n,r){return n.safe(e.value,r)}function vUe(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function xUe(e,t,n){const r=(qle(n)+(n.options.ruleSpaces?" ":"")).repeat(vUe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Gle={blockquote:$De,break:XV,code:GDe,definition:XDe,emphasis:Dle,hardBreak:XV,heading:tUe,html:Ule,image:Hle,imageReference:Qle,inlineCode:$le,link:Vle,linkReference:Kle,list:uUe,listItem:hUe,paragraph:fUe,root:pUe,strong:Wle,text:yUe,thematicBreak:xUe};function wUe(){return{enter:{table:bUe,tableData:JV,tableHeader:JV,tableRow:SUe},exit:{codeText:kUe,table:CUe,tableData:TI,tableHeader:TI,tableRow:TI}}}function bUe(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function CUe(e){this.exit(e),this.data.inTable=void 0}function SUe(e){this.enter({type:"tableRow",children:[]},e)}function TI(e){this.exit(e)}function JV(e){this.enter({type:"tableCell",children:[]},e)}function kUe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,_Ue));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function _Ue(e,t){return t==="|"?t:e}function jUe(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:A,table:a,tableCell:c,tableRow:o}};function a(f,p,m,g){return u(d(f,m,g),f.align)}function o(f,p,m,g){const y=h(f,m,g),v=u([y]);return v.slice(0,v.indexOf(`
`))}function c(f,p,m,g){const y=m.enter("tableCell"),v=m.enter("phrasing"),x=m.containerPhrasing(f,{...g,before:s,after:s});return v(),y(),x}function u(f,p){return HDe(f,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function d(f,p,m){const g=f.children;let y=-1;const v=[],x=p.enter("table");for(;++y<g.length;)v[y]=h(g[y],p,m);return x(),v}function h(f,p,m){const g=f.children;let y=-1;const v=[],x=p.enter("tableRow");for(;++y<g.length;)v[y]=c(g[y],f,p,m);return x(),v}function A(f,p,m){let g=Gle.inlineCode(f,p,m);return m.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function BUe(){return{exit:{taskListCheckValueChecked:ZV,taskListCheckValueUnchecked:ZV,paragraph:EUe}}}function NUe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:TUe}}}function ZV(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function EUe(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function TUe(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let c=Gle.listItem(e,t,n,{...r,...o.current()});return s&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+a}}function PUe(){return[uDe(),TDe(),FDe(),wUe(),BUe()]}function IUe(e){return{extensions:[dDe(),PDe(e),MDe(),jUe(e),NUe()]}}const OUe={tokenize:UUe,partial:!0},Yle={tokenize:HUe,partial:!0},Xle={tokenize:QUe,partial:!0},Jle={tokenize:$Ue,partial:!0},FUe={tokenize:zUe,partial:!0},Zle={name:"wwwAutolink",tokenize:RUe,previous:tce},ece={name:"protocolAutolink",tokenize:DUe,previous:nce},Ed={name:"emailAutolink",tokenize:LUe,previous:rce},mu={};function MUe(){return{text:mu}}let BA=48;for(;BA<123;)mu[BA]=Ed,BA++,BA===58?BA=65:BA===91&&(BA=97);mu[43]=Ed;mu[45]=Ed;mu[46]=Ed;mu[95]=Ed;mu[72]=[Ed,ece];mu[104]=[Ed,ece];mu[87]=[Ed,Zle];mu[119]=[Ed,Zle];function LUe(e,t,n){const r=this;let i,s;return a;function a(h){return!aM(h)||!rce.call(r,r.previous)||Y6(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(h))}function o(h){return aM(h)?(e.consume(h),o):h===64?(e.consume(h),c):n(h)}function c(h){return h===46?e.check(FUe,d,u)(h):h===45||h===95||ea(h)?(s=!0,e.consume(h),c):d(h)}function u(h){return e.consume(h),i=!0,c}function d(h){return s&&i&&ya(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function RUe(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!tce.call(r,r.previous)||Y6(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(OUe,e.attempt(Yle,e.attempt(Xle,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function DUe(e,t,n){const r=this;let i="",s=!1;return a;function a(h){return(h===72||h===104)&&nce.call(r,r.previous)&&!Y6(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(h),e.consume(h),o):n(h)}function o(h){if(ya(h)&&i.length<5)return i+=String.fromCodePoint(h),e.consume(h),o;if(h===58){const A=i.toLowerCase();if(A==="http"||A==="https")return e.consume(h),c}return n(h)}function c(h){return h===47?(e.consume(h),s?u:(s=!0,c)):n(h)}function u(h){return h===null||Bj(h)||or(h)||Yp(h)||$E(h)?n(h):e.attempt(Yle,e.attempt(Xle,d),n)(h)}function d(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function UUe(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function HUe(e,t,n){let r,i,s;return a;function a(u){return u===46||u===95?e.check(Jle,c,o)(u):u===null||or(u)||Yp(u)||u!==45&&$E(u)?c(u):(s=!0,e.consume(u),a)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function c(u){return i||r||!s?n(u):t(u)}}function QUe(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(Jle,t,s)(a):a===null||or(a)||Yp(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function $Ue(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),s):o===93?(e.consume(o),i):o===60||o===null||or(o)||Yp(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||or(o)||Yp(o)?t(o):r(o)}function s(o){return ya(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):ya(o)?(e.consume(o),a):n(o)}}function zUe(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return ea(s)?n(s):t(s)}}function tce(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||or(e)}function nce(e){return!ya(e)}function rce(e){return!(e===47||aM(e))}function aM(e){return e===43||e===45||e===46||e===95||ea(e)}function Y6(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const VUe={tokenize:ZUe,partial:!0};function KUe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:YUe,continuation:{tokenize:XUe},exit:JUe}},text:{91:{name:"gfmFootnoteCall",tokenize:GUe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:qUe,resolveTo:WUe}}}}function qUe(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){a=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!a||!a._balanced)return n(c);const u=Ac(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function WUe(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function GUe(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;return o;function o(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(h){if(s>999||h===93&&!a||h===null||h===91||or(h))return n(h);if(h===93){e.exit("chunkString");const A=e.exit("gfmFootnoteCallString");return i.includes(Ac(r.sliceSerialize(A)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return or(h)||(a=!0),s++,e.consume(h),h===92?d:u}function d(h){return h===91||h===92||h===93?(e.consume(h),s++,u):u(h)}}function YUe(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=0,o;return c;function c(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(p)}function d(p){if(a>999||p===93&&!o||p===null||p===91||or(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return s=Ac(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),A}return or(p)||(o=!0),a++,e.consume(p),p===92?h:d}function h(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}function A(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(s)||i.push(s),Tn(e,f,"gfmFootnoteDefinitionWhitespace")):n(p)}function f(p){return t(p)}}function XUe(e,t,n){return e.check(I2,t,e.attempt(VUe,t,n))}function JUe(e){e.exit("gfmFootnoteDefinition")}function ZUe(e,t,n){const r=this;return Tn(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function e6e(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let c=-1;for(;++c<a.length;)if(a[c][0]==="enter"&&a[c][1].type==="strikethroughSequenceTemporary"&&a[c][1]._close){let u=c;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[c][1].end.offset-a[c][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[c][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[c][1].end)},h={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[c][1].start)},A=[["enter",d,o],["enter",a[u][1],o],["exit",a[u][1],o],["enter",h,o]],f=o.parser.constructs.insideSpan.null;f&&Lo(A,A.length,0,zE(f,a.slice(u+1,c),o)),Lo(A,A.length,0,[["exit",h,o],["enter",a[c][1],o],["exit",a[c][1],o],["exit",d,o]]),Lo(a,u-1,c-u+3,A),c=u+A.length-2;break}}for(c=-1;++c<a.length;)a[c][1].type==="strikethroughSequenceTemporary"&&(a[c][1].type="data");return a}function s(a,o,c){const u=this.previous,d=this.events;let h=0;return A;function A(p){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(p):(a.enter("strikethroughSequenceTemporary"),f(p))}function f(p){const m=hv(u);if(p===126)return h>1?c(p):(a.consume(p),h++,f);if(h<2&&!n)return c(p);const g=a.exit("strikethroughSequenceTemporary"),y=hv(p);return g._open=!y||y===2&&!!m,g._close=!m||m===2&&!!y,o(p)}}}class t6e{constructor(){this.map=[]}add(t,n,r){n6e(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function n6e(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function r6e(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function i6e(){return{flow:{null:{name:"table",tokenize:s6e,resolveAll:a6e}}}}function s6e(e,t,n){const r=this;let i=0,s=0,a;return o;function o(I){let T=r.events.length-1;for(;T>-1;){const L=r.events[T][1].type;if(L==="lineEnding"||L==="linePrefix")T--;else break}const N=T>-1?r.events[T][1].type:null,F=N==="tableHead"||N==="tableRow"?k:c;return F===k&&r.parser.lazy[r.now().line]?n(I):F(I)}function c(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(a=!0,s+=1),d(I)}function d(I){return I===null?n(I):Ut(I)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),f):n(I):xn(I)?Tn(e,d,"whitespace")(I):(s+=1,a&&(a=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),h(I)))}function h(I){return I===null||I===124||or(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?A:h)}function A(I){return I===92||I===124?(e.consume(I),h):h(I)}function f(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),a=!1,xn(I)?Tn(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):p(I))}function p(I){return I===45||I===58?g(I):I===124?(a=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),m):b(I)}function m(I){return xn(I)?Tn(e,g,"whitespace")(I):g(I)}function g(I){return I===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),y):I===45?(s+=1,y(I)):I===null||Ut(I)?w(I):b(I)}function y(I){return I===45?(e.enter("tableDelimiterFiller"),v(I)):b(I)}function v(I){return I===45?(e.consume(I),v):I===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(I))}function x(I){return xn(I)?Tn(e,w,"whitespace")(I):w(I)}function w(I){return I===124?p(I):I===null||Ut(I)?!a||i!==s?b(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):b(I)}function b(I){return n(I)}function k(I){return e.enter("tableRow"),j(I)}function j(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),j):I===null||Ut(I)?(e.exit("tableRow"),t(I)):xn(I)?Tn(e,j,"whitespace")(I):(e.enter("data"),B(I))}function B(I){return I===null||I===124||or(I)?(e.exit("data"),j(I)):(e.consume(I),I===92?E:B)}function E(I){return I===92||I===124?(e.consume(I),B):B(I)}}function a6e(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,c=0,u,d,h;const A=new t6e;for(;++n<e.length;){const f=e[n],p=f[1];f[0]==="enter"?p.type==="tableHead"?(o=!1,c!==0&&(eK(A,t,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},A.add(n,0,[["enter",u,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,h=void 0,s=[0,0,0,0],a=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},A.add(n,0,[["enter",d,t]])),i=p.type==="tableDelimiterRow"?2:d?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(s[1]!==0&&(a[0]=a[1],h=jS(A,t,s,i,void 0,h),s=[0,0,0,0]),a[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],h=jS(A,t,s,i,void 0,h)),s=a,a=[s[1],n,0,0])):p.type==="tableHead"?(o=!0,c=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(c=n,s[1]!==0?(a[0]=a[1],h=jS(A,t,s,i,n,h)):a[1]!==0&&(h=jS(A,t,a,i,n,h)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(a[3]=n)}for(c!==0&&eK(A,t,c,u,d),A.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=r6e(t.events,n))}return e}function jS(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},Fg(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const c=Fg(t.events,n[1]);if(s={type:a,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=Fg(t.events,n[2]),d=Fg(t.events,n[3]),h={type:o,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const A=t.events[n[2]],f=t.events[n[3]];if(A[1].end=Object.assign({},f[1].end),A[1].type="chunkText",A[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,m=n[3]-n[2]-1;e.add(p,m,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return i!==void 0&&(s.end=Object.assign({},Fg(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function eK(e,t,n,r,i){const s=[],a=Fg(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function Fg(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const o6e={name:"tasklistCheck",tokenize:c6e};function l6e(){return{text:{91:o6e}}}function c6e(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return or(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),a):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),a):n(c)}function a(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return Ut(c)?t(c):xn(c)?e.check({tokenize:u6e},t,n)(c):n(c)}}function u6e(e,t,n){return Tn(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function d6e(e){return fle([MUe(),KUe(),e6e(e),i6e(),l6e()])}const h6e={};function f6e(e){const t=this,n=e||h6e,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(d6e(n)),s.push(PUe()),a.push(IUe(n))}const oM="616-403-6393",A6e="+16164036393",p6e="https://calendar.app.google/yqrrkgeL7Enjiiax9",m6e=["What's the housing market like in East Grand Rapids right now?","How much should I save for a down payment as a first-time buyer?","What neighborhoods are good for downsizing in Grand Rapids?","How long does it usually take to sell a home in West Michigan?","What does Holden's commission structure look like?","How does the home inspection process work?"],g6e=({onPick:e})=>l.jsxs("div",{className:"space-y-3",children:[l.jsxs("p",{className:"text-xs uppercase tracking-[0.2em] text-muted-foreground flex items-center gap-2",children:[l.jsx(Ts,{size:12,className:"text-gold"}),"Try asking"]}),l.jsx("div",{className:"flex flex-wrap gap-2",children:m6e.map(t=>l.jsx("button",{onClick:()=>e(t),className:"text-left text-sm px-3.5 py-2 border border-border bg-card hover:bg-secondary hover:border-gold/50 transition-colors text-foreground",children:t},t))})]}),y6e=/^(https?:|mailto:|tel:|sms:|\/|#)/i,v6e=e=>y6e.test(e)?e:"",x6e=({href:e,children:t,...n})=>{const r=e&&/^https?:/i.test(e),i=e&&/^(sms:|tel:|mailto:)/i.test(e);return l.jsx("a",{href:e,...r?{target:"_blank",rel:"noopener noreferrer"}:{},...i?{rel:"noopener"}:{},...n,children:t})},w6e="https://khmmwvmdbhaplcfcndjx.supabase.co/functions/v1/faq-concierge",b6e="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",C6e=()=>{const[e,t]=C.useState([]),[n,r]=C.useState(""),[i,s]=C.useState(!1),[a,o]=C.useState(null),c=C.useRef(null),u=C.useRef(null);C.useEffect(()=>{c.current&&(c.current.scrollTop=c.current.scrollHeight)},[e,i]);const d=async f=>{const p=f.trim();if(!p||i)return;o(null);const m={role:"user",content:p},g=[...e,m];t(g),r(""),s(!0);try{const y=await fetch(w6e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${b6e}`},body:JSON.stringify({messages:g})});if(y.status===429){o("Too many requests right now — try again in a moment."),s(!1);return}if(y.status===402){o(`AI service is temporarily unavailable. Text Holden directly at ${oM}.`),s(!1);return}if(!y.ok)throw new Error(`Server returned ${y.status}`);const v=await y.json();t([...g,{role:"assistant",content:v.content||"(no answer)"}])}catch(y){console.error("concierge error:",y),o(`Something went wrong. Text Holden at ${oM} and he'll get back to you fast.`)}finally{s(!1)}},h=f=>{f.preventDefault(),d(n)},A=f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),d(n))};return l.jsxs("div",{className:"border border-border bg-card flex flex-col",style:{minHeight:"min(70vh, 700px)"},children:[l.jsxs("div",{ref:c,className:"flex-1 overflow-y-auto p-4 md:p-6 space-y-6",style:{maxHeight:"60vh"},children:[e.length===0&&l.jsxs("div",{className:"space-y-6 py-4",children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"w-9 h-9 rounded-full bg-primary text-primary-foreground flex items-center justify-center shrink-0",children:l.jsx(Zk,{size:18})}),l.jsx("div",{className:"bg-secondary px-4 py-3 text-sm text-foreground max-w-[85%]",children:"Hi — I'm Holden's AI assistant. Ask me anything about Grand Rapids real estate, neighborhoods, the buying or selling process, or how Holden works. I'll search his site first and then the open web if I have to."})]}),l.jsx(g6e,{onPick:f=>d(f)})]}),e.map((f,p)=>l.jsxs("div",{className:`flex items-start gap-3 ${f.role==="user"?"flex-row-reverse":""}`,children:[l.jsx("div",{className:`w-9 h-9 rounded-full flex items-center justify-center shrink-0 ${f.role==="user"?"bg-gold/20 text-gold border border-gold/30":"bg-primary text-primary-foreground"}`,children:f.role==="user"?l.jsx(aj,{size:16}):l.jsx(Zk,{size:18})}),l.jsx("div",{className:`px-4 py-3 text-sm max-w-[85%] ${f.role==="user"?"bg-primary text-primary-foreground":"bg-secondary text-foreground"}`,children:f.role==="assistant"?l.jsx("div",{className:"prose prose-sm max-w-none prose-headings:text-foreground prose-p:text-foreground prose-li:text-foreground prose-strong:text-foreground prose-a:text-accent prose-a:underline prose-hr:border-border",children:l.jsx(q6,{remarkPlugins:[f6e],urlTransform:v6e,components:{a:x6e},children:f.content})}):l.jsx("p",{className:"whitespace-pre-wrap",children:f.content})})]},p)),i&&l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"w-9 h-9 rounded-full bg-primary text-primary-foreground flex items-center justify-center shrink-0",children:l.jsx(Zk,{size:18})}),l.jsxs("div",{className:"bg-secondary px-4 py-3 text-sm text-muted-foreground flex items-center gap-2",children:[l.jsx(Ba,{size:14,className:"animate-spin"}),"Searching the site…"]})]}),a&&l.jsx("div",{className:"bg-destructive/10 border border-destructive/30 px-4 py-3 text-sm text-destructive",children:a})]}),l.jsxs("form",{onSubmit:h,className:"border-t border-border p-3 md:p-4 flex gap-2 bg-background",children:[l.jsx("textarea",{ref:u,value:n,onChange:f=>r(f.target.value),onKeyDown:A,placeholder:"Ask anything about Grand Rapids real estate…",rows:1,disabled:i,className:"flex-1 resize-none px-4 py-3 bg-secondary text-foreground placeholder:text-muted-foreground border border-border focus:outline-none focus:border-gold/60 text-sm",style:{maxHeight:"120px"}}),l.jsxs("button",{type:"submit",disabled:i||!n.trim(),className:"px-4 md:px-6 bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-40 disabled:cursor-not-allowed transition-colors flex items-center gap-2",children:[i?l.jsx(Ba,{size:16,className:"animate-spin"}):l.jsx(Mre,{size:16}),l.jsx("span",{className:"hidden sm:inline text-xs uppercase tracking-wider font-medium",children:"Send"})]})]})]})};function S6e(){return gr({queryKey:["all-faqs-aggregated"],queryFn:async()=>{var h,A,f,p;const[e,t,n]=await Promise.all([Me.from("aeo_categories").select("id, name, slug, parent_id, faq_json, display_order, enabled").eq("enabled",!0).order("display_order"),Me.from("aeo_pages").select("id, title, h1, slug, faq_json, category_id, display_order").eq("status","published").order("display_order"),Me.from("blog_posts").select("id, title, slug, faq_json, category").eq("published",!0)]),r=e.data||[],i=t.data||[],s=n.data||[],a={};r.forEach(m=>a[m.id]=m);const o=m=>{const g=a[m.category_id];if(!g)return"/blog";if(g.parent_id){const y=a[g.parent_id];return y?`/${y.slug}/${g.slug}/${m.slug}`:`/${g.slug}/${m.slug}`}return`/${g.slug}/${m.slug}`},c=m=>{if(m.parent_id){const g=a[m.parent_id];return g?`/${g.slug}/${m.slug}`:`/${m.slug}`}return`/${m.slug}`},u={},d=m=>{const g=m.parent_id&&a[m.parent_id]||m;return u[g.id]||(u[g.id]={categoryName:g.name,categorySlug:g.slug,faqs:[]}),u[g.id]};for(const m of r){const g=Array.isArray(m.faq_json)?m.faq_json:[],y=c(m),v=d(m);for(const x of g)!(x!=null&&x.question)||!(x!=null&&x.answer)||v.faqs.push({question:x.question,answer:x.answer,sourceUrl:y,sourceTitle:m.name,category:((h=a[m.parent_id])==null?void 0:h.name)||m.name,categorySlug:((A=a[m.parent_id])==null?void 0:A.slug)||m.slug})}for(const m of i){const g=a[m.category_id];if(!g)continue;const y=Array.isArray(m.faq_json)?m.faq_json:[],v=o(m),x=d(g);for(const w of y)!(w!=null&&w.question)||!(w!=null&&w.answer)||x.faqs.push({question:w.question,answer:w.answer,sourceUrl:v,sourceTitle:m.h1||m.title,category:((f=a[g.parent_id])==null?void 0:f.name)||g.name,categorySlug:((p=a[g.parent_id])==null?void 0:p.slug)||g.slug})}for(const m of s){const g=Array.isArray(m.faq_json)?m.faq_json:[];if(g.length===0)continue;const y=m.category||"Blog",v=y.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")||"blog",x=`blog::${v}`;u[x]||(u[x]={categoryName:y,categorySlug:v,faqs:[]});for(const w of g)!(w!=null&&w.question)||!(w!=null&&w.answer)||u[x].faqs.push({question:w.question,answer:w.answer,sourceUrl:`/blog/${m.slug}`,sourceTitle:m.title,category:y,categorySlug:v})}return Object.values(u).filter(m=>m.faqs.length>0).sort((m,g)=>m.categoryName.localeCompare(g.categoryName))},staleTime:1e3*60*10})}function k6e(e,t){if(!t.trim())return[];const n=t.toLowerCase().replace(/[^a-z0-9\s]/g," ").split(/\s+/).filter(i=>i.length>2);if(n.length===0)return[];const r=[];for(const i of e)for(const s of i.faqs){const a=s.question.toLowerCase(),o=s.answer.toLowerCase();let c=0;for(const u of n)c+=(a.split(u).length-1)*3,c+=o.split(u).length-1;c>0&&r.push({...s,_score:c})}return r.sort((i,s)=>s._score-i._score),r.slice(0,30).map(({_score:i,...s})=>s)}const _6e=()=>{const{data:e,isLoading:t}=S6e(),[n,r]=C.useState(""),[i,s]=C.useState(null),[a,o]=C.useState(null),c=C.useMemo(()=>!e||!n.trim()?[]:k6e(e,n),[e,n]),u=(e||[]).reduce((d,h)=>d+h.faqs.length,0);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"heading-section mb-2",children:"Browse all questions"}),l.jsx("p",{className:"text-body text-muted-foreground",children:t?"Loading…":`${u} question${u===1?"":"s"} across ${(e||[]).length} categor${(e||[]).length===1?"y":"ies"} on the site. Each links to its full source page.`})]}),l.jsxs("div",{className:"relative",children:[l.jsx(hE,{size:16,className:"absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground"}),l.jsx("input",{type:"search",value:n,onChange:d=>r(d.target.value),placeholder:"Filter by keyword…",className:"w-full pl-11 pr-4 py-3 bg-card border border-border focus:outline-none focus:border-gold/60 text-sm text-foreground placeholder:text-muted-foreground"})]}),n.trim()&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:[c.length," match",c.length===1?"":"es"]}),c.length===0&&l.jsx("p",{className:"text-sm text-muted-foreground py-6 text-center",children:"No matches. Try the chat above — it can search the web too."}),l.jsx("div",{className:"space-y-2",children:c.map((d,h)=>{const A=`search-${h}`,f=a===A;return l.jsxs("div",{className:"border border-border bg-card overflow-hidden",children:[l.jsxs("button",{onClick:()=>o(f?null:A),className:"w-full flex items-start gap-3 p-4 text-left hover:bg-secondary/50 transition-colors",children:[l.jsx(fc,{size:16,className:`mt-0.5 shrink-0 text-gold transition-transform ${f?"rotate-90":""}`}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"font-medium text-foreground text-sm",children:d.question}),l.jsx("p",{className:"text-xs uppercase tracking-wider text-muted-foreground mt-1",children:d.category})]})]}),f&&l.jsxs("div",{className:"px-4 pb-4 pl-11 space-y-3",children:[l.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:d.answer}),l.jsxs(At,{to:d.sourceUrl,className:"inline-flex items-center gap-1.5 text-xs uppercase tracking-wider text-accent hover:text-gold transition-colors",children:["Read full answer on ",d.sourceTitle,l.jsx(eo,{size:11})]})]})]},A)})})]}),!n.trim()&&l.jsx("div",{className:"space-y-3",children:(e||[]).map(d=>{const h=i===d.categorySlug;return l.jsxs("div",{className:"border border-border bg-card overflow-hidden",children:[l.jsxs("button",{onClick:()=>s(h?null:d.categorySlug),className:"w-full flex items-center justify-between p-4 hover:bg-secondary/50 transition-colors",children:[l.jsxs("div",{className:"text-left",children:[l.jsx("p",{className:"font-medium text-foreground",children:d.categoryName}),l.jsxs("p",{className:"text-xs uppercase tracking-wider text-muted-foreground mt-0.5",children:[d.faqs.length," question",d.faqs.length===1?"":"s"]})]}),l.jsx(hc,{size:16,className:`text-gold transition-transform ${h?"rotate-180":""}`})]}),h&&l.jsx("div",{className:"border-t border-border divide-y divide-border",children:d.faqs.map((A,f)=>{const p=`${d.categorySlug}-${f}`,m=a===p;return l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>o(m?null:p),className:"w-full flex items-start gap-3 p-4 text-left hover:bg-secondary/50 transition-colors",children:[l.jsx(fc,{size:14,className:`mt-1 shrink-0 text-gold transition-transform ${m?"rotate-90":""}`}),l.jsx("p",{className:"flex-1 text-sm text-foreground",children:A.question})]}),m&&l.jsxs("div",{className:"px-4 pb-4 pl-11 space-y-3",children:[l.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:A.answer}),l.jsxs(At,{to:A.sourceUrl,className:"inline-flex items-center gap-1.5 text-xs uppercase tracking-wider text-accent hover:text-gold transition-colors",children:["Read full answer on ",A.sourceTitle,l.jsx(eo,{size:11})]})]})]},p)})})]},d.categorySlug)})})]})},j6e=()=>l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Ask Holden Anything | Grand Rapids Real Estate FAQ"}),l.jsx("meta",{name:"description",content:"Get instant answers to your Grand Rapids real estate questions. Holden's AI concierge searches his entire site to answer about buying, selling, neighborhoods, market trends, and more."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/faq"}),l.jsx("meta",{property:"og:title",content:"Ask Holden Anything | Grand Rapids Real Estate FAQ"}),l.jsx("meta",{property:"og:description",content:"AI-powered answers to every Grand Rapids real estate question — pulled from Holden's hundreds of FAQ pages and expert content."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/faq"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Ask Holden Anything | Grand Rapids Real Estate FAQ"}),l.jsx("meta",{name:"twitter:description",content:"AI-powered answers to every Grand Rapids real estate question."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://www.holdengr.com/"},{"@type":"ListItem",position:2,name:"Ask Holden",item:"https://www.holdengr.com/faq"}]})}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"WebApplication","@id":"https://www.holdengr.com/faq#concierge",name:"Ask Holden Anything",url:"https://www.holdengr.com/faq",applicationCategory:"BusinessApplication",description:"AI concierge that answers Grand Rapids real estate questions using Holden Richardson's site content and the open web.",isPartOf:{"@id":"https://www.holdengr.com/#website"},about:{"@id":"https://www.holdengr.com/#agent"},offers:{"@type":"Offer",price:"0",priceCurrency:"USD"}})})]}),l.jsx("section",{className:"bg-secondary -mt-20 pt-32 md:pt-40 pb-12 md:pb-16",children:l.jsx("div",{className:"container-page text-center max-w-3xl",children:l.jsxs(_e,{children:[l.jsxs("p",{className:"text-caption text-muted-foreground mb-4 flex items-center justify-center gap-2",children:[l.jsx(Ts,{size:12,className:"text-gold"}),"AI Concierge"]}),l.jsx("h1",{className:"heading-display mb-6",children:"Ask Holden Anything"}),l.jsx("p",{className:"text-body text-muted-foreground",children:"Type any question about Grand Rapids real estate. The concierge searches Holden's site first — and the open web if it has to — then gives you a real answer with sources."})]})})}),l.jsx("section",{className:"section-padding bg-background",children:l.jsx("div",{className:"container-page max-w-4xl",children:l.jsx(_e,{children:l.jsx(C6e,{})})})}),l.jsx("section",{className:"section-padding bg-secondary/30",children:l.jsx("div",{className:"container-page max-w-4xl",children:l.jsx(_e,{children:l.jsx(_6e,{})})})})]}),B6e=w2("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function qt({className:e,variant:t,...n}){return l.jsx("div",{className:it(B6e({variant:t}),e),...n})}const PI=10,ice=({categoryId:e,parentCategorySlug:t})=>{const[n,r]=C.useState(1),{data:i,isLoading:s}=gr({queryKey:["news-releases",e],queryFn:async()=>{const{data:h,error:A}=await Me.from("aeo_pages").select("id, title, slug, h1, subheadline, intro_text, body_content, created_at, published_at, press_links, status").eq("category_id",e).eq("status","published").order("published_at",{ascending:!1});if(A)throw A;return h}}),a=i||[],o=Math.max(1,Math.ceil(a.length/PI)),c=a.slice((n-1)*PI,n*PI),u=h=>{const f=(h.intro_text||h.body_content||"").replace(/<[^>]*>/g,"").trim();return f.length<=200?f:f.slice(0,200).replace(/\s+\S*$/,"")+"…"},d=h=>h?new Date(h).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"";return l.jsxs("div",{className:"bg-background",children:[l.jsx("section",{className:"py-16 md:py-20",children:l.jsx("div",{className:"container-page max-w-4xl mx-auto",children:l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-4 font-semibold",children:"Press & Media"}),l.jsx("h2",{className:"font-serif text-3xl md:text-4xl font-light mb-4 text-foreground",children:"News & Press Releases"}),l.jsx("div",{className:"w-16 h-px bg-accent mb-6"}),l.jsx("p",{className:"text-foreground/70 max-w-2xl text-lg leading-relaxed",children:"Stay up to date with the latest announcements, market insights, and press coverage. Each release reflects our commitment to transparency and leadership in the Grand Rapids real estate market."})]})})}),l.jsx("div",{className:"container-page max-w-4xl mx-auto",children:l.jsx("div",{className:"h-px bg-gradient-to-r from-accent/40 via-border/60 to-transparent"})}),l.jsx("section",{className:"py-12 md:py-16",children:l.jsx("div",{className:"container-page max-w-4xl mx-auto",children:s?l.jsx("div",{className:"space-y-6",children:[1,2,3].map(h=>l.jsx("div",{className:"h-40 bg-secondary/30 animate-pulse rounded"},h))}):a.length===0?l.jsx("div",{className:"text-center py-16",children:l.jsx("p",{className:"text-muted-foreground text-lg",children:"No press releases published yet."})}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"space-y-6",children:c.map((h,A)=>{const f=h.press_links,p=[f==null?void 0:f.national,f==null?void 0:f.local,f==null?void 0:f.source].filter(Boolean).length;return l.jsx(_e,{delay:A*.05,children:l.jsx("article",{className:"group border border-border/50 hover:border-accent/30 transition-all duration-300 bg-background",children:l.jsxs("div",{className:"p-6 md:p-8",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-muted-foreground",children:[l.jsx(Oo,{className:"w-3.5 h-3.5"}),d(h.published_at||h.created_at)]}),p>0&&l.jsxs(qt,{variant:"secondary",className:"text-xs font-normal",children:["Featured in ",p," outlet",p>1?"s":""]})]}),l.jsx(At,{to:`/news/${h.slug}`,className:"block group-hover:text-accent transition-colors",children:l.jsx("h3",{className:"font-serif text-xl md:text-2xl font-medium leading-snug mb-3",children:h.h1||h.title})}),h.subheadline&&l.jsx("p",{className:"text-accent/80 text-sm font-medium mb-2",children:h.subheadline}),l.jsx("p",{className:"text-foreground/65 leading-relaxed mb-4 text-[0.95rem]",children:u(h)}),l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[f&&l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsx("span",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"As seen in:"}),f.national&&l.jsxs("a",{href:f.national,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-accent hover:underline",children:["National ",l.jsx(eo,{className:"w-3 h-3"})]}),f.local&&l.jsxs("a",{href:f.local,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-accent hover:underline",children:["Local ",l.jsx(eo,{className:"w-3 h-3"})]}),f.source&&l.jsxs("a",{href:f.source,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-accent hover:underline",children:["Source ",l.jsx(eo,{className:"w-3 h-3"})]})]}),l.jsxs(At,{to:`/news/${h.slug}`,className:"inline-flex items-center gap-1.5 text-sm text-accent font-medium hover:gap-2.5 transition-all",children:["Read Full Release ",l.jsx(Va,{className:"w-4 h-4"})]})]})]})})},h.id)})}),o>1&&l.jsxs("div",{className:"flex items-center justify-center gap-4 mt-12",children:[l.jsxs(xe,{variant:"outline",size:"sm",disabled:n===1,onClick:()=>r(h=>Math.max(1,h-1)),children:[l.jsx(_re,{className:"w-4 h-4 mr-1"})," Previous"]}),l.jsxs("span",{className:"text-sm text-muted-foreground",children:["Page ",n," of ",o]}),l.jsxs(xe,{variant:"outline",size:"sm",disabled:n===o,onClick:()=>r(h=>Math.min(o,h+1)),children:["Next ",l.jsx(fc,{className:"w-4 h-4 ml-1"})]})]})]})})})]})},N6e=()=>{const{data:e,isLoading:t}=gr({queryKey:["news-category-flat"],queryFn:async()=>{const{data:n,error:r}=await Me.from("aeo_categories").select("id, name, slug, intro_text, parent_id").eq("slug","news").maybeSingle();if(r)throw r;return n}});return l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"News & Press | Holden Richardson | Grand Rapids Realtor"}),l.jsx("meta",{name:"description",content:"Latest press coverage, market news, and announcements from Holden Richardson — Grand Rapids Realtor at 616 Realty LLC."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/news"}),l.jsx("meta",{property:"og:title",content:"News & Press | Holden Richardson"}),l.jsx("meta",{property:"og:description",content:"Latest press coverage and announcements from Grand Rapids Realtor Holden Richardson."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/news"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"News & Press | Holden Richardson"}),l.jsx("meta",{name:"twitter:description",content:"Latest press coverage and announcements from Grand Rapids Realtor Holden Richardson."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://www.holdengr.com/"},{"@type":"ListItem",position:2,name:"News",item:"https://www.holdengr.com/news"}]})})]}),l.jsx("section",{className:"bg-secondary -mt-20 pt-32 md:pt-40 pb-12 md:pb-16",children:l.jsx("div",{className:"container-page text-center max-w-3xl",children:l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-muted-foreground mb-4",children:"News & Press"}),l.jsx("h1",{className:"heading-display mb-6",children:"In the News"}),l.jsx("p",{className:"text-body text-muted-foreground",children:(e==null?void 0:e.intro_text)||"Press coverage, market announcements, and updates from Holden Richardson and 616 Realty LLC."})]})})}),l.jsx("section",{className:"section-padding bg-background",children:l.jsxs("div",{className:"container-page max-w-5xl",children:[t&&l.jsx("p",{className:"text-center text-muted-foreground",children:"Loading…"}),e&&l.jsx(ice,{categoryId:e.id,parentCategorySlug:""})]})})]})};var II="focusScope.autoFocusOnMount",OI="focusScope.autoFocusOnUnmount",tK={bubbles:!1,cancelable:!0},E6e="FocusScope",WE=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[o,c]=C.useState(null),u=$i(i),d=$i(s),h=C.useRef(null),A=Qt(t,m=>c(m)),f=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let m=function(x){if(f.paused||!o)return;const w=x.target;o.contains(w)?h.current=w:uh(h.current,{select:!0})},g=function(x){if(f.paused||!o)return;const w=x.relatedTarget;w!==null&&(o.contains(w)||uh(h.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const b of x)b.removedNodes.length>0&&uh(o)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const v=new MutationObserver(y);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),v.disconnect()}}},[r,o,f.paused]),C.useEffect(()=>{if(o){rK.add(f);const m=document.activeElement;if(!o.contains(m)){const y=new CustomEvent(II,tK);o.addEventListener(II,u),o.dispatchEvent(y),y.defaultPrevented||(T6e(M6e(sce(o)),{select:!0}),document.activeElement===m&&uh(o))}return()=>{o.removeEventListener(II,u),setTimeout(()=>{const y=new CustomEvent(OI,tK);o.addEventListener(OI,d),o.dispatchEvent(y),y.defaultPrevented||uh(m??document.body,{select:!0}),o.removeEventListener(OI,d),rK.remove(f)},0)}}},[o,u,d,f]);const p=C.useCallback(m=>{if(!n&&!r||f.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(g&&y){const v=m.currentTarget,[x,w]=P6e(v);x&&w?!m.shiftKey&&y===w?(m.preventDefault(),n&&uh(x,{select:!0})):m.shiftKey&&y===x&&(m.preventDefault(),n&&uh(w,{select:!0})):y===v&&m.preventDefault()}},[n,r,f.paused]);return l.jsx(ut.div,{tabIndex:-1,...a,ref:A,onKeyDown:p})});WE.displayName=E6e;function T6e(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(uh(r,{select:t}),document.activeElement!==n)return}function P6e(e){const t=sce(e),n=nK(t,e),r=nK(t.reverse(),e);return[n,r]}function sce(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function nK(e,t){for(const n of e)if(!I6e(n,{upTo:t}))return n}function I6e(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 O6e(e){return e instanceof HTMLInputElement&&"select"in e}function uh(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&O6e(e)&&t&&e.select()}}var rK=F6e();function F6e(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=iK(e,t),e.unshift(t)},remove(t){var n;e=iK(e,t),(n=e[0])==null||n.resume()}}}function iK(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function M6e(e){return e.filter(t=>t.tagName!=="A")}var FI=0;function X6(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??sK()),document.body.insertAdjacentElement("beforeend",e[1]??sK()),FI++,()=>{FI===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),FI--}},[])}function sK(){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 h_="right-scroll-bar-position",f_="width-before-scroll-bar",L6e="with-scroll-bars-hidden",R6e="--removed-body-scroll-bar-size";function MI(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function D6e(e,t){var n=C.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var U6e=typeof window<"u"?C.useLayoutEffect:C.useEffect,aK=new WeakMap;function H6e(e,t){var n=D6e(null,function(r){return e.forEach(function(i){return MI(i,r)})});return U6e(function(){var r=aK.get(n);if(r){var i=new Set(r),s=new Set(e),a=n.current;i.forEach(function(o){s.has(o)||MI(o,null)}),s.forEach(function(o){i.has(o)||MI(o,a)})}aK.set(n,e)},[e]),n}function Q6e(e){return e}function $6e(e,t){t===void 0&&(t=Q6e);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var a=t(s,r);return n.push(a),function(){n=n.filter(function(o){return o!==a})}},assignSyncMedium:function(s){for(r=!0;n.length;){var a=n;n=[],a.forEach(s)}n={push:function(o){return s(o)},filter:function(){return n}}},assignMedium:function(s){r=!0;var a=[];if(n.length){var o=n;n=[],o.forEach(s),a=n}var c=function(){var d=a;a=[],d.forEach(s)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return i}function z6e(e){e===void 0&&(e={});var t=$6e(null);return t.options=Gc({async:!0,ssr:!1},e),t}var ace=function(e){var t=e.sideCar,n=d0(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return C.createElement(r,Gc({},n))};ace.isSideCarExport=!0;function V6e(e,t){return e.useMedium(t),ace}var oce=z6e(),LI=function(){},GE=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:LI,onWheelCapture:LI,onTouchMoveCapture:LI}),i=r[0],s=r[1],a=e.forwardProps,o=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,A=e.sideCar,f=e.noRelative,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,x=e.gapMode,w=d0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=A,k=H6e([n,t]),j=Gc(Gc({},w),i);return C.createElement(C.Fragment,null,d&&C.createElement(b,{sideCar:oce,removeScrollBar:u,shards:h,noRelative:f,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:x}),a?C.cloneElement(C.Children.only(o),Gc(Gc({},j),{ref:k})):C.createElement(v,Gc({},j,{className:c,ref:k}),o))});GE.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};GE.classNames={fullWidth:f_,zeroRight:h_};var K6e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function q6e(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=K6e();return t&&e.setAttribute("nonce",t),e}function W6e(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function G6e(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Y6e=function(){var e=0,t=null;return{add:function(n){e==0&&(t=q6e())&&(W6e(t,n),G6e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},X6e=function(){var e=Y6e();return function(t,n){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},lce=function(){var e=X6e(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},J6e={left:0,top:0,right:0,gap:0},RI=function(e){return parseInt(e||"",10)||0},Z6e=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[RI(n),RI(r),RI(i)]},eHe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return J6e;var t=Z6e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},tHe=lce(),_y="data-scroll-locked",nHe=function(e,t,n,r){var i=e.left,s=e.top,a=e.right,o=e.gap;return n===void 0&&(n="margin"),`
  .`.concat(L6e,` {
   overflow: hidden `).concat(r,`;
   padding-right: `).concat(o,"px ").concat(r,`;
  }
  body[`).concat(_y,`] {
    overflow: hidden `).concat(r,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
    padding-left: `.concat(i,`px;
    padding-top: `).concat(s,`px;
    padding-right: `).concat(a,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(o,"px ").concat(r,`;
    `),n==="padding"&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(h_,` {
    right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(f_,` {
    margin-right: `).concat(o,"px ").concat(r,`;
  }
  
  .`).concat(h_," .").concat(h_,` {
    right: 0 `).concat(r,`;
  }
  
  .`).concat(f_," .").concat(f_,` {
    margin-right: 0 `).concat(r,`;
  }
  
  body[`).concat(_y,`] {
    `).concat(R6e,": ").concat(o,`px;
  }
`)},oK=function(){var e=parseInt(document.body.getAttribute(_y)||"0",10);return isFinite(e)?e:0},rHe=function(){C.useEffect(function(){return document.body.setAttribute(_y,(oK()+1).toString()),function(){var e=oK()-1;e<=0?document.body.removeAttribute(_y):document.body.setAttribute(_y,e.toString())}},[])},iHe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;rHe();var s=C.useMemo(function(){return eHe(i)},[i]);return C.createElement(tHe,{styles:nHe(s,!t,i,n?"":"!important")})},lM=!1;if(typeof window<"u")try{var BS=Object.defineProperty({},"passive",{get:function(){return lM=!0,!0}});window.addEventListener("test",BS,BS),window.removeEventListener("test",BS,BS)}catch{lM=!1}var lg=lM?{passive:!1}:!1,sHe=function(e){return e.tagName==="TEXTAREA"},cce=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!sHe(e)&&n[t]==="visible")},aHe=function(e){return cce(e,"overflowY")},oHe=function(e){return cce(e,"overflowX")},lK=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=uce(e,r);if(i){var s=dce(e,r),a=s[1],o=s[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},lHe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},cHe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},uce=function(e,t){return e==="v"?aHe(t):oHe(t)},dce=function(e,t){return e==="v"?lHe(t):cHe(t)},uHe=function(e,t){return e==="h"&&t==="rtl"?-1:1},dHe=function(e,t,n,r,i){var s=uHe(e,window.getComputedStyle(t).direction),a=s*r,o=n.target,c=t.contains(o),u=!1,d=a>0,h=0,A=0;do{if(!o)break;var f=dce(e,o),p=f[0],m=f[1],g=f[2],y=m-g-s*p;(p||y)&&uce(e,o)&&(h+=y,A+=p);var v=o.parentNode;o=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&o!==document.body||c&&(t.contains(o)||t===o));return(d&&(Math.abs(h)<1||!i)||!d&&(Math.abs(A)<1||!i))&&(u=!0),u},NS=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cK=function(e){return[e.deltaX,e.deltaY]},uK=function(e){return e&&"current"in e?e.current:e},hHe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},fHe=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},AHe=0,cg=[];function pHe(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState(AHe++)[0],s=C.useState(lce)[0],a=C.useRef(e);C.useEffect(function(){a.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var m=zTe([e.lockRef.current],(e.shards||[]).map(uK),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var o=C.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!a.current.allowPinchZoom;var y=NS(m),v=n.current,x="deltaX"in m?m.deltaX:v[0]-y[0],w="deltaY"in m?m.deltaY:v[1]-y[1],b,k=m.target,j=Math.abs(x)>Math.abs(w)?"h":"v";if("touches"in m&&j==="h"&&k.type==="range")return!1;var B=lK(j,k);if(!B)return!0;if(B?b=j:(b=j==="v"?"h":"v",B=lK(j,k)),!B)return!1;if(!r.current&&"changedTouches"in m&&(x||w)&&(r.current=b),!b)return!0;var E=r.current||b;return dHe(E,g,m,E==="h"?x:w,!0)},[]),c=C.useCallback(function(m){var g=m;if(!(!cg.length||cg[cg.length-1]!==s)){var y="deltaY"in g?cK(g):NS(g),v=t.current.filter(function(b){return b.name===g.type&&(b.target===g.target||g.target===b.shadowParent)&&hHe(b.delta,y)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var x=(a.current.shards||[]).map(uK).filter(Boolean).filter(function(b){return b.contains(g.target)}),w=x.length>0?o(g,x[0]):!a.current.noIsolation;w&&g.cancelable&&g.preventDefault()}}},[]),u=C.useCallback(function(m,g,y,v){var x={name:m,delta:g,target:y,should:v,shadowParent:mHe(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(w){return w!==x})},1)},[]),d=C.useCallback(function(m){n.current=NS(m),r.current=void 0},[]),h=C.useCallback(function(m){u(m.type,cK(m),m.target,o(m,e.lockRef.current))},[]),A=C.useCallback(function(m){u(m.type,NS(m),m.target,o(m,e.lockRef.current))},[]);C.useEffect(function(){return cg.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:A}),document.addEventListener("wheel",c,lg),document.addEventListener("touchmove",c,lg),document.addEventListener("touchstart",d,lg),function(){cg=cg.filter(function(m){return m!==s}),document.removeEventListener("wheel",c,lg),document.removeEventListener("touchmove",c,lg),document.removeEventListener("touchstart",d,lg)}},[]);var f=e.removeScrollBar,p=e.inert;return C.createElement(C.Fragment,null,p?C.createElement(s,{styles:fHe(i)}):null,f?C.createElement(iHe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function mHe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const gHe=V6e(oce,pHe);var YE=C.forwardRef(function(e,t){return C.createElement(GE,Gc({},e,{ref:t,sideCar:gHe}))});YE.classNames=GE.classNames;var yHe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ug=new WeakMap,ES=new WeakMap,TS={},DI=0,hce=function(e){return e&&(e.host||hce(e.parentNode))},vHe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=hce(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},xHe=function(e,t,n,r){var i=vHe(t,Array.isArray(e)?e:[e]);TS[n]||(TS[n]=new WeakMap);var s=TS[n],a=[],o=new Set,c=new Set(i),u=function(h){!h||o.has(h)||(o.add(h),u(h.parentNode))};i.forEach(u);var d=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(A){if(o.has(A))d(A);else try{var f=A.getAttribute(r),p=f!==null&&f!=="false",m=(ug.get(A)||0)+1,g=(s.get(A)||0)+1;ug.set(A,m),s.set(A,g),a.push(A),m===1&&p&&ES.set(A,!0),g===1&&A.setAttribute(n,"true"),p||A.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",A,y)}})};return d(t),o.clear(),DI++,function(){a.forEach(function(h){var A=ug.get(h)-1,f=s.get(h)-1;ug.set(h,A),s.set(h,f),A||(ES.has(h)||h.removeAttribute(r),ES.delete(h)),f||h.removeAttribute(n)}),DI--,DI||(ug=new WeakMap,ug=new WeakMap,ES=new WeakMap,TS={})}},J6=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=yHe(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),xHe(r,i,n,"aria-hidden")):function(){return null}},XE="Dialog",[fce,Ace]=Wi(XE),[wHe,bc]=fce(XE),pce=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,o=C.useRef(null),c=C.useRef(null),[u,d]=ja({prop:r,defaultProp:i??!1,onChange:s,caller:XE});return l.jsx(wHe,{scope:t,triggerRef:o,contentRef:c,contentId:yl(),titleId:yl(),descriptionId:yl(),open:u,onOpenChange:d,onOpenToggle:C.useCallback(()=>d(h=>!h),[d]),modal:a,children:n})};pce.displayName=XE;var mce="DialogTrigger",gce=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bc(mce,n),s=Qt(t,i.triggerRef);return l.jsx(ut.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":tH(i.open),...r,ref:s,onClick:et(e.onClick,i.onOpenToggle)})});gce.displayName=mce;var Z6="DialogPortal",[bHe,yce]=fce(Z6,{forceMount:void 0}),vce=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=bc(Z6,t);return l.jsx(bHe,{scope:t,forceMount:n,children:C.Children.map(r,a=>l.jsx(ia,{present:n||s.open,children:l.jsx(v2,{asChild:!0,container:i,children:a})}))})};vce.displayName=Z6;var Pj="DialogOverlay",xce=C.forwardRef((e,t)=>{const n=yce(Pj,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=bc(Pj,e.__scopeDialog);return s.modal?l.jsx(ia,{present:r||s.open,children:l.jsx(SHe,{...i,ref:t})}):null});xce.displayName=Pj;var CHe=Qp("DialogOverlay.RemoveScroll"),SHe=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bc(Pj,n);return l.jsx(YE,{as:CHe,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx(ut.div,{"data-state":tH(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Xp="DialogContent",wce=C.forwardRef((e,t)=>{const n=yce(Xp,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=bc(Xp,e.__scopeDialog);return l.jsx(ia,{present:r||s.open,children:s.modal?l.jsx(kHe,{...i,ref:t}):l.jsx(_He,{...i,ref:t})})});wce.displayName=Xp;var kHe=C.forwardRef((e,t)=>{const n=bc(Xp,e.__scopeDialog),r=C.useRef(null),i=Qt(t,n.contentRef,r);return C.useEffect(()=>{const s=r.current;if(s)return J6(s)},[]),l.jsx(bce,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:et(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:et(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&s.preventDefault()}),onFocusOutside:et(e.onFocusOutside,s=>s.preventDefault())})}),_He=C.forwardRef((e,t)=>{const n=bc(Xp,e.__scopeDialog),r=C.useRef(!1),i=C.useRef(!1);return l.jsx(bce,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,o;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),bce=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,o=bc(Xp,n),c=C.useRef(null),u=Qt(t,c);return X6(),l.jsxs(l.Fragment,{children:[l.jsx(WE,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:l.jsx(Zv,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":tH(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(BHe,{titleId:o.titleId}),l.jsx(EHe,{contentRef:c,descriptionId:o.descriptionId})]})]})}),eH="DialogTitle",Cce=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bc(eH,n);return l.jsx(ut.h2,{id:i.titleId,...r,ref:t})});Cce.displayName=eH;var Sce="DialogDescription",kce=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bc(Sce,n);return l.jsx(ut.p,{id:i.descriptionId,...r,ref:t})});kce.displayName=Sce;var _ce="DialogClose",jce=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=bc(_ce,n);return l.jsx(ut.button,{type:"button",...r,ref:t,onClick:et(e.onClick,()=>i.onOpenChange(!1))})});jce.displayName=_ce;function tH(e){return e?"open":"closed"}var Bce="DialogTitleWarning",[jHe,Nce]=w1e(Bce,{contentName:Xp,titleName:eH,docsSlug:"dialog"}),BHe=({titleId:e})=>{const t=Nce(Bce),n=`\`${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 C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},NHe="DialogDescriptionWarning",EHe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Nce(NHe).contentName}}.`;return C.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},nH=pce,THe=gce,rH=vce,F2=xce,M2=wce,L2=Cce,R2=kce,JE=jce;const No=nH,PHe=rH,Ece=C.forwardRef(({className:e,...t},n)=>l.jsx(F2,{ref:n,className:it("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Ece.displayName=F2.displayName;const Ka=C.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(PHe,{children:[l.jsx(Ece,{}),l.jsxs(M2,{ref:r,className:it("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,l.jsxs(JE,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[l.jsx(ta,{className:"h-4 w-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ka.displayName=M2.displayName;const qa=({className:e,...t})=>l.jsx("div",{className:it("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});qa.displayName="DialogHeader";const Wa=C.forwardRef(({className:e,...t},n)=>l.jsx(L2,{ref:n,className:it("text-lg font-semibold leading-none tracking-tight",e),...t}));Wa.displayName=L2.displayName;const Ij=C.forwardRef(({className:e,...t},n)=>l.jsx(R2,{ref:n,className:it("text-sm text-muted-foreground",e),...t}));Ij.displayName=R2.displayName;const qf=C.forwardRef(({className:e,...t},n)=>l.jsx("div",{className:"relative w-full overflow-auto",children:l.jsx("table",{ref:n,className:it("w-full caption-bottom text-sm",e),...t})}));qf.displayName="Table";const Wf=C.forwardRef(({className:e,...t},n)=>l.jsx("thead",{ref:n,className:it("[&_tr]:border-b",e),...t}));Wf.displayName="TableHeader";const Gf=C.forwardRef(({className:e,...t},n)=>l.jsx("tbody",{ref:n,className:it("[&_tr:last-child]:border-0",e),...t}));Gf.displayName="TableBody";const IHe=C.forwardRef(({className:e,...t},n)=>l.jsx("tfoot",{ref:n,className:it("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));IHe.displayName="TableFooter";const Ei=C.forwardRef(({className:e,...t},n)=>l.jsx("tr",{ref:n,className:it("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Ei.displayName="TableRow";const yn=C.forwardRef(({className:e,...t},n)=>l.jsx("th",{ref:n,className:it("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));yn.displayName="TableHead";const sn=C.forwardRef(({className:e,...t},n)=>l.jsx("td",{ref:n,className:it("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));sn.displayName="TableCell";const OHe=C.forwardRef(({className:e,...t},n)=>l.jsx("caption",{ref:n,className:it("mt-4 text-sm text-muted-foreground",e),...t}));OHe.displayName="TableCaption";function D2(e){const t=C.useRef({value:e,previous:e});return C.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var ZE="Switch",[FHe,oPt]=Wi(ZE),[MHe,LHe]=FHe(ZE),Tce=C.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:c="on",onCheckedChange:u,form:d,...h}=e,[A,f]=C.useState(null),p=Qt(t,x=>f(x)),m=C.useRef(!1),g=A?d||!!A.closest("form"):!0,[y,v]=ja({prop:i,defaultProp:s??!1,onChange:u,caller:ZE});return l.jsxs(MHe,{scope:n,checked:y,disabled:o,children:[l.jsx(ut.button,{type:"button",role:"switch","aria-checked":y,"aria-required":a,"data-state":Fce(y),"data-disabled":o?"":void 0,disabled:o,value:c,...h,ref:p,onClick:et(e.onClick,x=>{v(w=>!w),g&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})}),g&&l.jsx(Oce,{control:A,bubbles:!m.current,name:r,value:c,checked:y,required:a,disabled:o,form:d,style:{transform:"translateX(-100%)"}})]})});Tce.displayName=ZE;var Pce="SwitchThumb",Ice=C.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=LHe(Pce,n);return l.jsx(ut.span,{"data-state":Fce(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});Ice.displayName=Pce;var RHe="SwitchBubbleInput",Oce=C.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},s)=>{const a=C.useRef(null),o=Qt(a,s),c=D2(n),u=k2(t);return C.useEffect(()=>{const d=a.current;if(!d)return;const h=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&f){const p=new Event("click",{bubbles:r});f.call(d,n),d.dispatchEvent(p)}},[c,n,r]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Oce.displayName=RHe;function Fce(e){return e?"checked":"unchecked"}var Mce=Tce,DHe=Ice;const pc=C.forwardRef(({className:e,...t},n)=>l.jsx(Mce,{className:it("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:l.jsx(DHe,{className:it("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));pc.displayName=Mce.displayName;var Lce={exports:{}},Rce={};/**
 * @license React
 * use-sync-external-store-shim.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var fv=C;function UHe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var HHe=typeof Object.is=="function"?Object.is:UHe,QHe=fv.useState,$He=fv.useEffect,zHe=fv.useLayoutEffect,VHe=fv.useDebugValue;function KHe(e,t){var n=t(),r=QHe({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return zHe(function(){i.value=n,i.getSnapshot=t,UI(i)&&s({inst:i})},[e,n,t]),$He(function(){return UI(i)&&s({inst:i}),e(function(){UI(i)&&s({inst:i})})},[e]),VHe(n),n}function UI(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!HHe(e,n)}catch{return!0}}function qHe(e,t){return t()}var WHe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?qHe:KHe;Rce.useSyncExternalStore=fv.useSyncExternalStore!==void 0?fv.useSyncExternalStore:WHe;Lce.exports=Rce;var iH=Lce.exports;function ws(e){this.content=e}ws.prototype={constructor:ws,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),s=r.content.slice();return i==-1?s.push(n||e,t):(s[i+1]=t,n&&(s[i]=n)),new ws(s)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new ws(n)},addToStart:function(e,t){return new ws([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new ws(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),s=r.find(e);return i.splice(s==-1?i.length:s,0,t,n),new ws(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=ws.from(e),e.size?new ws(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=ws.from(e),e.size?new ws(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=ws.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};ws.from=function(e){if(e instanceof ws)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new ws(t)};function Dce(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),s=t.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let a=0;i.text[a]==s.text[a];a++)n++;return n}if(i.content.size||s.content.size){let a=Dce(i.content,s.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function Uce(e,t,n,r){for(let i=e.childCount,s=t.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let a=e.child(--i),o=t.child(--s),c=a.nodeSize;if(a==o){n-=c,r-=c;continue}if(!a.sameMarkup(o))return{a:n,b:r};if(a.isText&&a.text!=o.text){let u=0,d=Math.min(a.text.length,o.text.length);for(;u<d&&a.text[a.text.length-u-1]==o.text[o.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(a.content.size||o.content.size){let u=Uce(a.content,o.content,n-1,r-1);if(u)return u}n-=c,r-=c}}class Qe{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,s){for(let a=0,o=0;o<n;a++){let c=this.content[a],u=o+c.nodeSize;if(u>t&&r(c,i+o,s||null,a)!==!1&&c.content.size){let d=o+1;c.nodesBetween(Math.max(0,t-d),Math.min(c.content.size,n-d),r,i+d)}o=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let s="",a=!0;return this.nodesBetween(t,n,(o,c)=>{let u=o.isText?o.text.slice(Math.max(t,c)-c,n-c):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&u||o.isTextblock)&&r&&(a?a=!1:s+=r),s+=u},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<t.content.length;s++)i.push(t.content[s]);return new Qe(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let s=0,a=0;a<n;s++){let o=this.content[s],c=a+o.nodeSize;c>t&&((a<t||c>n)&&(o.isText?o=o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o=o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=c}return new Qe(r,i)}cutByIndex(t,n){return t==n?Qe.empty:t==0&&n==this.content.length?this:new Qe(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new Qe(i,s)}addToStart(t){return new Qe([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Qe(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return Dce(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return Uce(this,t,n,r)}findIndex(t){if(t==0)return PS(0,t);if(t==this.size)return PS(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=t)return s==t?PS(n+1,s):PS(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return Qe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Qe(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Qe.empty;let n,r=0;for(let i=0;i<t.length;i++){let s=t[i];r+=s.nodeSize,i&&s.isText&&t[i-1].sameMarkup(s)?(n||(n=t.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new Qe(n||t,r)}static from(t){if(!t)return Qe.empty;if(t instanceof Qe)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Qe([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Qe.empty=new Qe([],0);const HI={index:0,offset:0};function PS(e,t){return HI.index=e,HI.offset=t,HI}function Oj(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!Oj(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!Oj(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let sr=class cM{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let s=t[i];if(this.eq(s))return t;if(this.type.excludes(s.type))n||(n=t.slice(0,i));else{if(s.type.excludes(this.type))return t;!r&&s.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&Oj(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return cM.none;if(t instanceof cM)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};sr.none=[];class Fj extends Error{}class at{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Qce(this.content,t+this.openStart,n);return r&&new at(r,this.openStart,this.openEnd)}removeBetween(t,n){return new at(Hce(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return at.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new at(Qe.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let s=t.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new at(t,r,i)}}at.empty=new at(Qe.empty,0,0);function Hce(e,t,n){let{index:r,offset:i}=e.findIndex(t),s=e.maybeChild(r),{index:a,offset:o}=e.findIndex(n);if(i==t||s.isText){if(o!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(r,s.copy(Hce(s.content,t-i-1,n-i-1)))}function Qce(e,t,n,r){let{index:i,offset:s}=e.findIndex(t),a=e.maybeChild(i);if(s==t||a.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let o=Qce(a.content,t-s-1,n,a);return o&&e.replaceChild(i,a.copy(o))}function GHe(e,t,n){if(n.openStart>e.depth)throw new Fj("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Fj("Inconsistent open depths");return $ce(e,t,n,0)}function $ce(e,t,n,r){let i=e.index(r),s=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let a=$ce(e,t,n,r+1);return s.copy(s.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let a=e.parent,o=a.content;return jp(a,o.cut(0,e.parentOffset).append(n.content).append(o.cut(t.parentOffset)))}else{let{start:a,end:o}=YHe(n,e);return jp(s,Vce(e,a,o,t,r))}else return jp(s,Mj(e,t,r))}function zce(e,t){if(!t.type.compatibleContent(e.type))throw new Fj("Cannot join "+t.type.name+" onto "+e.type.name)}function uM(e,t,n){let r=e.node(n);return zce(r,t.node(n)),r}function _p(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Uw(e,t,n,r){let i=(t||e).node(n),s=0,a=t?t.index(n):i.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(_p(e.nodeAfter,r),s++));for(let o=s;o<a;o++)_p(i.child(o),r);t&&t.depth==n&&t.textOffset&&_p(t.nodeBefore,r)}function jp(e,t){return e.type.checkContent(t),e.copy(t)}function Vce(e,t,n,r,i){let s=e.depth>i&&uM(e,t,i+1),a=r.depth>i&&uM(n,r,i+1),o=[];return Uw(null,e,i,o),s&&a&&t.index(i)==n.index(i)?(zce(s,a),_p(jp(s,Vce(e,t,n,r,i+1)),o)):(s&&_p(jp(s,Mj(e,t,i+1)),o),Uw(t,n,i,o),a&&_p(jp(a,Mj(n,r,i+1)),o)),Uw(r,null,i,o),new Qe(o)}function Mj(e,t,n){let r=[];if(Uw(null,e,n,r),e.depth>n){let i=uM(e,t,n+1);_p(jp(i,Mj(e,t,n+1)),r)}return Uw(t,null,n,r),new Qe(r)}function YHe(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let s=n-1;s>=0;s--)i=t.node(s).copy(Qe.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class Jb{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<t;s++)i+=r.child(s).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return sr.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let o=r;r=i,i=o}let s=r.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive===!1&&(!i||!s[a].isInSet(i.marks))&&(s=s[a--].removeFromSet(s));return s}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Lj(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let a=t;;){let{index:o,offset:c}=a.content.findIndex(s),u=s-c;if(r.push(a,o,i+c),!u||(a=a.child(o),a.isText))break;s=u-1,i+=c+1}return new Jb(n,r,s)}static resolveCached(t,n){let r=dK.get(t);if(r)for(let s=0;s<r.elts.length;s++){let a=r.elts[s];if(a.pos==n)return a}else dK.set(t,r=new XHe);let i=r.elts[r.i]=Jb.resolve(t,n);return r.i=(r.i+1)%JHe,i}}class XHe{constructor(){this.elts=[],this.i=0}}const JHe=12,dK=new WeakMap;class Lj{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const ZHe=Object.create(null);let df=class dM{constructor(t,n,r,i=sr.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||Qe.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&Oj(this.attrs,n||t.defaultAttrs||ZHe)&&sr.sameSet(this.marks,r||sr.none)}copy(t=null){return t==this.content?this:new dM(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new dM(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return at.empty;let i=this.resolve(t),s=this.resolve(n),a=r?0:i.sharedDepth(n),o=i.start(a),u=i.node(a).content.cut(i.pos-o,s.pos-o);return new at(u,i.depth-a,s.depth-a)}replace(t,n,r){return GHe(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Jb.resolveCached(this,t)}resolveNoCache(t){return Jb.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Kce(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=Qe.empty,i=0,s=r.childCount){let a=this.contentMatchAt(t).matchFragment(r,i,s),o=a&&a.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let c=i;c<s;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(t).matchType(r),a=s&&s.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=sr.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!sr.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=Qe.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};df.prototype.text=void 0;class Rj extends df{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Kce(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new Rj(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new Rj(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function Kce(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Jp{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new eQe(t,n);if(r.next==null)return Jp.empty;let i=qce(r);r.next&&r.err("Unexpected trailing text");let s=oQe(aQe(i));return lQe(s,r),s}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(t.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function s(a,o){let c=a.matchFragment(t,r);if(c&&(!n||c.validEnd))return Qe.from(o.map(u=>u.createAndFill()));for(let u=0;u<a.next.length;u++){let{type:d,next:h}=a.next[u];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let A=s(h,o.concat(d));if(A)return A}}return null}return s(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(t)){let a=[];for(let o=i;o.type;o=o.via)a.push(o.type);return a.reverse()}for(let a=0;a<s.next.length;a++){let{type:o,next:c}=s.next[a];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!i.type||c.validEnd)&&(r.push({match:o.contentMatch,type:o,via:i}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)s+=(a?", ":"")+r.next[a].type.name+"->"+t.indexOf(r.next[a].next);return s}).join(`
`)}}Jp.empty=new Jp(!0);class eQe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function qce(e){let t=[];do t.push(tQe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function tQe(e){let t=[];do t.push(nQe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function nQe(e){let t=sQe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=rQe(e,t);else break;return t}function hK(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function rQe(e,t){let n=hK(e),r=n;return e.eat(",")&&(e.next!="}"?r=hK(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function iQe(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let s in n){let a=n[s];a.isInGroup(t)&&i.push(a)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function sQe(e){if(e.eat("(")){let t=qce(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=iQe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function aQe(e){let t=[[]];return i(s(e,0),n()),t;function n(){return t.push([])-1}function r(a,o,c){let u={term:c,to:o};return t[a].push(u),u}function i(a,o){a.forEach(c=>c.to=o)}function s(a,o){if(a.type=="choice")return a.exprs.reduce((c,u)=>c.concat(s(u,o)),[]);if(a.type=="seq")for(let c=0;;c++){let u=s(a.exprs[c],o);if(c==a.exprs.length-1)return u;i(u,o=n())}else if(a.type=="star"){let c=n();return r(o,c),i(s(a.expr,c),c),[r(c)]}else if(a.type=="plus"){let c=n();return i(s(a.expr,o),c),i(s(a.expr,c),c),[r(c)]}else{if(a.type=="opt")return[r(o)].concat(s(a.expr,o));if(a.type=="range"){let c=o;for(let u=0;u<a.min;u++){let d=n();i(s(a.expr,c),d),c=d}if(a.max==-1)i(s(a.expr,c),c);else for(let u=a.min;u<a.max;u++){let d=n();r(c,d),i(s(a.expr,c),d),c=d}return[r(c)]}else{if(a.type=="name")return[r(o,void 0,a.value)];throw new Error("Unknown expr type")}}}}function Wce(e,t){return t-e}function fK(e,t){let n=[];return r(t),n.sort(Wce);function r(i){let s=e[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let a=0;a<s.length;a++){let{term:o,to:c}=s[a];!o&&n.indexOf(c)==-1&&r(c)}}}function oQe(e){let t=Object.create(null);return n(fK(e,0));function n(r){let i=[];r.forEach(a=>{e[a].forEach(({term:o,to:c})=>{if(!o)return;let u;for(let d=0;d<i.length;d++)i[d][0]==o&&(u=i[d][1]);fK(e,c).forEach(d=>{u||i.push([o,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let s=t[r.join(",")]=new Jp(r.indexOf(e.length-1)>-1);for(let a=0;a<i.length;a++){let o=i[a][1].sort(Wce);s.next.push({type:i[a][0],next:t[o.join(",")]||n(o)})}return s}}function lQe(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],s=!i.validEnd,a=[];for(let o=0;o<i.next.length;o++){let{type:c,next:u}=i.next[o];a.push(c.name),s&&!(c.isText||c.hasRequiredAttrs())&&(s=!1),r.indexOf(u)==-1&&r.push(u)}s&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Gce(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Yce(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let s=e[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Xce(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in e){let s=e[i];s.validate&&s.validate(t[i])}}function Jce(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new uQe(e,r,t[r]);return n}let AK=class Zce{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Jce(t,r.attrs),this.defaultAttrs=Gce(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Jp.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:Yce(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new df(this,this.computeAttrs(t),Qe.from(n),sr.setFrom(r))}createChecked(t=null,n,r){return n=Qe.from(n),this.checkContent(n),new df(this,this.computeAttrs(t),n,sr.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=Qe.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(Qe.empty,!0);return s?new df(this,t,n.append(s),sr.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){Xce(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:sr.none:t}static compile(t,n){let r=Object.create(null);t.forEach((s,a)=>r[s]=new Zce(s,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function cQe(e,t,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${s}`)}}class uQe{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?cQe(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class e5{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=Jce(t,i.attrs),this.excluded=null;let s=Gce(this.attrs);this.instance=s?new sr(this,s):null}create(t=null){return!t&&this.instance?this.instance:new sr(this,Yce(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((s,a)=>r[s]=new e5(s,i++,n,a)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){Xce(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class eue{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=ws.from(t.nodes),n.marks=ws.from(t.marks||{}),this.nodes=AK.compile(this.spec.nodes,this),this.marks=e5.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],a=s.spec.content||"",o=s.spec.marks;if(s.contentMatch=r[a]||(r[a]=Jp.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=o=="_"?null:o?pK(this,o.split(" ")):o==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],a=s.spec.excludes;s.excluded=a==null?[s]:a==""?[]:pK(this,a.split(" "))}this.nodeFromJSON=i=>df.fromJSON(this,i),this.markFromJSON=i=>sr.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof AK){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new Rj(r,r.defaultAttrs,t,sr.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function pK(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e.marks[i],a=s;if(s)n.push(s);else for(let o in e.marks){let c=e.marks[o];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function dQe(e){return e.tag!=null}function hQe(e){return e.style!=null}class hf{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(dQe(i))this.tags.push(i);else if(hQe(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=t.nodes[i.node];return s.contentMatch.matchType(s)})}parse(t,n={}){let r=new gK(this,n,!1);return r.addAll(t,sr.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new gK(this,n,!0);return r.addAll(t,sr.none,n.from,n.to),at.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(pQe(t,s.tag)&&(s.namespace===void 0||t.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let a=s.getAttrs(t);if(a===!1)continue;s.attrs=a||void 0}return s}}}matchStyle(t,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let a=this.styles[s],o=a.style;if(!(o.indexOf(t)!=0||a.context&&!r.matchesContext(a.context)||o.length>t.length&&(o.charCodeAt(t.length)!=61||o.slice(t.length+1)!=n))){if(a.getAttrs){let c=a.getAttrs(n);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(t){let n=[];function r(i){let s=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let o=n[a];if((o.priority==null?50:o.priority)<s)break}n.splice(a,0,i)}for(let i in t.marks){let s=t.marks[i].spec.parseDOM;s&&s.forEach(a=>{r(a=yK(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in t.nodes){let s=t.nodes[i].spec.parseDOM;s&&s.forEach(a=>{r(a=yK(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new hf(t,hf.schemaRules(t)))}}const tue={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},fQe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},nue={ol:!0,ul:!0},Zb=1,hM=2,Hw=4;function mK(e,t,n){return t!=null?(t?Zb:0)|(t==="full"?hM:0):e&&e.whitespace=="pre"?Zb|hM:n&~Hw}class IS{constructor(t,n,r,i,s,a){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=sr.none,this.match=s||(a&Hw?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Qe.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Zb)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=Qe.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(Qe.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!tue.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class gK{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,a=mK(null,n.preserveWhitespace,0)|(r?Hw:0);i?s=new IS(i.type,i.attrs,sr.none,!0,n.topMatch||i.type.contentMatch,a):r?s=new IS(null,null,sr.none,!0,null,a):s=new IS(t.schema.topNodeType,null,sr.none,!0,null,a),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,s=i.options&hM?"full":this.localPreserveWS||(i.options&Zb)>0,{schema:a}=this.parser;if(s==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
`);else if(a.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(a.linebreakReplacement.create())){let o=r.split(/\r?\n|\r/);for(let c=0;c<o.length;c++)c&&this.insertNode(a.linebreakReplacement.create(),n,!0),o[c]&&this.insertNode(a.text(o[c]),n,!/\S/.test(o[c]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],c=t.previousSibling;(!o||c&&c.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(r=r.slice(1))}r&&this.insertNode(a.text(r),n,!/\S/.test(r)),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,s=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let a=t.nodeName.toLowerCase(),o;nue.hasOwnProperty(a)&&this.parser.normalizeLists&&AQe(t);let c=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(o=this.parser.matchTag(t,this,r));e:if(c?c.ignore:fQe.hasOwnProperty(a))this.findInside(t),this.ignoreFallback(t,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(t=c.skip);let u,d=this.needsBlock;if(tue.hasOwnProperty(a))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),u=!0,s.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let h=c&&c.skip?n:this.readStyles(t,n);h&&this.addAll(t,h),u&&this.sync(s),this.needsBlock=d}else{let u=this.readStyles(t,n);u&&this.addElementByRule(t,c,u,c.consuming===!1?o:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
`),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],a=r.getPropertyValue(s);if(a)for(let o=void 0;;){let c=this.parser.matchStyle(s,a,this,o);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(u=>!c.clearMark(u)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)o=c;else break}}return n}addElementByRule(t,n,r,i){let s,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let c=this.enter(a,n.attrs||null,r,n.preserveWhitespace);c&&(s=!0,r=c)}else{let c=this.parser.schema.marks[n.mark];r=r.concat(c.create(n.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(c=>this.insertNode(c,r,!1));else{let c=t;typeof n.contentElement=="string"?c=t.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(t):n.contentElement&&(c=n.contentElement),this.findAround(t,c,!0),this.addAll(c,r),this.findAround(t,c,!1)}s&&this.sync(o)&&this.open--}addAll(t,n,r,i){let s=r||0;for(let a=r?t.childNodes[r]:t.firstChild,o=i==null?null:t.childNodes[i];a!=o;a=a.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(a,n);this.findAtPoint(t,s)}findPlace(t,n,r){let i,s;for(let a=this.open,o=0;a>=0;a--){let c=this.nodes[a],u=c.findWrapping(t);if(u&&(!i||i.length>u.length+o)&&(i=u,s=c,!u.length))break;if(c.solid){if(r)break;o+=2}}if(!i)return null;this.sync(s);for(let a=0;a<i.length;a++)n=this.enterInner(i[a],null,n,!1);return n}insertNode(t,n,r){if(t.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(t,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(t.type));let a=sr.none;for(let o of i.concat(t.marks))(s.type?s.type.allowsMarkType(o.type):vK(o.type,t.type))&&(a=o.addToSet(a));return s.content.push(t.mark(a)),!0}return!1}enter(t,n,r,i){let s=this.findPlace(t.create(n),r,!1);return s&&(s=this.enterInner(t,n,r,!0,i)),s}enterInner(t,n,r,i=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(t);let o=mK(t,s,a.options);a.options&Hw&&a.content.length==0&&(o|=Hw);let c=sr.none;return r=r.filter(u=>(a.type?a.type.allowsMarkType(u.type):vK(u.type,t))?(c=u.addToSet(c),!1):!0),this.nodes.push(new IS(t,n,c,i,null,o)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Zb)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),a=(o,c)=>{for(;o>=0;o--){let u=n[o];if(u==""){if(o==n.length-1||o==0)continue;for(;c>=s;c--)if(a(o-1,c))return!0;return!1}else{let d=c>0||c==0&&i?this.nodes[c].type:r&&c>=s?r.node(c-s).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;c--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function AQe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&nue.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function pQe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function yK(e){let t={};for(let n in e)t[n]=e[n];return t}function vK(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let s=[],a=o=>{s.push(o);for(let c=0;c<o.edgeCount;c++){let{type:u,next:d}=o.edge(c);if(u==t||s.indexOf(d)<0&&a(d))return!0}};if(a(i.contentMatch))return!0}}class xm{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=QI(n).createDocumentFragment());let i=r,s=[];return t.forEach(a=>{if(s.length||a.marks.length){let o=0,c=0;for(;o<s.length&&c<a.marks.length;){let u=a.marks[c];if(!this.marks[u.type.name]){c++;continue}if(!u.eq(s[o][0])||u.type.spec.spanning===!1)break;o++,c++}for(;o<s.length;)i=s.pop()[1];for(;c<a.marks.length;){let u=a.marks[c++],d=this.serializeMark(u,a.isInline,n);d&&(s.push([u,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=A_(QI(n),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let s=this.serializeMark(t.marks[i],t.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&A_(QI(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return A_(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new xm(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=xK(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return xK(t.marks)}}function xK(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function QI(e){return e.document||window.document}const wK=new WeakMap;function mQe(e){let t=wK.get(e);return t===void 0&&wK.set(e,t=gQe(e)),t}function gQe(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(e),t}function A_(e,t,n,r){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=mQe(r))&&s.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let o,c=n?e.createElementNS(n,i):e.createElement(i),u=t[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let h in u)if(u[h]!=null){let A=h.indexOf(" ");A>0?c.setAttributeNS(h.slice(0,A),h.slice(A+1),u[h]):h=="style"&&c.style?c.style.cssText=u[h]:c.setAttribute(h,u[h])}}for(let h=d;h<t.length;h++){let A=t[h];if(A===0){if(h<t.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:f,contentDOM:p}=A_(e,A,n,r);if(c.appendChild(f),p){if(o)throw new RangeError("Multiple content holes");o=p}}}return{dom:c,contentDOM:o}}const rue=65535,iue=Math.pow(2,16);function yQe(e,t){return e+t*iue}function bK(e){return e&rue}function vQe(e){return(e-(e&rue))/iue}const sue=1,aue=2,p_=4,oue=8;class fM{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&oue)>0}get deletedBefore(){return(this.delInfo&(sue|p_))>0}get deletedAfter(){return(this.delInfo&(aue|p_))>0}get deletedAcross(){return(this.delInfo&p_)>0}}class _o{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&_o.empty)return _o.empty}recover(t){let n=0,r=bK(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+vQe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,s=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let c=this.ranges[o]-(this.inverted?i:0);if(c>t)break;let u=this.ranges[o+s],d=this.ranges[o+a],h=c+u;if(t<=h){let A=u?t==c?-1:t==h?1:n:n,f=c+i+(A<0?0:d);if(r)return f;let p=t==(n<0?c:h)?null:yQe(o/3,t-c),m=t==c?aue:t==h?sue:p_;return(n<0?t!=c:t!=h)&&(m|=oue),new fM(f,m,p)}i+=d-u}return r?t+i:new fM(t+i,0,null)}touches(t,n){let r=0,i=bK(n),s=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let c=this.ranges[o]-(this.inverted?r:0);if(c>t)break;let u=this.ranges[o+s],d=c+u;if(t<=d&&o==i*3)return!0;r+=this.ranges[o+a]-u}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let a=this.ranges[i],o=a-(this.inverted?s:0),c=a+(this.inverted?0:s),u=this.ranges[i+n],d=this.ranges[i+r];t(o,o+u,c,c+d),s+=d-u}}invert(){return new _o(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?_o.empty:new _o(t<0?[0,-t,0]:[0,0,t])}}_o.empty=new _o([]);class e1{constructor(t,n,r=0,i=t?t.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e1(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,r=this._maps.length;n<t._maps.length;n++){let i=t.getMirror(n);this.appendMap(t._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this._maps.length+t._maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new e1;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let s=this.from;s<this.to;s++){let a=this._maps[s],o=a.mapResult(t,n);if(o.recover!=null){let c=this.getMirror(s);if(c!=null&&c>s&&c<this.to){s=c,t=this._maps[c].recover(o.recover);continue}}i|=o.delInfo,t=o.pos}return r?t:new fM(t,i,null)}}const $I=Object.create(null);let aa=class{getMap(){return _o.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=$I[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in $I)throw new RangeError("Duplicate use of step JSON ID "+t);return $I[t]=n,n.prototype.jsonID=t,n}};class Ni{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new Ni(t,null)}static fail(t){return new Ni(null,t)}static fromReplace(t,n,r,i){try{return Ni.ok(t.replace(n,r,i))}catch(s){if(s instanceof Fj)return Ni.fail(s.message);throw s}}}function sH(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let s=e.child(i);s.content.size&&(s=s.copy(sH(s.content,t,s))),s.isInline&&(s=t(s,n,i)),r.push(s)}return Qe.fromArray(r)}class zh extends aa{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new at(sH(n.content,(a,o)=>!a.isAtom||!o.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Ni.fromReplace(t,this.from,this.to,s)}invert(){return new lc(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new zh(n.pos,r.pos,this.mark)}merge(t){return t instanceof zh&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new zh(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new zh(n.from,n.to,t.markFromJSON(n.mark))}}aa.jsonID("addMark",zh);class lc extends aa{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new at(sH(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return Ni.fromReplace(t,this.from,this.to,r)}invert(){return new zh(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new lc(n.pos,r.pos,this.mark)}merge(t){return t instanceof lc&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new lc(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new lc(n.from,n.to,t.markFromJSON(n.mark))}}aa.jsonID("removeMark",lc);class Vh extends aa{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Ni.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ni.fromReplace(t,this.pos,this.pos+1,new at(Qe.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Vh(this.pos,n.marks[i]);return new Vh(this.pos,this.mark)}}return new Zp(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Vh(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Vh(n.pos,t.markFromJSON(n.mark))}}aa.jsonID("addNodeMark",Vh);class Zp extends aa{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return Ni.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ni.fromReplace(t,this.pos,this.pos+1,new at(Qe.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Vh(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Zp(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Zp(n.pos,t.markFromJSON(n.mark))}}aa.jsonID("removeNodeMark",Zp);class is extends aa{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&AM(t,this.from,this.to)?Ni.fail("Structure replace would overwrite content"):Ni.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new _o([this.from,this.to-this.from,this.slice.size])}invert(t){return new is(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new is(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(t){if(!(t instanceof is)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?at.empty:new at(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new is(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?at.empty:new at(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new is(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new is(n.from,n.to,at.fromJSON(t,n.slice),!!n.structure)}}aa.jsonID("replace",is);class as extends aa{constructor(t,n,r,i,s,a,o=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=a,this.structure=o}apply(t){if(this.structure&&(AM(t,this.from,this.gapFrom)||AM(t,this.gapTo,this.to)))return Ni.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ni.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ni.fromReplace(t,this.from,this.to,r):Ni.fail("Content does not fit in gap")}getMap(){return new _o([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new as(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new as(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new as(n.from,n.to,n.gapFrom,n.gapTo,at.fromJSON(t,n.slice),n.insert,!!n.structure)}}aa.jsonID("replaceAround",as);function AM(e,t,n){let r=e.resolve(t),i=n-t,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let a=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function xQe(e,t,n,r){let i=[],s=[],a,o;e.doc.nodesBetween(t,n,(c,u,d)=>{if(!c.isInline)return;let h=c.marks;if(!r.isInSet(h)&&d.type.allowsMarkType(r.type)){let A=Math.max(u,t),f=Math.min(u+c.nodeSize,n),p=r.addToSet(h);for(let m=0;m<h.length;m++)h[m].isInSet(p)||(a&&a.to==A&&a.mark.eq(h[m])?a.to=f:i.push(a=new lc(A,f,h[m])));o&&o.to==A?o.to=f:s.push(o=new zh(A,f,r))}}),i.forEach(c=>e.step(c)),s.forEach(c=>e.step(c))}function wQe(e,t,n,r){let i=[],s=0;e.doc.nodesBetween(t,n,(a,o)=>{if(!a.isInline)return;s++;let c=null;if(r instanceof e5){let u=a.marks,d;for(;d=r.isInSet(u);)(c||(c=[])).push(d),u=d.removeFromSet(u)}else r?r.isInSet(a.marks)&&(c=[r]):c=a.marks;if(c&&c.length){let u=Math.min(o+a.nodeSize,n);for(let d=0;d<c.length;d++){let h=c[d],A;for(let f=0;f<i.length;f++){let p=i[f];p.step==s-1&&h.eq(i[f].style)&&(A=p)}A?(A.to=u,A.step=s):i.push({style:h,from:Math.max(o,t),to:u,step:s})}}}),i.forEach(a=>e.step(new lc(a.from,a.to,a.style)))}function aH(e,t,n,r=n.contentMatch,i=!0){let s=e.doc.nodeAt(t),a=[],o=t+1;for(let c=0;c<s.childCount;c++){let u=s.child(c),d=o+u.nodeSize,h=r.matchType(u.type);if(!h)a.push(new is(o,d,at.empty));else{r=h;for(let A=0;A<u.marks.length;A++)n.allowsMarkType(u.marks[A].type)||e.step(new lc(o,d,u.marks[A]));if(i&&u.isText&&n.whitespace!="pre"){let A,f=/\r?\n|\r/g,p;for(;A=f.exec(u.text);)p||(p=new at(Qe.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),a.push(new is(o+A.index,o+A.index+A[0].length,p))}}o=d}if(!r.validEnd){let c=r.fillBefore(Qe.empty,!0);e.replace(o,o,new at(c,0,0))}for(let c=a.length-1;c>=0;c--)e.step(a[c])}function bQe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function g0(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,i=0,s=0;;--r){let a=e.$from.node(r),o=e.$from.index(r)+i,c=e.$to.indexAfter(r)-s;if(r<e.depth&&a.canReplace(o,c,n))return r;if(r==0||a.type.spec.isolating||!bQe(a,o,c))break;o&&(i=1),c<a.childCount&&(s=1)}return null}function CQe(e,t,n){let{$from:r,$to:i,depth:s}=t,a=r.before(s+1),o=i.after(s+1),c=a,u=o,d=Qe.empty,h=0;for(let p=s,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,d=Qe.from(r.node(p).copy(d)),h++):c--;let A=Qe.empty,f=0;for(let p=s,m=!1;p>n;p--)m||i.after(p+1)<i.end(p)?(m=!0,A=Qe.from(i.node(p).copy(A)),f++):u++;e.step(new as(c,u,a,o,new at(d.append(A),h,f),d.size-h,!0))}function oH(e,t,n=null,r=e){let i=SQe(e,t),s=i&&kQe(r,t);return s?i.map(CK).concat({type:t,attrs:n}).concat(s.map(CK)):null}function CK(e){return{type:e,attrs:null}}function SQe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.contentMatchAt(r).findWrapping(t);if(!s)return null;let a=s.length?s[0]:t;return n.canReplaceWith(r,i,a)?s:null}function kQe(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.child(r),a=t.contentMatch.findWrapping(s.type);if(!a)return null;let c=(a.length?a[a.length-1]:t).contentMatch;for(let u=r;c&&u<i;u++)c=c.matchType(n.child(u).type);return!c||!c.validEnd?null:a}function _Qe(e,t,n){let r=Qe.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let o=n[a].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Qe.from(n[a].type.create(n[a].attrs,r))}let i=t.start,s=t.end;e.step(new as(i,s,i,s,new at(r,0,0),n.length,!0))}function jQe(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(a,o)=>{let c=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,c)&&BQe(e.doc,e.mapping.slice(s).map(o),r)){let u=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!p?u=!1:!f&&p&&(u=!0)}u===!1&&cue(e,a,o,s),aH(e,e.mapping.slice(s).map(o,1),r,void 0,u===null);let d=e.mapping.slice(s),h=d.map(o,1),A=d.map(o+a.nodeSize,1);return e.step(new as(h,A,h+1,A-1,new at(Qe.from(r.create(c,null,a.marks)),0,0),1,!0)),u===!0&&lue(e,a,o,s),!1}})}function lue(e,t,n,r){t.forEach((i,s)=>{if(i.isText){let a,o=/\r?\n|\r/g;for(;a=o.exec(i.text);){let c=e.mapping.slice(r).map(n+1+s+a.index);e.replaceWith(c,c+1,t.type.schema.linebreakReplacement.create())}}})}function cue(e,t,n,r){t.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let a=e.mapping.slice(r).map(n+1+s);e.replaceWith(a,a+1,t.type.schema.text(`
`))}})}function BQe(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function NQe(e,t,n,r,i){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let a=n.create(r,null,i||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,a);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new as(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new at(Qe.from(a),0,0),1,!0))}function jy(e,t,n=1,r){let i=e.resolve(t),s=i.depth-n,a=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,d=n-2;u>s;u--,d--){let h=i.node(u),A=i.index(u);if(h.type.spec.isolating)return!1;let f=h.content.cutByIndex(A,h.childCount),p=r&&r[d+1];p&&(f=f.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[d]||h;if(!h.canReplace(A+1,h.childCount)||!m.type.validContent(f))return!1}let o=i.indexAfter(s),c=r&&r[0];return i.node(s).canReplaceWith(o,o,c?c.type:i.node(s+1).type)}function EQe(e,t,n=1,r){let i=e.doc.resolve(t),s=Qe.empty,a=Qe.empty;for(let o=i.depth,c=i.depth-n,u=n-1;o>c;o--,u--){s=Qe.from(i.node(o).copy(s));let d=r&&r[u];a=Qe.from(d?d.type.create(d.attrs,a):i.node(o).copy(a))}e.step(new is(t,t,new at(s.append(a),n,n),!0))}function Yf(e,t){let n=e.resolve(t),r=n.index();return uue(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function TQe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let s=t.child(i),a=s.type==r?e.type.schema.nodes.text:s.type;if(n=n.matchType(a),!n||!e.type.allowsMarks(s.marks))return!1}return n.validEnd}function uue(e,t){return!!(e&&t&&!e.isLeaf&&TQe(e,t))}function t5(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let s,a,o=r.index(i);if(i==r.depth?(s=r.nodeBefore,a=r.nodeAfter):n>0?(s=r.node(i+1),o++,a=r.node(i).maybeChild(o)):(s=r.node(i).maybeChild(o-1),a=r.node(i+1)),s&&!s.isTextblock&&uue(s,a)&&r.node(i).canReplace(o,o+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function PQe(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,s=e.doc.resolve(t-n),a=s.node().type;if(i&&a.inlineContent){let d=a.whitespace=="pre",h=!!a.contentMatch.matchType(i);d&&!h?r=!1:!d&&h&&(r=!0)}let o=e.steps.length;if(r===!1){let d=e.doc.resolve(t+n);cue(e,d.node(),d.before(),o)}a.inlineContent&&aH(e,t+n-1,a,s.node().contentMatchAt(s.index()),r==null);let c=e.mapping.slice(o),u=c.map(t-n);if(e.step(new is(u,c.map(t+n,-1),at.empty,!0)),r===!0){let d=e.doc.resolve(u);lue(e,d.node(),d.before(),e.steps.length)}return e}function IQe(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function due(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let a=r.depth;a>=0;a--){let o=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,c=r.index(a)+(o>0?1:0),u=r.node(a),d=!1;if(s==1)d=u.canReplace(c,c,i);else{let h=u.contentMatchAt(c).findWrapping(i.firstChild.type);d=h&&u.canReplaceWith(c,c,h[0])}if(d)return o==0?r.pos:o<0?r.before(a+1):r.after(a+1)}return null}function n5(e,t,n=t,r=at.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),s=e.resolve(n);return hue(i,s,r)?new is(t,n,r):new OQe(i,s,r).fit()}function hue(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class OQe{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Qe.empty;for(let i=0;i<=t.depth;i++){let s=t.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=Qe.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let s=this.placed,a=r.depth,o=i.depth;for(;a&&o&&s.childCount==1;)s=s.firstChild.content,a--,o--;let c=new at(s,a,o);return t>-1?new as(r.pos,t,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new is(r.pos,i.pos,c):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){t=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=zI(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let a=i.firstChild;for(let o=this.depth;o>=0;o--){let{type:c,match:u}=this.frontier[o],d,h=null;if(n==1&&(a?u.matchType(a.type)||(h=u.fillBefore(Qe.from(a),!1)):s&&c.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:o,parent:s,inject:h};if(n==2&&a&&(d=u.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:o,parent:s,wrap:d};if(s&&u.matchType(s.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=zI(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new at(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=zI(t,n);if(i.childCount<=1&&n>0){let s=t.size-n<=n+i.size;this.unplaced=new at(iw(t,n-1,1),n-1,s?n-1:r)}else this.unplaced=new at(iw(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let m=0;m<s.length;m++)this.openFrontierNode(s[m]);let a=this.unplaced,o=r?r.content:a.content,c=a.openStart-t,u=0,d=[],{match:h,type:A}=this.frontier[n];if(i){for(let m=0;m<i.childCount;m++)d.push(i.child(m));h=h.matchFragment(i)}let f=o.size+t-(a.content.size-a.openEnd);for(;u<o.childCount;){let m=o.child(u),g=h.matchType(m.type);if(!g)break;u++,(u>1||c==0||m.content.size)&&(h=g,d.push(fue(m.mark(A.allowedMarks(m.marks)),u==1?c:0,u==o.childCount?f:-1)))}let p=u==o.childCount;p||(f=-1),this.placed=sw(this.placed,n,Qe.from(d)),this.frontier[n].match=h,p&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=o;m<f;m++){let y=g.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),g=y.content}this.unplaced=p?t==0?at.empty:new at(iw(a.content,t-1,1),t-1,f<0?a.openEnd:t-1):new at(iw(a.content,t,u),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!VI(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),a=VI(t,n,i,r,s);if(a){for(let o=n-1;o>=0;o--){let{match:c,type:u}=this.frontier[o],d=VI(t,o,u,c,!0);if(!d||d.childCount)continue e}return{depth:n,fit:a,move:s?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=sw(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,s)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=sw(this.placed,this.depth,Qe.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Qe.empty,!0);n.childCount&&(this.placed=sw(this.placed,this.frontier.length,n))}}function iw(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(iw(e.firstChild.content,t-1,n)))}function sw(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(sw(e.lastChild.content,t-1,n)))}function zI(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function fue(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,fue(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Qe.empty,!0)))),e.copy(r)}function VI(e,t,n,r,i){let s=e.node(t),a=i?e.indexAfter(t):e.index(t);if(a==s.childCount&&!n.compatibleContent(s.type))return null;let o=r.fillBefore(s.content,!0,a);return o&&!FQe(n,s.content,a)?o:null}function FQe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function MQe(e){return e.spec.defining||e.spec.definingForContent}function LQe(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),s=e.doc.resolve(n);if(hue(i,s,r))return e.step(new is(t,n,r));let a=pue(i,s);a[a.length-1]==0&&a.pop();let o=-(i.depth+1);a.unshift(o);for(let A=i.depth,f=i.pos-1;A>0;A--,f--){let p=i.node(A).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;a.indexOf(A)>-1?o=A:i.before(A)==f&&a.splice(1,0,-A)}let c=a.indexOf(o),u=[],d=r.openStart;for(let A=r.content,f=0;;f++){let p=A.firstChild;if(u.push(p),f==r.openStart)break;A=p.content}for(let A=d-1;A>=0;A--){let f=u[A],p=MQe(f.type);if(p&&!f.sameMarkup(i.node(Math.abs(o)-1)))d=A;else if(p||!f.type.isTextblock)break}for(let A=r.openStart;A>=0;A--){let f=(A+d+1)%(r.openStart+1),p=u[f];if(p)for(let m=0;m<a.length;m++){let g=a[(m+c)%a.length],y=!0;g<0&&(y=!1,g=-g);let v=i.node(g-1),x=i.index(g-1);if(v.canReplaceWith(x,x,p.type,p.marks))return e.replace(i.before(g),y?s.after(g):n,new at(Aue(r.content,0,r.openStart,f),f,r.openEnd))}}let h=e.steps.length;for(let A=a.length-1;A>=0&&(e.replace(t,n,r),!(e.steps.length>h));A--){let f=a[A];f<0||(t=i.before(f),n=s.after(f))}}function Aue(e,t,n,r,i){if(t<n){let s=e.firstChild;e=e.replaceChild(0,s.copy(Aue(s.content,t+1,n,r,s)))}if(t>r){let s=i.contentMatchAt(0),a=s.fillBefore(e).append(e);e=a.append(s.matchFragment(a).fillBefore(Qe.empty,!0))}return e}function RQe(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=IQe(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new at(Qe.from(r),0,0))}function DQe(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),s=pue(r,i);for(let a=0;a<s.length;a++){let o=s[a],c=a==s.length-1;if(c&&o==0||r.node(o).type.contentMatch.validEnd)return e.delete(r.start(o),i.end(o));if(o>0&&(c||r.node(o-1).canReplace(r.index(o-1),i.indexAfter(o-1))))return e.delete(r.before(o),i.after(o))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function pue(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let s=e.start(i);if(s<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(s==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==s-1)&&n.push(i)}return n}class By extends aa{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return Ni.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Ni.fromReplace(t,this.pos,this.pos+1,new at(Qe.from(i),0,n.isLeaf?0:1))}getMap(){return _o.empty}invert(t){return new By(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new By(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new By(n.pos,n.attr,n.value)}}aa.jsonID("attr",By);class t1 extends aa{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return Ni.ok(r)}getMap(){return _o.empty}invert(t){return new t1(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new t1(n.attr,n.value)}}aa.jsonID("docAttr",t1);let Av=class extends Error{};Av=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Av.prototype=Object.create(Error.prototype);Av.prototype.constructor=Av;Av.prototype.name="TransformError";class mue{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new e1}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Av(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(t=i.map(t,1),n=i.map(n,-1)),i.forEach((s,a,o,c)=>{t=Math.min(t,o),n=Math.max(n,c)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=at.empty){let i=n5(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new at(Qe.from(r),0,0))}delete(t,n){return this.replace(t,n,at.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return LQe(this,t,n,r),this}replaceRangeWith(t,n,r){return RQe(this,t,n,r),this}deleteRange(t,n){return DQe(this,t,n),this}lift(t,n){return CQe(this,t,n),this}join(t,n=1){return PQe(this,t,n),this}wrap(t,n){return _Qe(this,t,n),this}setBlockType(t,n=t,r,i=null){return jQe(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return NQe(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new By(t,n,r)),this}setDocAttribute(t,n){return this.step(new t1(t,n)),this}addNodeMark(t,n){return this.step(new Vh(t,n)),this}removeNodeMark(t,n){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n instanceof sr)n.isInSet(r.marks)&&this.step(new Zp(t,n));else{let i=r.marks,s,a=[];for(;s=n.isInSet(i);)a.push(new Zp(t,s)),i=s.removeFromSet(i);for(let o=a.length-1;o>=0;o--)this.step(a[o])}return this}split(t,n=1,r){return EQe(this,t,n,r),this}addMark(t,n,r){return xQe(this,t,n,r),this}removeMark(t,n,r){return wQe(this,t,n,r),this}clearIncompatible(t,n,r){return aH(this,t,n,r),this}}const KI=Object.create(null);class mn{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new UQe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=at.empty){let r=n.content.lastChild,i=null;for(let o=0;o<n.openEnd;o++)i=r,r=r.lastChild;let s=t.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:c,$to:u}=a[o],d=t.mapping.slice(s);t.replaceRange(d.map(c.pos),d.map(u.pos),o?at.empty:n),o==0&&_K(t,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:o}=i[s],c=t.mapping.slice(r),u=c.map(a.pos),d=c.map(o.pos);s?t.deleteRange(u,d):(t.replaceRangeWith(u,d,n),_K(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new nn(t):Mg(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let s=t.depth-1;s>=0;s--){let a=n<0?Mg(t.node(0),t.node(s),t.before(s+1),t.index(s),n,r):Mg(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,n,r);if(a)return a}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new xl(t.node(0))}static atStart(t){return Mg(t,t,0,0,1)||new xl(t)}static atEnd(t){return Mg(t,t,t.content.size,t.childCount,-1)||new xl(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=KI[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in KI)throw new RangeError("Duplicate use of selection JSON ID "+t);return KI[t]=n,n.prototype.jsonID=t,n}getBookmark(){return nn.between(this.$anchor,this.$head).getBookmark()}}mn.prototype.visible=!0;class UQe{constructor(t,n){this.$from=t,this.$to=n}}let SK=!1;function kK(e){!SK&&!e.parent.inlineContent&&(SK=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class nn extends mn{constructor(t,n=t){kK(t),kK(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return mn.near(r);let i=t.resolve(n.map(this.anchor));return new nn(i.parent.inlineContent?i:r,r)}replace(t,n=at.empty){if(super.replace(t,n),n==at.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof nn&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new r5(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new nn(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=mn.findFrom(n,r,!0)||mn.findFrom(n,-r,!0);if(s)n=s.$head;else return mn.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(mn.findFrom(t,-r,!0)||mn.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new nn(t,n)}}mn.jsonID("text",nn);class r5{constructor(t,n){this.anchor=t,this.head=n}map(t){return new r5(t.map(this.anchor),t.map(this.head))}resolve(t){return nn.between(t.resolve(this.anchor),t.resolve(this.head))}}class Lt extends mn{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=t.resolve(i);return r?mn.near(s):new Lt(s)}content(){return new at(Qe.from(this.node),0,0)}eq(t){return t instanceof Lt&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new lH(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Lt(t.resolve(n.anchor))}static create(t,n){return new Lt(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}Lt.prototype.visible=!1;mn.jsonID("node",Lt);class lH{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new r5(r,r):new lH(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&Lt.isSelectable(r)?new Lt(n):mn.near(n)}}class xl extends mn{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=at.empty){if(n==at.empty){t.delete(0,t.doc.content.size);let r=mn.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new xl(t)}map(t){return new xl(t)}eq(t){return t instanceof xl}getBookmark(){return HQe}}mn.jsonID("all",xl);const HQe={map(){return this},resolve(e){return new xl(e)}};function Mg(e,t,n,r,i,s=!1){if(t.inlineContent)return nn.create(e,n);for(let a=r-(i>0?0:1);i>0?a<t.childCount:a>=0;a+=i){let o=t.child(a);if(o.isAtom){if(!s&&Lt.isSelectable(o))return Lt.create(e,n-(i<0?o.nodeSize:0))}else{let c=Mg(e,o,n+i,i<0?o.childCount:0,i,s);if(c)return c}n+=o.nodeSize*i}return null}function _K(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof is||i instanceof as))return;let s=e.mapping.maps[r],a;s.forEach((o,c,u,d)=>{a==null&&(a=d)}),e.setSelection(mn.near(e.doc.resolve(a),n))}const jK=1,OS=2,BK=4;class QQe extends mue{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|jK)&~OS,this.storedMarks=null,this}get selectionSet(){return(this.updated&jK)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=OS,this}ensureMarks(t){return sr.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&OS)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~OS,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||sr.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),!t)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let a=this.doc.resolve(n);s=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,s)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(mn.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=BK,this}get scrolledIntoView(){return(this.updated&BK)>0}}function NK(e,t){return!t||!e?e:e.bind(t)}class aw{constructor(t,n,r){this.name=t,this.init=NK(n.init,r),this.apply=NK(n.apply,r)}}const $Qe=[new aw("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new aw("selection",{init(e,t){return e.selection||mn.atStart(t.doc)},apply(e){return e.selection}}),new aw("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new aw("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class qI{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=$Qe.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new aw(r.key,r.spec.state,r))})}}class ay{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let s=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let c=i?i[a].n:0,u=i?i[a].state:this,d=c<n.length&&o.spec.appendTransaction.call(o,c?n.slice(c):n,u,r);if(d&&r.filterTransaction(d,a)){if(d.setMeta("appendedTransaction",t),!i){i=[];for(let h=0;h<this.config.plugins.length;h++)i.push(h<a?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),s=!0}i&&(i[a]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ay(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(t,this[s.name],this,n)}return n}get tr(){return new QQe(this)}static create(t){let n=new qI(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new ay(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}reconfigure(t){let n=new qI(this.schema,t.plugins),r=n.fields,i=new ay(n);for(let s=0;s<r.length;s++){let a=r[s].name;i[a]=this.hasOwnProperty(a)?this[a]:r[s].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new qI(t.schema,t.plugins),s=new ay(i);return i.fields.forEach(a=>{if(a.name=="doc")s.doc=df.fromJSON(t.schema,n.doc);else if(a.name=="selection")s.selection=mn.fromJSON(s.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let o in r){let c=r[o],u=c.spec.state;if(c.key==a.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,o)){s[a.name]=u.fromJSON.call(c,t,n[o],s);return}}s[a.name]=a.init(t,s)}}),s}}function gue(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=gue(i,t,{})),n[r]=i}return n}class qr{constructor(t){this.spec=t,this.props={},t.props&&gue(t.props,this,this.props),this.key=t.key?t.key.key:yue("plugin")}getState(t){return t[this.key]}}const WI=Object.create(null);function yue(e){return e in WI?e+"$"+ ++WI[e]:(WI[e]=0,e+"$")}class Gi{constructor(t="key"){this.key=yue(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const zQe=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function vue(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const VQe=(e,t,n)=>{let r=vue(e,n);if(!r)return!1;let i=cH(r);if(!i){let a=r.blockRange(),o=a&&g0(a);return o==null?!1:(t&&t(e.tr.lift(a,o).scrollIntoView()),!0)}let s=i.nodeBefore;if(Cue(e,i,t,-1))return!0;if(r.parent.content.size==0&&(pv(s,"end")||Lt.isSelectable(s)))for(let a=r.depth;;a--){let o=n5(e.doc,r.before(a),r.after(a),at.empty);if(o&&o.slice.size<o.to-o.from){if(t){let c=e.tr.step(o);c.setSelection(pv(s,"end")?mn.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):Lt.create(c.doc,i.pos-s.nodeSize)),t(c.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},KQe=(e,t,n)=>{let r=vue(e,n);if(!r)return!1;let i=cH(r);return i?xue(e,i,t):!1},qQe=(e,t,n)=>{let r=wue(e,n);if(!r)return!1;let i=uH(r);return i?xue(e,i,t):!1};function xue(e,t,n){let r=t.nodeBefore,i=r,s=t.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let d=i.lastChild;if(!d)return!1;i=d}let a=t.nodeAfter,o=a,c=t.pos+1;for(;!o.isTextblock;c++){if(o.type.spec.isolating)return!1;let d=o.firstChild;if(!d)return!1;o=d}let u=n5(e.doc,s,c,at.empty);if(!u||u.from!=s||u instanceof is&&u.slice.size>=c-s)return!1;if(n){let d=e.tr.step(u);d.setSelection(nn.create(d.doc,s)),n(d.scrollIntoView())}return!0}function pv(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const WQe=(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=cH(r)}let a=s&&s.nodeBefore;return!a||!Lt.isSelectable(a)?!1:(t&&t(e.tr.setSelection(Lt.create(e.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)};function cH(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function wue(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const GQe=(e,t,n)=>{let r=wue(e,n);if(!r)return!1;let i=uH(r);if(!i)return!1;let s=i.nodeAfter;if(Cue(e,i,t,1))return!0;if(r.parent.content.size==0&&(pv(s,"start")||Lt.isSelectable(s))){let a=n5(e.doc,r.before(),r.after(),at.empty);if(a&&a.slice.size<a.to-a.from){if(t){let o=e.tr.step(a);o.setSelection(pv(s,"start")?mn.findFrom(o.doc.resolve(o.mapping.map(i.pos)),1):Lt.create(o.doc,o.mapping.map(i.pos))),t(o.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},YQe=(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;s=uH(r)}let a=s&&s.nodeAfter;return!a||!Lt.isSelectable(a)?!1:(t&&t(e.tr.setSelection(Lt.create(e.doc,s.pos)).scrollIntoView()),!0)};function uH(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const XQe=(e,t)=>{let n=e.selection,r=n instanceof Lt,i;if(r){if(n.node.isTextblock||!Yf(e.doc,n.from))return!1;i=n.from}else if(i=t5(e.doc,n.from,-1),i==null)return!1;if(t){let s=e.tr.join(i);r&&s.setSelection(Lt.create(s.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(s.scrollIntoView())}return!0},JQe=(e,t)=>{let n=e.selection,r;if(n instanceof Lt){if(n.node.isTextblock||!Yf(e.doc,n.to))return!1;r=n.to}else if(r=t5(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},ZQe=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),s=i&&g0(i);return s==null?!1:(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)},e$e=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
`).scrollIntoView()),!0)};function bue(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const t$e=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),a=bue(i.contentMatchAt(s));if(!a||!i.canReplaceWith(s,s,a))return!1;if(t){let o=n.after(),c=e.tr.replaceWith(o,o,a.createAndFill());c.setSelection(mn.near(c.doc.resolve(o),1)),t(c.scrollIntoView())}return!0},n$e=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof xl||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=bue(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(a,s.createAndFill());o.setSelection(nn.create(o.doc,a+1)),t(o.scrollIntoView())}return!0},r$e=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(jy(e.doc,s))return t&&t(e.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&g0(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},i$e=(e,t)=>{let{$from:n,to:r}=e.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),t&&t(e.tr.setSelection(Lt.create(e.doc,i))),!0)};function s$e(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,s=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(s,s+1)||!(i.isTextblock||Yf(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Cue(e,t,n,r){let i=t.nodeBefore,s=t.nodeAfter,a,o,c=i.type.spec.isolating||s.type.spec.isolating;if(!c&&s$e(e,t,n))return!0;let u=!c&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(a=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(a[0]||s.type).validEnd){if(n){let f=t.pos+s.nodeSize,p=Qe.empty;for(let y=a.length-1;y>=0;y--)p=Qe.from(a[y].create(null,p));p=Qe.from(i.copy(p));let m=e.tr.step(new as(t.pos-1,f,t.pos,f,new at(p,1,0),a.length,!0)),g=m.doc.resolve(f+2*a.length);g.nodeAfter&&g.nodeAfter.type==i.type&&Yf(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let d=s.type.spec.isolating||r>0&&c?null:mn.findFrom(t,1),h=d&&d.$from.blockRange(d.$to),A=h&&g0(h);if(A!=null&&A>=t.depth)return n&&n(e.tr.lift(h,A).scrollIntoView()),!0;if(u&&pv(s,"start",!0)&&pv(i,"end")){let f=i,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let m=s,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(f.canReplace(f.childCount,f.childCount,m.content)){if(n){let y=Qe.empty;for(let x=p.length-1;x>=0;x--)y=Qe.from(p[x].copy(y));let v=e.tr.step(new as(t.pos-p.length,t.pos+s.nodeSize,t.pos+g,t.pos+s.nodeSize-g,new at(y,p.length,0),0,!0));n(v.scrollIntoView())}return!0}}return!1}function Sue(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(t.tr.setSelection(nn.create(t.doc,e<0?i.start(s):i.end(s)))),!0):!1}}const a$e=Sue(-1),o$e=Sue(1);function l$e(e,t=null){return function(n,r){let{$from:i,$to:s}=n.selection,a=i.blockRange(s),o=a&&oH(a,e,t);return o?(r&&r(n.tr.wrap(a,o).scrollIntoView()),!0):!1}}function EK(e,t=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[s];n.doc.nodesBetween(a,o,(c,u)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(e,t)))if(c.type==e)i=!0;else{let d=n.doc.resolve(u),h=d.index();i=d.parent.canReplaceWith(h,h+1,e)}})}if(!i)return!1;if(r){let s=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:o},$to:{pos:c}}=n.selection.ranges[a];s.setBlockType(o,c,e,t)}r(s.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function c$e(e,t=null){return function(n,r){let{$from:i,$to:s}=n.selection,a=i.blockRange(s);if(!a)return!1;let o=r?n.tr:null;return u$e(o,a,e,t)?(r&&r(o.scrollIntoView()),!0):!1}}function u$e(e,t,n,r=null){let i=!1,s=t,a=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let c=a.resolve(t.start-2);s=new Lj(c,c,t.depth),t.endIndex<t.parent.childCount&&(t=new Lj(t.$from,a.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let o=oH(s,n,r,t);return o?(e&&d$e(e,t,o,i,n),!0):!1}function d$e(e,t,n,r,i){let s=Qe.empty;for(let d=n.length-1;d>=0;d--)s=Qe.from(n[d].type.create(n[d].attrs,s));e.step(new as(t.start-(r?2:0),t.end,t.start,t.end,new at(s,0,0),n.length,!0));let a=0;for(let d=0;d<n.length;d++)n[d].type==i&&(a=d+1);let o=n.length-a,c=t.start+n.length-(r?2:0),u=t.parent;for(let d=t.startIndex,h=t.endIndex,A=!0;d<h;d++,A=!1)!A&&jy(e.doc,c,o)&&(e.split(c,o),c+=2*o),c+=u.child(d).nodeSize;return e}function h$e(e){return function(t,n){let{$from:r,$to:i}=t.selection,s=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==e);return s?n?r.node(s.depth-1).type==e?f$e(t,n,e,s):A$e(t,n,s):!0:!1}}function f$e(e,t,n,r){let i=e.tr,s=r.end,a=r.$to.end(r.depth);s<a&&(i.step(new as(s-1,a,s,a,new at(Qe.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Lj(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const o=g0(r);if(o==null)return!1;i.lift(r,o);let c=i.doc.resolve(i.mapping.map(s,-1)-1);return Yf(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function A$e(e,t,n){let r=e.tr,i=n.parent;for(let f=n.end,p=n.endIndex-1,m=n.startIndex;p>m;p--)f-=i.child(p).nodeSize,r.delete(f-1,f+1);let s=r.doc.resolve(n.start),a=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let o=n.startIndex==0,c=n.endIndex==i.childCount,u=s.node(-1),d=s.index(-1);if(!u.canReplace(d+(o?0:1),d+1,a.content.append(c?Qe.empty:Qe.from(i))))return!1;let h=s.pos,A=h+a.nodeSize;return r.step(new as(h-(o?1:0),A+(c?1:0),h+1,A-1,new at((o?Qe.empty:Qe.from(i.copy(Qe.empty))).append(c?Qe.empty:Qe.from(i.copy(Qe.empty))),o?0:1,c?0:1),o?0:1)),t(r.scrollIntoView()),!0}function p$e(e){return function(t,n){let{$from:r,$to:i}=t.selection,s=r.blockRange(i,u=>u.childCount>0&&u.firstChild.type==e);if(!s)return!1;let a=s.startIndex;if(a==0)return!1;let o=s.parent,c=o.child(a-1);if(c.type!=e)return!1;if(n){let u=c.lastChild&&c.lastChild.type==o.type,d=Qe.from(u?e.create():null),h=new at(Qe.from(e.create(null,Qe.from(o.type.create(null,d)))),u?3:1,0),A=s.start,f=s.end;n(t.tr.step(new as(A-(u?3:1),f,A,f,h,1,!0)).scrollIntoView())}return!0}}const ks=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},mv=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let pM=null;const qu=function(e,t,n){let r=pM||(pM=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},m$e=function(){pM=null},em=function(e,t,n,r){return n&&(TK(e,t,n,r,-1)||TK(e,t,n,r,1))},g$e=/^(img|br|input|textarea|hr)$/i;function TK(e,t,n,r,i){for(var s;;){if(e==n&&t==r)return!0;if(t==(i<0?0:ul(e))){let a=e.parentNode;if(!a||a.nodeType!=1||U2(e)||g$e.test(e.nodeName)||e.contentEditable=="false")return!1;t=ks(e)+(i<0?0:1),e=a}else if(e.nodeType==1){let a=e.childNodes[t+(i<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false")if(!((s=a.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)t+=i;else return!1;else e=a,t=i<0?ul(e):0}else return!1}}function ul(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function y$e(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=ul(e)}else if(e.parentNode&&!U2(e))t=ks(e),e=e.parentNode;else return null}}function v$e(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!U2(e))t=ks(e)+1,e=e.parentNode;else return null}}function x$e(e,t,n){for(let r=t==0,i=t==ul(e);r||i;){if(e==n)return!0;let s=ks(e);if(e=e.parentNode,!e)return!1;r=r&&s==0,i=i&&s==ul(e)}}function U2(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const i5=function(e){return e.focusNode&&em(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function VA(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function w$e(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function b$e(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(ul(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(ul(r.startContainer),r.startOffset)}}}const hu=typeof navigator<"u"?navigator:null,PK=typeof document<"u"?document:null,Xf=hu&&hu.userAgent||"",mM=/Edge\/(\d+)/.exec(Xf),kue=/MSIE \d/.exec(Xf),gM=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Xf),to=!!(kue||gM||mM),ff=kue?document.documentMode:gM?+gM[1]:mM?+mM[1]:0,wl=!to&&/gecko\/(\d+)/i.test(Xf);wl&&+(/Firefox\/(\d+)/.exec(Xf)||[0,0])[1];const yM=!to&&/Chrome\/(\d+)/.exec(Xf),js=!!yM,_ue=yM?+yM[1]:0,ra=!to&&!!hu&&/Apple Computer/.test(hu.vendor),gv=ra&&(/Mobile\/\w+/.test(Xf)||!!hu&&hu.maxTouchPoints>2),il=gv||(hu?/Mac/.test(hu.platform):!1),jue=hu?/Win/.test(hu.platform):!1,td=/Android \d/.test(Xf),H2=!!PK&&"webkitFontSmoothing"in PK.documentElement.style,C$e=H2?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function S$e(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Ou(e,t){return typeof e=="number"?e:e[t]}function k$e(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function IK(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let a=n||e.dom;a;){if(a.nodeType!=1){a=mv(a);continue}let o=a,c=o==s.body,u=c?S$e(s):k$e(o),d=0,h=0;if(t.top<u.top+Ou(r,"top")?h=-(u.top-t.top+Ou(i,"top")):t.bottom>u.bottom-Ou(r,"bottom")&&(h=t.bottom-t.top>u.bottom-u.top?t.top+Ou(i,"top")-u.top:t.bottom-u.bottom+Ou(i,"bottom")),t.left<u.left+Ou(r,"left")?d=-(u.left-t.left+Ou(i,"left")):t.right>u.right-Ou(r,"right")&&(d=t.right-u.right+Ou(i,"right")),d||h)if(c)s.defaultView.scrollBy(d,h);else{let f=o.scrollLeft,p=o.scrollTop;h&&(o.scrollTop+=h),d&&(o.scrollLeft+=d);let m=o.scrollLeft-f,g=o.scrollTop-p;t={left:t.left-m,top:t.top-g,right:t.right-m,bottom:t.bottom-g}}let A=c?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(A))break;a=A=="absolute"?a.offsetParent:mv(a)}}function _$e(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let s=(t.left+t.right)/2,a=n+1;a<Math.min(innerHeight,t.bottom);a+=5){let o=e.root.elementFromPoint(s,a);if(!o||o==e.dom||!e.dom.contains(o))continue;let c=o.getBoundingClientRect();if(c.top>=n-20){r=o,i=c.top;break}}return{refDOM:r,refTop:i,stack:Bue(e.dom)}}function Bue(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=mv(r));return t}function j$e({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Nue(n,r==0?0:r-t)}function Nue(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:s}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=s&&(r.scrollLeft=s)}}let dg=null;function B$e(e){if(e.setActive)return e.setActive();if(dg)return e.focus(dg);let t=Bue(e);e.focus(dg==null?{get preventScroll(){return dg={preventScroll:!0},!0}}:void 0),dg||(dg=!1,Nue(t,0))}function Eue(e,t){let n,r=2e8,i,s=0,a=t.top,o=t.top,c,u;for(let d=e.firstChild,h=0;d;d=d.nextSibling,h++){let A;if(d.nodeType==1)A=d.getClientRects();else if(d.nodeType==3)A=qu(d).getClientRects();else continue;for(let f=0;f<A.length;f++){let p=A[f];if(p.top<=a&&p.bottom>=o){a=Math.max(p.bottom,a),o=Math.min(p.top,o);let m=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(m<r){n=d,r=m,i=m&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,d.nodeType==1&&m&&(s=h+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=d,u={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(s=h+1)}}return!n&&c&&(n=c,i=u,r=0),n&&n.nodeType==3?N$e(n,i):!n||r&&n.nodeType==1?{node:e,offset:s}:Eue(n,i)}function N$e(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(e,s+1),r.setStart(e,s);let a=dh(r,1);if(a.top!=a.bottom&&dH(t,a)){i={node:e,offset:s+(t.left>=(a.left+a.right)/2?1:0)};break}}return r.detach(),i||{node:e,offset:0}}function dH(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function E$e(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function T$e(e,t,n){let{node:r,offset:i}=Eue(t,n),s=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return e.docView.posFromDOM(r,i,s)}function P$e(e,t,n,r){let i=-1;for(let s=t,a=!1;s!=e.dom;){let o=e.docView.nearestDesc(s,!0),c;if(!o)return null;if(o.dom.nodeType==1&&(o.node.isBlock&&o.parent||!o.contentDOM)&&((c=o.dom.getBoundingClientRect()).width||c.height)&&(o.node.isBlock&&o.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(o.dom.nodeName)&&(!a&&c.left>r.left||c.top>r.top?i=o.posBefore:(!a&&c.right<r.left||c.bottom<r.top)&&(i=o.posAfter),a=!0),!o.contentDOM&&i<0&&!o.node.isText))return(o.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?o.posBefore:o.posAfter;s=o.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function Tue(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let a=e.childNodes[s];if(a.nodeType==1){let o=a.getClientRects();for(let c=0;c<o.length;c++){let u=o[c];if(dH(t,u))return Tue(a,t,u)}}if((s=(s+1)%r)==i)break}return e}function I$e(e,t){let n=e.dom.ownerDocument,r,i=0,s=b$e(n,t.left,t.top);s&&({node:r,offset:i}=s);let a=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),o;if(!a||!e.dom.contains(a.nodeType!=1?a.parentNode:a)){let u=e.dom.getBoundingClientRect();if(!dH(t,u)||(a=Tue(e.dom,t,u),!a))return null}if(ra)for(let u=a;r&&u;u=mv(u))u.draggable&&(r=void 0);if(a=E$e(a,t),r){if(wl&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let d=r.childNodes[i],h;d.nodeName=="IMG"&&(h=d.getBoundingClientRect()).right<=t.left&&h.bottom>t.top&&i++}let u;H2&&i&&r.nodeType==1&&(u=r.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(o=P$e(e,r,i,t))}o==null&&(o=T$e(e,a,t));let c=e.docView.nearestDesc(a,!0);return{pos:o,inside:c?c.posAtStart-c.border:-1}}function OK(e){return e.top<e.bottom||e.left<e.right}function dh(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(OK(r))return r}return Array.prototype.find.call(n,OK)||e.getBoundingClientRect()}const O$e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Pue(e,t,n){let{node:r,offset:i,atom:s}=e.docView.domFromPos(t,n<0?-1:1),a=H2||wl;if(r.nodeType==3)if(a&&(O$e.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let c=dh(qu(r,i,i),n);if(wl&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let u=dh(qu(r,i-1,i-1),-1);if(u.top==c.top){let d=dh(qu(r,i,i+1),-1);if(d.top!=c.top)return Sx(d,d.left<u.left)}}return c}else{let c=i,u=i,d=n<0?1:-1;return n<0&&!i?(u++,d=-1):n>=0&&i==r.nodeValue.length?(c--,d=1):n<0?c--:u++,Sx(dh(qu(r,c,u),d),d<0)}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==ul(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return GI(c.getBoundingClientRect(),!1)}if(s==null&&i<ul(r)){let c=r.childNodes[i];if(c.nodeType==1)return GI(c.getBoundingClientRect(),!0)}return GI(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==ul(r))){let c=r.childNodes[i-1],u=c.nodeType==3?qu(c,ul(c)-(a?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(u)return Sx(dh(u,1),!1)}if(s==null&&i<ul(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let u=c?c.nodeType==3?qu(c,0,a?0:1):c.nodeType==1?c:null:null;if(u)return Sx(dh(u,-1),!0)}return Sx(dh(r.nodeType==3?qu(r):r,-n),n>=0)}function Sx(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function GI(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Iue(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function F$e(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return Iue(e,t,()=>{let{node:s}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let o=e.docView.nearestDesc(s,!0);if(!o)break;if(o.node.isBlock){s=o.contentDOM||o.dom;break}s=o.dom.parentNode}let a=Pue(e,i.pos,1);for(let o=s.firstChild;o;o=o.nextSibling){let c;if(o.nodeType==1)c=o.getClientRects();else if(o.nodeType==3)c=qu(o,0,o.nodeValue.length).getClientRects();else continue;for(let u=0;u<c.length;u++){let d=c[u];if(d.bottom>d.top+1&&(n=="up"?a.top-d.top>(d.bottom-a.top)*2:d.bottom-a.bottom>(a.bottom-d.top)*2))return!1}}return!0})}const M$e=/[\u0590-\u08ac]/;function L$e(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,a=i==r.parent.content.size,o=e.domSelection();return o?!M$e.test(r.parent.textContent)||!o.modify?n=="left"||n=="backward"?s:a:Iue(e,t,()=>{let{focusNode:c,focusOffset:u,anchorNode:d,anchorOffset:h}=e.domSelectionRange(),A=o.caretBidiLevel;o.modify("move",n,"character");let f=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:p,focusOffset:m}=e.domSelectionRange(),g=p&&!f.contains(p.nodeType==1?p:p.parentNode)||c==p&&u==m;try{o.collapse(d,h),c&&(c!=d||u!=h)&&o.extend&&o.extend(c,u)}catch{}return A!=null&&(o.caretBidiLevel=A),g}):r.pos==r.start()||r.pos==r.end()}let FK=null,MK=null,LK=!1;function R$e(e,t,n){return FK==t&&MK==n?LK:(FK=t,MK=n,LK=n=="up"||n=="down"?F$e(e,t,n):L$e(e,t,n))}const bl=0,RK=1,ep=2,fu=3;class Q2{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=bl,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let s,a;if(t==this.contentDOM)s=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;s=t.previousSibling}for(;s&&!((a=s.pmViewDesc)&&a.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(a)+a.size:this.posAtStart}else{let s,a;if(t==this.contentDOM)s=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;s=t.nextSibling}for(;s&&!((a=s.pmViewDesc)&&a.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(a):this.posAtEnd}let i;if(t==this.dom&&this.contentDOM)i=n>ks(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=t;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let s=t;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let s=this.getDesc(i),a;if(s&&(!n||s.node))if(r&&(a=s.nodeDOM)&&!(a.nodeType==1?a.contains(t.nodeType==1?t:t.parentNode):a==t))r=!1;else return s}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==t&&s!=r){for(;!i.border&&i.children.length;)for(let a=0;a<i.children.length;a++){let o=i.children[a];if(o.size){i=o;break}}return i}if(t<s)return i.descAt(t-r-i.border);r=s}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let a=this.children[r],o=s+a.size;if(o>t||a instanceof Fue){i=t-s;break}s=o}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof Oue&&s.side>=0;r--);if(n<=0){let s,a=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,a=!1);return s&&n&&a&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?ks(s.dom)+1:0}}else{let s,a=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,a=!1);return s&&a&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?ks(s.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let a=r,o=0;;o++){let c=this.children[o],u=a+c.size;if(i==-1&&t<=u){let d=a+c.border;if(t>=d&&n<=u-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(t,n,d);t=a;for(let h=o;h>0;h--){let A=this.children[h-1];if(A.size&&A.dom.parentNode==this.contentDOM&&!A.emptyChildAt(1)){i=ks(A.dom)+1;break}t-=A.size}i==-1&&(i=0)}if(i>-1&&(u>n||o==this.children.length-1)){n=u;for(let d=o+1;d<this.children.length;d++){let h=this.children[d];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){s=ks(h.dom);break}n+=h.size}s==-1&&(s=this.contentDOM.childNodes.length);break}a=u}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:s}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let s=Math.min(t,n),a=Math.max(t,n);for(let f=0,p=0;f<this.children.length;f++){let m=this.children[f],g=p+m.size;if(s>p&&a<g)return m.setSelection(t-p-m.border,n-p-m.border,r,i);p=g}let o=this.domFromPos(t,t?-1:1),c=n==t?o:this.domFromPos(n,n?-1:1),u=r.root.getSelection(),d=r.domSelectionRange(),h=!1;if((wl||ra)&&t==n){let{node:f,offset:p}=o;if(f.nodeType==3){if(h=!!(p&&f.nodeValue[p-1]==`
`),h&&p==f.nodeValue.length)for(let m=f,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(o=c={node:g.parentNode,offset:ks(g)+1});break}let y=m.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let m=f.childNodes[p-1];h=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(wl&&d.focusNode&&d.focusNode!=c.node&&d.focusNode.nodeType==1){let f=d.focusNode.childNodes[d.focusOffset];f&&f.contentEditable=="false"&&(i=!0)}if(!(i||h&&ra)&&em(o.node,o.offset,d.anchorNode,d.anchorOffset)&&em(c.node,c.offset,d.focusNode,d.focusOffset))return;let A=!1;if((u.extend||t==n)&&!(h&&wl)){u.collapse(o.node,o.offset);try{t!=n&&u.extend(c.node,c.offset),A=!0}catch{}}if(!A){if(t>n){let p=o;o=c,c=p}let f=document.createRange();f.setEnd(c.node,c.offset),f.setStart(o.node,o.offset),u.removeAllRanges(),u.addRange(f)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],a=r+s.size;if(r==a?t<=a&&n>=r:t<a&&n>r){let o=r+s.border,c=a-s.border;if(t>=o&&n<=c){this.dirty=t==r||n==a?ep:RK,t==o&&n==c&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=fu:s.markDirty(t-o,n-o);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?ep:fu}r=a}this.dirty=ep}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?ep:RK;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class Oue extends Q2{constructor(t,n,r,i){let s,a=n.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(a.nodeType!=1){let o=document.createElement("span");o.appendChild(a),a=o}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(t,[],a,null),this.widget=n,this.widget=n,s=this}matchesWidget(t){return this.dirty==bl&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class D$e extends Q2{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class tm extends Q2{constructor(t,n,r,i,s){super(t,[],r,i),this.mark=n,this.spec=s}static create(t,n,r,i){let s=i.nodeViews[n.type.name],a=s&&s(n,i,r);return(!a||!a.dom)&&(a=xm.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new tm(t,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&fu||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=fu&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=bl){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=bl}}slice(t,n,r){let i=tm.create(this.parent,this.mark,!0,r),s=this.children,a=this.size;n<a&&(s=xM(s,n,a,r)),t>0&&(s=xM(s,0,t,r));for(let o=0;o<s.length;o++)s[o].parent=i;return i.children=s,i}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Af extends Q2{constructor(t,n,r,i,s,a,o,c,u){super(t,[],s,a),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=o}static create(t,n,r,i,s,a){let o=s.nodeViews[n.type.name],c,u=o&&o(n,s,()=>{if(!c)return a;if(c.parent)return c.parent.posBeforeChild(c)},r,i),d=u&&u.dom,h=u&&u.contentDOM;if(n.isText){if(!d)d=document.createTextNode(n.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:h}=xm.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let A=d;return d=Rue(d,r,n),u?c=new U$e(t,n,r,i,d,h||null,A,u,s,a+1):n.isText?new s5(t,n,r,i,d,A,s):new Af(t,n,r,i,d,h||null,A,s,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>Qe.empty)}return t}matchesNode(t,n,r){return this.dirty==bl&&t.eq(this.node)&&Dj(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,s=t.composing?this.localCompositionInfo(t,n):null,a=s&&s.pos>-1?s:null,o=s&&s.pos<0,c=new Q$e(this,a&&a.node,t);V$e(this.node,this.innerDeco,(u,d,h)=>{u.spec.marks?c.syncToMarks(u.spec.marks,r,t,d):u.type.side>=0&&!h&&c.syncToMarks(d==this.node.childCount?sr.none:this.node.child(d).marks,r,t,d),c.placeWidget(u,t,i)},(u,d,h,A)=>{c.syncToMarks(u.marks,r,t,A);let f;c.findNodeMatch(u,d,h,A)||o&&t.state.selection.from>i&&t.state.selection.to<i+u.nodeSize&&(f=c.findIndexWithChild(s.node))>-1&&c.updateNodeAt(u,d,h,f,t)||c.updateNextNode(u,d,h,t,A,i)||c.addNode(u,d,h,t,i),i+=u.nodeSize}),c.syncToMarks([],r,t,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==ep)&&(a&&this.protectLocalComposition(t,a),Mue(this.contentDOM,this.children,t),gv&&K$e(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof nn)||r<n||i>n+this.node.content.size)return null;let s=t.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,o=q$e(this.node.content,a,r-n,i-n);return o<0?null:{node:s,pos:o,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let a=new D$e(this,s,n,i);t.input.compositionNodes.push(a),this.children=xM(this.children,r,r+i.length,t,a)}update(t,n,r,i){return this.dirty==fu||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=bl}updateOuterDeco(t){if(Dj(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Lue(this.dom,this.nodeDOM,vM(this.outerDeco,this.node,n),vM(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function DK(e,t,n,r,i){Rue(r,t,e);let s=new Af(void 0,e,t,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class s5 extends Af{constructor(t,n,r,i,s,a,o){super(t,n,r,i,s,null,a,o,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==fu||this.dirty!=bl&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=bl||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=bl,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),s=document.createTextNode(i.text);return new s5(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=fu)}get domAtom(){return!1}isText(t){return this.node.text==t}}class Fue extends Q2{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==bl&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class U$e extends Af{constructor(t,n,r,i,s,a,o,c,u,d){super(t,n,r,i,s,a,o,u,d),this.spec=c}update(t,n,r,i){if(this.dirty==fu)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let s=this.spec.update(t,n,r);return s&&this.updateInner(t,n,r,i),s}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function Mue(e,t,n){let r=e.firstChild,i=!1;for(let s=0;s<t.length;s++){let a=t[s],o=a.dom;if(o.parentNode==e){for(;o!=r;)r=UK(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(o,r);if(a instanceof tm){let c=r?r.previousSibling:e.lastChild;Mue(a.contentDOM,a.children,n),r=c?c.nextSibling:e.firstChild}}for(;r;)r=UK(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Qw=function(e){e&&(this.nodeName=e)};Qw.prototype=Object.create(null);const tp=[new Qw];function vM(e,t,n){if(e.length==0)return tp;let r=n?tp[0]:new Qw,i=[r];for(let s=0;s<e.length;s++){let a=e[s].type.attrs;if(a){a.nodeName&&i.push(r=new Qw(a.nodeName));for(let o in a){let c=a[o];c!=null&&(n&&i.length==1&&i.push(r=new Qw(t.isInline?"span":"div")),o=="class"?r.class=(r.class?r.class+" ":"")+c:o=="style"?r.style=(r.style?r.style+";":"")+c:o!="nodeName"&&(r[o]=c))}}}return i}function Lue(e,t,n,r){if(n==tp&&r==tp)return t;let i=t;for(let s=0;s<r.length;s++){let a=r[s],o=n[s];if(s){let c;o&&o.nodeName==a.nodeName&&i!=e&&(c=i.parentNode)&&c.nodeName.toLowerCase()==a.nodeName||(c=document.createElement(a.nodeName),c.pmIsDeco=!0,c.appendChild(i),o=tp[0]),i=c}H$e(i,o||tp[0],a)}return i}function H$e(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&e.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&e.classList.add(i[s]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}function Rue(e,t,n){return Lue(e,e,tp,vM(t,n,e.nodeType!=1))}function Dj(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function UK(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Q$e{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=$$e(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r,i){let s=0,a=this.stack.length>>1,o=Math.min(a,t.length);for(;s<o&&(s==a-1?this.top:this.stack[s+1<<1]).matchesMark(t[s])&&t[s].type.spec.spanning!==!1;)s++;for(;s<a;)this.destroyRest(),this.top.dirty=bl,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<t.length;){this.stack.push(this.top,this.index+1);let c=-1,u=this.top.children.length;i<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let d=this.index;d<u;d++){let h=this.top.children[d];if(h.matchesMark(t[a])&&!this.isLocked(h.dom)){c=d;break}}if(c>-1)c>this.index&&(this.changed=!0,this.destroyBetween(this.index,c)),this.top=this.top.children[this.index];else{let d=tm.create(this.top,t[a],n,r);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,a++}}findNodeMatch(t,n,r,i){let s=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(t,n,r))s=this.top.children.indexOf(a,this.index);else for(let o=this.index,c=Math.min(this.top.children.length,o+5);o<c;o++){let u=this.top.children[o];if(u.matchesNode(t,n,r)&&!this.preMatch.matched.has(u)){s=o;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(t,n,r,i,s){let a=this.top.children[i];return a.dirty==fu&&a.dom==a.contentDOM&&(a.dirty=ep),a.update(t,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}t=n}}updateNextNode(t,n,r,i,s,a){for(let o=this.index;o<this.top.children.length;o++){let c=this.top.children[o];if(c instanceof Af){let u=this.preMatch.matched.get(c);if(u!=null&&u!=s)return!1;let d=c.dom,h,A=this.isLocked(d)&&!(t.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==t.text&&c.dirty!=fu&&Dj(n,c.outerDeco));if(!A&&c.update(t,n,r,i))return this.destroyBetween(this.index,o),c.dom!=d&&(this.changed=!0),this.index++,!0;if(!A&&(h=this.recreateWrapper(c,t,n,r,i,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=ep,h.updateChildren(i,a+1),h.dirty=bl),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,i,s,a){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!Dj(r,t.outerDeco)||!i.eq(t.innerDeco))return null;let o=Af.create(this.top,n,r,i,s,a);if(o.contentDOM){o.children=t.children,t.children=[];for(let c of o.children)c.parent=o}return t.destroy(),o}addNode(t,n,r,i,s){let a=Af.create(this.top,t,n,r,i,s);a.contentDOM&&a.updateChildren(i,s+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new Oue(this.top,t,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof tm;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof s5)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((ra||js)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new Fue(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function $$e(e,t){let n=t,r=n.children.length,i=e.childCount,s=new Map,a=[];e:for(;i>0;){let o;for(;;)if(r){let u=n.children[r-1];if(u instanceof tm)n=u,r=u.children.length;else{o=u,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=o.node;if(c){if(c!=e.child(i-1))break;--i,s.set(o,i),a.push(o)}}return{index:i,matched:s,matches:a.reverse()}}function z$e(e,t){return e.type.side-t.type.side}function V$e(e,t,n,r){let i=t.locals(e),s=0;if(i.length==0){for(let u=0;u<e.childCount;u++){let d=e.child(u);r(d,i,t.forChild(s,d),u),s+=d.nodeSize}return}let a=0,o=[],c=null;for(let u=0;;){let d,h;for(;a<i.length&&i[a].to==s;){let g=i[a++];g.widget&&(d?(h||(h=[d])).push(g):d=g)}if(d)if(h){h.sort(z$e);for(let g=0;g<h.length;g++)n(h[g],u,!!c)}else n(d,u,!!c);let A,f;if(c)f=-1,A=c,c=null;else if(u<e.childCount)f=u,A=e.child(u++);else break;for(let g=0;g<o.length;g++)o[g].to<=s&&o.splice(g--,1);for(;a<i.length&&i[a].from<=s&&i[a].to>s;)o.push(i[a++]);let p=s+A.nodeSize;if(A.isText){let g=p;a<i.length&&i[a].from<g&&(g=i[a].from);for(let y=0;y<o.length;y++)o[y].to<g&&(g=o[y].to);g<p&&(c=A.cut(g-s),A=A.cut(0,g-s),p=g,f=-1)}else for(;a<i.length&&i[a].to<p;)a++;let m=A.isInline&&!A.isLeaf?o.filter(g=>!g.inline):o.slice();r(A,m,t.forChild(s,A),f),s=p}}function K$e(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function q$e(e,t,n,r){for(let i=0,s=0;i<e.childCount&&s<=r;){let a=e.child(i++),o=s;if(s+=a.nodeSize,!a.isText)continue;let c=a.text;for(;i<e.childCount;){let u=e.child(i++);if(s+=u.nodeSize,!u.isText)break;c+=u.text}if(s>=n){if(s>=r&&c.slice(r-t.length-o,r-o)==t)return r-t.length;let u=o<r?c.lastIndexOf(t,r-o-1):-1;if(u>=0&&u+t.length+o>=n)return o+u;if(n==r&&c.length>=r+t.length-o&&c.slice(r-o,r-o+t.length)==t)return r}}return-1}function xM(e,t,n,r,i){let s=[];for(let a=0,o=0;a<e.length;a++){let c=e[a],u=o,d=o+=c.size;u>=n||d<=t?s.push(c):(u<t&&s.push(c.slice(0,t-u,r)),i&&(s.push(i),i=void 0),d>n&&s.push(c.slice(n-u,c.size,r)))}return s}function hH(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),s=i&&i.size==0,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let o=r.resolve(a),c,u;if(i5(n)){for(c=a;i&&!i.node;)i=i.parent;let h=i.node;if(i&&h.isAtom&&Lt.isSelectable(h)&&i.parent&&!(h.isInline&&x$e(n.focusNode,n.focusOffset,i.dom))){let A=i.posBefore;u=new Lt(a==A?o:r.resolve(A))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=a,A=a;for(let f=0;f<n.rangeCount;f++){let p=n.getRangeAt(f);h=Math.min(h,e.docView.posFromDOM(p.startContainer,p.startOffset,1)),A=Math.max(A,e.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(h<0)return null;[c,a]=A==e.state.selection.anchor?[A,h]:[h,A],o=r.resolve(a)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let d=r.resolve(c);if(!u){let h=t=="pointer"||e.state.selection.head<o.pos&&!s?1:-1;u=fH(e,d,o,h)}return u}function Due(e){return e.editable?e.hasFocus():Hue(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function od(e,t=!1){let n=e.state.selection;if(Uue(e,n),!!Due(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&js){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&em(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)G$e(e);else{let{anchor:r,head:i}=n,s,a;HK&&!(n instanceof nn)&&(n.$from.parent.inlineContent||(s=QK(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=QK(e,n.to))),e.docView.setSelection(r,i,e,t),HK&&(s&&$K(s),a&&$K(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&W$e(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const HK=ra||js&&_ue<63;function QK(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(ra&&i&&i.contentEditable=="false")return YI(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return YI(i);if(s)return YI(s)}}function YI(e){return e.contentEditable="true",ra&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function $K(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function W$e(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!Due(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function G$e(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,ks(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&to&&ff<=11&&(n.disabled=!0,n.disabled=!1)}function Uue(e,t){if(t instanceof Lt){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(zK(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else zK(e)}function zK(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function fH(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||nn.between(t,n,r)}function VK(e){return e.editable&&!e.hasFocus()?!1:Hue(e)}function Hue(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function Y$e(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return em(t.node,t.offset,n.anchorNode,n.anchorOffset)}function wM(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return s&&mn.findFrom(s,t)}function gh(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function KK(e,t,n){let r=e.state.selection;if(r instanceof nn)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let a=e.state.doc.resolve(i.pos+s.nodeSize*(t<0?-1:1));return gh(e,new nn(r.$anchor,a))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=wM(e.state,t);return i&&i instanceof Lt?gh(e,i):!1}else if(!(il&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,a;if(!s||s.isText)return!1;let o=t<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?Lt.isSelectable(s)?gh(e,new Lt(t<0?e.state.doc.resolve(i.pos-s.nodeSize):i)):H2?gh(e,new nn(e.state.doc.resolve(t<0?o:o+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Lt&&r.node.isInline)return gh(e,new nn(t>0?r.$to:r.$from));{let i=wM(e.state,t);return i?gh(e,i):!1}}}function Uj(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function $w(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function hg(e,t){return t<0?X$e(e):J$e(e)}function X$e(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,s,a=!1;for(wl&&n.nodeType==1&&r<Uj(n)&&$w(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let o=n.childNodes[r-1];if($w(o,-1))i=n,s=--r;else if(o.nodeType==3)n=o,r=n.nodeValue.length;else break}}else{if(Que(n))break;{let o=n.previousSibling;for(;o&&$w(o,-1);)i=n.parentNode,s=ks(o),o=o.previousSibling;if(o)n=o,r=Uj(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}a?bM(e,n,r):i&&bM(e,i,s)}function J$e(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Uj(n),s,a;for(;;)if(r<i){if(n.nodeType!=1)break;let o=n.childNodes[r];if($w(o,1))s=n,a=++r;else break}else{if(Que(n))break;{let o=n.nextSibling;for(;o&&$w(o,1);)s=o.parentNode,a=ks(o)+1,o=o.nextSibling;if(o)n=o,r=0,i=Uj(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}s&&bM(e,s,a)}function Que(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Z$e(e,t){for(;e&&t==e.childNodes.length&&!U2(e);)t=ks(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function e8e(e,t){for(;e&&!t&&!U2(e);)t=ks(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function bM(e,t,n){if(t.nodeType!=3){let s,a;(a=Z$e(t,n))?(t=a,n=0):(s=e8e(t,n))&&(t=s,n=s.nodeValue.length)}let r=e.domSelection();if(!r)return;if(i5(r)){let s=document.createRange();s.setEnd(t,n),s.setStart(t,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&od(e)},50)}function qK(e,t){let n=e.state.doc.resolve(t);if(!(js||jue)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let s=e.coordsAtPos(t-1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(t<n.end()){let s=e.coordsAtPos(t+1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function WK(e,t,n){let r=e.state.selection;if(r instanceof nn&&!r.empty||n.indexOf("s")>-1||il&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let a=wM(e.state,t);if(a&&a instanceof Lt)return gh(e,a)}if(!i.parent.inlineContent){let a=t<0?i:s,o=r instanceof xl?mn.near(a,t):mn.findFrom(a,t);return o?gh(e,o):!1}return!1}function GK(e,t){if(!(e.state.selection instanceof nn))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let a=e.state.tr;return t<0?a.delete(n.pos-s.nodeSize,n.pos):a.delete(n.pos,n.pos+s.nodeSize),e.dispatch(a),!0}return!1}function YK(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function t8e(e){if(!ra||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;YK(e,r,"true"),setTimeout(()=>YK(e,r,"false"),20)}return!1}function n8e(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function r8e(e,t){let n=t.keyCode,r=n8e(t);if(n==8||il&&n==72&&r=="c")return GK(e,-1)||hg(e,-1);if(n==46&&!t.shiftKey||il&&n==68&&r=="c")return GK(e,1)||hg(e,1);if(n==13||n==27)return!0;if(n==37||il&&n==66&&r=="c"){let i=n==37?qK(e,e.state.selection.from)=="ltr"?-1:1:-1;return KK(e,i,r)||hg(e,i)}else if(n==39||il&&n==70&&r=="c"){let i=n==39?qK(e,e.state.selection.from)=="ltr"?1:-1:1;return KK(e,i,r)||hg(e,i)}else{if(n==38||il&&n==80&&r=="c")return WK(e,-1,r)||hg(e,-1);if(n==40||il&&n==78&&r=="c")return t8e(e)||WK(e,1,r)||hg(e,1);if(r==(il?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function AH(e,t){e.someProp("transformCopied",f=>{t=f(t,e)});let n=[],{content:r,openStart:i,openEnd:s}=t;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let f=r.firstChild;n.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let a=e.someProp("clipboardSerializer")||xm.fromSchema(e.state.schema),o=Wue(),c=o.createElement("div");c.appendChild(a.serializeFragment(r,{document:o}));let u=c.firstChild,d,h=0;for(;u&&u.nodeType==1&&(d=que[u.nodeName.toLowerCase()]);){for(let f=d.length-1;f>=0;f--){let p=o.createElement(d[f]);for(;c.firstChild;)p.appendChild(c.firstChild);c.appendChild(p),h++}u=c.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${h?` -${h}`:""} ${JSON.stringify(n)}`);let A=e.someProp("clipboardTextSerializer",f=>f(t,e))||t.content.textBetween(0,t.content.size,`

`);return{dom:c,text:A,slice:t}}function $ue(e,t,n,r,i){let s=i.parent.type.spec.code,a,o;if(!n&&!t)return null;let c=!!t&&(r||s||!n);if(c){if(e.someProp("transformPastedText",A=>{t=A(t,s||r,e)}),s)return o=new at(Qe.from(e.state.schema.text(t.replace(/\r\n?/g,`
`))),0,0),e.someProp("transformPasted",A=>{o=A(o,e,!0)}),o;let h=e.someProp("clipboardTextParser",A=>A(t,i,r,e));if(h)o=h;else{let A=i.marks(),{schema:f}=e.state,p=xm.fromSchema(f);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=a.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(f.text(m,A)))})}}else e.someProp("transformPastedHTML",h=>{n=h(n,e)}),a=o8e(n),H2&&l8e(a);let u=a&&a.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let h=+d[3];h>0;h--){let A=a.firstChild;for(;A&&A.nodeType!=1;)A=A.nextSibling;if(!A)break;a=A}if(o||(o=(e.someProp("clipboardParser")||e.someProp("domParser")||hf.fromSchema(e.state.schema)).parseSlice(a,{preserveWhitespace:!!(c||d),context:i,ruleFromNode(A){return A.nodeName=="BR"&&!A.nextSibling&&A.parentNode&&!i8e.test(A.parentNode.nodeName)?{ignore:!0}:null}})),d)o=c8e(XK(o,+d[1],+d[2]),d[4]);else if(o=at.maxOpen(s8e(o.content,i),!0),o.openStart||o.openEnd){let h=0,A=0;for(let f=o.content.firstChild;h<o.openStart&&!f.type.spec.isolating;h++,f=f.firstChild);for(let f=o.content.lastChild;A<o.openEnd&&!f.type.spec.isolating;A++,f=f.lastChild);o=XK(o,h,A)}return e.someProp("transformPasted",h=>{o=h(o,e,c)}),o}const i8e=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function s8e(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),s,a=[];if(e.forEach(o=>{if(!a)return;let c=i.findWrapping(o.type),u;if(!c)return a=null;if(u=a.length&&s.length&&Vue(c,s,o,a[a.length-1],0))a[a.length-1]=u;else{a.length&&(a[a.length-1]=Kue(a[a.length-1],s.length));let d=zue(o,c);a.push(d),i=i.matchType(d.type),s=c}}),a)return Qe.from(a)}return e}function zue(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Qe.from(e));return e}function Vue(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let s=Vue(e,t,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(Qe.from(zue(n,e,i+1))))}}function Kue(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Kue(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Qe.empty,!0);return e.copy(n.append(r))}function CM(e,t,n,r,i,s){let a=t<0?e.firstChild:e.lastChild,o=a.content;return e.childCount>1&&(s=0),i<r-1&&(o=CM(o,t,n,r,i+1,s)),i>=n&&(o=t<0?a.contentMatchAt(0).fillBefore(o,s<=i).append(o):o.append(a.contentMatchAt(a.childCount).fillBefore(Qe.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(o))}function XK(e,t,n){return t<e.openStart&&(e=new at(CM(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new at(CM(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const que={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let JK=null;function Wue(){return JK||(JK=document.implementation.createHTMLDocument("title"))}let XI=null;function a8e(e){let t=window.trustedTypes;return t?(XI||(XI=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),XI.createHTML(e)):e}function o8e(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Wue().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&que[r[1].toLowerCase()])&&(e=i.map(s=>"<"+s+">").join("")+e+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=a8e(e),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function l8e(e){let t=e.querySelectorAll(js?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function c8e(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:s,openEnd:a}=e;for(let o=r.length-2;o>=0;o-=2){let c=n.nodes[r[o]];if(!c||c.hasRequiredAttrs())break;i=Qe.from(c.create(r[o+1],i)),s++,a++}return new at(i,s,a)}const Na={},Ea={},u8e={touchstart:!0,touchmove:!0};class d8e{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function h8e(e){for(let t in Na){let n=Na[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{A8e(e,r)&&!pH(e,r)&&(e.editable||!(r.type in Ea))&&n(e,r)},u8e[t]?{passive:!0}:void 0)}ra&&e.dom.addEventListener("input",()=>null),SM(e)}function Kh(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function f8e(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function SM(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>pH(e,r))})}function pH(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function A8e(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function p8e(e,t){!pH(e,t)&&Na[t.type]&&(e.editable||!(t.type in Ea))&&Na[t.type](e,t)}Ea.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Yue(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(td&&js&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),gv&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,VA(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||r8e(e,n)?n.preventDefault():Kh(e,"key")};Ea.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Ea.keypress=(e,t)=>{let n=t;if(Yue(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||il&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof nn)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),s=()=>e.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",a=>a(e,r.$from.pos,r.$to.pos,i,s))&&e.dispatch(s()),n.preventDefault()}};function a5(e){return{left:e.clientX,top:e.clientY}}function m8e(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function mH(e,t,n,r,i){if(r==-1)return!1;let s=e.state.doc.resolve(r);for(let a=s.depth+1;a>0;a--)if(e.someProp(t,o=>a>s.depth?o(e,n,s.nodeAfter,s.before(a),i,!0):o(e,n,s.node(a),s.before(a),i,!1)))return!0;return!1}function Ny(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function g8e(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&Lt.isSelectable(r)?(Ny(e,new Lt(n)),!0):!1}function y8e(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof Lt&&(r=n.node);let s=e.state.doc.resolve(t);for(let a=s.depth+1;a>0;a--){let o=a>s.depth?s.nodeAfter:s.node(a);if(Lt.isSelectable(o)){r&&n.$from.depth>0&&a>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(a);break}}return i!=null?(Ny(e,Lt.create(e.state.doc,i)),!0):!1}function v8e(e,t,n,r,i){return mH(e,"handleClickOn",t,n,r)||e.someProp("handleClick",s=>s(e,t,r))||(i?y8e(e,n):g8e(e,n))}function x8e(e,t,n,r){return mH(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function w8e(e,t,n,r){return mH(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||b8e(e,n,r)}function b8e(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Ny(e,nn.create(r,0,r.content.size)),!0):!1;let i=r.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s),o=i.before(s);if(a.inlineContent)Ny(e,nn.create(r,o+1,o+1+a.content.size));else if(Lt.isSelectable(a))Ny(e,Lt.create(r,o));else continue;return!0}}function gH(e){return Hj(e)}const Gue=il?"metaKey":"ctrlKey";Na.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=gH(e),i=Date.now(),s="singleClick";i-e.input.lastClick.time<500&&m8e(n,e.input.lastClick)&&!n[Gue]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?s="doubleClick":e.input.lastClick.type=="doubleClick"&&(s="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let a=e.posAtCoords(a5(n));a&&(s=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new C8e(e,a,n,!!r)):(s=="doubleClick"?x8e:w8e)(e,a.pos,a.inside,n)?n.preventDefault():Kh(e,"pointer"))};class C8e{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[Gue],this.allowDefault=r.shiftKey;let s,a;if(n.inside>-1)s=t.state.doc.nodeAt(n.inside),a=n.inside;else{let d=t.state.doc.resolve(n.pos);s=d.parent,a=d.depth?d.before():0}const o=i?null:r.target,c=o?t.docView.nearestDesc(o,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:u}=t.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof Lt&&u.from<=a&&u.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&wl&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Kh(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>od(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(a5(t))),this.updateAllowDefault(t),this.allowDefault||!n?Kh(this.view,"pointer"):v8e(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||ra&&this.mightDrag&&!this.mightDrag.node.isAtom||js&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ny(this.view,mn.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):Kh(this.view,"pointer")}move(t){this.updateAllowDefault(t),Kh(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Na.touchstart=e=>{e.input.lastTouch=Date.now(),gH(e),Kh(e,"pointer")};Na.touchmove=e=>{e.input.lastTouch=Date.now(),Kh(e,"pointer")};Na.contextmenu=e=>gH(e);function Yue(e,t){return e.composing?!0:ra&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const S8e=td?5e3:-1;Ea.compositionstart=Ea.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof nn&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||js&&jue&&k8e(e)))e.markCursor=e.state.storedMarks||n.marks(),Hj(e,!0),e.markCursor=null;else if(Hj(e,!t.selection.empty),wl&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let a=s<0?i.lastChild:i.childNodes[s-1];if(!a)break;if(a.nodeType==3){let o=e.domSelection();o&&o.collapse(a,a.nodeValue.length);break}else i=a,s=-1}}e.input.composing=!0}Xue(e,S8e)};function k8e(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}Ea.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Xue(e,20))};function Xue(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Hj(e),t))}function Jue(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=j8e());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function _8e(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=y$e(t.focusNode,t.focusOffset),r=v$e(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=e.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let a=n.pmViewDesc;if(!(!a||!a.isText(n.nodeValue)))return r}}return n||r}function j8e(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Hj(e,t=!1){if(!(td&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Jue(e),t||e.docView&&e.docView.dirty){let n=hH(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function B8e(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const n1=to&&ff<15||gv&&C$e<604;Na.copy=Ea.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let s=n1?null:n.clipboardData,a=r.content(),{dom:o,text:c}=AH(e,a);s?(n.preventDefault(),s.clearData(),s.setData("text/html",o.innerHTML),s.setData("text/plain",c)):B8e(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function N8e(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function E8e(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?r1(e,r.value,null,i,t):r1(e,r.textContent,r.innerHTML,i,t)},50)}function r1(e,t,n,r,i){let s=$ue(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",c=>c(e,i,s||at.empty)))return!0;if(!s)return!1;let a=N8e(s),o=a?e.state.tr.replaceSelectionWith(a,r):e.state.tr.replaceSelection(s);return e.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Zue(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Ea.paste=(e,t)=>{let n=t;if(e.composing&&!td)return;let r=n1?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&r1(e,Zue(r),r.getData("text/html"),i,n)?n.preventDefault():E8e(e,n)};class ede{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const T8e=il?"altKey":"ctrlKey";function tde(e,t){let n=e.someProp("dragCopies",r=>!r(t));return n??!t[T8e]}Na.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,s=i.empty?null:e.posAtCoords(a5(n)),a;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof Lt?i.to-1:i.to))){if(r&&r.mightDrag)a=Lt.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=e.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=e.docView&&(a=Lt.create(e.state.doc,h.posBefore))}}let o=(a||e.state.selection).content(),{dom:c,text:u,slice:d}=AH(e,o);(!n.dataTransfer.files.length||!js||_ue>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(n1?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",n1||n.dataTransfer.setData("text/plain",u),e.dragging=new ede(d,tde(e,n),a)};Na.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Ea.dragover=Ea.dragenter=(e,t)=>t.preventDefault();Ea.drop=(e,t)=>{try{P8e(e,t,e.dragging)}finally{e.dragging=null}};function P8e(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(a5(t));if(!r)return;let i=e.state.doc.resolve(r.pos),s=n&&n.slice;s?e.someProp("transformPasted",f=>{s=f(s,e,!1)}):s=$ue(e,Zue(t.dataTransfer),n1?null:t.dataTransfer.getData("text/html"),!1,i);let a=!!(n&&tde(e,t));if(e.someProp("handleDrop",f=>f(e,t,s||at.empty,a))){t.preventDefault();return}if(!s)return;t.preventDefault();let o=s?due(e.state.doc,i.pos,s):i.pos;o==null&&(o=i.pos);let c=e.state.tr;if(a){let{node:f}=n;f?f.replace(c):c.deleteSelection()}let u=c.mapping.map(o),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(h))return;let A=c.doc.resolve(u);if(d&&Lt.isSelectable(s.content.firstChild)&&A.nodeAfter&&A.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Lt(A));else{let f=c.mapping.map(o);c.mapping.maps[c.mapping.maps.length-1].forEach((p,m,g,y)=>f=y),c.setSelection(fH(e,A,c.doc.resolve(f)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}Na.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&od(e)},20))};Na.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Na.beforeinput=(e,t)=>{if(js&&td&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",s=>s(e,VA(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in Ea)Na[e]=Ea[e];function i1(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Qj{constructor(t,n){this.toDOM=t,this.spec=n||Bp,this.side=this.spec.side||0}map(t,n,r,i){let{pos:s,deleted:a}=t.mapResult(n.from+i,this.side<0?-1:1);return a?null:new Ca(s-r,s-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Qj&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&i1(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class pf{constructor(t,n){this.attrs=t,this.spec=n||Bp}map(t,n,r,i){let s=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,a=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=a?null:new Ca(s,a,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof pf&&i1(this.attrs,t.attrs)&&i1(this.spec,t.spec)}static is(t){return t.type instanceof pf}destroy(){}}class yH{constructor(t,n){this.attrs=t,this.spec=n||Bp}map(t,n,r,i){let s=t.mapResult(n.from+i,1);if(s.deleted)return null;let a=t.mapResult(n.to+i,-1);return a.deleted||a.pos<=s.pos?null:new Ca(s.pos-r,a.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),s;return i==n.from&&!(s=t.child(r)).isText&&i+s.nodeSize==n.to}eq(t){return this==t||t instanceof yH&&i1(this.attrs,t.attrs)&&i1(this.spec,t.spec)}destroy(){}}class Ca{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Ca(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new Ca(t,t,new Qj(n,r))}static inline(t,n,r,i){return new Ca(t,n,new pf(r,i))}static node(t,n,r,i){return new Ca(t,n,new yH(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof pf}get widget(){return this.type instanceof Qj}}const Lg=[],Bp={};class $r{constructor(t,n){this.local=t.length?t:Lg,this.children=n.length?n:Lg}static create(t,n){return n.length?$j(n,t,0,Bp):qs}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,s){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=n&&o.to>=t&&(!s||s(o.spec))&&r.push(o.copy(o.from+i,o.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>t){let o=this.children[a]+1;this.children[a+2].findInner(t-o,n-o,r,i+o,s)}}map(t,n,r){return this==qs||t.maps.length==0?this:this.mapInner(t,n,0,0,r||Bp)}mapInner(t,n,r,i,s){let a;for(let o=0;o<this.local.length;o++){let c=this.local[o].map(t,r,i);c&&c.type.valid(n,c)?(a||(a=[])).push(c):s.onRemove&&s.onRemove(this.local[o].spec)}return this.children.length?I8e(this.children,a||[],t,n,r,i,s):a?new $r(a.sort(Np),Lg):qs}add(t,n){return n.length?this==qs?$r.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,s=0;t.forEach((o,c)=>{let u=c+r,d;if(d=rde(n,o,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<c;)s+=3;i[s]==c?i[s+2]=i[s+2].addInner(o,d,u+1):i.splice(s,0,c,c+o.nodeSize,$j(d,o,u+1,Bp)),s+=3}});let a=nde(s?ide(n):n,-r);for(let o=0;o<a.length;o++)a[o].type.valid(t,a[o])||a.splice(o--,1);return new $r(a.length?this.local.concat(a).sort(Np):this.local,i||this.children)}remove(t){return t.length==0||this==qs?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let a,o=r[s]+n,c=r[s+1]+n;for(let d=0,h;d<t.length;d++)(h=t[d])&&h.from>o&&h.to<c&&(t[d]=null,(a||(a=[])).push(h));if(!a)continue;r==this.children&&(r=this.children.slice());let u=r[s+2].removeInner(a,o+1);u!=qs?r[s+2]=u:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,a;s<t.length;s++)if(a=t[s])for(let o=0;o<i.length;o++)i[o].eq(a,n)&&(i==this.local&&(i=this.local.slice()),i.splice(o--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new $r(i,r):qs}forChild(t,n){if(this==qs)return this;if(n.isLeaf)return $r.empty;let r,i;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=t){this.children[o]==t&&(r=this.children[o+2]);break}let s=t+1,a=s+n.content.size;for(let o=0;o<this.local.length;o++){let c=this.local[o];if(c.from<a&&c.to>s&&c.type instanceof pf){let u=Math.max(s,c.from)-s,d=Math.min(a,c.to)-s;u<d&&(i||(i=[])).push(c.copy(u,d))}}if(i){let o=new $r(i.sort(Np),Lg);return r?new kh([o,r]):o}return r||qs}eq(t){if(this==t)return!0;if(!(t instanceof $r)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return vH(this.localsInner(t))}localsInner(t){if(this==qs)return Lg;if(t.inlineContent||!this.local.some(pf.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof pf||n.push(this.local[r]);return n}forEachSet(t){t(this)}}$r.empty=new $r([],[]);$r.removeOverlap=vH;const qs=$r.empty;class kh{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,Bp));return kh.from(r)}forChild(t,n){if(n.isLeaf)return $r.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(t,n);s!=qs&&(s instanceof kh?r=r.concat(s.members):r.push(s))}return kh.from(r)}eq(t){if(!(t instanceof kh)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(t);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let a=0;a<s.length;a++)n.push(s[a])}}return n?vH(r?n:n.sort(Np)):Lg}static from(t){switch(t.length){case 0:return qs;case 1:return t[0];default:return new kh(t.every(n=>n instanceof $r)?t:t.reduce((n,r)=>n.concat(r instanceof $r?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function I8e(e,t,n,r,i,s,a){let o=e.slice();for(let u=0,d=s;u<n.maps.length;u++){let h=0;n.maps[u].forEach((A,f,p,m)=>{let g=m-p-(f-A);for(let y=0;y<o.length;y+=3){let v=o[y+1];if(v<0||A>v+d-h)continue;let x=o[y]+d-h;f>=x?o[y+1]=A<=x?-2:-1:A>=d&&g&&(o[y]+=g,o[y+1]+=g)}h+=g}),d=n.maps[u].map(d,-1)}let c=!1;for(let u=0;u<o.length;u+=3)if(o[u+1]<0){if(o[u+1]==-2){c=!0,o[u+1]=-1;continue}let d=n.map(e[u]+s),h=d-i;if(h<0||h>=r.content.size){c=!0;continue}let A=n.map(e[u+1]+s,-1),f=A-i,{index:p,offset:m}=r.content.findIndex(h),g=r.maybeChild(p);if(g&&m==h&&m+g.nodeSize==f){let y=o[u+2].mapInner(n,g,d+1,e[u]+s+1,a);y!=qs?(o[u]=h,o[u+1]=f,o[u+2]=y):(o[u+1]=-2,c=!0)}else c=!0}if(c){let u=O8e(o,e,t,n,i,s,a),d=$j(u,r,0,a);t=d.local;for(let h=0;h<o.length;h+=3)o[h+1]<0&&(o.splice(h,3),h-=3);for(let h=0,A=0;h<d.children.length;h+=3){let f=d.children[h];for(;A<o.length&&o[A]<f;)A+=3;o.splice(A,0,d.children[h],d.children[h+1],d.children[h+2])}}return new $r(t.sort(Np),o)}function nde(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new Ca(i.from+t,i.to+t,i.type))}return n}function O8e(e,t,n,r,i,s,a){function o(c,u){for(let d=0;d<c.local.length;d++){let h=c.local[d].map(r,i,u);h?n.push(h):a.onRemove&&a.onRemove(c.local[d].spec)}for(let d=0;d<c.children.length;d+=3)o(c.children[d+2],c.children[d]+u+1)}for(let c=0;c<e.length;c+=3)e[c+1]==-1&&o(e[c+2],t[c]+s+1);return n}function rde(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let s=0,a;s<e.length;s++)(a=e[s])&&a.from>n&&a.to<r&&((i||(i=[])).push(a),e[s]=null);return i}function ide(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function $j(e,t,n,r){let i=[],s=!1;t.forEach((o,c)=>{let u=rde(e,o,c+n);if(u){s=!0;let d=$j(u,o,n+c+1,r);d!=qs&&i.push(c,c+o.nodeSize,d)}});let a=nde(s?ide(e):e,-n).sort(Np);for(let o=0;o<a.length;o++)a[o].type.valid(t,a[o])||(r.onRemove&&r.onRemove(a[o].spec),a.splice(o--,1));return a.length||i.length?new $r(a,i):qs}function Np(e,t){return e.from-t.from||e.to-t.to}function vH(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let s=t[i];if(s.from==r.from){s.to!=r.to&&(t==e&&(t=e.slice()),t[i]=s.copy(s.from,r.to),ZK(t,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,s.from),ZK(t,i,r.copy(s.from,r.to)));break}}}return t}function ZK(e,t,n){for(;t<e.length&&Np(n,e[t])>0;)t++;e.splice(t,0,n)}function JI(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=qs&&t.push(r)}),e.cursorWrapper&&t.push($r.create(e.state.doc,[e.cursorWrapper.deco])),kh.from(t)}const F8e={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},M8e=to&&ff<=11;class L8e{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class R8e{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new L8e,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);to&&ff<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():ra&&t.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),M8e&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,F8e)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(VK(this.view)){if(this.suppressingSelectionUpdates)return od(this.view);if(to&&ff<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&em(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let s=t.focusNode;s;s=mv(s))n.add(s);for(let s=t.anchorNode;s;s=mv(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&VK(t)&&!this.ignoreSelectionChange(r),s=-1,a=-1,o=!1,c=[];if(t.editable)for(let d=0;d<n.length;d++){let h=this.registerMutation(n[d],c);h&&(s=s<0?h.from:Math.min(h.from,s),a=a<0?h.to:Math.max(h.to,a),h.typeOver&&(o=!0))}if(c.some(d=>d.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46)){for(let d of c)if(d.nodeName=="BR"&&d.parentNode){let h=d.nextSibling;h&&h.nodeType==1&&h.contentEditable=="false"&&d.parentNode.removeChild(d)}}else if(wl&&c.length){let d=c.filter(h=>h.nodeName=="BR");if(d.length==2){let[h,A]=d;h.parentNode&&h.parentNode.parentNode==A.parentNode?A.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let A of d){let f=A.parentNode;f&&f.nodeName=="LI"&&(!h||H8e(t,h)!=f)&&A.remove()}}}let u=null;s<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&i5(r)&&(u=hH(t))&&u.eq(mn.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,od(t),this.currentSelection.set(r),t.scrollToSelection()):(s>-1||i)&&(s>-1&&(t.docView.markDirty(s,a),D8e(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,Q8e(t,c)),this.handleDOMChange(s,a,o,c),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||od(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let d=0;d<t.addedNodes.length;d++){let h=t.addedNodes[d];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let i=t.previousSibling,s=t.nextSibling;if(to&&ff<=11&&t.addedNodes.length)for(let d=0;d<t.addedNodes.length;d++){let{previousSibling:h,nextSibling:A}=t.addedNodes[d];(!h||Array.prototype.indexOf.call(t.addedNodes,h)<0)&&(i=h),(!A||Array.prototype.indexOf.call(t.addedNodes,A)<0)&&(s=A)}let a=i&&i.parentNode==t.target?ks(i)+1:0,o=r.localPosFromDOM(t.target,a,-1),c=s&&s.parentNode==t.target?ks(s):t.target.childNodes.length,u=r.localPosFromDOM(t.target,c,1);return{from:o,to:u}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=t.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let eq=new WeakMap,tq=!1;function D8e(e){if(!eq.has(e)&&(eq.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=wl,tq)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),tq=!0}}function nq(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,s=t.endOffset,a=e.domAtPos(e.state.selection.anchor);return em(a.node,a.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function U8e(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return nq(e,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?nq(e,n):null}function H8e(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function Q8e(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let s of t)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let a=s.nextSibling;for(;a&&a.nodeName!="TD"&&a.nodeName!="TH";)a=a.nextSibling;if(a){let o=a;for(;;){let c=o.firstChild;if(!c||c.nodeType!=1||c.contentEditable=="false"||/^(BR|IMG)$/.test(c.nodeName))break;o=c}o.insertBefore(s,o.firstChild),r==s&&e.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function $8e(e,t,n){let{node:r,fromOffset:i,toOffset:s,from:a,to:o}=e.docView.parseRange(t,n),c=e.domSelectionRange(),u,d=c.anchorNode;if(d&&e.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:c.anchorOffset}],i5(c)||u.push({node:c.focusNode,offset:c.focusOffset})),js&&e.input.lastKeyCode===8)for(let g=s;g>i;g--){let y=r.childNodes[g-1],v=y.pmViewDesc;if(y.nodeName=="BR"&&!v){s=g;break}if(!v||v.size)break}let h=e.state.doc,A=e.someProp("domParser")||hf.fromSchema(e.state.schema),f=h.resolve(a),p=null,m=A.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:i,to:s,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:z8e,context:f});if(u&&u[0].pos!=null){let g=u[0].pos,y=u[1]&&u[1].pos;y==null&&(y=g),p={anchor:g+a,head:y+a}}return{doc:m,sel:p,from:a,to:o}}function z8e(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(ra&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||ra&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const V8e=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function K8e(e,t,n,r,i){let s=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let j=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,B=hH(e,j);if(B&&!e.state.selection.eq(B)){if(js&&td&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",I=>I(e,VA(13,"Enter"))))return;let E=e.state.tr.setSelection(B);j=="pointer"?E.setMeta("pointer",!0):j=="key"&&E.scrollIntoView(),s&&E.setMeta("composition",s),e.dispatch(E)}return}let a=e.state.doc.resolve(t),o=a.sharedDepth(n);t=a.before(o+1),n=e.state.doc.resolve(n).after(o+1);let c=e.state.selection,u=$8e(e,t,n),d=e.state.doc,h=d.slice(u.from,u.to),A,f;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(A=e.state.selection.to,f="end"):(A=e.state.selection.from,f="start"),e.input.lastKeyCode=null;let p=G8e(h.content,u.doc.content,u.from,A,f);if(p&&e.input.domChangeCount++,(gv&&e.input.lastIOSEnter>Date.now()-225||td)&&i.some(j=>j.nodeType==1&&!V8e.test(j.nodeName))&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",j=>j(e,VA(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(r&&c instanceof nn&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))p={start:c.from,endA:c.to,endB:c.to};else{if(u.sel){let j=rq(e,e.state.doc,u.sel);if(j&&!j.eq(e.state.selection)){let B=e.state.tr.setSelection(j);s&&B.setMeta("composition",s),e.dispatch(B)}}return}e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof nn&&(p.start>e.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?p.start=e.state.selection.from:p.endA<e.state.selection.to&&p.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),to&&ff<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>u.from&&u.doc.textBetween(p.start-u.from-1,p.start-u.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=u.doc.resolveNoCache(p.start-u.from),g=u.doc.resolveNoCache(p.endB-u.from),y=d.resolve(p.start),v=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=p.endA;if((gv&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(j=>j.nodeName=="DIV"||j.nodeName=="P"))||!v&&m.pos<u.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(u.doc.textBetween(m.pos,g.pos,"","")))&&e.someProp("handleKeyDown",j=>j(e,VA(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&W8e(d,p.start,p.endA,m,g)&&e.someProp("handleKeyDown",j=>j(e,VA(8,"Backspace")))){td&&js&&e.domObserver.suppressSelectionUpdates();return}js&&p.endB==p.start&&(e.input.lastChromeDelete=Date.now()),td&&!v&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==p.endA&&(p.endB-=2,g=u.doc.resolveNoCache(p.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(j){return j(e,VA(13,"Enter"))})},20));let x=p.start,w=p.endA,b=j=>{let B=j||e.state.tr.replace(x,w,u.doc.slice(p.start-u.from,p.endB-u.from));if(u.sel){let E=rq(e,B.doc,u.sel);E&&!(js&&e.composing&&E.empty&&(p.start!=p.endB||e.input.lastChromeDelete<Date.now()-100)&&(E.head==x||E.head==B.mapping.map(w)-1)||to&&E.empty&&E.head==x)&&B.setSelection(E)}return s&&B.setMeta("composition",s),B.scrollIntoView()},k;if(v)if(m.pos==g.pos){to&&ff<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>od(e),20));let j=b(e.state.tr.delete(x,w)),B=d.resolve(p.start).marksAcross(d.resolve(p.endA));B&&j.ensureMarks(B),e.dispatch(j)}else if(p.endA==p.endB&&(k=q8e(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start())))){let j=b(e.state.tr);k.type=="add"?j.addMark(x,w,k.mark):j.removeMark(x,w,k.mark),e.dispatch(j)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let j=m.parent.textBetween(m.parentOffset,g.parentOffset),B=()=>b(e.state.tr.insertText(j,x,w));e.someProp("handleTextInput",E=>E(e,x,w,j,B))||e.dispatch(B())}else e.dispatch(b());else e.dispatch(b())}function rq(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:fH(e,t.resolve(n.anchor),t.resolve(n.head))}function q8e(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,s=r,a,o,c;for(let d=0;d<r.length;d++)i=r[d].removeFromSet(i);for(let d=0;d<n.length;d++)s=n[d].removeFromSet(s);if(i.length==1&&s.length==0)o=i[0],a="add",c=d=>d.mark(o.addToSet(d.marks));else if(i.length==0&&s.length==1)o=s[0],a="remove",c=d=>d.mark(o.removeFromSet(d.marks));else return null;let u=[];for(let d=0;d<t.childCount;d++)u.push(c(t.child(d)));if(Qe.from(u).eq(e))return{mark:o,type:a}}function W8e(e,t,n,r,i){if(n-t<=i.pos-r.pos||ZI(r,!0,!1)<i.pos)return!1;let s=e.resolve(t);if(!r.parent.isTextblock){let o=s.nodeAfter;return o!=null&&n==t+o.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let a=e.resolve(ZI(s,!0,!0));return!a.parent.isTextblock||a.pos>n||ZI(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function ZI(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let s=e.node(r).maybeChild(e.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function G8e(e,t,n,r,i){let s=e.findDiffStart(t,n);if(s==null)return null;let{a,b:o}=e.findDiffEnd(t,n+e.size,n+t.size);if(i=="end"){let c=Math.max(0,s-Math.min(a,o));r-=a+c-s}if(a<s&&e.size<t.size){let c=r<=s&&r>=a?s-r:0;s-=c,s&&s<t.size&&iq(t.textBetween(s-1,s+1))&&(s+=c?1:-1),o=s+(o-a),a=s}else if(o<s){let c=r<=s&&r>=o?s-r:0;s-=c,s&&s<e.size&&iq(e.textBetween(s-1,s+1))&&(s+=c?1:-1),a=s+(a-o),o=s}return{start:s,endA:a,endB:o}}function iq(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class sde{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new d8e,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(cq),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=oq(this),aq(this),this.nodeViews=lq(this),this.docView=DK(this.state.doc,sq(this),JI(this),this.dom,this),this.domObserver=new R8e(this,(r,i,s,a)=>K8e(this,r,i,s,a)),this.domObserver.start(),h8e(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&SM(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(cq),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let i=this.state,s=!1,a=!1;t.storedMarks&&this.composing&&(Jue(this),a=!0),this.state=t;let o=i.plugins!=t.plugins||this._props.plugins!=n.plugins;if(o||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=lq(this);X8e(f,this.nodeViews)&&(this.nodeViews=f,s=!0)}(o||n.handleDOMEvents!=this._props.handleDOMEvents)&&SM(this),this.editable=oq(this),aq(this);let c=JI(this),u=sq(this),d=i.plugins!=t.plugins&&!i.doc.eq(t.doc)?"reset":t.scrollToSelection>i.scrollToSelection?"to selection":"preserve",h=s||!this.docView.matchesNode(t.doc,u,c);(h||!t.selection.eq(i.selection))&&(a=!0);let A=d=="preserve"&&a&&this.dom.style.overflowAnchor==null&&_$e(this);if(a){this.domObserver.stop();let f=h&&(to||js)&&!this.composing&&!i.selection.empty&&!t.selection.empty&&Y8e(i.selection,t.selection);if(h){let p=js?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=_8e(this)),(s||!this.docView.update(t.doc,u,c,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=DK(t.doc,u,c,this.dom,this)),p&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Y$e(this))?od(this,f):(Uue(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,i),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():A&&j$e(A)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Lt){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&IK(this,n.getBoundingClientRect(),t)}else IK(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}updateDraggedNode(t,n){let r=t.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new ede(t.slice,t.move,i<0?void 0:Lt.create(this.state.doc,i))}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let a=0;a<this.directPlugins.length;a++){let o=this.directPlugins[a].props[t];if(o!=null&&(i=n?n(o):o))return i}let s=this.state.plugins;if(s)for(let a=0;a<s.length;a++){let o=s[a].props[t];if(o!=null&&(i=n?n(o):o))return i}}hasFocus(){if(to){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&B$e(this.dom),od(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return I$e(this,t)}coordsAtPos(t,n=1){return Pue(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return R$e(this,n||this.state,t)}pasteHTML(t,n){return r1(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return r1(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return AH(this,t)}destroy(){this.docView&&(f8e(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],JI(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,m$e())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return p8e(this,t)}domSelectionRange(){let t=this.domSelection();return t?ra&&this.root.nodeType===11&&w$e(this.dom.ownerDocument)==this.dom&&U8e(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}sde.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function sq(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Ca.node(0,e.state.doc.content.size,t)]}function aq(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Ca.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function oq(e){return!e.someProp("editable",t=>t(e.state)===!1)}function Y8e(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function lq(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function X8e(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function cq(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var If={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},zj={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},J8e=typeof navigator<"u"&&/Mac/.test(navigator.platform),Z8e=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var _s=0;_s<10;_s++)If[48+_s]=If[96+_s]=String(_s);for(var _s=1;_s<=24;_s++)If[_s+111]="F"+_s;for(var _s=65;_s<=90;_s++)If[_s]=String.fromCharCode(_s+32),zj[_s]=String.fromCharCode(_s);for(var e4 in If)zj.hasOwnProperty(e4)||(zj[e4]=If[e4]);function e7e(e){var t=J8e&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||Z8e&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?zj:If)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const t7e=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),n7e=typeof navigator<"u"&&/Win/.test(navigator.platform);function r7e(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,s,a;for(let o=0;o<t.length-1;o++){let c=t[o];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))t7e?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),a&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function i7e(e){let t=Object.create(null);for(let n in e)t[r7e(n)]=e[n];return t}function t4(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function s7e(e){return new qr({props:{handleKeyDown:ade(e)}})}function ade(e){let t=i7e(e);return function(n,r){let i=e7e(r),s,a=t[t4(i,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let o=t[t4(i,r,!1)];if(o&&o(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(n7e&&r.ctrlKey&&r.altKey)&&(s=If[r.keyCode])&&s!=i){let o=t[t4(s,r)];if(o&&o(n.state,n.dispatch,n))return!0}}return!1}}var a7e=Object.defineProperty,xH=(e,t)=>{for(var n in t)a7e(e,n,{get:t[n],enumerable:!0})};function o5(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var l5=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([a,o])=>[a,(...u)=>{const d=o(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,a=[],o=!!e,c=e||i.tr,u=()=>(!o&&t&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(h=>h===!0)),d={...Object.fromEntries(Object.entries(n).map(([h,A])=>[h,(...p)=>{const m=this.buildProps(c,t),g=A(...p)(m);return a.push(g),d}])),run:u};return d}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map(([o,c])=>[o,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,a={tr:e,editor:r,view:s,state:o5({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([o,c])=>[o,(...u)=>c(...u)(a)]))}};return a}},ode={};xH(ode,{blur:()=>o7e,clearContent:()=>l7e,clearNodes:()=>c7e,command:()=>u7e,createParagraphNear:()=>d7e,cut:()=>h7e,deleteCurrentNode:()=>f7e,deleteNode:()=>A7e,deleteRange:()=>p7e,deleteSelection:()=>m7e,enter:()=>g7e,exitCode:()=>y7e,extendMarkRange:()=>v7e,first:()=>x7e,focus:()=>b7e,forEach:()=>C7e,insertContent:()=>S7e,insertContentAt:()=>j7e,joinBackward:()=>E7e,joinDown:()=>N7e,joinForward:()=>T7e,joinItemBackward:()=>P7e,joinItemForward:()=>I7e,joinTextblockBackward:()=>O7e,joinTextblockForward:()=>F7e,joinUp:()=>B7e,keyboardShortcut:()=>L7e,lift:()=>R7e,liftEmptyBlock:()=>D7e,liftListItem:()=>U7e,newlineInCode:()=>H7e,resetAttributes:()=>Q7e,scrollIntoView:()=>$7e,selectAll:()=>z7e,selectNodeBackward:()=>V7e,selectNodeForward:()=>K7e,selectParentNode:()=>q7e,selectTextblockEnd:()=>W7e,selectTextblockStart:()=>G7e,setContent:()=>Y7e,setMark:()=>mze,setMeta:()=>gze,setNode:()=>yze,setNodeSelection:()=>vze,setTextDirection:()=>xze,setTextSelection:()=>wze,sinkListItem:()=>bze,splitBlock:()=>Cze,splitListItem:()=>Sze,toggleList:()=>kze,toggleMark:()=>_ze,toggleNode:()=>jze,toggleWrap:()=>Bze,undoInputRule:()=>Nze,unsetAllMarks:()=>Eze,unsetMark:()=>Tze,unsetTextDirection:()=>Pze,updateAttributes:()=>Ize,wrapIn:()=>Oze,wrapInList:()=>Fze});var o7e=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),l7e=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),c7e=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:a})=>{e.doc.nodesBetween(s.pos,a.pos,(o,c)=>{if(o.type.isText)return;const{doc:u,mapping:d}=t,h=u.resolve(d.map(c)),A=u.resolve(d.map(c+o.nodeSize)),f=h.blockRange(A);if(!f)return;const p=g0(f);if(o.type.isTextblock){const{defaultType:m}=h.parent.contentMatchAt(h.index());t.setNodeMarkup(f.start,m)}(p||p===0)&&t.lift(f,p)})}),!0},u7e=e=>t=>e(t),d7e=()=>({state:e,dispatch:t})=>n$e(e,t),h7e=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const a=r.mapping.map(t);return r.insert(a,s.content),r.setSelection(new nn(r.doc.resolve(Math.max(a-1,0)))),!0},f7e=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(t){const o=i.before(s),c=i.after(s);e.delete(o,c).scrollIntoView()}return!0}return!1};function Pi(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var A7e=e=>({tr:t,state:n,dispatch:r})=>{const i=Pi(e,n.schema),s=t.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===i){if(r){const c=s.before(a),u=s.after(a);t.delete(c,u).scrollIntoView()}return!0}return!1},p7e=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},m7e=()=>({state:e,dispatch:t})=>zQe(e,t),g7e=()=>({commands:e})=>e.keyboardShortcut("Enter"),y7e=()=>({state:e,dispatch:t})=>t$e(e,t);function wH(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Vj(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:wH(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function lde(e,t,n={}){return e.find(r=>r.type===t&&Vj(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function uq(e,t,n={}){return!!lde(e,t,n)}function bH(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if((!i.node||!i.node.marks.some(d=>d.type===t))&&(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(d=>d.type===t)||(n=n||((r=i.node.marks[0])==null?void 0:r.attrs),!lde([...i.node.marks],t,n)))return;let a=i.index,o=e.start()+i.offset,c=a+1,u=o+i.node.nodeSize;for(;a>0&&uq([...e.parent.child(a-1).marks],t,n);)a-=1,o-=e.parent.child(a).nodeSize;for(;c<e.parent.childCount&&uq([...e.parent.child(c).marks],t,n);)u+=e.parent.child(c).nodeSize,c+=1;return{from:o,to:u}}function Td(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var v7e=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const s=Td(e,r.schema),{doc:a,selection:o}=n,{$from:c,from:u,to:d}=o;if(i){const h=bH(c,s,t);if(h&&h.from<=u&&h.to>=d){const A=nn.create(a,h.from,h.to);n.setSelection(A)}}return!0},x7e=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function cde(e){return e instanceof nn}function np(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function ude(e,t=null){if(!t)return null;const n=mn.atStart(e),r=mn.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,s=r.to;return t==="all"?nn.create(e,np(0,i,s),np(e.content.size,i,s)):nn.create(e,np(t,i,s),np(t,i,s))}function dq(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Kj(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function w7e(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var b7e=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:s})=>{t={scrollIntoView:!0,...t};const a=()=>{(Kj()||dq())&&r.dom.focus(),w7e()&&!Kj()&&!dq()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(s&&e===null&&!cde(n.state.selection))return a(),!0;const o=ude(i.doc,e)||n.state.selection,c=n.state.selection.eq(o);return s&&(c||i.setSelection(o),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},C7e=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),S7e=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),dde=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&dde(r)}return e};function FS(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return dde(n)}function s1(e,t,n){if(e instanceof df||e instanceof Qe)return e;n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,i=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return Qe.fromArray(e.map(o=>t.nodeFromJSON(o)));const a=t.nodeFromJSON(e);return n.errorOnInvalidContent&&a.check(),a}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",s),s1("",t,n)}if(i){if(n.errorOnInvalidContent){let a=!1,o="";const c=new eue({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(a=!0,o=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?hf.fromSchema(c).parseSlice(FS(e),n.parseOptions):hf.fromSchema(c).parse(FS(e),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const s=hf.fromSchema(t);return n.slice?s.parseSlice(FS(e),n.parseOptions).content:s.parse(FS(e),n.parseOptions)}return s1("",t,n)}function k7e(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof is||i instanceof as))return;const s=e.mapping.maps[r];let a=0;s.forEach((o,c,u,d)=>{a===0&&(a=d)}),e.setSelection(mn.near(e.doc.resolve(a),n))}var _7e=e=>!("type"in e),j7e=(e,t,n)=>({tr:r,dispatch:i,editor:s})=>{var a;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let o;const c=g=>{s.emit("contentError",{editor:s,error:g,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{s1(t,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(g){c(g)}try{o=s1(t,s.schema,{parseOptions:u,errorOnInvalidContent:(a=n.errorOnInvalidContent)!=null?a:s.options.enableContentCheck})}catch(g){return c(g),!1}let{from:d,to:h}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},A=!0,f=!0;if((_7e(o)?o:[o]).forEach(g=>{g.check(),A=A?g.isText&&g.marks.length===0:!1,f=f?g.isBlock:!1}),d===h&&f){const{parent:g}=r.doc.resolve(d);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(d-=1,h+=1)}let m;if(A){if(Array.isArray(t))m=t.map(g=>g.text||"").join("");else if(t instanceof Qe){let g="";t.forEach(y=>{y.text&&(g+=y.text)}),m=g}else typeof t=="object"&&t&&t.text?m=t.text:m=t;r.insertText(m,d,h)}else{m=o;const g=r.doc.resolve(d),y=g.node(),v=g.parentOffset===0,x=y.isText||y.isTextblock,w=y.content.size>0;v&&x&&w&&(d=Math.max(0,d-1)),r.replaceWith(d,h,m)}n.updateSelection&&k7e(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:m}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:m})}return!0},B7e=()=>({state:e,dispatch:t})=>XQe(e,t),N7e=()=>({state:e,dispatch:t})=>JQe(e,t),E7e=()=>({state:e,dispatch:t})=>VQe(e,t),T7e=()=>({state:e,dispatch:t})=>GQe(e,t),P7e=()=>({state:e,dispatch:t,tr:n})=>{try{const r=t5(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},I7e=()=>({state:e,dispatch:t,tr:n})=>{try{const r=t5(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},O7e=()=>({state:e,dispatch:t})=>KQe(e,t),F7e=()=>({state:e,dispatch:t})=>qQe(e,t);function hde(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function M7e(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,s,a;for(let o=0;o<t.length-1;o+=1){const c=t[o];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))Kj()||hde()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var L7e=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const s=M7e(e).split(/-(?!$)/),a=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),o=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,o))});return c==null||c.steps.forEach(u=>{const d=u.map(r.mapping);d&&i&&r.maybeStep(d)}),!0};function Of(e,t,n={}){const{from:r,to:i,empty:s}=e.selection,a=t?Pi(t,e.schema):null,o=[];e.doc.nodesBetween(r,i,(h,A)=>{if(h.isText)return;const f=Math.max(r,A),p=Math.min(i,A+h.nodeSize);o.push({node:h,from:f,to:p})});const c=i-r,u=o.filter(h=>a?a.name===h.node.type.name:!0).filter(h=>Vj(h.node.attrs,n,{strict:!1}));return s?!!u.length:u.reduce((h,A)=>h+A.to-A.from,0)>=c}var R7e=(e,t={})=>({state:n,dispatch:r})=>{const i=Pi(e,n.schema);return Of(n,i,t)?ZQe(n,r):!1},D7e=()=>({state:e,dispatch:t})=>r$e(e,t),U7e=e=>({state:t,dispatch:n})=>{const r=Pi(e,t.schema);return h$e(r)(t,n)},H7e=()=>({state:e,dispatch:t})=>e$e(e,t);function c5(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function hq(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}var Q7e=(e,t)=>({tr:n,state:r,dispatch:i})=>{let s=null,a=null;const o=c5(typeof e=="string"?e:e.name,r.schema);if(!o)return!1;o==="node"&&(s=Pi(e,r.schema)),o==="mark"&&(a=Td(e,r.schema));let c=!1;return n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(d,h)=>{s&&s===d.type&&(c=!0,i&&n.setNodeMarkup(h,void 0,hq(d.attrs,t))),a&&d.marks.length&&d.marks.forEach(A=>{a===A.type&&(c=!0,i&&n.addMark(h,h+d.nodeSize,a.create(hq(A.attrs,t))))})})}),c},$7e=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),z7e=()=>({tr:e,dispatch:t})=>{if(t){const n=new xl(e.doc);e.setSelection(n)}return!0},V7e=()=>({state:e,dispatch:t})=>WQe(e,t),K7e=()=>({state:e,dispatch:t})=>YQe(e,t),q7e=()=>({state:e,dispatch:t})=>i$e(e,t),W7e=()=>({state:e,dispatch:t})=>o$e(e,t),G7e=()=>({state:e,dispatch:t})=>a$e(e,t);function kM(e,t,n={},r={}){return s1(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Y7e=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:a,commands:o})=>{const{doc:c}=s;if(r.preserveWhitespace!=="full"){const u=kM(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return a&&s.replaceWith(0,c.content.size,u).setMeta("preventUpdate",!n),!0}return a&&s.setMeta("preventUpdate",!n),o.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function fde(e,t){const n=Td(t,e.schema),{from:r,to:i,empty:s}=e.selection,a=[];s?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,c=>{a.push(...c.marks)});const o=a.find(c=>c.type.name===n.name);return o?{...o.attrs}:{}}function Ade(e,t){const n=new mue(e);return t.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function X7e(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function J7e(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function Z7e(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function u5(e){return t=>Z7e(t.$from,e)}function Ot(e,t,n){return e.config[t]===void 0&&e.parent?Ot(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?Ot(e.parent,t,n):null}):e.config[t]}function CH(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},r=Ot(t,"addExtensions",n);return r?[t,...CH(r())]:t}).flat(10)}function SH(e,t){const n=xm.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function pde(e){return typeof e=="function"}function Un(e,t=void 0,...n){return pde(e)?t?e.bind(t)(...n):e(...n):e}function eze(e={}){return Object.keys(e).length===0&&e.constructor===Object}function yv(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function mde(e){const t=[],{nodeExtensions:n,markExtensions:r}=yv(e),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},a=n.filter(u=>u.name!=="text").map(u=>u.name),o=r.map(u=>u.name),c=[...a,...o];return e.forEach(u=>{const d={name:u.name,options:u.options,storage:u.storage,extensions:i},h=Ot(u,"addGlobalAttributes",d);if(!h)return;h().forEach(f=>{let p;Array.isArray(f.types)?p=f.types:f.types==="*"?p=c:f.types==="nodes"?p=a:f.types==="marks"?p=o:p=[],p.forEach(m=>{Object.entries(f.attributes).forEach(([g,y])=>{t.push({type:m,name:g,attribute:{...s,...y}})})})})}),i.forEach(u=>{const d={name:u.name,options:u.options,storage:u.storage},h=Ot(u,"addAttributes",d);if(!h)return;const A=h();Object.entries(A).forEach(([f,p])=>{const m={...s,...p};typeof(m==null?void 0:m.default)=="function"&&(m.default=m.default()),m!=null&&m.isRequired&&(m==null?void 0:m.default)===void 0&&delete m.default,t.push({type:u.name,name:f,attribute:m})})}),t}function si(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const o=s?String(s).split(" "):[],c=r[i]?r[i].split(" "):[],u=o.filter(d=>!c.includes(d));r[i]=[...c,...u].join(" ")}else if(i==="style"){const o=s?s.split(";").map(d=>d.trim()).filter(Boolean):[],c=r[i]?r[i].split(";").map(d=>d.trim()).filter(Boolean):[],u=new Map;c.forEach(d=>{const[h,A]=d.split(":").map(f=>f.trim());u.set(h,A)}),o.forEach(d=>{const[h,A]=d.split(":").map(f=>f.trim());u.set(h,A)}),r[i]=Array.from(u.entries()).map(([d,h])=>`${d}: ${h}`).join("; ")}else r[i]=s}),r},{})}function a1(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>si(n,r),{})}function tze(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function fq(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((s,a)=>{const o=a.attribute.parseHTML?a.attribute.parseHTML(n):tze(n.getAttribute(a.name));return o==null?s:{...s,[a.name]:o}},{});return{...r,...i}}}}function Aq(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&eze(n)?!1:n!=null))}function pq(e){var t,n;const r={};return!((t=e==null?void 0:e.attribute)!=null&&t.isRequired)&&"default"in((e==null?void 0:e.attribute)||{})&&(r.default=e.attribute.default),((n=e==null?void 0:e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function nze(e,t){var n;const r=mde(e),{nodeExtensions:i,markExtensions:s}=yv(e),a=(n=i.find(u=>Ot(u,"topNode")))==null?void 0:n.name,o=Object.fromEntries(i.map(u=>{const d=r.filter(y=>y.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:t},A=e.reduce((y,v)=>{const x=Ot(v,"extendNodeSchema",h);return{...y,...x?x(u):{}}},{}),f=Aq({...A,content:Un(Ot(u,"content",h)),marks:Un(Ot(u,"marks",h)),group:Un(Ot(u,"group",h)),inline:Un(Ot(u,"inline",h)),atom:Un(Ot(u,"atom",h)),selectable:Un(Ot(u,"selectable",h)),draggable:Un(Ot(u,"draggable",h)),code:Un(Ot(u,"code",h)),whitespace:Un(Ot(u,"whitespace",h)),linebreakReplacement:Un(Ot(u,"linebreakReplacement",h)),defining:Un(Ot(u,"defining",h)),isolating:Un(Ot(u,"isolating",h)),attrs:Object.fromEntries(d.map(pq))}),p=Un(Ot(u,"parseHTML",h));p&&(f.parseDOM=p.map(y=>fq(y,d)));const m=Ot(u,"renderHTML",h);m&&(f.toDOM=y=>m({node:y,HTMLAttributes:a1(y,d)}));const g=Ot(u,"renderText",h);return g&&(f.toText=g),[u.name,f]})),c=Object.fromEntries(s.map(u=>{const d=r.filter(g=>g.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:t},A=e.reduce((g,y)=>{const v=Ot(y,"extendMarkSchema",h);return{...g,...v?v(u):{}}},{}),f=Aq({...A,inclusive:Un(Ot(u,"inclusive",h)),excludes:Un(Ot(u,"excludes",h)),group:Un(Ot(u,"group",h)),spanning:Un(Ot(u,"spanning",h)),code:Un(Ot(u,"code",h)),attrs:Object.fromEntries(d.map(pq))}),p=Un(Ot(u,"parseHTML",h));p&&(f.parseDOM=p.map(g=>fq(g,d)));const m=Ot(u,"renderHTML",h);return m&&(f.toDOM=g=>m({mark:g,HTMLAttributes:a1(g,d)})),[u.name,f]}));return new eue({topNode:a,nodes:o,marks:c})}function rze(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}function zw(e){return e.sort((n,r)=>{const i=Ot(n,"priority")||100,s=Ot(r,"priority")||100;return i>s?-1:i<s?1:0})}function gde(e){const t=zw(CH(e)),n=rze(t.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),t}function yde(e,t,n){const{from:r,to:i}=t,{blockSeparator:s=`

`,textSerializers:a={}}=n||{};let o="";return e.nodesBetween(r,i,(c,u,d,h)=>{var A;c.isBlock&&u>r&&(o+=s);const f=a==null?void 0:a[c.type.name];if(f)return d&&(o+=f({node:c,pos:u,parent:d,index:h,range:t})),!1;c.isText&&(o+=(A=c==null?void 0:c.text)==null?void 0:A.slice(Math.max(r,u)-u,i-u))}),o}function ize(e,t){const n={from:0,to:e.content.size};return yde(e,n,t)}function vde(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function sze(e,t){const n=Pi(t,e.schema),{from:r,to:i}=e.selection,s=[];e.doc.nodesBetween(r,i,o=>{s.push(o)});const a=s.reverse().find(o=>o.type.name===n.name);return a?{...a.attrs}:{}}function xde(e,t){const n=c5(typeof t=="string"?t:t.name,e.schema);return n==="node"?sze(e,t):n==="mark"?fde(e,t):{}}function aze(e,t=JSON.stringify){const n={};return e.filter(r=>{const i=t(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function oze(e){const t=aze(e);return t.length===1?t:t.filter((n,r)=>!t.filter((s,a)=>a!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function wde(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((i,s)=>{const a=[];if(i.ranges.length)i.forEach((o,c)=>{a.push({from:o,to:c})});else{const{from:o,to:c}=n[s];if(o===void 0||c===void 0)return;a.push({from:o,to:c})}a.forEach(({from:o,to:c})=>{const u=t.slice(s).map(o,-1),d=t.slice(s).map(c),h=t.invert().map(u,-1),A=t.invert().map(d);r.push({oldRange:{from:h,to:A},newRange:{from:u,to:d}})})}),oze(r)}function kH(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const s=n.resolve(e),a=bH(s,i.type);a&&r.push({mark:i,...a})}):n.nodesBetween(e,t,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(a=>({from:s,to:s+i.nodeSize,mark:a})))}),r}var lze=(e,t,n,r=20)=>{const i=e.doc.resolve(n);let s=r,a=null;for(;s>0&&a===null;){const o=i.node(s);(o==null?void 0:o.type.name)===t?a=o:s-=1}return[a,s]};function kx(e,t){return t.nodes[e]||t.marks[e]||null}function m_(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(s=>s.type===t&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}var cze=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,s,a,o)=>{var c,u;const d=((u=(c=i.type.spec).toText)==null?void 0:u.call(c,{node:i,pos:s,parent:a,index:o}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?d:d.slice(0,Math.max(0,r-s))}),n};function _M(e,t,n={}){const{empty:r,ranges:i}=e.selection,s=t?Td(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(h=>s?s.name===h.type.name:!0).find(h=>Vj(h.attrs,n,{strict:!1}));let a=0;const o=[];if(i.forEach(({$from:h,$to:A})=>{const f=h.pos,p=A.pos;e.doc.nodesBetween(f,p,(m,g)=>{if(s&&m.inlineContent&&!m.type.allowsMarkType(s))return!1;if(!m.isText&&!m.marks.length)return;const y=Math.max(f,g),v=Math.min(p,g+m.nodeSize),x=v-y;a+=x,o.push(...m.marks.map(w=>({mark:w,from:y,to:v})))})}),a===0)return!1;const c=o.filter(h=>s?s.name===h.mark.type.name:!0).filter(h=>Vj(h.mark.attrs,n,{strict:!1})).reduce((h,A)=>h+A.to-A.from,0),u=o.filter(h=>s?h.mark.type!==s&&h.mark.type.excludes(s):!0).reduce((h,A)=>h+A.to-A.from,0);return(c>0?c+u:c)>=a}function uze(e,t,n={}){if(!t)return Of(e,null,n)||_M(e,null,n);const r=c5(t,e.schema);return r==="node"?Of(e,t,n):r==="mark"?_M(e,t,n):!1}var dze=(e,t)=>{const{$from:n,$to:r,$anchor:i}=e.selection;if(t){const s=u5(o=>o.type.name===t)(e.selection);if(!s)return!1;const a=e.doc.resolve(s.pos+1);return i.pos+1===a.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},hze=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function mq(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function gq(e,t){const{nodeExtensions:n}=yv(t),r=n.find(a=>a.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=Un(Ot(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function d5(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((r=e.text)!=null?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(s=>{i!==!1&&(d5(s,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function bde(e){return e instanceof Lt}var Cde=class Sde{constructor(t){this.position=t}static fromJSON(t){return new Sde(t.position)}toJSON(){return{position:this.position}}};function fze(e,t){const n=t.mapping.mapResult(e.position);return{position:new Cde(n.pos),mapResult:n}}function Aze(e){return new Cde(e)}function pze(e,t,n){var r;const{selection:i}=t;let s=null;if(cde(i)&&(s=i.$cursor),s){const o=(r=e.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(o)||!o.some(u=>u.type.excludes(n)))}const{ranges:a}=i;return a.some(({$from:o,$to:c})=>{let u=o.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(o.pos,c.pos,(d,h,A)=>{if(u)return!1;if(d.isInline){const f=!A||A.type.allowsMarkType(n),p=!!n.isInSet(d.marks)||!d.marks.some(m=>m.type.excludes(n));u=f&&p}return!u}),u})}var mze=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:a,ranges:o}=s,c=Td(e,r.schema);if(i)if(a){const u=fde(r,c);n.addStoredMark(c.create({...u,...t}))}else o.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;r.doc.nodesBetween(d,h,(A,f)=>{const p=Math.max(f,d),m=Math.min(f+A.nodeSize,h);A.marks.find(y=>y.type===c)?A.marks.forEach(y=>{c===y.type&&n.addMark(p,m,c.create({...y.attrs,...t}))}):n.addMark(p,m,c.create(t))})});return pze(r,n,c)},gze=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),yze=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const s=Pi(e,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:o})=>EK(s,{...a,...t})(n)?!0:o.clearNodes()).command(({state:o})=>EK(s,{...a,...t})(o,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},vze=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=np(e,0,r.content.size),s=Lt.create(r,i);t.setSelection(s)}return!0},xze=(e,t)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;let a,o;return typeof t=="number"?(a=t,o=t):t&&"from"in t&&"to"in t?(a=t.from,o=t.to):(a=s.from,o=s.to),i&&n.doc.nodesBetween(a,o,(c,u)=>{c.isText||n.setNodeMarkup(u,void 0,{...c.attrs,dir:e})}),!0},wze=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:s}=typeof e=="number"?{from:e,to:e}:e,a=nn.atStart(r).from,o=nn.atEnd(r).to,c=np(i,a,o),u=np(s,a,o),d=nn.create(r,c,u);t.setSelection(d)}return!0},bze=e=>({state:t,dispatch:n})=>{const r=Pi(e,t.schema);return p$e(r)(t,n)};function yq(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}var Cze=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:a}=t,{$from:o,$to:c}=s,u=i.extensionManager.attributes,d=m_(u,o.node().type.name,o.node().attrs);if(s instanceof Lt&&s.node.isBlock)return!o.parentOffset||!jy(a,o.pos)?!1:(r&&(e&&yq(n,i.extensionManager.splittableMarks),t.split(o.pos).scrollIntoView()),!0);if(!o.parent.isBlock)return!1;const h=c.parentOffset===c.parent.content.size,A=o.depth===0?void 0:X7e(o.node(-1).contentMatchAt(o.indexAfter(-1)));let f=h&&A?[{type:A,attrs:d}]:void 0,p=jy(t.doc,t.mapping.map(o.pos),1,f);if(!f&&!p&&jy(t.doc,t.mapping.map(o.pos),1,A?[{type:A}]:void 0)&&(p=!0,f=A?[{type:A,attrs:d}]:void 0),r){if(p&&(s instanceof nn&&t.deleteSelection(),t.split(t.mapping.map(o.pos),1,f),A&&!h&&!o.parentOffset&&o.parent.type!==A)){const m=t.mapping.map(o.before()),g=t.doc.resolve(m);o.node(-1).canReplaceWith(g.index(),g.index()+1,A)&&t.setNodeMarkup(t.mapping.map(o.before()),A)}e&&yq(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return p},Sze=(e,t={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var a;const o=Pi(e,r.schema),{$from:c,$to:u}=r.selection,d=r.selection.node;if(d&&d.isBlock||c.depth<2||!c.sameParent(u))return!1;const h=c.node(-1);if(h.type!==o)return!1;const A=s.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==o||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let y=Qe.empty;const v=c.index(-1)?1:c.index(-2)?2:3;for(let B=c.depth-v;B>=c.depth-3;B-=1)y=Qe.from(c.node(B).copy(y));const x=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,w={...m_(A,c.node().type.name,c.node().attrs),...t},b=((a=o.contentMatch.defaultType)==null?void 0:a.createAndFill(w))||void 0;y=y.append(Qe.from(o.createAndFill(null,b)||void 0));const k=c.before(c.depth-(v-1));n.replace(k,c.after(-x),new at(y,4-v,0));let j=-1;n.doc.nodesBetween(k,n.doc.content.size,(B,E)=>{if(j>-1)return!1;B.isTextblock&&B.content.size===0&&(j=E+1)}),j>-1&&n.setSelection(nn.near(n.doc.resolve(j))),n.scrollIntoView()}return!0}const f=u.pos===c.end()?h.contentMatchAt(0).defaultType:null,p={...m_(A,h.type.name,h.attrs),...t},m={...m_(A,c.node().type.name,c.node().attrs),...t};n.delete(c.pos,u.pos);const g=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!jy(n.doc,c.pos,2))return!1;if(i){const{selection:y,storedMarks:v}=r,{splittableMarks:x}=s.extensionManager,w=v||y.$to.parentOffset&&y.$from.marks();if(n.split(c.pos,2,g).scrollIntoView(),!w||!i)return!0;const b=w.filter(k=>x.includes(k.type.name));n.ensureMarks(b)}return!0},n4=(e,t)=>{const n=u5(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Yf(e.doc,n.pos)&&e.join(n.pos),!0},r4=(e,t)=>{const n=u5(a=>a.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Yf(e.doc,r)&&e.join(r),!0},kze=(e,t,n,r={})=>({editor:i,tr:s,state:a,dispatch:o,chain:c,commands:u,can:d})=>{const{extensions:h,splittableMarks:A}=i.extensionManager,f=Pi(e,a.schema),p=Pi(t,a.schema),{selection:m,storedMarks:g}=a,{$from:y,$to:v}=m,x=y.blockRange(v),w=g||m.$to.parentOffset&&m.$from.marks();if(!x)return!1;const b=u5(k=>gq(k.type.name,h))(m);if(x.depth>=1&&b&&x.depth-b.depth<=1){if(b.node.type===f)return u.liftListItem(p);if(gq(b.node.type.name,h)&&f.validContent(b.node.content)&&o)return c().command(()=>(s.setNodeMarkup(b.pos,f),!0)).command(()=>n4(s,f)).command(()=>r4(s,f)).run()}return!n||!w||!o?c().command(()=>d().wrapInList(f,r)?!0:u.clearNodes()).wrapInList(f,r).command(()=>n4(s,f)).command(()=>r4(s,f)).run():c().command(()=>{const k=d().wrapInList(f,r),j=w.filter(B=>A.includes(B.type.name));return s.ensureMarks(j),k?!0:u.clearNodes()}).wrapInList(f,r).command(()=>n4(s,f)).command(()=>r4(s,f)).run()},_ze=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,a=Td(e,r.schema);return _M(r,a,t)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,t)},jze=(e,t,n={})=>({state:r,commands:i})=>{const s=Pi(e,r.schema),a=Pi(t,r.schema),o=Of(r,s,n);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),o?i.setNode(a,c):i.setNode(s,{...c,...n})},Bze=(e,t={})=>({state:n,commands:r})=>{const i=Pi(e,n.schema);return Of(n,i,t)?r.lift(i):r.wrapIn(i,t)},Nze=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(e))){if(t){const a=e.tr,o=s.transform;for(let c=o.steps.length-1;c>=0;c-=1)a.step(o.steps[c].invert(o.docs[c]));if(s.text){const c=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,e.schema.text(s.text,c))}else a.delete(s.from,s.to)}return!0}}return!1},Eze=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(s=>{e.removeMark(s.$from.pos,s.$to.pos)}),!0},Tze=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,c=Td(e,r.schema),{$from:u,empty:d,ranges:h}=o;if(!i)return!0;if(d&&a){let{from:A,to:f}=o;const p=(s=u.marks().find(g=>g.type===c))==null?void 0:s.attrs,m=bH(u,c,p);m&&(A=m.from,f=m.to),n.removeMark(A,f,c)}else h.forEach(A=>{n.removeMark(A.$from.pos,A.$to.pos,c)});return n.removeStoredMark(c),!0},Pze=e=>({tr:t,state:n,dispatch:r})=>{const{selection:i}=n;let s,a;return typeof e=="number"?(s=e,a=e):e&&"from"in e&&"to"in e?(s=e.from,a=e.to):(s=i.from,a=i.to),r&&t.doc.nodesBetween(s,a,(o,c)=>{if(o.isText)return;const u={...o.attrs};delete u.dir,t.setNodeMarkup(c,void 0,u)}),!0},Ize=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let s=null,a=null;const o=c5(typeof e=="string"?e:e.name,r.schema);if(!o)return!1;o==="node"&&(s=Pi(e,r.schema)),o==="mark"&&(a=Td(e,r.schema));let c=!1;return n.selection.ranges.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;let A,f,p,m;n.selection.empty?r.doc.nodesBetween(d,h,(g,y)=>{s&&s===g.type&&(c=!0,p=Math.max(y,d),m=Math.min(y+g.nodeSize,h),A=y,f=g)}):r.doc.nodesBetween(d,h,(g,y)=>{y<d&&s&&s===g.type&&(c=!0,p=Math.max(y,d),m=Math.min(y+g.nodeSize,h),A=y,f=g),y>=d&&y<=h&&(s&&s===g.type&&(c=!0,i&&n.setNodeMarkup(y,void 0,{...g.attrs,...t})),a&&g.marks.length&&g.marks.forEach(v=>{if(a===v.type&&(c=!0,i)){const x=Math.max(y,d),w=Math.min(y+g.nodeSize,h);n.addMark(x,w,a.create({...v.attrs,...t}))}}))}),f&&(A!==void 0&&i&&n.setNodeMarkup(A,void 0,{...f.attrs,...t}),a&&f.marks.length&&f.marks.forEach(g=>{a===g.type&&i&&n.addMark(p,m,a.create({...g.attrs,...t}))}))}),c},Oze=(e,t={})=>({state:n,dispatch:r})=>{const i=Pi(e,n.schema);return l$e(i,t)(n,r)},Fze=(e,t={})=>({state:n,dispatch:r})=>{const i=Pi(e,n.schema);return c$e(i,t)(n,r)},Mze=class{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(i=>i.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(i=>i!==n):delete this.callbacks[t]),this}once(t,n){const r=(...i)=>{this.off(t,r),n.apply(this,i)};return this.on(t,r)}removeAllListeners(){this.callbacks={}}},h5=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=(t=e.undoable)!=null?t:!0}},Lze=(e,t)=>{if(wH(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function MS(e){var t;const{editor:n,from:r,to:i,text:s,rules:a,plugin:o}=e,{view:c}=n;if(c.composing)return!1;const u=c.state.doc.resolve(r);if(u.parent.type.spec.code||(t=u.nodeBefore||u.nodeAfter)!=null&&t.marks.find(A=>A.type.spec.code))return!1;let d=!1;const h=cze(u)+s;return a.forEach(A=>{if(d)return;const f=Lze(h,A.find);if(!f)return;const p=c.state.tr,m=o5({state:c.state,transaction:p}),g={from:r-(f[0].length-s.length),to:i},{commands:y,chain:v,can:x}=new l5({editor:n,state:m});A.handler({state:m,range:g,match:f,commands:y,chain:v,can:x})===null||!p.steps.length||(A.undoable&&p.setMeta(o,{transform:p,from:r,to:i,text:s}),c.dispatch(p),d=!0)}),d}function Rze(e){const{editor:t,rules:n}=e,r=new qr({state:{init(){return null},apply(i,s,a){const o=i.getMeta(r);if(o)return o;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:d}=c;typeof d=="string"?d=d:d=SH(Qe.from(d),a.schema);const{from:h}=c,A=h+d.length;MS({editor:t,from:h,to:A,text:d,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,a,o){return MS({editor:t,from:s,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&MS({editor:t,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?MS({editor:t,from:a.pos,to:a.pos,text:`
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Dze(e){return Object.prototype.toString.call(e).slice(8,-1)}function LS(e){return Dze(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function kde(e,t){const n={...e};return LS(e)&&LS(t)&&Object.keys(t).forEach(r=>{LS(t[r])&&LS(e[r])?n[r]=kde(e[r],t[r]):n[r]=t[r]}),n}var _H=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Un(Ot(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Un(Ot(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>kde(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},wm=class _de extends _H{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n=typeof t=="function"?t():t;return new _de(n)}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(u=>(u==null?void 0:u.type.name)===n.name))return!1;const c=a.find(u=>(u==null?void 0:u.type.name)===n.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function Uze(e){return typeof e=="number"}var jde=class{constructor(e){this.find=e.find,this.handler=e.handler}},Hze=(e,t,n)=>{if(wH(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=e,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function Qze(e){const{editor:t,state:n,from:r,to:i,rule:s,pasteEvent:a,dropEvent:o}=e,{commands:c,chain:u,can:d}=new l5({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,(f,p)=>{var m,g,y,v,x;if((g=(m=f.type)==null?void 0:m.spec)!=null&&g.code||!(f.isText||f.isTextblock||f.isInline))return;const w=(x=(v=(y=f.content)==null?void 0:y.size)!=null?v:f.nodeSize)!=null?x:0,b=Math.max(r,p),k=Math.min(i,p+w);if(b>=k)return;const j=f.isText?f.text||"":f.textBetween(b-p,k-p,void 0,"");Hze(j,s.find,a).forEach(E=>{if(E.index===void 0)return;const I=b+E.index+1,T=I+E[0].length,N={from:n.tr.mapping.map(I),to:n.tr.mapping.map(T)},F=s.handler({state:n,range:N,match:E,commands:c,chain:u,can:d,pasteEvent:a,dropEvent:o});h.push(F)})}),h.every(f=>f!==null)}var RS=null,$ze=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData("text/html",e),n};function zze(e){const{editor:t,rules:n}=e;let r=null,i=!1,s=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,o;try{o=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{o=null}const c=({state:d,from:h,to:A,rule:f,pasteEvt:p})=>{const m=d.tr,g=o5({state:d,transaction:m});if(!(!Qze({editor:t,state:g,from:Math.max(h-1,0),to:A.b-1,rule:f,pasteEvent:p,dropEvent:o})||!m.steps.length)){try{o=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{o=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return n.map(d=>new qr({view(h){const A=p=>{var m;r=(m=h.dom.parentElement)!=null&&m.contains(p.target)?h.dom.parentElement:null,r&&(RS=t)},f=()=>{RS&&(RS=null)};return window.addEventListener("dragstart",A),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",A),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(h,A)=>{if(s=r===h.dom.parentElement,o=A,!s){const f=RS;f!=null&&f.isEditable&&setTimeout(()=>{const p=f.state.selection;p&&f.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(h,A)=>{var f;const p=(f=A.clipboardData)==null?void 0:f.getData("text/html");return a=A,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(h,A,f)=>{const p=h[0],m=p.getMeta("uiEvent")==="paste"&&!i,g=p.getMeta("uiEvent")==="drop"&&!s,y=p.getMeta("applyPasteRules"),v=!!y;if(!m&&!g&&!v)return;if(v){let{text:b}=y;typeof b=="string"?b=b:b=SH(Qe.from(b),f.schema);const{from:k}=y,j=k+b.length,B=$ze(b);return c({rule:d,state:f,from:k,to:{b:j},pasteEvt:B})}const x=A.doc.content.findDiffStart(f.doc.content),w=A.doc.content.findDiffEnd(f.doc.content);if(!(!Uze(x)||!w||x===w.b))return c({rule:d,state:f,from:x,to:w,pasteEvt:a})}}))}var f5=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=gde(e),this.schema=nze(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:kx(t.name,this.schema)},r=Ot(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){const{editor:e}=this;return zw([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:kx(r.name,this.schema)},s=[],a=Ot(r,"addKeyboardShortcuts",i);let o={};if(r.type==="mark"&&Ot(r,"exitable",i)&&(o.ArrowRight=()=>wm.handleExit({editor:e,mark:r})),a){const A=Object.fromEntries(Object.entries(a()).map(([f,p])=>[f,()=>p({editor:e})]));o={...o,...A}}const c=s7e(o);s.push(c);const u=Ot(r,"addInputRules",i);if(mq(r,e.options.enableInputRules)&&u){const A=u();if(A&&A.length){const f=Rze({editor:e,rules:A}),p=Array.isArray(f)?f:[f];s.push(...p)}}const d=Ot(r,"addPasteRules",i);if(mq(r,e.options.enablePasteRules)&&d){const A=d();if(A&&A.length){const f=zze({editor:e,rules:A});s.push(...f)}}const h=Ot(r,"addProseMirrorPlugins",i);if(h){const A=h();s.push(...A)}return s})}get attributes(){return mde(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=yv(this.extensions);return Object.fromEntries(t.filter(n=>!!Ot(n,"addNodeView")).map(n=>{const r=this.attributes.filter(c=>c.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:Pi(n.name,this.schema)},s=Ot(n,"addNodeView",i);if(!s)return[];const a=s();if(!a)return[];const o=(c,u,d,h,A)=>{const f=a1(c,r);return a({node:c,view:u,getPos:d,decorations:h,innerDecorations:A,editor:e,extension:n,HTMLAttributes:f})};return[n.name,o]}))}dispatchTransaction(e){const{editor:t}=this;return zw([...this.extensions].reverse()).reduceRight((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:kx(i.name,this.schema)},a=Ot(i,"dispatchTransaction",s);return a?o=>{a.call(s,{transaction:o,next:r})}:r},e)}transformPastedHTML(e){const{editor:t}=this;return zw([...this.extensions]).reduce((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:kx(i.name,this.schema)},a=Ot(i,"transformPastedHTML",s);return a?(o,c)=>{const u=r(o,c);return a.call(s,u)}:r},e||(r=>r))}get markViews(){const{editor:e}=this,{markExtensions:t}=yv(this.extensions);return Object.fromEntries(t.filter(n=>!!Ot(n,"addMarkView")).map(n=>{const r=this.attributes.filter(o=>o.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:Td(n.name,this.schema)},s=Ot(n,"addMarkView",i);if(!s)return[];const a=(o,c,u)=>{const d=a1(o,r);return s()({mark:o,view:c,inline:u,editor:e,extension:n,HTMLAttributes:d,updateAttributes:h=>{i9e(o,e,h)}})};return[n.name,a]}))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(t=>[t.name,t.storage])),e.forEach(t=>{var n;const r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:kx(t.name,this.schema)};t.type==="mark"&&((n=Un(Ot(t,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(t.name);const i=Ot(t,"onBeforeCreate",r),s=Ot(t,"onCreate",r),a=Ot(t,"onUpdate",r),o=Ot(t,"onSelectionUpdate",r),c=Ot(t,"onTransaction",r),u=Ot(t,"onFocus",r),d=Ot(t,"onBlur",r),h=Ot(t,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),a&&this.editor.on("update",a),o&&this.editor.on("selectionUpdate",o),c&&this.editor.on("transaction",c),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),h&&this.editor.on("destroy",h)})}};f5.resolve=gde;f5.sort=zw;f5.flatten=CH;var Vze={};xH(Vze,{ClipboardTextSerializer:()=>Nde,Commands:()=>Ede,Delete:()=>Tde,Drop:()=>Pde,Editable:()=>Ide,FocusEvents:()=>Fde,Keymap:()=>Mde,Paste:()=>Lde,Tabindex:()=>Rde,TextDirection:()=>Dde,focusEventsPluginKey:()=>Ode});var vi=class Bde extends _H{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n=typeof t=="function"?t():t;return new Bde(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},Nde=vi.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new qr({key:new Gi("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:s}=i,a=Math.min(...s.map(d=>d.$from.pos)),o=Math.max(...s.map(d=>d.$to.pos)),c=vde(n);return yde(r,{from:a,to:o},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),Ede=vi.create({name:"commands",addCommands(){return{...ode}}}),Tde=vi.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;const s=()=>{var a,o,c,u;if((u=(c=(o=(a=this.editor.options.coreExtensionOptions)==null?void 0:a.delete)==null?void 0:o.filterTransaction)==null?void 0:c.call(o,e))!=null?u:e.getMeta("y-sync$"))return;const d=Ade(e.before,[e,...t]);wde(d).forEach(f=>{d.mapping.mapResult(f.oldRange.from).deletedAfter&&d.mapping.mapResult(f.oldRange.to).deletedBefore&&d.before.nodesBetween(f.oldRange.from,f.oldRange.to,(p,m)=>{const g=m+p.nodeSize-2,y=f.oldRange.from<=m&&g<=f.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:m,to:g,newFrom:d.mapping.map(m),newTo:d.mapping.map(g),deletedRange:f.oldRange,newRange:f.newRange,partial:!y,editor:this.editor,transaction:e,combinedTransform:d})})});const A=d.mapping;d.steps.forEach((f,p)=>{var m,g;if(f instanceof lc){const y=A.slice(p).map(f.from,-1),v=A.slice(p).map(f.to),x=A.invert().map(y,-1),w=A.invert().map(v),b=(m=d.doc.nodeAt(y-1))==null?void 0:m.marks.some(j=>j.eq(f.mark)),k=(g=d.doc.nodeAt(v))==null?void 0:g.marks.some(j=>j.eq(f.mark));this.editor.emit("delete",{type:"mark",mark:f.mark,from:f.from,to:f.to,deletedRange:{from:x,to:w},newRange:{from:y,to:v},partial:!!(k||b),editor:this.editor,transaction:e,combinedTransform:d})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(s,0):s()}}),Pde=vi.create({name:"drop",addProseMirrorPlugins(){return[new qr({key:new Gi("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),Ide=vi.create({name:"editable",addProseMirrorPlugins(){return[new qr({key:new Gi("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Ode=new Gi("focusEvents"),Fde=vi.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new qr({key:Ode,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),Mde=vi.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:o})=>{const{selection:c,doc:u}=o,{empty:d,$anchor:h}=c,{pos:A,parent:f}=h,p=h.parent.isTextblock&&A>0?o.doc.resolve(A-1):h,m=p.parent.type.spec.isolating,g=h.pos-h.parentOffset,y=m&&p.parent.childCount===1?g===h.pos:mn.atStart(u).from===A;return!d||!f.type.isTextblock||f.textContent.length||!y||y&&h.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Kj()||hde()?s:i},addProseMirrorPlugins(){return[new qr({key:new Gi("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(m=>m.getMeta("composition")))return;const r=e.some(m=>m.docChanged)&&!t.doc.eq(n.doc),i=e.some(m=>m.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:a,to:o}=t.selection,c=mn.atStart(t.doc).from,u=mn.atEnd(t.doc).to;if(s||!(a===c&&o===u)||!d5(n.doc))return;const A=n.tr,f=o5({state:n,transaction:A}),{commands:p}=new l5({editor:this.editor,state:f});if(p.clearNodes(),!!A.steps.length)return A}})]}}),Lde=vi.create({name:"paste",addProseMirrorPlugins(){return[new qr({key:new Gi("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),Rde=vi.create({name:"tabindex",addProseMirrorPlugins(){return[new qr({key:new Gi("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Dde=vi.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=yv(this.extensions);return[{types:e.filter(t=>t.name!=="text").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const n=t.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new qr({key:new Gi("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),Kze=class ow{constructor(t,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!=null?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new ow(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new ow(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new ow(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,a=n.isInline,o=this.pos+r+(s?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const c=this.resolvedPos.doc.resolve(o);if(!i&&!a&&c.depth<=this.depth)return;const u=new ow(c,this.editor,i,i||a?n:null);i&&(u.actualDepth=this.depth+1),t.push(u)}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===t)if(Object.keys(n).length>0){const s=i.node.attrs,a=Object.keys(n);for(let o=0;o<a.length;o+=1){const c=a[o];if(s[c]!==n[c])break}}else r=i;i=i.parent}return r}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(a=>{r&&i.length>0||(a.node.type.name===t&&s.every(c=>n[c]===a.node.attrs[c])&&i.push(a),!(r&&i.length>0)&&(i=i.concat(a.querySelectorAll(t,n,r))))}),i}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}},qze=`.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}

.ProseMirror [contenteditable="false"] {
  white-space: normal;
}

.ProseMirror [contenteditable="false"] [contenteditable="true"] {
  white-space: pre-wrap;
}

.ProseMirror pre {
  white-space: pre-wrap;
}

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

.ProseMirror-gapcursor {
  display: none;
  pointer-events: none;
  position: absolute;
  margin: 0;
}

.ProseMirror-gapcursor:after {
  content: "";
  display: block;
  position: absolute;
  top: -2px;
  width: 20px;
  border-top: 1px solid black;
  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}

@keyframes ProseMirror-cursor-blink {
  to {
    visibility: hidden;
  }
}

.ProseMirror-hideselection *::selection {
  background: transparent;
}

.ProseMirror-hideselection *::-moz-selection {
  background: transparent;
}

.ProseMirror-hideselection * {
  caret-color: transparent;
}

.ProseMirror-focused .ProseMirror-gapcursor {
  display: block;
}`;function Wze(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}var Gze=class extends Mze{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:fze,createMappablePosition:Aze},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:i,moved:s})=>this.options.onDrop(r,i,s)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=ude(t,this.options.autofocus);this.editorState=ay.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;e!=null&&e.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Wze(qze,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=pde(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(a=>!a.key.startsWith(s))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;const r=[...this.options.enableCoreExtensions?[Ide,Nde.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:t.blockSeparator}),Ede,Fde,Mde,Rde,Pde,Lde,Tde,Dde.configure({direction:this.options.textDirection})].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new f5(r,this)}createCommandManager(){this.commandManager=new l5({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=kM(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),e=kM(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,s=t.transformPastedHTML,a=this.extensionManager.transformPastedHTML(s);this.editorView=new sde(e,{...t,attributes:{role:"textbox",...t==null?void 0:t.attributes},dispatchTransaction:i,transformPastedHTML:a,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.prependClass(),this.injectCSS();const c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(u=>{var d;return(d=this.capturedTransaction)==null?void 0:d.step(u)});return}const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const a=n.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),o=a==null?void 0:a.getMeta("focus"),c=a==null?void 0:a.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:a}),c&&this.emit("blur",{editor:this,event:c.event,transaction:a}),!(e.getMeta("preventUpdate")||!n.some(u=>u.docChanged)||s.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return xde(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return uze(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return SH(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`

`,textSerializers:n={}}=e||{};return ize(this.state.doc,{blockSeparator:t,textSerializers:{...vde(this.schema),...n}})}get isEmpty(){return d5(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return(t=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?t:!0}$node(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new Kze(t,this)}get $doc(){return this.$pos(0)}};function vv(e){return new h5({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Un(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=t,a=r[r.length-1],o=r[0];if(a){const c=o.search(/\S/),u=n.from+o.indexOf(a),d=u+a.length;if(kH(n.from,n.to,t.doc).filter(f=>f.mark.type.excluded.find(m=>m===e.type&&m!==f.mark.type)).filter(f=>f.to>u).length)return null;d<n.to&&s.delete(d,n.to),u>n.from&&s.delete(n.from+c,u);const A=n.from+c+a.length;s.addMark(n.from+c,A,e.type.create(i||{})),s.removeStoredMark(e.type)}},undoable:e.undoable})}function Ude(e){return new h5({find:e.find,handler:({state:t,range:n,match:r})=>{const i=Un(e.getAttributes,void 0,r)||{},{tr:s}=t,a=n.from;let o=n.to;const c=e.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let d=a+u;d>o?d=o:o=d+r[1].length;const h=r[0][r[0].length-1];s.insertText(h,a+r[0].length-1),s.replaceWith(d,o,c)}else if(r[0]){const u=e.type.isInline?a:a-1;s.insert(u,e.type.create(i)).delete(s.mapping.map(a),s.mapping.map(o))}s.scrollIntoView()},undoable:e.undoable})}function jM(e){return new h5({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),s=Un(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,s)},undoable:e.undoable})}function xv(e){return new h5({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const s=Un(e.getAttributes,void 0,r)||{},a=t.tr.delete(n.from,n.to),c=a.doc.resolve(n.from).blockRange(),u=c&&oH(c,e.type,s);if(!u)return null;if(a.wrap(c,u),e.keepMarks&&e.editor){const{selection:h,storedMarks:A}=t,{splittableMarks:f}=e.editor.extensionManager,p=A||h.$to.parentOffset&&h.$from.marks();if(p){const m=p.filter(g=>f.includes(g.type.name));a.ensureMarks(m)}}if(e.keepAttributes){const h=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,s).run()}const d=a.doc.resolve(n.from-1).nodeBefore;d&&d.type===e.type&&Yf(a.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&a.join(n.from-1)},undoable:e.undoable})}var Yze=e=>"touches"in e,Xze=class{constructor(e){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=o=>{if(!this.isResizing||!this.activeHandle)return;const c=o.clientX-this.startX,u=o.clientY-this.startY;this.handleResize(c,u)},this.handleTouchMove=o=>{if(!this.isResizing||!this.activeHandle)return;const c=o.touches[0];if(!c)return;const u=c.clientX-this.startX,d=c.clientY-this.startY;this.handleResize(u,d)},this.handleMouseUp=()=>{if(!this.isResizing)return;const o=this.element.offsetWidth,c=this.element.offsetHeight;this.onCommit(o,c),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!1)};var t,n,r,i,s,a;this.node=e.node,this.editor=e.editor,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,(t=e.options)!=null&&t.min&&(this.minSize={...this.minSize,...e.options.min}),(n=e.options)!=null&&n.max&&(this.maxSize=e.options.max),(r=e==null?void 0:e.options)!=null&&r.directions&&(this.directions=e.options.directions),(i=e.options)!=null&&i.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),(s=e.options)!=null&&s.className&&(this.classNames={container:e.options.className.container||"",wrapper:e.options.className.wrapper||"",handle:e.options.className.handle||"",resizing:e.options.className.resizing||""}),(a=e.options)!=null&&a.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var e;return(e=this.contentElement)!=null?e:null}handleEditorUpdate(){const e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type!==this.node.type?!1:(this.node=e,this.onUpdate?this.onUpdate(e,t,n):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const e=document.createElement("div");return e.dataset.resizeContainer="",e.dataset.node=this.node.type.name,e.style.display="flex",this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){const e=document.createElement("div");return e.style.position="relative",e.style.display="block",e.dataset.resizeWrapper="",this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){const t=document.createElement("div");return t.dataset.resizeHandle=e,t.style.position="absolute",this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){const n=t.includes("top"),r=t.includes("bottom"),i=t.includes("left"),s=t.includes("right");n&&(e.style.top="0"),r&&(e.style.bottom="0"),i&&(e.style.left="0"),s&&(e.style.right="0"),(t==="top"||t==="bottom")&&(e.style.left="0",e.style.right="0"),(t==="left"||t==="right")&&(e.style.top="0",e.style.bottom="0")}attachHandles(){this.directions.forEach(e=>{let t;this.createCustomHandle?t=this.createCustomHandle(e):t=this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener("mousedown",n=>this.handleResizeStart(n,e)),t.addEventListener("touchstart",n=>this.handleResizeStart(n,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){const e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,Yze(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;const n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),s=this.applyConstraints(r,i,n);this.element.style.width=`${s.width}px`,this.element.style.height=`${s.height}px`,this.onResize&&this.onResize(s.width,s.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight;const s=e.includes("right"),a=e.includes("left"),o=e.includes("bottom"),c=e.includes("top");return s?r=this.startWidth+t:a&&(r=this.startWidth-t),o?i=this.startHeight+n:c&&(i=this.startHeight-n),(e==="right"||e==="left")&&(r=this.startWidth+(s?t:-t)),(e==="top"||e==="bottom")&&(i=this.startHeight+(o?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){var r,i,s,a;if(!n){let u=Math.max(this.minSize.width,e),d=Math.max(this.minSize.height,t);return(r=this.maxSize)!=null&&r.width&&(u=Math.min(this.maxSize.width,u)),(i=this.maxSize)!=null&&i.height&&(d=Math.min(this.maxSize.height,d)),{width:u,height:d}}let o=e,c=t;return o<this.minSize.width&&(o=this.minSize.width,c=o/this.aspectRatio),c<this.minSize.height&&(c=this.minSize.height,o=c*this.aspectRatio),(s=this.maxSize)!=null&&s.width&&o>this.maxSize.width&&(o=this.maxSize.width,c=o/this.aspectRatio),(a=this.maxSize)!=null&&a.height&&c>this.maxSize.height&&(c=this.maxSize.height,o=c*this.aspectRatio),{width:o,height:c}}applyAspectRatio(e,t,n){const r=n==="left"||n==="right",i=n==="top"||n==="bottom";return r?{width:e,height:e/this.aspectRatio}:i?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}};function Jze(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof Lt){const s=r.index();return r.parent.canReplaceWith(s,s+1,t)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(t))return!0;i-=1}return!1}var Zze={};xH(Zze,{createAtomBlockMarkdownSpec:()=>Hde,createBlockMarkdownSpec:()=>e9e,createInlineMarkdownSpec:()=>r9e,parseAttributes:()=>jH,parseIndentedBlocks:()=>BM,renderNestedMarkdownContent:()=>NH,serializeAttributes:()=>BH});function jH(e){if(!(e!=null&&e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,u=>(n.push(u),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const u=i.map(d=>d.trim().slice(1));t.class=u.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(t.id=s[1]);const a=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(a)).forEach(([,u,d])=>{var h;const A=parseInt(((h=d.match(/__QUOTED_(\d+)__/))==null?void 0:h[1])||"0",10),f=n[A];f&&(t[u]=f.slice(1,-1))});const c=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return c&&c.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(t[d]=!0)}),t}function BH(e){if(!e||Object.keys(e).length===0)return"";const t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(r=>t.push(`.${r}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?t.push(n):r!==!1&&r!=null&&t.push(`${n}="${String(r)}"`))}),t.join(" ")}function Hde(e){const{nodeName:t,name:n,parseAttributes:r=jH,serializeAttributes:i=BH,defaultAttributes:s={},requiredAttributes:a=[],allowedAttributes:o}=e,c=n||t,u=d=>{if(!o)return d;const h={};return o.forEach(A=>{A in d&&(h[A]=d[A])}),h};return{parseMarkdown:(d,h)=>{const A={...s,...d.attributes};return h.createNode(t,A,[])},markdownTokenizer:{name:t,level:"block",start(d){var h;const A=new RegExp(`^:::${c}(?:\\s|$)`,"m"),f=(h=d.match(A))==null?void 0:h.index;return f!==void 0?f:-1},tokenize(d,h,A){const f=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),p=d.match(f);if(!p)return;const m=p[1]||"",g=r(m);if(!a.find(v=>!(v in g)))return{type:t,raw:p[0],attributes:g}}},renderMarkdown:d=>{const h=u(d.attrs||{}),A=i(h),f=A?` {${A}}`:"";return`:::${c}${f} :::`}}}function e9e(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=jH,serializeAttributes:s=BH,defaultAttributes:a={},content:o="block",allowedAttributes:c}=e,u=n||t,d=h=>{if(!c)return h;const A={};return c.forEach(f=>{f in h&&(A[f]=h[f])}),A};return{parseMarkdown:(h,A)=>{let f;if(r){const m=r(h);f=typeof m=="string"?[{type:"text",text:m}]:m}else o==="block"?f=A.parseChildren(h.tokens||[]):f=A.parseInline(h.tokens||[]);const p={...a,...h.attributes};return A.createNode(t,p,f)},markdownTokenizer:{name:t,level:"block",start(h){var A;const f=new RegExp(`^:::${u}`,"m"),p=(A=h.match(f))==null?void 0:A.index;return p!==void 0?p:-1},tokenize(h,A,f){var p;const m=new RegExp(`^:::${u}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),g=h.match(m);if(!g)return;const[y,v=""]=g,x=i(v);let w=1;const b=y.length;let k="";const j=/^:::([\w-]*)(\s.*)?/gm,B=h.slice(b);for(j.lastIndex=0;;){const E=j.exec(B);if(E===null)break;const I=E.index,T=E[1];if(!((p=E[2])!=null&&p.endsWith(":::"))){if(T)w+=1;else if(w-=1,w===0){const N=B.slice(0,I);k=N.trim();const F=h.slice(0,b+I+E[0].length);let L=[];if(k)if(o==="block")for(L=f.blockTokens(N),L.forEach(U=>{U.text&&(!U.tokens||U.tokens.length===0)&&(U.tokens=f.inlineTokens(U.text))});L.length>0;){const U=L[L.length-1];if(U.type==="paragraph"&&(!U.text||U.text.trim()===""))L.pop();else break}else L=f.inlineTokens(k);return{type:t,raw:F,attributes:x,content:k,tokens:L}}}}}},renderMarkdown:(h,A)=>{const f=d(h.attrs||{}),p=s(f),m=p?` {${p}}`:"",g=A.renderChildren(h.content||[],`

`);return`:::${u}${m}

${g}

:::`}}}function t9e(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;r!==null;){const[,i,s,a]=r;t[i]=s||a,r=n.exec(e)}return t}function n9e(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}="${n}"`).join(" ")}function r9e(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=t9e,serializeAttributes:s=n9e,defaultAttributes:a={},selfClosing:o=!1,allowedAttributes:c}=e,u=n||t,d=A=>{if(!c)return A;const f={};return c.forEach(p=>{const m=typeof p=="string"?p:p.name,g=typeof p=="string"?void 0:p.skipIfDefault;if(m in A){const y=A[m];if(g!==void 0&&y===g)return;f[m]=y}}),f},h=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(A,f)=>{const p={...a,...A.attributes};if(o)return f.createNode(t,p);const m=r?r(A):A.content||"";return m?f.createNode(t,p,[f.createTextNode(m)]):f.createNode(t,p,[])},markdownTokenizer:{name:t,level:"inline",start(A){const f=o?new RegExp(`\\[${h}\\s*[^\\]]*\\]`):new RegExp(`\\[${h}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${h}\\]`),p=A.match(f),m=p==null?void 0:p.index;return m!==void 0?m:-1},tokenize(A,f,p){const m=o?new RegExp(`^\\[${h}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${h}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${h}\\]`),g=A.match(m);if(!g)return;let y="",v="";if(o){const[,w]=g;v=w}else{const[,w,b]=g;v=w,y=b||""}const x=i(v.trim());return{type:t,raw:g[0],content:y.trim(),attributes:x}}},renderMarkdown:A=>{let f="";r?f=r(A):A.content&&A.content.length>0&&(f=A.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const p=d(A.attrs||{}),m=s(p),g=m?` ${m}`:"";return o?`[${u}${g}]`:`[${u}${g}]${f}[/${u}]`}}}function BM(e,t,n){var r,i,s,a;const o=e.split(`
`),c=[];let u="",d=0;const h=t.baseIndentSize||2;for(;d<o.length;){const A=o[d],f=A.match(t.itemPattern);if(!f){if(c.length>0)break;if(A.trim()===""){d+=1,u=`${u}${A}
`;continue}else return}const p=t.extractItemData(f),{indentLevel:m,mainContent:g}=p;u=`${u}${A}
`;const y=[g];for(d+=1;d<o.length;){const b=o[d];if(b.trim()===""){const j=o.slice(d+1).findIndex(I=>I.trim()!=="");if(j===-1)break;if((((i=(r=o[d+1+j].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>m){y.push(b),u=`${u}${b}
`,d+=1;continue}else break}if((((a=(s=b.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:a.length)||0)>m)y.push(b),u=`${u}${b}
`,d+=1;else break}let v;const x=y.slice(1);if(x.length>0){const b=x.map(k=>k.slice(m+h)).join(`
`);b.trim()&&(t.customNestedParser?v=t.customNestedParser(b):v=n.blockTokens(b))}const w=t.createToken(p,v);c.push(w)}if(c.length!==0)return{items:c,raw:u}}function NH(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const i=typeof n=="function"?n(r):n,[s,...a]=e.content,o=t.renderChildren([s]),c=[`${i}${o}`];return a&&a.length>0&&a.forEach(u=>{const d=t.renderChildren([u]);if(d){const h=d.split(`
`).map(A=>A?t.indent(A):"").join(`
`);c.push(h)}}),c.join(`
`)}function i9e(e,t,n={}){const{state:r}=t,{doc:i,tr:s}=r,a=e;i.descendants((o,c)=>{const u=s.mapping.map(c),d=s.mapping.map(c)+o.nodeSize;let h=null;if(o.marks.forEach(f=>{if(f!==a)return!1;h=f}),!h)return;let A=!1;if(Object.keys(n).forEach(f=>{n[f]!==h.attrs[f]&&(A=!0)}),A){const f=e.type.create({...e.attrs,...n});s.removeMark(u,d,e.type),s.addMark(u,d,f)}}),s.docChanged&&t.view.dispatch(s)}var Ia=class Qde extends _H{constructor(){super(...arguments),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new Qde(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function nm(e){return new jde({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const s=Un(e.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:a}=t,o=r[r.length-1],c=r[0];let u=n.to;if(o){const d=c.search(/\S/),h=n.from+c.indexOf(o),A=h+o.length;if(kH(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(g=>g===e.type&&g!==p.mark.type)).filter(p=>p.to>h).length)return null;A<n.to&&a.delete(A,n.to),h>n.from&&a.delete(n.from+d,h),u=n.from+d+o.length,a.addMark(n.from+d,u,e.type.create(s||{})),a.removeStoredMark(e.type)}}})}function s9e(e){return new jde({find:e.find,handler({match:t,chain:n,range:r,pasteEvent:i}){const s=Un(e.getAttributes,void 0,t,i),a=Un(e.getContent,void 0,s);if(s===!1||s===null)return null;const o={type:e.type.name,attrs:s};a&&(o.content=a),t.input&&n().deleteRange(r).insertContentAt(r.from,o)}})}const{getOwnPropertyNames:a9e,getOwnPropertySymbols:o9e}=Object,{hasOwnProperty:l9e}=Object.prototype;function i4(e,t){return function(r,i,s){return e(r,i,s)&&t(r,i,s)}}function DS(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);const{cache:s}=i,a=s.get(n),o=s.get(r);if(a&&o)return a===r&&o===n;s.set(n,r),s.set(r,n);const c=e(n,r,i);return s.delete(n),s.delete(r),c}}function c9e(e){return e!=null?e[Symbol.toStringTag]:void 0}function vq(e){return a9e(e).concat(o9e(e))}const u9e=Object.hasOwn||((e,t)=>l9e.call(e,t));function bm(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const d9e="__v",h9e="__o",f9e="_owner",{getOwnPropertyDescriptor:xq,keys:wq}=Object;function A9e(e,t){return e.byteLength===t.byteLength&&qj(new Uint8Array(e),new Uint8Array(t))}function p9e(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function m9e(e,t){return e.byteLength===t.byteLength&&qj(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function g9e(e,t){return bm(e.getTime(),t.getTime())}function y9e(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function v9e(e,t){return e===t}function bq(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),s=e.entries();let a,o,c=0;for(;(a=s.next())&&!a.done;){const u=t.entries();let d=!1,h=0;for(;(o=u.next())&&!o.done;){if(i[h]){h++;continue}const A=a.value,f=o.value;if(n.equals(A[0],f[0],c,h,e,t,n)&&n.equals(A[1],f[1],A[0],f[0],e,t,n)){d=i[h]=!0;break}h++}if(!d)return!1;c++}return!0}const x9e=bm;function w9e(e,t,n){const r=wq(e);let i=r.length;if(wq(t).length!==i)return!1;for(;i-- >0;)if(!$de(e,t,n,r[i]))return!1;return!0}function _x(e,t,n){const r=vq(e);let i=r.length;if(vq(t).length!==i)return!1;let s,a,o;for(;i-- >0;)if(s=r[i],!$de(e,t,n,s)||(a=xq(e,s),o=xq(t,s),(a||o)&&(!a||!o||a.configurable!==o.configurable||a.enumerable!==o.enumerable||a.writable!==o.writable)))return!1;return!0}function b9e(e,t){return bm(e.valueOf(),t.valueOf())}function C9e(e,t){return e.source===t.source&&e.flags===t.flags}function Cq(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),s=e.values();let a,o;for(;(a=s.next())&&!a.done;){const c=t.values();let u=!1,d=0;for(;(o=c.next())&&!o.done;){if(!i[d]&&n.equals(a.value,o.value,a.value,o.value,e,t,n)){u=i[d]=!0;break}d++}if(!u)return!1}return!0}function qj(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function S9e(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 $de(e,t,n,r){return(r===f9e||r===h9e||r===d9e)&&(e.$$typeof||t.$$typeof)?!0:u9e(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const k9e="[object ArrayBuffer]",_9e="[object Arguments]",j9e="[object Boolean]",B9e="[object DataView]",N9e="[object Date]",E9e="[object Error]",T9e="[object Map]",P9e="[object Number]",I9e="[object Object]",O9e="[object RegExp]",F9e="[object Set]",M9e="[object String]",L9e={"[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},R9e="[object URL]",D9e=Object.prototype.toString;function U9e({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:a,areNumbersEqual:o,areObjectsEqual:c,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:h,areTypedArraysEqual:A,areUrlsEqual:f,unknownTagComparators:p}){return function(g,y,v){if(g===y)return!0;if(g==null||y==null)return!1;const x=typeof g;if(x!==typeof y)return!1;if(x!=="object")return x==="number"?o(g,y,v):x==="function"?s(g,y,v):!1;const w=g.constructor;if(w!==y.constructor)return!1;if(w===Object)return c(g,y,v);if(Array.isArray(g))return t(g,y,v);if(w===Date)return r(g,y,v);if(w===RegExp)return d(g,y,v);if(w===Map)return a(g,y,v);if(w===Set)return h(g,y,v);const b=D9e.call(g);if(b===N9e)return r(g,y,v);if(b===O9e)return d(g,y,v);if(b===T9e)return a(g,y,v);if(b===F9e)return h(g,y,v);if(b===I9e)return typeof g.then!="function"&&typeof y.then!="function"&&c(g,y,v);if(b===R9e)return f(g,y,v);if(b===E9e)return i(g,y,v);if(b===_9e)return c(g,y,v);if(L9e[b])return A(g,y,v);if(b===k9e)return e(g,y,v);if(b===B9e)return n(g,y,v);if(b===j9e||b===P9e||b===M9e)return u(g,y,v);if(p){let k=p[b];if(!k){const j=c9e(g);j&&(k=p[j])}if(k)return k(g,y,v)}return!1}}function H9e({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:A9e,areArraysEqual:n?_x:p9e,areDataViewsEqual:m9e,areDatesEqual:g9e,areErrorsEqual:y9e,areFunctionsEqual:v9e,areMapsEqual:n?i4(bq,_x):bq,areNumbersEqual:x9e,areObjectsEqual:n?_x:w9e,arePrimitiveWrappersEqual:b9e,areRegExpsEqual:C9e,areSetsEqual:n?i4(Cq,_x):Cq,areTypedArraysEqual:n?i4(qj,_x):qj,areUrlsEqual:S9e,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=DS(r.areArraysEqual),s=DS(r.areMapsEqual),a=DS(r.areObjectsEqual),o=DS(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:a,areSetsEqual:o})}return r}function Q9e(e){return function(t,n,r,i,s,a,o){return e(t,n,o)}}function $9e({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(o,c){const{cache:u=e?new WeakMap:void 0,meta:d}=n();return t(o,c,{cache:u,equals:r,meta:d,strict:i})};if(e)return function(o,c){return t(o,c,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const s={cache:void 0,equals:r,meta:void 0,strict:i};return function(o,c){return t(o,c,s)}}const zde=Jf();Jf({strict:!0});Jf({circular:!0});Jf({circular:!0,strict:!0});Jf({createInternalComparator:()=>bm});Jf({strict:!0,createInternalComparator:()=>bm});Jf({circular:!0,createInternalComparator:()=>bm});Jf({circular:!0,createInternalComparator:()=>bm,strict:!0});function Jf(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,s=H9e(e),a=U9e(s),o=n?n(a):Q9e(a);return $9e({circular:t,comparator:a,createState:r,equals:o,strict:i})}var Vde={exports:{}},Kde={};/**
 * @license React
 * use-sync-external-store-shim/with-selector.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var A5=C,z9e=iH;function V9e(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var K9e=typeof Object.is=="function"?Object.is:V9e,q9e=z9e.useSyncExternalStore,W9e=A5.useRef,G9e=A5.useEffect,Y9e=A5.useMemo,X9e=A5.useDebugValue;Kde.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=W9e(null);if(s.current===null){var a={hasValue:!1,value:null};s.current=a}else a=s.current;s=Y9e(function(){function c(f){if(!u){if(u=!0,d=f,f=r(f),i!==void 0&&a.hasValue){var p=a.value;if(i(p,f))return h=p}return h=f}if(p=h,K9e(d,f))return p;var m=r(f);return i!==void 0&&i(p,m)?(d=f,p):(d=f,h=m)}var u=!1,d,h,A=n===void 0?null:n;return[function(){return c(t())},A===null?void 0:function(){return c(A())}]},[t,n,r,i]);var o=q9e(e,s[0],s[1]);return G9e(function(){a.hasValue=!0,a.value=o},[o]),X9e(o),o};Vde.exports=Kde;var J9e=Vde.exports,Z9e=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},eVe=({contentComponent:e})=>{const t=iH.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return l.jsx(l.Fragment,{children:Object.values(t)})};function tVe(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:iU.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}var nVe=class extends re.Component{constructor(e){var t;super(e),this.editorContentRef=re.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((t=e.editor)!=null&&t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&((e=t.view.dom)!=null&&e.parentNode)){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n}),t.contentComponent=tVe(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;const t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null;try{if(!((e=t.view.dom)!=null&&e.parentNode))return;const n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return l.jsxs(l.Fragment,{children:[l.jsx("div",{ref:Z9e(t,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&l.jsx(eVe,{contentComponent:e.contentComponent})]})}},rVe=C.forwardRef((e,t)=>{const n=re.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return re.createElement(nVe,{key:n,innerRef:t,...e})}),qde=re.memo(rVe),iVe=typeof window<"u"?C.useLayoutEffect:C.useEffect,sVe=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",t),()=>{n.off("transaction",t)}}}};function aVe(e){var t;const[n]=C.useState(()=>new sVe(e.editor)),r=J9e.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!=null?t:zde);return iVe(()=>n.watch(e.editor),[e.editor,n]),C.useDebugValue(r),r}var oVe=!1,NM=typeof window>"u",lVe=NM||!!(typeof window<"u"&&window.next),cVe=class Wde{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return NM||lVe?null:this.createEditor();if(this.options.current.immediatelyRender&&NM&&oVe)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)==null?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)==null?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)==null?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)==null?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)==null?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)==null?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)==null?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)==null?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)==null?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)==null?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)==null?void 0:s.call(i,...r)},onDelete:(...r)=>{var i,s;return(s=(i=this.options.current).onDelete)==null?void 0:s.call(i,...r)}};return new Gze(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((i,s)=>{var a;return i===((a=n.extensions)==null?void 0:a[s])}):t[r]===n[r])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?Wde.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((r,i)=>r===t[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function uVe(e={},t=[]){const n=C.useRef(e);n.current=e;const[r]=C.useState(()=>new cVe(n)),i=iH.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return C.useDebugValue(i),C.useEffect(r.onRender(t)),aVe({editor:i,selector:({transactionNumber:s})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&s===0?0:s+1}),i}var Gde=C.createContext({editor:null});Gde.Consumer;var dVe=C.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),hVe=()=>C.useContext(dVe);re.forwardRef((e,t)=>{const{onDragStart:n}=hVe(),r=e.as||"div";return l.jsx(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});re.createContext({markViewContentRef:()=>{}});var EH=C.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});EH.displayName="TiptapContext";var fVe=()=>C.useContext(EH);function Yde({editor:e,instance:t,children:n}){const r=e??t;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const i=C.useMemo(()=>({editor:r}),[r]),s=C.useMemo(()=>({editor:r}),[r]);return l.jsx(Gde.Provider,{value:s,children:l.jsx(EH.Provider,{value:i,children:n})})}Yde.displayName="Tiptap";function Xde({...e}){const{editor:t}=fVe();return l.jsx(qde,{editor:t,...e})}Xde.displayName="Tiptap.Content";Object.assign(Yde,{Content:Xde});var Wj=(e,t)=>{if(e==="slot")return 0;if(e instanceof Function)return e(t);const{children:n,...r}=t??{};if(e==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},AVe=/^\s*>\s$/,pVe=Ia.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return Wj("blockquote",{...si(this.options.HTMLAttributes,e),children:Wj("slot",{})})},parseMarkdown:(e,t)=>t.createNode("blockquote",void 0,t.parseChildren(e.tokens||[])),renderMarkdown:(e,t)=>{if(!e.content)return"";const n=">",r=[];return e.content.forEach(i=>{const o=t.renderChildren([i]).split(`
`).map(c=>c.trim()===""?n:`${n} ${c}`);r.push(o.join(`
`))}),r.join(`
${n}
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[xv({find:AVe,type:this.type})]}}),mVe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,gVe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,yVe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,vVe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,xVe=wm.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return Wj("strong",{...si(this.options.HTMLAttributes,e),children:Wj("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[vv({find:mVe,type:this.type}),vv({find:yVe,type:this.type})]},addPasteRules(){return[nm({find:gVe,type:this.type}),nm({find:vVe,type:this.type})]}}),wVe=/(^|[^`])`([^`]+)`(?!`)$/,bVe=/(^|[^`])`([^`]+)`(?!`)/g,CVe=wm.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",si(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[vv({find:wVe,type:this.type})]},addPasteRules(){return[nm({find:bVe,type:this.type})]}}),s4=4,SVe=/^```([a-z]+)?[\s\n]$/,kVe=/^~~~([a-z]+)?[\s\n]$/,_Ve=Ia.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:s4,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;if(!n)return null;const s=[...((t=e.firstElementChild)==null?void 0:t.classList)||[]].filter(a=>a.startsWith(n)).map(a=>a.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",si(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n;return((n=e.raw)==null?void 0:n.startsWith("```"))===!1&&e.codeBlockStyle!=="indented"?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r="";const i=((n=e.attrs)==null?void 0:n.language)||"";return e.content?r=[`\`\`\`${i}`,t.renderChildren(e.content),"```"].join(`
`):r=`\`\`\`${i}

\`\`\``,r},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:s4,{state:r}=e,{selection:i}=r,{$from:s,empty:a}=i;if(s.parent.type!==this.type)return!1;const o=" ".repeat(n);return a?e.commands.insertContent(o):e.commands.command(({tr:c})=>{const{from:u,to:d}=i,f=r.doc.textBetween(u,d,`
`,`
`).split(`
`).map(p=>o+p).join(`
`);return c.replaceWith(u,d,r.schema.text(f)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:s4,{state:r}=e,{selection:i}=r,{$from:s,empty:a}=i;return s.parent.type!==this.type?!1:a?e.commands.command(({tr:o})=>{var c;const{pos:u}=s,d=s.start(),h=s.end(),f=r.doc.textBetween(d,h,`
`,`
`).split(`
`);let p=0,m=0;const g=u-d;for(let k=0;k<f.length;k+=1){if(m+f[k].length>=g){p=k;break}m+=f[k].length+1}const v=((c=f[p].match(/^ */))==null?void 0:c[0])||"",x=Math.min(v.length,n);if(x===0)return!0;let w=d;for(let k=0;k<p;k+=1)w+=f[k].length+1;return o.delete(w,w+x),u-w<=x&&o.setSelection(nn.create(o.doc,w)),!0}):e.commands.command(({tr:o})=>{const{from:c,to:u}=i,A=r.doc.textBetween(c,u,`
`,`
`).split(`
`).map(f=>{var p;const m=((p=f.match(/^ */))==null?void 0:p[0])||"",g=Math.min(m.length,n);return f.slice(g)}).join(`
`);return o.replaceWith(c,u,r.schema.text(A)),!0})},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`

`);return!s||!a?!1:e.chain().command(({tr:o})=>(o.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:u})=>(u.setSelection(mn.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[jM({find:SVe,type:this.type,getAttributes:e=>({language:e[1]})}),jM({find:kVe,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new qr({key:new Gi("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:a,schema:o}=e.state,c=o.text(n.replace(/\r\n?/g,`
`));return a.replaceSelectionWith(this.type.create({language:s},c)),a.selection.$from.parent.type!==this.type&&a.setSelection(nn.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),e.dispatch(a),!0}}})]}}),jVe=Ia.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`

`):""}),BVe=Ia.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",si(this.options.HTMLAttributes,e)]},renderText(){return`
`},renderMarkdown:()=>`  
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,c=s||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:u,dispatch:d})=>{if(d&&c&&a){const h=c.filter(A=>o.includes(A.type.name));u.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),NVe=Ia.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,si(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=(n=e.attrs)!=null&&n.level?parseInt(e.attrs.level,10):1,i="#".repeat(r);return e.content?`${i} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>jM({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),EVe=Ia.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",si(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!Jze(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,i=e();return bde(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:a,dispatch:o})=>{if(o){const{$to:c}=a.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(nn.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(Lt.create(a.doc,c.pos)):a.setSelection(nn.create(a.doc,c.pos));else{const d=s.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,h=d==null?void 0:d.create();h&&(a.insert(u,h),a.setSelection(nn.create(a.doc,u+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Ude({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),TVe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,PVe=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,IVe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,OVe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,FVe=wm.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",si(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[vv({find:TVe,type:this.type}),vv({find:IVe,type:this.type})]},addPasteRules(){return[nm({find:PVe,type:this.type}),nm({find:OVe,type:this.type})]}});const MVe="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",LVe="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",EM="numeric",TM="ascii",PM="alpha",Vw="asciinumeric",lw="alphanumeric",IM="domain",Jde="emoji",RVe="scheme",DVe="slashscheme",a4="whitespace";function UVe(e,t){return e in t||(t[e]=[]),t[e]}function rp(e,t,n){t[EM]&&(t[Vw]=!0,t[lw]=!0),t[TM]&&(t[Vw]=!0,t[PM]=!0),t[Vw]&&(t[lw]=!0),t[PM]&&(t[lw]=!0),t[lw]&&(t[IM]=!0),t[Jde]&&(t[IM]=!0);for(const r in t){const i=UVe(r,n);i.indexOf(e)<0&&i.push(e)}}function HVe(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function $a(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}$a.groups={};$a.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const i=t.jr[r][0],s=t.jr[r][1];if(s&&i.test(e))return s}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r=r||$a.groups;let i;return t&&t.j?i=t:(i=new $a(t),n&&r&&rp(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this;const s=e.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(e[a]);return i.tt(e[s-1],t,n,r)},tt(e,t,n,r){r=r||$a.groups;const i=this;if(t&&t.j)return i.j[e]=t,t;const s=t;let a,o=i.go(e);if(o?(a=new $a,Object.assign(a.j,o.j),a.jr.push.apply(a.jr,o.jr),a.jd=o.jd,a.t=o.t):a=new $a,s){if(r)if(a.t&&typeof a.t=="string"){const c=Object.assign(HVe(a.t,r),n);rp(s,c,r)}else n&&rp(s,n,r);a.t=s}return i.j[e]=a,a}};const pn=(e,t,n,r,i)=>e.ta(t,n,r,i),Jr=(e,t,n,r,i)=>e.tr(t,n,r,i),Sq=(e,t,n,r,i)=>e.ts(t,n,r,i),Ke=(e,t,n,r,i)=>e.tt(t,n,r,i),zu="WORD",OM="UWORD",Zde="ASCIINUMERICAL",ehe="ALPHANUMERICAL",o1="LOCALHOST",FM="TLD",MM="UTLD",g_="SCHEME",Rg="SLASH_SCHEME",TH="NUM",LM="WS",PH="NL",Kw="OPENBRACE",qw="CLOSEBRACE",Gj="OPENBRACKET",Yj="CLOSEBRACKET",Xj="OPENPAREN",Jj="CLOSEPAREN",Zj="OPENANGLEBRACKET",eB="CLOSEANGLEBRACKET",tB="FULLWIDTHLEFTPAREN",nB="FULLWIDTHRIGHTPAREN",rB="LEFTCORNERBRACKET",iB="RIGHTCORNERBRACKET",sB="LEFTWHITECORNERBRACKET",aB="RIGHTWHITECORNERBRACKET",oB="FULLWIDTHLESSTHAN",lB="FULLWIDTHGREATERTHAN",cB="AMPERSAND",uB="APOSTROPHE",dB="ASTERISK",yh="AT",hB="BACKSLASH",fB="BACKTICK",AB="CARET",_h="COLON",IH="COMMA",pB="DOLLAR",$c="DOT",mB="EQUALS",OH="EXCLAMATION",Zo="HYPHEN",Ww="PERCENT",gB="PIPE",yB="PLUS",vB="POUND",Gw="QUERY",FH="QUOTE",the="FULLWIDTHMIDDLEDOT",MH="SEMI",zc="SLASH",Yw="TILDE",xB="UNDERSCORE",nhe="EMOJI",wB="SYM";var rhe=Object.freeze({__proto__:null,ALPHANUMERICAL:ehe,AMPERSAND:cB,APOSTROPHE:uB,ASCIINUMERICAL:Zde,ASTERISK:dB,AT:yh,BACKSLASH:hB,BACKTICK:fB,CARET:AB,CLOSEANGLEBRACKET:eB,CLOSEBRACE:qw,CLOSEBRACKET:Yj,CLOSEPAREN:Jj,COLON:_h,COMMA:IH,DOLLAR:pB,DOT:$c,EMOJI:nhe,EQUALS:mB,EXCLAMATION:OH,FULLWIDTHGREATERTHAN:lB,FULLWIDTHLEFTPAREN:tB,FULLWIDTHLESSTHAN:oB,FULLWIDTHMIDDLEDOT:the,FULLWIDTHRIGHTPAREN:nB,HYPHEN:Zo,LEFTCORNERBRACKET:rB,LEFTWHITECORNERBRACKET:sB,LOCALHOST:o1,NL:PH,NUM:TH,OPENANGLEBRACKET:Zj,OPENBRACE:Kw,OPENBRACKET:Gj,OPENPAREN:Xj,PERCENT:Ww,PIPE:gB,PLUS:yB,POUND:vB,QUERY:Gw,QUOTE:FH,RIGHTCORNERBRACKET:iB,RIGHTWHITECORNERBRACKET:aB,SCHEME:g_,SEMI:MH,SLASH:zc,SLASH_SCHEME:Rg,SYM:wB,TILDE:Yw,TLD:FM,UNDERSCORE:xB,UTLD:MM,UWORD:OM,WORD:zu,WS:LM});const Fu=/[a-z]/,jx=new RegExp("\\p{L}","u"),o4=new RegExp("\\p{Emoji}","u"),Mu=/\d/,l4=/\s/,kq="\r",c4=`
`,QVe="️",$Ve="‍",u4="";let US=null,HS=null;function zVe(e=[]){const t={};$a.groups=t;const n=new $a;US==null&&(US=_q(MVe)),HS==null&&(HS=_q(LVe)),Ke(n,"'",uB),Ke(n,"{",Kw),Ke(n,"}",qw),Ke(n,"[",Gj),Ke(n,"]",Yj),Ke(n,"(",Xj),Ke(n,")",Jj),Ke(n,"<",Zj),Ke(n,">",eB),Ke(n,"(",tB),Ke(n,")",nB),Ke(n,"「",rB),Ke(n,"」",iB),Ke(n,"『",sB),Ke(n,"』",aB),Ke(n,"<",oB),Ke(n,">",lB),Ke(n,"&",cB),Ke(n,"*",dB),Ke(n,"@",yh),Ke(n,"`",fB),Ke(n,"^",AB),Ke(n,":",_h),Ke(n,",",IH),Ke(n,"$",pB),Ke(n,".",$c),Ke(n,"=",mB),Ke(n,"!",OH),Ke(n,"-",Zo),Ke(n,"%",Ww),Ke(n,"|",gB),Ke(n,"+",yB),Ke(n,"#",vB),Ke(n,"?",Gw),Ke(n,'"',FH),Ke(n,"/",zc),Ke(n,";",MH),Ke(n,"~",Yw),Ke(n,"_",xB),Ke(n,"\\",hB),Ke(n,"・",the);const r=Jr(n,Mu,TH,{[EM]:!0});Jr(r,Mu,r);const i=Jr(r,Fu,Zde,{[Vw]:!0}),s=Jr(r,jx,ehe,{[lw]:!0}),a=Jr(n,Fu,zu,{[TM]:!0});Jr(a,Mu,i),Jr(a,Fu,a),Jr(i,Mu,i),Jr(i,Fu,i);const o=Jr(n,jx,OM,{[PM]:!0});Jr(o,Fu),Jr(o,Mu,s),Jr(o,jx,o),Jr(s,Mu,s),Jr(s,Fu),Jr(s,jx,s);const c=Ke(n,c4,PH,{[a4]:!0}),u=Ke(n,kq,LM,{[a4]:!0}),d=Jr(n,l4,LM,{[a4]:!0});Ke(n,u4,d),Ke(u,c4,c),Ke(u,u4,d),Jr(u,l4,d),Ke(d,kq),Ke(d,c4),Jr(d,l4,d),Ke(d,u4,d);const h=Jr(n,o4,nhe,{[Jde]:!0});Ke(h,"#"),Jr(h,o4,h),Ke(h,QVe,h);const A=Ke(h,$Ve);Ke(A,"#"),Jr(A,o4,h);const f=[[Fu,a],[Mu,i]],p=[[Fu,null],[jx,o],[Mu,s]];for(let m=0;m<US.length;m++)th(n,US[m],FM,zu,f);for(let m=0;m<HS.length;m++)th(n,HS[m],MM,OM,p);rp(FM,{tld:!0,ascii:!0},t),rp(MM,{utld:!0,alpha:!0},t),th(n,"file",g_,zu,f),th(n,"mailto",g_,zu,f),th(n,"http",Rg,zu,f),th(n,"https",Rg,zu,f),th(n,"ftp",Rg,zu,f),th(n,"ftps",Rg,zu,f),rp(g_,{scheme:!0,ascii:!0},t),rp(Rg,{slashscheme:!0,ascii:!0},t),e=e.sort((m,g)=>m[0]>g[0]?1:-1);for(let m=0;m<e.length;m++){const g=e[m][0],v=e[m][1]?{[RVe]:!0}:{[DVe]:!0};g.indexOf("-")>=0?v[IM]=!0:Fu.test(g)?Mu.test(g)?v[Vw]=!0:v[TM]=!0:v[EM]=!0,Sq(n,g,g,v)}return Sq(n,"localhost",o1,{ascii:!0}),n.jd=new $a(wB),{start:n,tokens:Object.assign({groups:t},rhe)}}function ihe(e,t){const n=VVe(t.replace(/[A-Z]/g,o=>o.toLowerCase())),r=n.length,i=[];let s=0,a=0;for(;a<r;){let o=e,c=null,u=0,d=null,h=-1,A=-1;for(;a<r&&(c=o.go(n[a]));)o=c,o.accepts()?(h=0,A=0,d=o):h>=0&&(h+=n[a].length,A++),u+=n[a].length,s+=n[a].length,a++;s-=h,a-=A,u-=h,i.push({t:d.t,v:t.slice(s-u,s),s:s-u,e:s})}return i}function VVe(e){const t=[],n=e.length;let r=0;for(;r<n;){let i=e.charCodeAt(r),s,a=i<55296||i>56319||r+1===n||(s=e.charCodeAt(r+1))<56320||s>57343?e[r]:e.slice(r,r+2);t.push(a),r+=a.length}return t}function th(e,t,n,r,i){let s;const a=t.length;for(let o=0;o<a-1;o++){const c=t[o];e.j[c]?s=e.j[c]:(s=new $a(r),s.jr=i.slice(),e.j[c]=s),e=s}return s=new $a(n),s.jr=i.slice(),e.j[t[a-1]]=s,s}function _q(e){const t=[],n=[];let r=0,i="0123456789";for(;r<e.length;){let s=0;for(;i.indexOf(e[r+s])>=0;)s++;if(s>0){t.push(n.join(""));for(let a=parseInt(e.substring(r,r+s),10);a>0;a--)n.pop();r+=s}else n.push(e[r]),r++}return t}const l1={defaultProtocol:"http",events:null,format:jq,formatHref:jq,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function LH(e,t=null){let n=Object.assign({},l1);e&&(n=Object.assign(n,e instanceof LH?e.o:e));const r=n.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}LH.prototype={o:l1,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let i=this.o[e];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:l1[e],typeof i=="function"&&r&&(i=i(t,n))):typeof i=="function"&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function jq(e){return e}function she(e,t){this.t="token",this.v=e,this.tk=t}she.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=l1.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),i=e.get("tagName",n,t),s=this.toFormattedString(e),a={},o=e.get("className",n,t),c=e.get("target",n,t),u=e.get("rel",n,t),d=e.getObj("attributes",n,t),h=e.getObj("events",n,t);return a.href=r,o&&(a.class=o),c&&(a.target=c),u&&(a.rel=u),d&&Object.assign(a,d),{tagName:i,attributes:a,content:s,eventListeners:h}}};function p5(e,t){class n extends she{constructor(i,s){super(i,s),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const Bq=p5("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Nq=p5("text"),KVe=p5("nl"),QS=p5("url",{isLink:!0,toHref(e=l1.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==o1&&e[1].t===_h}}),qo=e=>new $a(e);function qVe({groups:e}){const t=e.domain.concat([cB,dB,yh,hB,fB,AB,pB,mB,Zo,TH,Ww,gB,yB,vB,zc,wB,Yw,xB]),n=[uB,_h,IH,$c,OH,Ww,Gw,FH,MH,Zj,eB,Kw,qw,Yj,Gj,Xj,Jj,tB,nB,rB,iB,sB,aB,oB,lB],r=[cB,uB,dB,hB,fB,AB,pB,mB,Zo,Kw,qw,Ww,gB,yB,vB,Gw,zc,wB,Yw,xB],i=qo(),s=Ke(i,Yw);pn(s,r,s),pn(s,e.domain,s);const a=qo(),o=qo(),c=qo();pn(i,e.domain,a),pn(i,e.scheme,o),pn(i,e.slashscheme,c),pn(a,r,s),pn(a,e.domain,a);const u=Ke(a,yh);Ke(s,yh,u),Ke(o,yh,u),Ke(c,yh,u);const d=Ke(s,$c);pn(d,r,s),pn(d,e.domain,s);const h=qo();pn(u,e.domain,h),pn(h,e.domain,h);const A=Ke(h,$c);pn(A,e.domain,h);const f=qo(Bq);pn(A,e.tld,f),pn(A,e.utld,f),Ke(u,o1,f);const p=Ke(h,Zo);Ke(p,Zo,p),pn(p,e.domain,h),pn(f,e.domain,h),Ke(f,$c,A),Ke(f,Zo,p);const m=Ke(f,_h);pn(m,e.numeric,Bq);const g=Ke(a,Zo),y=Ke(a,$c);Ke(g,Zo,g),pn(g,e.domain,a),pn(y,r,s),pn(y,e.domain,a);const v=qo(QS);pn(y,e.tld,v),pn(y,e.utld,v),pn(v,e.domain,a),pn(v,r,s),Ke(v,$c,y),Ke(v,Zo,g),Ke(v,yh,u);const x=Ke(v,_h),w=qo(QS);pn(x,e.numeric,w);const b=qo(QS),k=qo();pn(b,t,b),pn(b,n,k),pn(k,t,b),pn(k,n,k),Ke(v,zc,b),Ke(w,zc,b);const j=Ke(o,_h),B=Ke(c,_h),E=Ke(B,zc),I=Ke(E,zc);pn(o,e.domain,a),Ke(o,$c,y),Ke(o,Zo,g),pn(c,e.domain,a),Ke(c,$c,y),Ke(c,Zo,g),pn(j,e.domain,b),Ke(j,zc,b),Ke(j,Gw,b),pn(I,e.domain,b),pn(I,t,b),Ke(I,zc,b);const T=[[Kw,qw],[Gj,Yj],[Xj,Jj],[Zj,eB],[tB,nB],[rB,iB],[sB,aB],[oB,lB]];for(let N=0;N<T.length;N++){const[F,L]=T[N],U=Ke(b,F);Ke(k,F,U),Ke(U,L,b);const H=qo(QS);pn(U,t,H);const K=qo();pn(U,n),pn(H,t,H),pn(H,n,K),pn(K,t,H),pn(K,n,K),Ke(H,L,b),Ke(K,L,b)}return Ke(i,o1,v),Ke(i,PH,KVe),{start:i,tokens:rhe}}function WVe(e,t,n){let r=n.length,i=0,s=[],a=[];for(;i<r;){let o=e,c=null,u=null,d=0,h=null,A=-1;for(;i<r&&!(c=o.go(n[i].t));)a.push(n[i++]);for(;i<r&&(u=c||o.go(n[i].t));)c=null,o=u,o.accepts()?(A=0,h=o):A>=0&&A++,i++,d++;if(A<0)i-=d,i<r&&(a.push(n[i]),i++);else{a.length>0&&(s.push(d4(Nq,t,a)),a=[]),i-=A,d-=A;const f=h.t,p=n.slice(i-d,i);s.push(d4(f,t,p))}}return a.length>0&&s.push(d4(Nq,t,a)),s}function d4(e,t,n){const r=n[0].s,i=n[n.length-1].e,s=t.slice(r,i);return new e(s,n)}const GVe=typeof console<"u"&&console&&console.warn||(()=>{}),YVe="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Cr={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function XVe(){return $a.groups={},Cr.scanner=null,Cr.parser=null,Cr.tokenQueue=[],Cr.pluginQueue=[],Cr.customSchemes=[],Cr.initialized=!1,Cr}function Eq(e,t=!1){if(Cr.initialized&&GVe(`linkifyjs: already initialized - will not register custom scheme "${e}" ${YVe}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);Cr.customSchemes.push([e,t])}function JVe(){Cr.scanner=zVe(Cr.customSchemes);for(let e=0;e<Cr.tokenQueue.length;e++)Cr.tokenQueue[e][1]({scanner:Cr.scanner});Cr.parser=qVe(Cr.scanner.tokens);for(let e=0;e<Cr.pluginQueue.length;e++)Cr.pluginQueue[e][1]({scanner:Cr.scanner,parser:Cr.parser});return Cr.initialized=!0,Cr}function RH(e){return Cr.initialized||JVe(),WVe(Cr.parser.start,e,ihe(Cr.scanner.start,e))}RH.scan=ihe;function ahe(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new LH(n),i=RH(e),s=[];for(let a=0;a<i.length;a++){const o=i[a];o.isLink&&(!t||o.t===t)&&r.check(o)&&s.push(o.toFormattedObject(r))}return s}var DH="[\0-   ᠎ -\u2029  ]",ZVe=new RegExp(DH),eKe=new RegExp(`${DH}$`),tKe=new RegExp(DH,"g");function nKe(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function rKe(e){return new qr({key:new Gi("autolink"),appendTransaction:(t,n,r)=>{const i=t.some(u=>u.docChanged)&&!n.doc.eq(r.doc),s=t.some(u=>u.getMeta("preventAutolink"));if(!i||s)return;const{tr:a}=r,o=Ade(n.doc,[...t]);if(wde(o).forEach(({newRange:u})=>{const d=J7e(r.doc,u,f=>f.isTextblock);let h,A;if(d.length>1)h=d[0],A=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(d.length){const f=r.doc.textBetween(u.from,u.to," "," ");if(!eKe.test(f))return;h=d[0],A=r.doc.textBetween(h.pos,u.to,void 0," ")}if(h&&A){const f=A.split(ZVe).filter(Boolean);if(f.length<=0)return!1;const p=f[f.length-1],m=h.pos+A.lastIndexOf(p);if(!p)return!1;const g=RH(p).map(y=>y.toObject(e.defaultProtocol));if(!nKe(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>e.validate(y.value)).filter(y=>e.shouldAutoLink(y.value)).forEach(y=>{kH(y.from,y.to,r.doc).some(v=>v.mark.type===e.type)||a.addMark(y.from,y.to,e.type.create({href:y.href}))})}}),!!a.steps.length)return a}})}function iKe(e){return new qr({key:new Gi("handleClickLink"),props:{handleClick:(t,n,r)=>{var i,s;if(r.button!==0||!t.editable)return!1;let a=null;if(r.target instanceof HTMLAnchorElement)a=r.target;else{const c=r.target;if(!c)return!1;const u=e.editor.view.dom;a=c.closest("a"),a&&!u.contains(a)&&(a=null)}if(!a)return!1;let o=!1;if(e.enableClickSelection&&(o=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){const c=xde(t.state,e.type.name),u=(i=a.href)!=null?i:c.href,d=(s=a.target)!=null?s:c.target;u&&(window.open(u,d),o=!0)}return o}}})}function sKe(e){return new qr({key:new Gi("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:i}=e,{state:s}=t,{selection:a}=s,{empty:o}=a;if(o)return!1;let c="";r.content.forEach(d=>{c+=d.textContent});const u=ahe(c,{defaultProtocol:e.defaultProtocol}).find(d=>d.isLink&&d.value===c);return!c||!u||i!==void 0&&!i(u.value)?!1:e.editor.commands.setMark(e.type,{href:u.href})}}})}function NA(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!e||e.replace(tKe,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var ohe=wm.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){Eq(e);return}Eq(e.scheme,e.optionalSlashes)})},onDestroy(){XVe()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!NA(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const i=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(i)||!/\./.test(i))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!NA(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!NA(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",si(this.options.HTMLAttributes,e),0]:["a",si(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,i,s;const a=(r=(n=e.attrs)==null?void 0:n.href)!=null?r:"",o=(s=(i=e.attrs)==null?void 0:i.title)!=null?s:"",c=t.renderChildren(e);return o?`[${c}](${a} "${o}")`:`[${c}](${a})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!NA(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!NA(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[nm({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,i=ahe(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!NA(a,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(s=>{this.options.shouldAutoLink(s.value)&&t.push({text:s.value,data:{href:s.href},index:s.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)==null?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(rKe({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!NA(i,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(iKe({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(sKe({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),aKe=ohe,oKe=Object.defineProperty,lKe=(e,t)=>{for(var n in t)oKe(e,n,{get:t[n],enumerable:!0})},cKe="listItem",Tq="textStyle",Pq=/^\s*([-+*])\s$/,lhe=Ia.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",si(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>e.type!=="list"||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(cKe,this.editor.getAttributes(Tq)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=xv({find:Pq,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=xv({find:Pq,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Tq),editor:this.editor})),[e]}}),che=Ia.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",si(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{if(e.type!=="list_item")return[];let n=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(i=>i.type==="paragraph"))n=t.parseChildren(e.tokens);else{const i=e.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(n=[{type:"paragraph",content:t.parseInline(i.tokens)}],e.tokens.length>1){const a=e.tokens.slice(1),o=t.parseChildren(a);n.push(...o)}}else n=t.parseChildren(e.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(e,t,n)=>NH(e,t,r=>{var i,s;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((s=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:s.start)||1)+r.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),uKe={};lKe(uKe,{findListItemPos:()=>$2,getNextListDepth:()=>UH,handleBackspace:()=>RM,handleDelete:()=>DM,hasListBefore:()=>uhe,hasListItemAfter:()=>dKe,hasListItemBefore:()=>dhe,listItemHasSubList:()=>hhe,nextListIsDeeper:()=>fhe,nextListIsHigher:()=>Ahe});var $2=(e,t)=>{const{$from:n}=t.selection,r=Pi(e,t.schema);let i=null,s=n.depth,a=n.pos,o=null;for(;s>0&&o===null;)i=n.node(s),i.type===r?o=s:(s-=1,a-=1);return o===null?null:{$pos:t.doc.resolve(a),depth:o}},UH=(e,t)=>{const n=$2(e,t);if(!n)return!1;const[,r]=lze(t,e,n.$pos.pos+4);return r},uhe=(e,t,n)=>{const{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),s=e.doc.resolve(i).node();return!(!s||!n.includes(s.type.name))},dhe=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==e)},hhe=(e,t,n)=>{if(!n)return!1;const r=Pi(e,t.schema);let i=!1;return n.descendants(s=>{s.type===r&&(i=!0)}),i},RM=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Of(e.state,t)&&uhe(e.state,t,n)){const{$anchor:o}=e.state.selection,c=e.state.doc.resolve(o.before()-1),u=[];c.node().descendants((A,f)=>{A.type.name===t&&u.push({node:A,pos:f})});const d=u.at(-1);if(!d)return!1;const h=e.state.doc.resolve(c.start()+d.pos+1);return e.chain().cut({from:o.start()-1,to:o.end()+1},h.end()).joinForward().run()}if(!Of(e.state,t)||!hze(e.state))return!1;const r=$2(t,e.state);if(!r)return!1;const s=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=hhe(t,e.state,s);return dhe(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},fhe=(e,t)=>{const n=UH(e,t),r=$2(e,t);return!r||!n?!1:n>r.depth},Ahe=(e,t)=>{const n=UH(e,t),r=$2(e,t);return!r||!n?!1:n<r.depth},DM=(e,t)=>{if(!Of(e.state,t)||!dze(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:fhe(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():Ahe(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},dKe=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==e)},phe=vi.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&DM(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&DM(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&RM(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&RM(e,n,r)&&(t=!0)}),t}}}}),Iq=/^(\s*)(\d+)\.\s+(.*)$/,hKe=/^\s/;function fKe(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n],s=i.match(Iq);if(!s)break;const[,a,o,c]=s,u=a.length;let d=c,h=n+1;const A=[i];for(;h<e.length;){const f=e[h];if(f.match(Iq))break;if(f.trim()==="")A.push(f),d+=`
`,h+=1;else if(f.match(hKe))A.push(f),d+=`
${f.slice(u+2)}`,h+=1;else break}t.push({indent:u,number:parseInt(o,10),content:d.trim(),raw:A.join(`
`)}),r=h,n=h}return[t,r]}function mhe(e,t,n){var r;const i=[];let s=0;for(;s<e.length;){const a=e[s];if(a.indent===t){const o=a.content.split(`
`),c=((r=o[0])==null?void 0:r.trim())||"",u=[];c&&u.push({type:"paragraph",raw:c,tokens:n.inlineTokens(c)});const d=o.slice(1).join(`
`).trim();if(d){const f=n.blockTokens(d);u.push(...f)}let h=s+1;const A=[];for(;h<e.length&&e[h].indent>t;)A.push(e[h]),h+=1;if(A.length>0){const f=Math.min(...A.map(m=>m.indent)),p=mhe(A,f,n);u.push({type:"list",ordered:!0,start:A[0].number,items:p,raw:A.map(m=>m.raw).join(`
`)})}i.push({type:"list_item",raw:a.raw,tokens:u}),s=h}else s+=1}return i}function AKe(e,t){return e.map(n=>{if(n.type!=="list_item")return t.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...t.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=t.parseChildren([i]);r.push({type:"paragraph",content:s})}else{const s=t.parseChildren([i]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}var pKe="listItem",Oq="textStyle",Fq=/^(\d+)\.\s$/,ghe=Ia.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",si(this.options.HTMLAttributes,n),0]:["ol",si(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if(e.type!=="list"||!e.ordered)return[];const n=e.start||1,r=e.items?AKe(e.items,t):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(/^(\s*)(\d+)\.\s+/),n=t==null?void 0:t.index;return n!==void 0?n:-1},tokenize:(e,t,n)=>{var r;const i=e.split(`
`),[s,a]=fKe(i);if(s.length===0)return;const o=mhe(s,0,n);return o.length===0?void 0:{type:"list",ordered:!0,start:((r=s[0])==null?void 0:r.number)||1,items:o,raw:i.slice(0,a).join(`
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(pKe,this.editor.getAttributes(Oq)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=xv({find:Fq,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=xv({find:Fq,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(Oq)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),mKe=/^\s*(\[([( |x])?\])\s$/,gKe=Ia.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",si(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;const i=`- [${(n=e.attrs)!=null&&n.checked?"x":" "}] `;return NH(e,t,i)},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),o=document.createElement("input"),c=document.createElement("div"),u=h=>{var A,f;o.ariaLabel=((f=(A=this.options.a11y)==null?void 0:A.checkboxLabel)==null?void 0:f.call(A,h,o.checked))||`Task item checkbox for ${h.textContent||"empty task item"}`};u(e),s.contentEditable="false",o.type="checkbox",o.addEventListener("mousedown",h=>h.preventDefault()),o.addEventListener("change",h=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){o.checked=!o.checked;return}const{checked:A}=h.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const p=n();if(typeof p!="number")return!1;const m=f.doc.nodeAt(p);return f.setNodeMarkup(p,void 0,{...m==null?void 0:m.attrs,checked:A}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,A)||(o.checked=!o.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,A])=>{i.setAttribute(h,A)}),i.dataset.checked=e.attrs.checked,o.checked=e.attrs.checked,s.append(o,a),i.append(s,c),Object.entries(t).forEach(([h,A])=>{i.setAttribute(h,A)});let d=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:h=>{if(h.type!==this.type)return!1;i.dataset.checked=h.attrs.checked,o.checked=h.attrs.checked,u(h);const A=r.extensionManager.attributes,f=a1(h,A),p=new Set(Object.keys(f)),m=this.options.HTMLAttributes;return d.forEach(g=>{p.has(g)||(g in m?i.setAttribute(g,m[g]):i.removeAttribute(g))}),Object.entries(f).forEach(([g,y])=>{y==null?g in m?i.setAttribute(g,m[g]):i.removeAttribute(g):i.setAttribute(g,y)}),d=p,!0}}}},addInputRules(){return[xv({find:mKe,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),yKe=Ia.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",si(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=s=>{const a=BM(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,c)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:c}),customNestedParser:r},n);return a?[{type:"taskList",raw:a.raw,items:a.items}]:n.blockTokens(s)},i=BM(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,a)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:a}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});vi.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(lhe.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(che.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(phe.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(ghe.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(gKe.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(yKe.configure(this.options.taskList)),e}});var Mq="&nbsp;",vKe=" ",xKe=Ia.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",si(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(n.length===1&&n[0].type==="image")return t.parseChildren([n[0]]);const r=t.parseInline(n);return r.length===1&&r[0].type==="text"&&(r[0].text===Mq||r[0].text===vKe)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t)=>{if(!e)return"";const n=Array.isArray(e.content)?e.content:[];return n.length===0?Mq:t.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),wKe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,bKe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,CKe=wm.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",si(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[vv({find:wKe,type:this.type})]},addPasteRules(){return[nm({find:bKe,type:this.type})]}}),SKe=Ia.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),kKe=wm.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",si(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!i)return;const s=i[2].trim();return{type:"underline",raw:i[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function _Ke(e={}){return new qr({view(t){return new jKe(t,e)}})}class jKe{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=a=>{this[i](a)};return t.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r,i=this.editorView.dom,s=i.getBoundingClientRect(),a=s.width/i.offsetWidth,o=s.height/i.offsetHeight;if(n){let h=t.nodeBefore,A=t.nodeAfter;if(h||A){let f=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(f){let p=f.getBoundingClientRect(),m=h?p.bottom:p.top;h&&A&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*o;r={left:p.left,right:p.right,top:m-g,bottom:m+g}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),A=this.width/2*a;r={left:h.left-A,right:h.left+A,top:h.top,bottom:h.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let u,d;if(!c||c==document.body&&getComputedStyle(c).position=="static")u=-pageXOffset,d=-pageYOffset;else{let h=c.getBoundingClientRect(),A=h.width/c.offsetWidth,f=h.height/c.offsetHeight;u=h.left-c.scrollLeft*A,d=h.top-c.scrollTop*f}this.element.style.left=(r.left-u)/a+"px",this.element.style.top=(r.top-d)/o+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/o+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,t):i;if(n&&!s){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=due(this.editorView.state.doc,a,this.editorView.dragging.slice);o!=null&&(a=o)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class ii extends mn{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return ii.valid(r)?new ii(r):mn.near(r)}content(){return at.empty}eq(t){return t instanceof ii&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ii(t.resolve(n.pos))}getBookmark(){return new HH(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!BKe(t)||!NKe(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(t.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&ii.valid(t))return t;let i=t.pos,s=null;for(let a=t.depth;;a--){let o=t.node(a);if(n>0?t.indexAfter(a)<o.childCount:t.index(a)>0){s=o.child(n>0?t.indexAfter(a):t.index(a)-1);break}else if(a==0)return null;i+=n;let c=t.doc.resolve(i);if(ii.valid(c))return c}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!Lt.isSelectable(s)){t=t.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=a,i+=n;let o=t.doc.resolve(i);if(ii.valid(o))return o}return null}}}ii.prototype.visible=!1;ii.findFrom=ii.findGapCursorFrom;mn.jsonID("gapcursor",ii);class HH{constructor(t){this.pos=t}map(t){return new HH(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return ii.valid(n)?new ii(n):mn.near(n)}}function yhe(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function BKe(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||yhe(i.type))return!0;if(i.inlineContent)return!1}}return!0}function NKe(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||yhe(i.type))return!0;if(i.inlineContent)return!1}}return!0}function EKe(){return new qr({props:{decorations:OKe,createSelectionBetween(e,t,n){return t.pos==n.pos&&ii.valid(n)?new ii(n):null},handleClick:PKe,handleKeyDown:TKe,handleDOMEvents:{beforeinput:IKe}}})}const TKe=ade({ArrowLeft:$S("horiz",-1),ArrowRight:$S("horiz",1),ArrowUp:$S("vert",-1),ArrowDown:$S("vert",1)});function $S(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,i,s){let a=r.selection,o=t>0?a.$to:a.$from,c=a.empty;if(a instanceof nn){if(!s.endOfTextblock(n)||o.depth==0)return!1;c=!1,o=r.doc.resolve(t>0?o.after():o.before())}let u=ii.findGapCursorFrom(o,t,c);return u?(i&&i(r.tr.setSelection(new ii(u))),!0):!1}}function PKe(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!ii.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Lt.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new ii(r))),!0)}function IKe(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof ii))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=Qe.empty;for(let a=r.length-1;a>=0;a--)i=Qe.from(r[a].createAndFill(null,i));let s=e.state.tr.replace(n.pos,n.pos,new at(i,0,0));return s.setSelection(nn.near(s.doc.resolve(n.pos+1))),e.dispatch(s),!1}function OKe(e){if(!(e.selection instanceof ii))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",$r.create(e.doc,[Ca.widget(e.selection.head,t,{key:"gapcursor"})])}var bB=200,ls=function(){};ls.prototype.append=function(t){return t.length?(t=ls.from(t),!this.length&&t||t.length<bB&&this.leafAppend(t)||this.length<bB&&t.leafPrepend(this)||this.appendInner(t)):this};ls.prototype.prepend=function(t){return t.length?ls.from(t).append(this):this};ls.prototype.appendInner=function(t){return new FKe(this,t)};ls.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?ls.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};ls.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};ls.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};ls.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,a){return i.push(t(s,a))},n,r),i};ls.from=function(t){return t instanceof ls?t:t&&t.length?new vhe(t):ls.empty};var vhe=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new t(this.values.slice(i,s))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,s,a,o){for(var c=s;c<a;c++)if(i(this.values[c],o+c)===!1)return!1},t.prototype.forEachInvertedInner=function(i,s,a,o){for(var c=s-1;c>=a;c--)if(i(this.values[c],o+c)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=bB)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=bB)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(ls);ls.empty=new vhe([]);var FKe=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,s,a){var o=this.left.length;if(i<o&&this.left.forEachInner(r,i,Math.min(s,o),a)===!1||s>o&&this.right.forEachInner(r,Math.max(i-o,0),Math.min(this.length,s)-o,a+o)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,s,a){var o=this.left.length;if(i>o&&this.right.forEachInvertedInner(r,i-o,Math.max(s,o)-o,a+o)===!1||s<o&&this.left.forEachInvertedInner(r,Math.min(i,o),s,a)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(ls);const MKe=500;class sc{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let a=t.tr,o,c,u=[],d=[];return this.items.forEach((h,A)=>{if(!h.step){i||(i=this.remapping(r,A+1),s=i.maps.length),s--,d.push(h);return}if(i){d.push(new nh(h.map));let f=h.step.map(i.slice(s)),p;f&&a.maybeStep(f).doc&&(p=a.mapping.maps[a.mapping.maps.length-1],u.push(new nh(p,void 0,void 0,u.length+d.length))),s--,p&&i.appendMap(p,s)}else a.maybeStep(h.step);if(h.selection)return o=i?h.selection.map(i.slice(s)):h.selection,c=new sc(this.items.slice(0,r).append(d.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:o}}addTransform(t,n,r,i){let s=[],a=this.eventCount,o=this.items,c=!i&&o.length?o.get(o.length-1):null;for(let d=0;d<t.steps.length;d++){let h=t.steps[d].invert(t.docs[d]),A=new nh(t.mapping.maps[d],h,n),f;(f=c&&c.merge(A))&&(A=f,d?s.pop():o=o.slice(0,o.length-1)),s.push(A),n&&(a++,n=void 0),i||(c=A)}let u=a-r.depth;return u>RKe&&(o=LKe(o,u),a-=u),new sc(o.append(s),a)}remapping(t,n){let r=new e1;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},t,n),r}addMaps(t){return this.eventCount==0?this:new sc(this.items.append(t.map(n=>new nh(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=t.mapping,a=t.steps.length,o=this.eventCount;this.items.forEach(A=>{A.selection&&o--},i);let c=n;this.items.forEach(A=>{let f=s.getMirror(--c);if(f==null)return;a=Math.min(a,f);let p=s.maps[f];if(A.step){let m=t.steps[f].invert(t.docs[f]),g=A.selection&&A.selection.map(s.slice(c+1,f));g&&o++,r.push(new nh(p,m,g))}else r.push(new nh(p))},i);let u=[];for(let A=n;A<a;A++)u.push(new nh(s.maps[A]));let d=this.items.slice(0,i).append(u).append(r),h=new sc(d,o);return h.emptyItemCount()>MKe&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],s=0;return this.items.forEach((a,o)=>{if(o>=t)i.push(a),a.selection&&s++;else if(a.step){let c=a.step.map(n.slice(r)),u=c&&c.getMap();if(r--,u&&n.appendMap(u,r),c){let d=a.selection&&a.selection.map(n.slice(r));d&&s++;let h=new nh(u.invert(),c,d),A,f=i.length-1;(A=i.length&&i[f].merge(h))?i[f]=A:i.push(h)}}else a.map&&r--},this.items.length,0),new sc(ls.from(i.reverse()),s)}}sc.empty=new sc(ls.empty,0);function LKe(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}let nh=class xhe{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new xhe(n.getMap().invert(),n,this.selection)}}};class vh{constructor(t,n,r,i,s){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const RKe=20;function DKe(e,t,n,r){let i=n.getMeta(Ep),s;if(i)return i.historyState;n.getMeta(QKe)&&(e=new vh(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(a&&a.getMeta(Ep))return a.getMeta(Ep).redo?new vh(e.done.addTransform(n,void 0,r,y_(t)),e.undone,Lq(n.mapping.maps),e.prevTime,e.prevComposition):new vh(e.done,e.undone.addTransform(n,void 0,r,y_(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let o=n.getMeta("composition"),c=e.prevTime==0||!a&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!UKe(n,e.prevRanges)),u=a?h4(e.prevRanges,n.mapping):Lq(n.mapping.maps);return new vh(e.done.addTransform(n,c?t.selection.getBookmark():void 0,r,y_(t)),sc.empty,u,n.time,o??e.prevComposition)}else return(s=n.getMeta("rebased"))?new vh(e.done.rebased(n,s),e.undone.rebased(n,s),h4(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new vh(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),h4(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function UKe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<t.length;s+=2)r<=t[s+1]&&i>=t[s]&&(n=!0)}),n}function Lq(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,s,a)=>t.push(s,a));return t}function h4(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),s=t.map(e[r+1],-1);i<=s&&n.push(i,s)}return n}function HKe(e,t,n){let r=y_(t),i=Ep.get(t).spec.config,s=(n?e.undone:e.done).popEvent(t,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),o=(n?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,r),c=new vh(n?o:s.remaining,n?s.remaining:o,null,0,-1);return s.transform.setSelection(a).setMeta(Ep,{redo:n,historyState:c})}let f4=!1,Rq=null;function y_(e){let t=e.plugins;if(Rq!=t){f4=!1,Rq=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){f4=!0;break}}return f4}const Ep=new Gi("history"),QKe=new Gi("closeHistory");function $Ke(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new qr({key:Ep,state:{init(){return new vh(sc.empty,sc.empty,null,0,-1)},apply(t,n,r){return DKe(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?bhe:r=="historyRedo"?Che:null;return!i||!t.editable?!1:(n.preventDefault(),i(t.state,t.dispatch))}}}})}function whe(e,t){return(n,r)=>{let i=Ep.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let s=HKe(i,n,e);s&&r(t?s.scrollIntoView():s)}return!0}}const bhe=whe(!1,!0),Che=whe(!0,!0);vi.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc;if(((e==null?void 0:e.mode)||this.options.mode)==="textSize"){const r=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(r)}return t.nodeSize},this.storage.words=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new qr({key:new Gi("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const i=this.options.limit;if(i==null||i===0){e=!0;return}const s=this.storage.characters({node:r.doc});if(s>i){const a=s-i,o=0,c=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(o,c);return e=!0,u}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:t.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!t.getMeta("paste"))return!1;const o=t.selection.$head.pos,c=s-r,u=o-c,d=o;return t.deleteRange(u,d),!(this.storage.characters({node:t.doc})>r)}})]}});var zKe=vi.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[_Ke(this.options)]}});vi.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new qr({key:new Gi("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,s=[];if(!n||!r)return $r.create(e,[]);let a=0;this.options.mode==="deepest"&&e.descendants((c,u)=>{if(c.isText)return;if(!(i>=u&&i<=u+c.nodeSize-1))return!1;a+=1});let o=0;return e.descendants((c,u)=>{if(c.isText||!(i>=u&&i<=u+c.nodeSize-1))return!1;if(o+=1,this.options.mode==="deepest"&&a-o>0||this.options.mode==="shallowest"&&o>1)return this.options.mode==="deepest";s.push(Ca.node(u,u+c.nodeSize,{class:this.options.className}))}),$r.create(e,s)}}})]}});var VKe=vi.create({name:"gapCursor",addProseMirrorPlugins(){return[EKe()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Un(Ot(e,"allowGapCursor",n)))!=null?t:null}}}),Dq="placeholder";function KKe(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var qKe=vi.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:Dq,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const e=this.options.dataAttribute?`data-${KKe(this.options.dataAttribute)}`:`data-${Dq}`;return[new qr({key:new Gi("placeholder"),props:{decorations:({doc:t,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,s=[];if(!r)return null;const a=this.editor.isEmpty;return t.descendants((o,c)=>{const u=i>=c&&i<=c+o.nodeSize,d=!o.isLeaf&&d5(o);if((u||!this.options.showOnlyCurrent)&&d){const h=[this.options.emptyNodeClass];a&&h.push(this.options.emptyEditorClass);const A=Ca.node(c,c+o.nodeSize,{class:h.join(" "),[e]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:c,hasAnchor:u}):this.options.placeholder});s.push(A)}return this.options.includeChildren}),$r.create(t,s)}}})]}});vi.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new qr({key:new Gi("selection"),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||bde(n.selection)||e.view.dragging?null:$r.create(n.doc,[Ca.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function Uq({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(t==null?void 0:t.type)===e}var WKe=vi.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new Gi(this.name),n=this.options.node||((e=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new qr({key:t,appendTransaction:(i,s,a)=>{const{doc:o,tr:c,schema:u}=a,d=t.getState(a),h=o.content.size,A=u.nodes[n];if(d)return c.insert(h,A.create())},state:{init:(i,s)=>{const a=s.tr.doc.lastChild;return!Uq({node:a,types:r})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const a=i.doc.lastChild;return!Uq({node:a,types:r})}}})]}}),GKe=vi.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>bhe(e,t),redo:()=>({state:e,dispatch:t})=>Che(e,t)}},addProseMirrorPlugins(){return[$Ke(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),YKe=vi.create({name:"starterKit",addExtensions(){var e,t,n,r;const i=[];return this.options.bold!==!1&&i.push(xVe.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(pVe.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(lhe.configure(this.options.bulletList)),this.options.code!==!1&&i.push(CVe.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(_Ve.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(jVe.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(zKe.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(VKe.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(BVe.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(NVe.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(GKe.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(EVe.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(FVe.configure(this.options.italic)),this.options.listItem!==!1&&i.push(che.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(phe.configure((e=this.options)==null?void 0:e.listKeymap)),this.options.link!==!1&&i.push(ohe.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&i.push(ghe.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(xKe.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(CKe.configure(this.options.strike)),this.options.text!==!1&&i.push(SKe.configure(this.options.text)),this.options.underline!==!1&&i.push(kKe.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(WKe.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),XKe=YKe,JKe=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,ZKe=Ia.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",si(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,r,i,s,a;const o=(n=(t=e.attrs)==null?void 0:t.src)!=null?n:"",c=(i=(r=e.attrs)==null?void 0:r.alt)!=null?i:"",u=(a=(s=e.attrs)==null?void 0:s.title)!=null?a:"";return u?`![${c}](${o} "${u}")`:`![${c}](${o})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:s,HTMLAttributes:a,editor:o})=>{const c=document.createElement("img");Object.entries(a).forEach(([h,A])=>{if(A!=null)switch(h){case"width":case"height":break;default:c.setAttribute(h,A);break}}),c.src=a.src;const u=new Xze({element:c,editor:o,node:i,getPos:s,onResize:(h,A)=>{c.style.width=`${h}px`,c.style.height=`${A}px`},onCommit:(h,A)=>{const f=s();f!==void 0&&this.editor.chain().setNodeSelection(f).updateAttributes(this.name,{width:h,height:A}).run()},onUpdate:(h,A,f)=>h.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),d=u.dom;return d.style.visibility="hidden",d.style.pointerEvents="none",c.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},u}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Ude({find:JKe,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),eqe=ZKe,tqe=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,nqe=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g,She=e=>e.match(tqe),Hq=(e,t)=>t?"https://www.youtube-nocookie.com/embed/videoseries?list=":e?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",rqe=e=>{const{url:t,allowFullscreen:n,autoplay:r,ccLanguage:i,ccLoadPolicy:s,controls:a,disableKBcontrols:o,enableIFrameApi:c,endTime:u,interfaceLanguage:d,ivLoadPolicy:h,loop:A,modestBranding:f,nocookie:p,origin:m,playlist:g,progressBarColor:y,startAt:v,rel:x}=e;if(!She(t))return null;if(t.includes("/embed/"))return t;if(t.includes("youtu.be")){const B=t.split("/").pop();return B?`${Hq(p)}${B}`:null}const b=/(?:(v|list)=|shorts\/)([-\w]+)/gm.exec(t);if(!b||!b[2])return null;let k=`${Hq(p,b[1]==="list")}${b[2]}`;const j=[];return n===!1&&j.push("fs=0"),r&&j.push("autoplay=1"),i&&j.push(`cc_lang_pref=${i}`),s&&j.push("cc_load_policy=1"),a||j.push("controls=0"),o&&j.push("disablekb=1"),c&&j.push("enablejsapi=1"),u&&j.push(`end=${u}`),d&&j.push(`hl=${d}`),h&&j.push(`iv_load_policy=${h}`),A&&j.push("loop=1"),f&&j.push("modestbranding=1"),m&&j.push(`origin=${m}`),g&&j.push(`playlist=${g}`),v&&j.push(`start=${v}`),y&&j.push(`color=${y}`),x!==void 0&&j.push(`rel=${x}`),j.length&&(k+=`${b[1]==="list"?"&":"?"}${j.join("&")}`),k},iqe=Ia.create({name:"youtube",addOptions(){return{addPasteHandler:!0,allowFullscreen:!0,autoplay:!1,ccLanguage:void 0,ccLoadPolicy:void 0,controls:!0,disableKBcontrols:!1,enableIFrameApi:!1,endTime:0,height:480,interfaceLanguage:void 0,ivLoadPolicy:0,loop:!1,modestBranding:!1,HTMLAttributes:{},inline:!1,nocookie:!1,origin:"",playlist:"",progressBarColor:void 0,width:640,rel:1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},start:{default:0},width:{default:this.options.width},height:{default:this.options.height}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:e=>({commands:t})=>She(e.src)?t.insertContent({type:this.name,attrs:e}):!1}},addPasteRules(){return this.options.addPasteHandler?[s9e({find:nqe,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){const t=rqe({url:e.src,allowFullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,controls:this.options.controls,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,nocookie:this.options.nocookie,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,startAt:e.start||0,rel:this.options.rel});return e.src=t,["div",{"data-youtube-video":""},["iframe",si(this.options.HTMLAttributes,{width:this.options.width,height:this.options.height,allowfullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,rel:this.options.rel},e)]]},...Hde({nodeName:"youtube",allowedAttributes:["src","width","height","start"]})}),sqe=iqe,aqe=qKe;async function khe(e,t=1200,n=1200,r=.85){return new Promise((i,s)=>{const a=new Image,o=URL.createObjectURL(e);a.onload=()=>{URL.revokeObjectURL(o);let{width:c,height:u}=a;if(c>t||u>n){const A=Math.min(t/c,n/u);c=Math.round(c*A),u=Math.round(u*A)}const d=document.createElement("canvas");d.width=c,d.height=u;const h=d.getContext("2d");if(!h){s(new Error("Could not get canvas context"));return}h.drawImage(a,0,0,c,u),d.toBlob(A=>{if(!A){s(new Error("Could not compress image"));return}const f=new File([A],e.name.replace(/\.[^.]+$/,".webp"),{type:"image/webp"});i(f)},"image/webp",r)},a.onerror=()=>{URL.revokeObjectURL(o),s(new Error("Failed to load image"))},a.src=o})}async function oqe(e){const t=await khe(e),r=`images/${`${Date.now()}-${t.name}`}`,{error:i}=await Me.storage.from("blog-assets").upload(r,t,{contentType:t.type,upsert:!1});if(i)throw i;const{data:s}=Me.storage.from("blog-assets").getPublicUrl(r);return s.publicUrl}async function lqe(e){const t=await khe(e,1600,900,.9),r=`featured/${`${Date.now()}-${t.name}`}`,{error:i}=await Me.storage.from("blog-assets").upload(r,t,{contentType:t.type,upsert:!1});if(i)throw i;const{data:s}=Me.storage.from("blog-assets").getPublicUrl(r);return s.publicUrl}var m5="Popover",[_he,uPt]=Wi(m5,[i0]),z2=i0(),[cqe,Zf]=_he(m5),jhe=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!1}=e,o=z2(t),c=C.useRef(null),[u,d]=C.useState(!1),[h,A]=ja({prop:r,defaultProp:i??!1,onChange:s,caller:m5});return l.jsx(CU,{...o,children:l.jsx(cqe,{scope:t,contentId:yl(),triggerRef:c,open:h,onOpenChange:A,onOpenToggle:C.useCallback(()=>A(f=>!f),[A]),hasCustomAnchor:u,onCustomAnchorAdd:C.useCallback(()=>d(!0),[]),onCustomAnchorRemove:C.useCallback(()=>d(!1),[]),modal:a,children:n})})};jhe.displayName=m5;var Bhe="PopoverAnchor",uqe=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Zf(Bhe,n),s=z2(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=i;return C.useEffect(()=>(a(),()=>o()),[a,o]),l.jsx(yE,{...s,...r,ref:t})});uqe.displayName=Bhe;var Nhe="PopoverTrigger",Ehe=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Zf(Nhe,n),s=z2(n),a=Qt(t,i.triggerRef),o=l.jsx(ut.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Fhe(i.open),...r,ref:a,onClick:et(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?o:l.jsx(yE,{asChild:!0,...s,children:o})});Ehe.displayName=Nhe;var QH="PopoverPortal",[dqe,hqe]=_he(QH,{forceMount:void 0}),The=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,s=Zf(QH,t);return l.jsx(dqe,{scope:t,forceMount:n,children:l.jsx(ia,{present:n||s.open,children:l.jsx(v2,{asChild:!0,container:i,children:r})})})};The.displayName=QH;var wv="PopoverContent",Phe=C.forwardRef((e,t)=>{const n=hqe(wv,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,s=Zf(wv,e.__scopePopover);return l.jsx(ia,{present:r||s.open,children:s.modal?l.jsx(Aqe,{...i,ref:t}):l.jsx(pqe,{...i,ref:t})})});Phe.displayName=wv;var fqe=Qp("PopoverContent.RemoveScroll"),Aqe=C.forwardRef((e,t)=>{const n=Zf(wv,e.__scopePopover),r=C.useRef(null),i=Qt(t,r),s=C.useRef(!1);return C.useEffect(()=>{const a=r.current;if(a)return J6(a)},[]),l.jsx(YE,{as:fqe,allowPinchZoom:!0,children:l.jsx(Ihe,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:et(e.onCloseAutoFocus,a=>{var o;a.preventDefault(),s.current||(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:et(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,u=o.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:et(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),pqe=C.forwardRef((e,t)=>{const n=Zf(wv,e.__scopePopover),r=C.useRef(!1),i=C.useRef(!1);return l.jsx(Ihe,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,o;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),Ihe=C.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...h}=e,A=Zf(wv,n),f=z2(n);return X6(),l.jsx(WE,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:l.jsx(Zv,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>A.onOpenChange(!1),children:l.jsx(SU,{"data-state":Fhe(A.open),role:"dialog",id:A.contentId,...f,...h,ref:t,style:{...h.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)"}})})})}),Ohe="PopoverClose",mqe=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=Zf(Ohe,n);return l.jsx(ut.button,{type:"button",...r,ref:t,onClick:et(e.onClick,()=>i.onOpenChange(!1))})});mqe.displayName=Ohe;var gqe="PopoverArrow",yqe=C.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=z2(n);return l.jsx(kU,{...i,...r,ref:t})});yqe.displayName=gqe;function Fhe(e){return e?"open":"closed"}var vqe=jhe,xqe=Ehe,wqe=The,Mhe=Phe;const UM=vqe,HM=xqe,CB=C.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>l.jsx(wqe,{children:l.jsx(Mhe,{ref:i,align:t,sideOffset:n,className:it("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",e),...r})}));CB.displayName=Mhe.displayName;const po=({onClick:e,isActive:t,children:n,title:r})=>l.jsx(xe,{type:"button",variant:t?"default":"ghost",size:"icon",className:"h-8 w-8",onClick:e,title:r,children:n}),bqe=({content:e,onChange:t})=>{const{toast:n}=Qf(),r=C.useRef(null),[i,s]=C.useState(""),[a,o]=C.useState(""),c=uVe({extensions:[XKe,eqe.configure({inline:!1,allowBase64:!1}),sqe.configure({width:640,height:360}),aKe.configure({openOnClick:!1,autolink:!0}),aqe.configure({placeholder:"Start writing your post…"})],content:e,onUpdate:({editor:A})=>{t(A.getHTML())}}),u=C.useCallback(async A=>{var p;const f=(p=A.target.files)==null?void 0:p[0];if(!(!f||!c)){try{n({title:"Uploading image…"});const m=await oqe(f);c.chain().focus().setImage({src:m}).run(),n({title:"Image uploaded"})}catch(m){n({variant:"destructive",title:"Upload failed",description:m instanceof Error?m.message:"Unknown error"})}r.current&&(r.current.value="")}},[c,n]),d=C.useCallback(()=>{!c||!i||(c.commands.setYoutubeVideo({src:i}),s(""))},[c,i]),h=C.useCallback(()=>{!c||!a||(c.chain().focus().setLink({href:a}).run(),o(""))},[c,a]);return c?l.jsxs("div",{className:"border border-input rounded-md overflow-hidden",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-0.5 p-2 border-b border-input bg-muted/50",children:[l.jsx(po,{onClick:()=>c.chain().focus().toggleBold().run(),isActive:c.isActive("bold"),title:"Bold",children:l.jsx(m2e,{className:"h-4 w-4"})}),l.jsx(po,{onClick:()=>c.chain().focus().toggleItalic().run(),isActive:c.isActive("italic"),title:"Italic",children:l.jsx(I2e,{className:"h-4 w-4"})}),l.jsx(po,{onClick:()=>c.chain().focus().toggleCode().run(),isActive:c.isActive("code"),title:"Code",children:l.jsx(b2e,{className:"h-4 w-4"})}),l.jsx("div",{className:"w-px h-6 bg-border mx-1"}),l.jsx(po,{onClick:()=>c.chain().focus().toggleHeading({level:1}).run(),isActive:c.isActive("heading",{level:1}),title:"Heading 1",children:l.jsx(B2e,{className:"h-4 w-4"})}),l.jsx(po,{onClick:()=>c.chain().focus().toggleHeading({level:2}).run(),isActive:c.isActive("heading",{level:2}),title:"Heading 2",children:l.jsx(N2e,{className:"h-4 w-4"})}),l.jsx(po,{onClick:()=>c.chain().focus().toggleHeading({level:3}).run(),isActive:c.isActive("heading",{level:3}),title:"Heading 3",children:l.jsx(E2e,{className:"h-4 w-4"})}),l.jsx("div",{className:"w-px h-6 bg-border mx-1"}),l.jsx(po,{onClick:()=>c.chain().focus().toggleBulletList().run(),isActive:c.isActive("bulletList"),title:"Bullet List",children:l.jsx(D2e,{className:"h-4 w-4"})}),l.jsx(po,{onClick:()=>c.chain().focus().toggleOrderedList().run(),isActive:c.isActive("orderedList"),title:"Ordered List",children:l.jsx(L2e,{className:"h-4 w-4"})}),l.jsx(po,{onClick:()=>c.chain().focus().toggleBlockquote().run(),isActive:c.isActive("blockquote"),title:"Blockquote",children:l.jsx(Q2e,{className:"h-4 w-4"})}),l.jsx(po,{onClick:()=>c.chain().focus().setHorizontalRule().run(),title:"Horizontal Rule",children:l.jsx(Ore,{className:"h-4 w-4"})}),l.jsx("div",{className:"w-px h-6 bg-border mx-1"}),l.jsx(po,{onClick:()=>{var A;return(A=r.current)==null?void 0:A.click()},title:"Insert Image",children:l.jsx(dU,{className:"h-4 w-4"})}),l.jsx("input",{ref:r,type:"file",accept:"image/*",className:"hidden",onChange:u}),l.jsxs(UM,{children:[l.jsx(HM,{asChild:!0,children:l.jsx(xe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",title:"YouTube",children:l.jsx(Qre,{className:"h-4 w-4"})})}),l.jsx(CB,{className:"w-80",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Xe,{placeholder:"YouTube URL",value:i,onChange:A=>s(A.target.value)}),l.jsx(xe,{type:"button",size:"sm",onClick:d,children:"Add"})]})})]}),l.jsxs(UM,{children:[l.jsx(HM,{asChild:!0,children:l.jsx(xe,{type:"button",variant:c.isActive("link")?"default":"ghost",size:"icon",className:"h-8 w-8",title:"Link",children:l.jsx(Tre,{className:"h-4 w-4"})})}),l.jsx(CB,{className:"w-80",children:l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Xe,{placeholder:"https://...",value:a,onChange:A=>o(A.target.value)}),l.jsx(xe,{type:"button",size:"sm",onClick:h,children:"Add"})]})})]}),l.jsx("div",{className:"w-px h-6 bg-border mx-1"}),l.jsx(po,{onClick:()=>c.chain().focus().undo().run(),title:"Undo",children:l.jsx(W2e,{className:"h-4 w-4"})}),l.jsx(po,{onClick:()=>c.chain().focus().redo().run(),title:"Redo",children:l.jsx($2e,{className:"h-4 w-4"})})]}),l.jsx(qde,{editor:c,className:`prose prose-lg max-w-none p-4 min-h-[300px] focus-within:outline-none
                   prose-headings:font-serif prose-headings:font-medium
                   prose-p:text-foreground prose-a:text-accent
                   [&_.ProseMirror]:outline-none [&_.ProseMirror]:min-h-[280px]
                   [&_.ProseMirror_p.is-editor-empty:first-child::before]:text-muted-foreground
                   [&_.ProseMirror_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]
                   [&_.ProseMirror_p.is-editor-empty:first-child::before]:float-left
                   [&_.ProseMirror_p.is-editor-empty:first-child::before]:h-0
                   [&_.ProseMirror_p.is-editor-empty:first-child::before]:pointer-events-none`})]}):null},Cqe=({value:e,onChange:t})=>{const{toast:n}=Qf(),[r,i]=C.useState(!1),[s,a]=C.useState(!1),[o,c]=C.useState(""),[u,d]=C.useState(!1),h=C.useCallback(async p=>{if(!p.type.startsWith("image/")){n({variant:"destructive",title:"Please select an image file"});return}i(!0);try{const m=await lqe(p);t(m),n({title:"Featured image uploaded"})}catch(m){n({variant:"destructive",title:"Upload failed",description:m instanceof Error?m.message:"Unknown error"})}i(!1)},[t,n]),A=C.useCallback(p=>{p.preventDefault(),d(!1);const m=p.dataTransfer.files[0];m&&h(m)},[h]),f=()=>{o.trim()&&(t(o.trim()),c(""),a(!1))};return e?l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{children:"Featured Image"}),l.jsxs("div",{className:"relative group",children:[l.jsx("img",{src:e,alt:"Featured",className:"w-full aspect-[16/9] object-cover border border-input rounded-md"}),l.jsx(xe,{type:"button",variant:"destructive",size:"icon",className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>t(""),children:l.jsx(ta,{className:"h-4 w-4"})})]})]}):l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{children:"Featured Image"}),l.jsxs("div",{className:`border-2 border-dashed rounded-md p-8 text-center transition-colors ${u?"border-accent bg-accent/10":"border-input hover:border-muted-foreground"}`,onDragOver:p=>{p.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:A,children:[l.jsx(dU,{className:"h-10 w-10 mx-auto mb-3 text-muted-foreground"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:r?"Uploading…":"Drag & drop an image or"}),l.jsxs("div",{className:"flex items-center justify-center gap-2",children:[l.jsxs(xe,{type:"button",variant:"outline",size:"sm",disabled:r,onClick:()=>{const p=document.createElement("input");p.type="file",p.accept="image/*",p.onchange=m=>{var y;const g=(y=m.target.files)==null?void 0:y[0];g&&h(g)},p.click()},children:[l.jsx(Hre,{className:"h-4 w-4 mr-1"}),"Upload"]}),l.jsxs(xe,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!s),children:[l.jsx(Tre,{className:"h-4 w-4 mr-1"}),"URL"]})]}),s&&l.jsxs("div",{className:"flex gap-2 mt-4 max-w-md mx-auto",children:[l.jsx(Xe,{placeholder:"https://...",value:o,onChange:p=>c(p.target.value)}),l.jsx(xe,{type:"button",size:"sm",onClick:f,children:"Set"})]})]})]})},Sqe=[{term:"white neighborhood",severity:"critical"},{term:"black neighborhood",severity:"critical"},{term:"hispanic area",severity:"critical"},{term:"asian community",severity:"critical"},{term:"segregated",severity:"critical"},{term:"ethnic neighborhood",severity:"critical"},{term:"minority area",severity:"critical"},{term:"colored",severity:"critical"},{term:"exclusive community",severity:"warning"},{term:"private neighborhood",severity:"warning"},{term:"christian neighborhood",severity:"critical"},{term:"jewish area",severity:"critical"},{term:"muslim community",severity:"critical"},{term:"near churches",severity:"warning"},{term:"near synagogues",severity:"warning"},{term:"near mosques",severity:"warning"},{term:"church community",severity:"warning"},{term:"bachelor pad",severity:"warning"},{term:"man cave",severity:"warning"},{term:"master bedroom",severity:"warning"},{term:"no children",severity:"critical"},{term:"adults only",severity:"critical"},{term:"no kids",severity:"critical"},{term:"adult community",severity:"warning"},{term:"perfect for singles",severity:"warning"},{term:"not suitable for families",severity:"critical"},{term:"ideal for young couples",severity:"warning"},{term:"traditional family",severity:"warning"},{term:"best schools for families",severity:"warning"},{term:"great school district",severity:"warning"},{term:"best school district",severity:"warning"},{term:"perfect for retirees",severity:"warning"},{term:"retirees only",severity:"critical"},{term:"handicapped",severity:"critical"},{term:"crippled",severity:"critical"},{term:"wheelchair bound",severity:"critical"},{term:"mentally ill",severity:"critical"},{term:"crazy neighborhood",severity:"critical"},{term:"able-bodied",severity:"warning"},{term:"walking distance",severity:"warning"},{term:"young professionals only",severity:"critical"},{term:"no elderly",severity:"critical"}],kqe=["perfect for families like yours","you would fit in","people like you","your kind of neighborhood","best area for your type","you'll love it here","great for your family","ideal neighborhood for you","you belong here","your type of community"],Qq={"exclusive community":"established community","private neighborhood":"well-maintained neighborhood","walking distance":"nearby amenities within a walkable neighborhood","master bedroom":"primary bedroom","bachelor pad":"studio or one-bedroom home","man cave":"bonus room or flex space","adult community":"age-qualified community (if legally designated)","perfect for singles":"ideal for independent living","ideal for young couples":"great for those starting out","traditional family":"diverse community","best schools for families":"sought-after school district","great school district":"sought-after school district","best school district":"sought-after school district","perfect for retirees":"low-maintenance living","able-bodied":"accessible features available","church community":"established community with local amenities","near churches":"near community gathering places","near synagogues":"near community gathering places","near mosques":"near community gathering places",handicapped:"accessible","wheelchair bound":"wheelchair user","you'll love it here":"a community many find appealing","great for your family":"a neighborhood with broad appeal","ideal neighborhood for you":"a neighborhood worth exploring"};function Ff(e){const t=[],n=e.toLowerCase();for(const{term:r,severity:i}of Sqe){const s=n.indexOf(r);if(s!==-1){const a=Math.max(0,s-30),o=Math.min(e.length,s+r.length+30),c=Qq[r];t.push({term:r,context:`...${e.slice(a,o)}...`,severity:i,suggestion:c?`Replace "${r}" with "${c}".`:`Remove or rephrase "${r}" — it may violate Fair Housing Act protections.`})}}for(const r of kqe){const i=n.indexOf(r);if(i!==-1){const s=Math.max(0,i-30),a=Math.min(e.length,i+r.length+30),o=Qq[r];t.push({term:r,context:`...${e.slice(s,a)}...`,severity:"warning",suggestion:o?`Replace with "${o}".`:`"${r}" could be interpreted as steering. Use neutral, inclusive language.`})}}return t}function Lhe(e){return e.some(t=>t.severity==="critical")}const Rhe=({violations:e})=>{if(e.length===0)return null;const t=e.filter(r=>r.severity==="critical"),n=e.filter(r=>r.severity==="warning");return l.jsxs("div",{className:"border border-destructive/40 bg-destructive/5 rounded p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-destructive",children:[l.jsx(Vp,{className:"w-4 h-4"}),"Fair Housing Compliance (",e.length," issue",e.length!==1?"s":"",")"]}),t.map((r,i)=>l.jsxs("div",{className:"flex items-start gap-2 text-sm border-l-2 border-destructive pl-3",children:[l.jsx(b2,{className:"w-3.5 h-3.5 mt-0.5 text-destructive shrink-0"}),l.jsxs("div",{children:[l.jsxs("span",{className:"font-medium",children:['"',r.term,'"']}),l.jsxs("span",{className:"text-muted-foreground ml-1",children:["— ",r.suggestion]})]})]},`c-${i}`)),n.map((r,i)=>l.jsxs("div",{className:"flex items-start gap-2 text-sm border-l-2 border-yellow-500 pl-3",children:[l.jsx(Vp,{className:"w-3.5 h-3.5 mt-0.5 text-yellow-600 shrink-0"}),l.jsxs("div",{children:[l.jsxs("span",{className:"font-medium",children:['"',r.term,'"']}),l.jsxs("span",{className:"text-muted-foreground ml-1",children:["— ",r.suggestion]})]})]},`w-${i}`))]})},_qe={title:"",slug:"",excerpt:"",content:"",featured_image:"",author:"Admin",category:"General",tags:"",published:!1,meta_title:"",meta_description:""};function jqe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Bqe=({initialData:e,onSubmit:t,onCancel:n,isSubmitting:r,isEditing:i})=>{const[s,a]=C.useState(e||_qe),[o,c]=C.useState(!i),[u,d]=C.useState([]);C.useEffect(()=>{e&&a(e)},[e]);const h=f=>{a(p=>({...p,title:f,slug:o?jqe(f):p.slug}))},A=f=>{f.preventDefault();const p=`${s.title} ${s.excerpt} ${s.content}`,m=Ff(p);d(m),!(s.published&&Lhe(m))&&t(s)};return l.jsxs("form",{onSubmit:A,className:"space-y-6",children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"editor-title",children:"Title *"}),l.jsx(Xe,{id:"editor-title",value:s.title,onChange:f=>h(f.target.value),required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"editor-slug",children:"Slug"}),l.jsx(Xe,{id:"editor-slug",value:s.slug,onChange:f=>{c(!1),a({...s,slug:f.target.value})},placeholder:"auto-generated-from-title"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"editor-excerpt",children:"Excerpt"}),l.jsx(Vi,{id:"editor-excerpt",value:s.excerpt,onChange:f=>a({...s,excerpt:f.target.value}),rows:2,placeholder:"A brief summary of the post…"})]}),l.jsx(Cqe,{value:s.featured_image,onChange:f=>a({...s,featured_image:f})}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{children:"Content *"}),l.jsx(bqe,{content:s.content,onChange:f=>a({...s,content:f})})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"editor-author",children:"Author"}),l.jsx(Xe,{id:"editor-author",value:s.author,onChange:f=>a({...s,author:f.target.value})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"editor-category",children:"Category"}),l.jsx(Xe,{id:"editor-category",value:s.category,onChange:f=>a({...s,category:f.target.value})})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"editor-tags",children:"Tags (comma-separated)"}),l.jsx(Xe,{id:"editor-tags",value:s.tags,onChange:f=>a({...s,tags:f.target.value}),placeholder:"real estate, market, tips"})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"editor-meta-title",children:"Meta Title"}),l.jsx(Xe,{id:"editor-meta-title",value:s.meta_title,onChange:f=>a({...s,meta_title:f.target.value}),placeholder:"SEO title (uses post title if empty)"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"editor-meta-desc",children:"Meta Description"}),l.jsx(Xe,{id:"editor-meta-desc",value:s.meta_description,onChange:f=>a({...s,meta_description:f.target.value}),placeholder:"SEO description…"})]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(pc,{id:"editor-published",checked:s.published,onCheckedChange:f=>a({...s,published:f})}),l.jsx(ht,{htmlFor:"editor-published",children:"Publish immediately"})]}),l.jsx(Rhe,{violations:u}),l.jsxs("div",{className:"flex justify-end gap-4",children:[l.jsx(xe,{type:"button",variant:"outline",onClick:n,children:"Cancel"}),l.jsx(xe,{type:"submit",disabled:r,children:r?"Saving…":i?"Update Post":"Create Post"})]})]})};var Dhe="AlertDialog",[Nqe,dPt]=Wi(Dhe,[Ace]),Pd=Ace(),Uhe=e=>{const{__scopeAlertDialog:t,...n}=e,r=Pd(t);return l.jsx(nH,{...r,...n,modal:!0})};Uhe.displayName=Dhe;var Eqe="AlertDialogTrigger",Tqe=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Pd(n);return l.jsx(THe,{...i,...r,ref:t})});Tqe.displayName=Eqe;var Pqe="AlertDialogPortal",Hhe=e=>{const{__scopeAlertDialog:t,...n}=e,r=Pd(t);return l.jsx(rH,{...r,...n})};Hhe.displayName=Pqe;var Iqe="AlertDialogOverlay",Qhe=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Pd(n);return l.jsx(F2,{...i,...r,ref:t})});Qhe.displayName=Iqe;var Ey="AlertDialogContent",[Oqe,Fqe]=Nqe(Ey),Mqe=Gne("AlertDialogContent"),$he=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,s=Pd(n),a=C.useRef(null),o=Qt(t,a),c=C.useRef(null);return l.jsx(jHe,{contentName:Ey,titleName:zhe,docsSlug:"alert-dialog",children:l.jsx(Oqe,{scope:n,cancelRef:c,children:l.jsxs(M2,{role:"alertdialog",...s,...i,ref:o,onOpenAutoFocus:et(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[l.jsx(Mqe,{children:r}),l.jsx(Rqe,{contentRef:a})]})})})});$he.displayName=Ey;var zhe="AlertDialogTitle",Vhe=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Pd(n);return l.jsx(L2,{...i,...r,ref:t})});Vhe.displayName=zhe;var Khe="AlertDialogDescription",qhe=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Pd(n);return l.jsx(R2,{...i,...r,ref:t})});qhe.displayName=Khe;var Lqe="AlertDialogAction",Whe=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Pd(n);return l.jsx(JE,{...i,...r,ref:t})});Whe.displayName=Lqe;var Ghe="AlertDialogCancel",Yhe=C.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Fqe(Ghe,n),s=Pd(n),a=Qt(t,i);return l.jsx(JE,{...s,...r,ref:a})});Yhe.displayName=Ghe;var Rqe=({contentRef:e})=>{const t=`\`${Ey}\` requires a description for the component to be accessible for screen reader users.

You can add a description to the \`${Ey}\` by passing a \`${Khe}\` component as a child, which also benefits sighted users by adding visible context to the dialog.

Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ey}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.

For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return C.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Dqe=Uhe,Uqe=Hhe,Xhe=Qhe,Jhe=$he,Zhe=Whe,efe=Yhe,tfe=Vhe,nfe=qhe;const SB=Dqe,Hqe=Uqe,rfe=C.forwardRef(({className:e,...t},n)=>l.jsx(Xhe,{className:it("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));rfe.displayName=Xhe.displayName;const c1=C.forwardRef(({className:e,...t},n)=>l.jsxs(Hqe,{children:[l.jsx(rfe,{}),l.jsx(Jhe,{ref:n,className:it("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));c1.displayName=Jhe.displayName;const u1=({className:e,...t})=>l.jsx("div",{className:it("flex flex-col space-y-2 text-center sm:text-left",e),...t});u1.displayName="AlertDialogHeader";const d1=({className:e,...t})=>l.jsx("div",{className:it("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});d1.displayName="AlertDialogFooter";const h1=C.forwardRef(({className:e,...t},n)=>l.jsx(tfe,{ref:n,className:it("text-lg font-semibold",e),...t}));h1.displayName=tfe.displayName;const f1=C.forwardRef(({className:e,...t},n)=>l.jsx(nfe,{ref:n,className:it("text-sm text-muted-foreground",e),...t}));f1.displayName=nfe.displayName;const Ty=C.forwardRef(({className:e,...t},n)=>l.jsx(Zhe,{ref:n,className:it(E6(),e),...t}));Ty.displayName=Zhe.displayName;const A1=C.forwardRef(({className:e,...t},n)=>l.jsx(efe,{ref:n,className:it(E6({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));A1.displayName=efe.displayName;const Qqe=()=>{const e=El(),{toast:t}=Qf(),{user:n,isLoading:r,isAdmin:i,signOut:s}=A0(),[a,o]=C.useState(""),[c,u]=C.useState(!1),[d,h]=C.useState(!1),[A,f]=C.useState(null),[p,m]=C.useState(null),{data:g,isLoading:y,error:v,refetch:x}=$4e(),w=z4e(),b=V4e(),k=K4e();C.useEffect(()=>{const U=localStorage.getItem("blog_api_key");U&&(o(U),u(!0))},[]),C.useEffect(()=>{!r&&!n?e("/auth"):!r&&n&&!i&&(t({variant:"destructive",title:"Access Denied",description:"You don't have permission to access this page."}),e("/"))},[n,r,i,e,t]);const j=()=>{localStorage.setItem("blog_api_key",a),u(!0),x(),t({title:"API Key Saved",description:"Your API key has been saved locally."})},B=()=>{f(null),h(!0)},E=U=>{f(U),h(!0)},I=U=>{var H;return{title:U.title,slug:U.slug,excerpt:U.excerpt||"",content:U.content,featured_image:U.featured_image||"",author:U.author,category:U.category,tags:((H=U.tags)==null?void 0:H.join(", "))||"",published:U.published,meta_title:U.meta_title||"",meta_description:U.meta_description||""}},T=async U=>{const H={title:U.title,slug:U.slug||void 0,excerpt:U.excerpt||void 0,content:U.content,featured_image:U.featured_image||void 0,author:U.author||"Admin",category:U.category||"General",tags:U.tags?U.tags.split(",").map(K=>K.trim()):[],published:U.published,meta_title:U.meta_title||void 0,meta_description:U.meta_description||void 0};try{A?(await b.mutateAsync({slug:A.slug,data:H}),t({title:"Post updated successfully"})):(await w.mutateAsync(H),t({title:"Post created successfully"})),h(!1),f(null)}catch(K){t({variant:"destructive",title:"Error",description:K instanceof Error?K.message:"Something went wrong"})}},N=async()=>{if(p)try{await k.mutateAsync(p),t({title:"Post deleted successfully"}),m(null)}catch(U){t({variant:"destructive",title:"Error",description:U instanceof Error?U.message:"Failed to delete post"})}},F=async U=>{try{await b.mutateAsync({slug:U.slug,data:{published:!U.published}}),t({title:U.published?"Post unpublished":"Post published"})}catch(H){t({variant:"destructive",title:"Error",description:H instanceof Error?H.message:"Failed to update post"})}},L=async()=>{await s(),e("/auth")};return r?l.jsx(ln,{children:l.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:l.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})})}):!n||!i?null:l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Blog Admin | Holden Richardson"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsx("div",{className:"section-padding",children:l.jsxs("div",{className:"container-page",children:[l.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4 mb-8",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"heading-section",children:"Blog Admin"}),l.jsx("p",{className:"text-muted-foreground mt-2",children:"Manage your blog posts"})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs(xe,{variant:"outline",size:"sm",onClick:()=>e("/admin/profile"),children:[l.jsx(AE,{className:"w-4 h-4 mr-2"}),"Profile"]}),l.jsxs(xe,{variant:"outline",size:"sm",onClick:L,children:[l.jsx(Ire,{className:"w-4 h-4 mr-2"}),"Sign Out"]})]})]}),!c&&l.jsxs(Xt,{className:"mb-8",children:[l.jsx(wa,{children:l.jsxs(ba,{className:"flex items-center gap-2",children:[l.jsx(hU,{className:"w-5 h-5"}),"API Key Setup"]})}),l.jsxs(Jt,{children:[l.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Enter your BLOG_API_KEY to manage posts. This will be stored locally in your browser."}),l.jsxs("div",{className:"flex gap-4",children:[l.jsx(Xe,{type:"password",placeholder:"Enter your BLOG_API_KEY",value:a,onChange:U=>o(U.target.value),className:"max-w-md"}),l.jsx(xe,{onClick:j,children:"Save Key"})]})]})]}),c&&l.jsxs(Xt,{children:[l.jsxs(wa,{className:"flex flex-row items-center justify-between",children:[l.jsx(ba,{children:"Posts"}),l.jsxs(xe,{onClick:B,children:[l.jsx(zp,{className:"w-4 h-4 mr-2"}),"New Post"]})]}),l.jsxs(Jt,{children:[y&&l.jsx("div",{className:"space-y-4",children:[...Array(5)].map((U,H)=>l.jsx(lt,{className:"h-16 w-full"},H))}),v&&l.jsxs("div",{className:"text-center py-8",children:[l.jsx("p",{className:"text-destructive mb-4",children:"Failed to load posts. Check your API key."}),l.jsx(xe,{variant:"outline",onClick:()=>u(!1),children:"Update API Key"})]}),!y&&!v&&g&&l.jsxs(qf,{children:[l.jsx(Wf,{children:l.jsxs(Ei,{children:[l.jsx(yn,{children:"Title"}),l.jsx(yn,{children:"Category"}),l.jsx(yn,{children:"Status"}),l.jsx(yn,{children:"Date"}),l.jsx(yn,{className:"text-right",children:"Actions"})]})}),l.jsxs(Gf,{children:[g.length===0&&l.jsx(Ei,{children:l.jsx(sn,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"No posts yet. Create your first post!"})}),g.map(U=>l.jsxs(Ei,{children:[l.jsx(sn,{className:"font-medium",children:U.title}),l.jsx(sn,{children:U.category}),l.jsx(sn,{children:l.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-1 text-xs rounded ${U.published?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200"}`,children:U.published?l.jsxs(l.Fragment,{children:[l.jsx(Tb,{className:"w-3 h-3"})," Published"]}):l.jsxs(l.Fragment,{children:[l.jsx(N7,{className:"w-3 h-3"})," Draft"]})})}),l.jsx(sn,{children:new Date(U.created_at).toLocaleDateString()}),l.jsx(sn,{className:"text-right",children:l.jsxs("div",{className:"flex items-center justify-end gap-2",children:[l.jsx(xe,{variant:"ghost",size:"icon",onClick:()=>F(U),title:U.published?"Unpublish":"Publish",children:U.published?l.jsx(N7,{className:"w-4 h-4"}):l.jsx(Tb,{className:"w-4 h-4"})}),l.jsx(xe,{variant:"ghost",size:"icon",onClick:()=>E(U),children:l.jsx(Fre,{className:"w-4 h-4"})}),l.jsx(xe,{variant:"ghost",size:"icon",onClick:()=>m(U.slug),children:l.jsx(jl,{className:"w-4 h-4 text-destructive"})})]})})]},U.id))]})]})]})]})]})}),l.jsx(No,{open:d,onOpenChange:h,children:l.jsxs(Ka,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[l.jsx(qa,{children:l.jsx(Wa,{children:A?"Edit Post":"Create New Post"})}),l.jsx(Bqe,{initialData:A?I(A):void 0,onSubmit:T,onCancel:()=>h(!1),isSubmitting:w.isPending||b.isPending,isEditing:!!A})]})}),l.jsx(SB,{open:!!p,onOpenChange:()=>m(null),children:l.jsxs(c1,{children:[l.jsxs(u1,{children:[l.jsx(h1,{children:"Delete Post"}),l.jsx(f1,{children:"Are you sure you want to delete this post? This action cannot be undone."})]}),l.jsxs(d1,{children:[l.jsx(A1,{children:"Cancel"}),l.jsx(Ty,{onClick:N,className:"bg-destructive text-destructive-foreground",children:"Delete"})]})]})})]})},$qe=()=>{const e=El(),{toast:t}=Qf(),{user:n,isLoading:r,isAdmin:i}=A0(),[s,a]=C.useState(""),[o,c]=C.useState(""),[u,d]=C.useState(""),[h,A]=C.useState(!1),[f,p]=C.useState(""),[m,g]=C.useState(!1);C.useEffect(()=>{!r&&!n?e("/auth"):!r&&n&&!i&&(t({variant:"destructive",title:"Access Denied",description:"You don't have permission to access this page."}),e("/"))},[n,r,i,e,t]),C.useEffect(()=>{const x=localStorage.getItem("blog_api_key");x&&p(x)},[]);const y=async x=>{if(x.preventDefault(),o!==u){t({variant:"destructive",title:"Passwords don't match",description:"Please make sure your new passwords match."});return}if(o.length<6){t({variant:"destructive",title:"Password too short",description:"Password must be at least 6 characters."});return}A(!0);const{error:w}=await Me.auth.updateUser({password:o});w?t({variant:"destructive",title:"Failed to update password",description:w.message}):(t({title:"Password updated",description:"Your password has been changed successfully."}),a(""),c(""),d("")),A(!1)},v=()=>{localStorage.setItem("blog_api_key",f),t({title:"API Key updated",description:"Your API key has been saved locally."})};return r?l.jsx(ln,{children:l.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:l.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Loading..."})})}):!n||!i?null:l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Profile Settings | Holden Richardson | 616 Realty"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsx("div",{className:"section-padding",children:l.jsxs("div",{className:"container-page max-w-2xl",children:[l.jsxs(xe,{variant:"ghost",onClick:()=>e("/admin/blog"),className:"mb-6",children:[l.jsx(pm,{className:"w-4 h-4 mr-2"}),"Back to Blog Admin"]}),l.jsx("h1",{className:"heading-section mb-8",children:"Profile Settings"}),l.jsxs(Xt,{className:"mb-8",children:[l.jsxs(wa,{children:[l.jsx(ba,{children:"Account Information"}),l.jsx(kp,{children:"Your account details"})]}),l.jsx(Jt,{children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(ht,{className:"text-muted-foreground",children:"Email"}),l.jsx("p",{className:"text-foreground",children:n.email})]}),l.jsxs("div",{children:[l.jsx(ht,{className:"text-muted-foreground",children:"User ID"}),l.jsx("p",{className:"text-foreground font-mono text-sm",children:n.id})]}),l.jsxs("div",{children:[l.jsx(ht,{className:"text-muted-foreground",children:"Role"}),l.jsx("p",{className:"text-foreground",children:"Administrator"})]})]})})]}),l.jsxs(Xt,{className:"mb-8",children:[l.jsxs(wa,{children:[l.jsx(ba,{children:"Change Password"}),l.jsx(kp,{children:"Update your password"})]}),l.jsx(Jt,{children:l.jsxs("form",{onSubmit:y,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"new-password",children:"New Password"}),l.jsx(Xe,{id:"new-password",type:"password",value:o,onChange:x=>c(x.target.value),placeholder:"••••••••",required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"confirm-new-password",children:"Confirm New Password"}),l.jsx(Xe,{id:"confirm-new-password",type:"password",value:u,onChange:x=>d(x.target.value),placeholder:"••••••••",required:!0})]}),l.jsxs(xe,{type:"submit",disabled:h,children:[l.jsx(Pb,{className:"w-4 h-4 mr-2"}),h?"Updating...":"Update Password"]})]})})]}),l.jsxs(Xt,{children:[l.jsxs(wa,{children:[l.jsxs(ba,{className:"flex items-center gap-2",children:[l.jsx(O2e,{className:"w-5 h-5"}),"API Key"]}),l.jsx(kp,{children:"Your Blog API key for managing posts. This is stored locally in your browser."})]}),l.jsx(Jt,{children:l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"api-key",children:"BLOG_API_KEY"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Xe,{id:"api-key",type:m?"text":"password",value:f,onChange:x=>p(x.target.value),placeholder:"Enter your API key"}),l.jsx(xe,{type:"button",variant:"outline",onClick:()=>g(!m),children:m?"Hide":"Show"})]})]}),l.jsxs(xe,{onClick:v,children:[l.jsx(Pb,{className:"w-4 h-4 mr-2"}),"Save API Key"]})]})})]})]})})]})};function ife(){const{configMap:e,isLoading:t}=Os(),n=ioe(),r=e.product_tier==="aeo"?"aeo":"core";return{tier:r,isAeo:r==="aeo",isCore:r==="core",isLoading:t,setTier:s=>{n.mutate([{key:"product_tier",value:s}])}}}const zqe=[{key:"agent_name",label:"Agent Name"},{key:"agent_market",label:"Market / City"},{key:"agent_brokerage",label:"Brokerage"},{key:"agent_team",label:"Team Name"},{key:"agent_title",label:"Professional Title"},{key:"agent_phone",label:"Phone Number"},{key:"agent_email",label:"Email Address"}],Vqe=[{key:"booking_url",label:"Booking URL (Calendly, etc.)",placeholder:"https://calendly.com/yourname"},{key:"site_base_url",label:"Published Site URL",placeholder:"https://www.holdengr.com"}],Kqe=[{key:"about_google_business",label:"Google Business Profile",placeholder:"https://g.page/yourbusiness"},{key:"about_website",label:"Website URL",placeholder:"https://www.yoursite.com"},{key:"about_facebook",label:"Facebook",placeholder:"https://facebook.com/yourpage"},{key:"about_instagram",label:"Instagram",placeholder:"https://instagram.com/yourhandle"},{key:"about_linkedin",label:"LinkedIn",placeholder:"https://linkedin.com/in/yourprofile"},{key:"about_youtube",label:"YouTube",placeholder:"https://youtube.com/@yourchannel"},{key:"about_x",label:"X (Twitter)",placeholder:"https://x.com/yourhandle"},{key:"about_tiktok",label:"TikTok",placeholder:"https://tiktok.com/@yourhandle"},{key:"about_zillow",label:"Zillow",placeholder:"https://zillow.com/profile/yourprofile"},{key:"about_realtor",label:"Realtor.com",placeholder:"https://realtor.com/realestateagents/yourprofile"}],qqe=()=>{const{configMap:e,isLoading:t}=Os(),n=ioe(),[r,i]=C.useState({}),s={...e,...r},a=()=>{const c=Object.entries(r).map(([u,d])=>({key:u,value:d}));if(c.length===0){De({title:"No changes to save"});return}n.mutate(c,{onSuccess:()=>{De({title:"Configuration saved!"}),i({})},onError:u=>De({title:"Error saving",description:u.message,variant:"destructive"})})};if(t)return l.jsx("div",{className:"space-y-4",children:Array.from({length:6}).map((c,u)=>l.jsx(lt,{className:"h-10 w-full"},u))});const o=c=>l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:c.map(u=>l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(ht,{htmlFor:u.key,className:"text-xs uppercase tracking-wider",children:u.label}),l.jsx(Xe,{id:u.key,value:s[u.key]||"",onChange:d=>i(h=>({...h,[u.key]:d.target.value})),placeholder:u.placeholder||u.label,type:u.key==="agent_email"?"email":u.key==="agent_phone"?"tel":"text"})]},u.key))});return l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-serif text-xl mb-2",children:"Agent Identity"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Your agent details power AI-generated content and JSON-LD schema across the site."}),o(zqe)]}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-serif text-xl mb-2",children:"CTAs & Site Settings"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Configure your booking link and published site URL. The site URL is used for all JSON-LD schema, Open Graph tags, canonical links, and sitemaps."}),o(Vqe)]}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-serif text-xl mb-2",children:"About & Profile Links"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Add your full profile URLs to build authority in AI models and search engines."}),o(Kqe)]}),l.jsx("div",{className:"rounded-md border border-accent/30 bg-accent/5 p-4",children:l.jsxs("p",{className:"text-sm text-muted-foreground",children:[l.jsx("span",{className:"font-semibold text-foreground",children:"Follow Up Boss API Key:"})," This key is stored securely as a secret — not in this form. To add or update it, paste your API key in the Lovable chat and ask to save it as a secret."]})}),l.jsxs(xe,{onClick:a,disabled:n.isPending,className:"btn-gold border-0",children:[l.jsx(Pb,{className:"w-4 h-4 mr-2"}),n.isPending?"Saving...":"Save Config"]})]})};function eA(e){return gr({queryKey:["aeo-categories","all"],queryFn:async()=>{let t=Me.from("aeo_categories").select("*").order("display_order");const{data:n,error:r}=await t;if(r)throw r;return n.map(i=>({...i,faq_json:i.faq_json||[],faq_title:i.faq_title||null,video_orientation:i.video_orientation||"horizontal",section_headings:i.section_headings||[],cover_image_id:i.cover_image_id||null,content_image_ids:i.content_image_ids||[],parent_id:i.parent_id||null,stats_json:i.stats_json||[]}))}})}function Wqe(e){return gr({queryKey:["aeo-subcategories",e],enabled:!!e,queryFn:async()=>{const{data:t,error:n}=await Me.from("aeo_categories").select("*").eq("parent_id",e).eq("enabled",!0).order("display_order");if(n)throw n;return t.map(r=>({...r,faq_json:r.faq_json||[],faq_title:r.faq_title||null,video_orientation:r.video_orientation||"horizontal",section_headings:r.section_headings||[],cover_image_id:r.cover_image_id||null,content_image_ids:r.content_image_ids||[],parent_id:r.parent_id||null,stats_json:r.stats_json||[]}))}})}function Cc(e){return gr({queryKey:["aeo-pages",e],queryFn:async()=>{let t=Me.from("aeo_pages").select("*, aeo_categories!inner(*)");const{data:n,error:r}=await t.order("display_order");if(r)throw r;return n.map(i=>({...i,category:i.aeo_categories,faq_json:i.faq_json||[]}))}})}function Gqe(e,t,n){return gr({queryKey:["aeo-page",e,n,t],enabled:!!e&&!!t,queryFn:async()=>{const r=n||e;if(n){const{data:a}=await Me.from("aeo_categories").select("id").eq("slug",e).is("parent_id",null).maybeSingle();if(!a)return null;const{data:o}=await Me.from("aeo_categories").select("id").eq("slug",n).eq("parent_id",a.id).maybeSingle();if(!o)return null;const{data:c,error:u}=await Me.from("aeo_pages").select("*, aeo_categories!inner(*)").eq("category_id",o.id).eq("slug",t).maybeSingle();if(u)throw u;return c?{...c,category:c.aeo_categories,faq_json:c.faq_json||[]}:null}const{data:i,error:s}=await Me.from("aeo_pages").select("*, aeo_categories!inner(*)").eq("aeo_categories.slug",r).eq("slug",t).maybeSingle();if(s)throw s;return i?{...i,category:i.aeo_categories,faq_json:i.faq_json||[]}:null}})}function Yqe(e){return gr({queryKey:["aeo-children",e],enabled:!!e,queryFn:async()=>{const{data:t,error:n}=await Me.from("aeo_pages").select("*, aeo_categories(*)").eq("parent_id",e).order("display_order");if(n)throw n;return t.map(r=>({...r,category:r.aeo_categories,faq_json:r.faq_json||[]}))}})}const Xqe=new Set(["the","and","for","with","that","this","what","when","where","which","how","why","you","your","are","was","were","from","have","has","had","but","not","can","does","did","into","about","over","under","they","them","their","our","out","get","got","any","all","one","two","its","it's","i've","i'm","don't","grand","rapids","michigan","mi"]);function $q(e){return new Set((e||"").toLowerCase().replace(/[^a-z0-9\s]/g," ").split(/\s+/).filter(t=>t.length>3&&!Xqe.has(t)))}function Jqe(e,t,n,r=5){return gr({queryKey:["aeo-peers",e,t,r],enabled:!!e&&!!t,queryFn:async()=>{const{data:i,error:s}=await Me.from("aeo_pages").select("id, title, slug, h1, intro_text, faq_json, display_order").eq("category_id",e).eq("status","published").neq("id",t).order("display_order");if(s)throw s;const a=i||[],o=$q(n||""),c=a.map(d=>{const A=(Array.isArray(d.faq_json)?d.faq_json:[]).map(m=>`${(m==null?void 0:m.question)||""} ${(m==null?void 0:m.answer)||""}`).join(" "),f=$q(`${d.h1||""} ${d.title||""} ${d.intro_text||""} ${A}`);let p=0;if(o.size>0)for(const m of o)f.has(m)&&(p+=1);return{p:d,overlap:p}}),u=c.some(d=>d.overlap>0);return c.sort((d,h)=>u&&h.overlap!==d.overlap?h.overlap-d.overlap:(d.p.display_order??0)-(h.p.display_order??0)),c.slice(0,r).map(({p:d})=>({id:d.id,title:d.title,slug:d.slug,h1:d.h1,intro_text:d.intro_text}))}})}function sfe(){const e=cs();return Is({mutationFn:async t=>{const{data:n,error:r}=await Me.from("aeo_pages").insert(t).select().single();if(r)throw r;return n},onSuccess:()=>e.invalidateQueries({queryKey:["aeo-pages"]})})}function g5(){const e=cs();return Is({mutationFn:async({id:t,...n})=>{const{category:r,children:i,...s}=n,{data:a,error:o}=await Me.from("aeo_pages").update(s).eq("id",t).select().single();if(o)throw o;return a},onSuccess:()=>{e.invalidateQueries({queryKey:["aeo-pages"]}),e.invalidateQueries({queryKey:["aeo-page"]})}})}function afe(){const e=cs();return Is({mutationFn:async t=>{const{error:n}=await Me.from("aeo_pages").delete().eq("id",t);if(n)throw n},onSuccess:()=>e.invalidateQueries({queryKey:["aeo-pages"]})})}function ofe(){const e=cs();return Is({mutationFn:async({id:t,...n})=>{const{error:r}=await Me.from("aeo_categories").update(n).eq("id",t);if(r)throw r},onSuccess:()=>e.invalidateQueries({queryKey:["aeo-categories"]})})}function Zqe(){const e=cs();return Is({mutationFn:async t=>{const{error:n}=await Me.from("aeo_categories").delete().eq("id",t);if(n)throw n},onSuccess:()=>e.invalidateQueries({queryKey:["aeo-categories"]})})}function eWe(){const e=cs();return Is({mutationFn:async t=>{const{data:n,error:r}=await Me.from("aeo_categories").insert(t).select().single();if(r)throw r;return n},onSuccess:()=>{e.invalidateQueries({queryKey:["aeo-categories"]}),e.invalidateQueries({queryKey:["aeo-subcategories"]})}})}function p1(e,[t,n]){return Math.min(n,Math.max(t,e))}var tWe=[" ","Enter","ArrowUp","ArrowDown"],nWe=[" ","Enter"],rm="Select",[y5,v5,rWe]=y2(rm),[y0,hPt]=Wi(rm,[rWe,i0]),x5=i0(),[iWe,tA]=y0(rm),[sWe,aWe]=y0(rm),lfe=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:s,value:a,defaultValue:o,onValueChange:c,dir:u,name:d,autoComplete:h,disabled:A,required:f,form:p}=e,m=x5(t),[g,y]=C.useState(null),[v,x]=C.useState(null),[w,b]=C.useState(!1),k=gm(u),[j,B]=ja({prop:r,defaultProp:i??!1,onChange:s,caller:rm}),[E,I]=ja({prop:a,defaultProp:o,onChange:c,caller:rm}),T=C.useRef(null),N=g?p||!!g.closest("form"):!0,[F,L]=C.useState(new Set),U=Array.from(F).map(H=>H.props.value).join(";");return l.jsx(CU,{...m,children:l.jsxs(iWe,{required:f,scope:t,trigger:g,onTriggerChange:y,valueNode:v,onValueNodeChange:x,valueNodeHasChildren:w,onValueNodeHasChildrenChange:b,contentId:yl(),value:E,onValueChange:I,open:j,onOpenChange:B,dir:k,triggerPointerDownPosRef:T,disabled:A,children:[l.jsx(y5.Provider,{scope:t,children:l.jsx(sWe,{scope:e.__scopeSelect,onNativeOptionAdd:C.useCallback(H=>{L(K=>new Set(K).add(H))},[]),onNativeOptionRemove:C.useCallback(H=>{L(K=>{const $=new Set(K);return $.delete(H),$})},[]),children:n})}),N?l.jsxs(Pfe,{"aria-hidden":!0,required:f,tabIndex:-1,name:d,autoComplete:h,value:E,onChange:H=>I(H.target.value),disabled:A,form:p,children:[E===void 0?l.jsx("option",{value:""}):null,Array.from(F)]},U):null]})})};lfe.displayName=rm;var cfe="SelectTrigger",ufe=C.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,s=x5(n),a=tA(cfe,n),o=a.disabled||r,c=Qt(t,a.onTriggerChange),u=v5(n),d=C.useRef("touch"),[h,A,f]=Ofe(m=>{const g=u().filter(x=>!x.disabled),y=g.find(x=>x.value===a.value),v=Ffe(g,m,y);v!==void 0&&a.onValueChange(v.value)}),p=m=>{o||(a.onOpenChange(!0),f()),m&&(a.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return l.jsx(yE,{asChild:!0,...s,children:l.jsx(ut.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":Ife(a.value)?"":void 0,...i,ref:c,onClick:et(i.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&p(m)}),onPointerDown:et(i.onPointerDown,m=>{d.current=m.pointerType;const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(p(m),m.preventDefault())}),onKeyDown:et(i.onKeyDown,m=>{const g=h.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&A(m.key),!(g&&m.key===" ")&&tWe.includes(m.key)&&(p(),m.preventDefault())})})})});ufe.displayName=cfe;var dfe="SelectValue",hfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:s,placeholder:a="",...o}=e,c=tA(dfe,n),{onValueNodeHasChildrenChange:u}=c,d=s!==void 0,h=Qt(t,c.onValueNodeChange);return qi(()=>{u(d)},[u,d]),l.jsx(ut.span,{...o,ref:h,style:{pointerEvents:"none"},children:Ife(c.value)?l.jsx(l.Fragment,{children:a}):s})});hfe.displayName=dfe;var oWe="SelectIcon",ffe=C.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return l.jsx(ut.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});ffe.displayName=oWe;var lWe="SelectPortal",Afe=e=>l.jsx(v2,{asChild:!0,...e});Afe.displayName=lWe;var im="SelectContent",pfe=C.forwardRef((e,t)=>{const n=tA(im,e.__scopeSelect),[r,i]=C.useState();if(qi(()=>{i(new DocumentFragment)},[]),!n.open){const s=r;return s?Hf.createPortal(l.jsx(mfe,{scope:e.__scopeSelect,children:l.jsx(y5.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),s):null}return l.jsx(gfe,{...e,ref:t})});pfe.displayName=im;var Gl=10,[mfe,nA]=y0(im),cWe="SelectContentImpl",uWe=Qp("SelectContent.RemoveScroll"),gfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:o,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:A,collisionPadding:f,sticky:p,hideWhenDetached:m,avoidCollisions:g,...y}=e,v=tA(im,n),[x,w]=C.useState(null),[b,k]=C.useState(null),j=Qt(t,Z=>w(Z)),[B,E]=C.useState(null),[I,T]=C.useState(null),N=v5(n),[F,L]=C.useState(!1),U=C.useRef(!1);C.useEffect(()=>{if(x)return J6(x)},[x]),X6();const H=C.useCallback(Z=>{const[de,...ue]=N().map(ie=>ie.ref.current),[ae]=ue.slice(-1),he=document.activeElement;for(const ie of Z)if(ie===he||(ie==null||ie.scrollIntoView({block:"nearest"}),ie===de&&b&&(b.scrollTop=0),ie===ae&&b&&(b.scrollTop=b.scrollHeight),ie==null||ie.focus(),document.activeElement!==he))return},[N,b]),K=C.useCallback(()=>H([B,x]),[H,B,x]);C.useEffect(()=>{F&&K()},[F,K]);const{onOpenChange:$,triggerPointerDownPosRef:z}=v;C.useEffect(()=>{if(x){let Z={x:0,y:0};const de=ae=>{var he,ie;Z={x:Math.abs(Math.round(ae.pageX)-(((he=z.current)==null?void 0:he.x)??0)),y:Math.abs(Math.round(ae.pageY)-(((ie=z.current)==null?void 0:ie.y)??0))}},ue=ae=>{Z.x<=10&&Z.y<=10?ae.preventDefault():x.contains(ae.target)||$(!1),document.removeEventListener("pointermove",de),z.current=null};return z.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",ue,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",ue,{capture:!0})}}},[x,$,z]),C.useEffect(()=>{const Z=()=>$(!1);return window.addEventListener("blur",Z),window.addEventListener("resize",Z),()=>{window.removeEventListener("blur",Z),window.removeEventListener("resize",Z)}},[$]);const[Q,oe]=Ofe(Z=>{const de=N().filter(he=>!he.disabled),ue=de.find(he=>he.ref.current===document.activeElement),ae=Ffe(de,Z,ue);ae&&setTimeout(()=>ae.ref.current.focus())}),R=C.useCallback((Z,de,ue)=>{const ae=!U.current&&!ue;(v.value!==void 0&&v.value===de||ae)&&(E(Z),ae&&(U.current=!0))},[v.value]),M=C.useCallback(()=>x==null?void 0:x.focus(),[x]),Y=C.useCallback((Z,de,ue)=>{const ae=!U.current&&!ue;(v.value!==void 0&&v.value===de||ae)&&T(Z)},[v.value]),X=r==="popper"?QM:yfe,q=X===QM?{side:o,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:A,collisionPadding:f,sticky:p,hideWhenDetached:m,avoidCollisions:g}:{};return l.jsx(mfe,{scope:n,content:x,viewport:b,onViewportChange:k,itemRefCallback:R,selectedItem:B,onItemLeave:M,itemTextRefCallback:Y,focusSelectedItem:K,selectedItemText:I,position:r,isPositioned:F,searchRef:Q,children:l.jsx(YE,{as:uWe,allowPinchZoom:!0,children:l.jsx(WE,{asChild:!0,trapped:v.open,onMountAutoFocus:Z=>{Z.preventDefault()},onUnmountAutoFocus:et(i,Z=>{var de;(de=v.trigger)==null||de.focus({preventScroll:!0}),Z.preventDefault()}),children:l.jsx(Zv,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:Z=>Z.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:l.jsx(X,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:Z=>Z.preventDefault(),...y,...q,onPlaced:()=>L(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:et(y.onKeyDown,Z=>{const de=Z.ctrlKey||Z.altKey||Z.metaKey;if(Z.key==="Tab"&&Z.preventDefault(),!de&&Z.key.length===1&&oe(Z.key),["ArrowUp","ArrowDown","Home","End"].includes(Z.key)){let ae=N().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes(Z.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(Z.key)){const he=Z.target,ie=ae.indexOf(he);ae=ae.slice(ie+1)}setTimeout(()=>H(ae)),Z.preventDefault()}})})})})})})});gfe.displayName=cWe;var dWe="SelectItemAlignedPosition",yfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,s=tA(im,n),a=nA(im,n),[o,c]=C.useState(null),[u,d]=C.useState(null),h=Qt(t,j=>d(j)),A=v5(n),f=C.useRef(!1),p=C.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:y,focusSelectedItem:v}=a,x=C.useCallback(()=>{if(s.trigger&&s.valueNode&&o&&u&&m&&g&&y){const j=s.trigger.getBoundingClientRect(),B=u.getBoundingClientRect(),E=s.valueNode.getBoundingClientRect(),I=y.getBoundingClientRect();if(s.dir!=="rtl"){const he=I.left-B.left,ie=E.left-he,Ce=j.left-ie,Oe=j.width+Ce,te=Math.max(Oe,B.width),je=window.innerWidth-Gl,tt=p1(ie,[Gl,Math.max(Gl,je-te)]);o.style.minWidth=Oe+"px",o.style.left=tt+"px"}else{const he=B.right-I.right,ie=window.innerWidth-E.right-he,Ce=window.innerWidth-j.right-ie,Oe=j.width+Ce,te=Math.max(Oe,B.width),je=window.innerWidth-Gl,tt=p1(ie,[Gl,Math.max(Gl,je-te)]);o.style.minWidth=Oe+"px",o.style.right=tt+"px"}const T=A(),N=window.innerHeight-Gl*2,F=m.scrollHeight,L=window.getComputedStyle(u),U=parseInt(L.borderTopWidth,10),H=parseInt(L.paddingTop,10),K=parseInt(L.borderBottomWidth,10),$=parseInt(L.paddingBottom,10),z=U+H+F+$+K,Q=Math.min(g.offsetHeight*5,z),oe=window.getComputedStyle(m),R=parseInt(oe.paddingTop,10),M=parseInt(oe.paddingBottom,10),Y=j.top+j.height/2-Gl,X=N-Y,q=g.offsetHeight/2,Z=g.offsetTop+q,de=U+H+Z,ue=z-de;if(de<=Y){const he=T.length>0&&g===T[T.length-1].ref.current;o.style.bottom="0px";const ie=u.clientHeight-m.offsetTop-m.offsetHeight,Ce=Math.max(X,q+(he?M:0)+ie+K),Oe=de+Ce;o.style.height=Oe+"px"}else{const he=T.length>0&&g===T[0].ref.current;o.style.top="0px";const Ce=Math.max(Y,U+m.offsetTop+(he?R:0)+q)+ue;o.style.height=Ce+"px",m.scrollTop=de-Y+m.offsetTop}o.style.margin=`${Gl}px 0`,o.style.minHeight=Q+"px",o.style.maxHeight=N+"px",r==null||r(),requestAnimationFrame(()=>f.current=!0)}},[A,s.trigger,s.valueNode,o,u,m,g,y,s.dir,r]);qi(()=>x(),[x]);const[w,b]=C.useState();qi(()=>{u&&b(window.getComputedStyle(u).zIndex)},[u]);const k=C.useCallback(j=>{j&&p.current===!0&&(x(),v==null||v(),p.current=!1)},[x,v]);return l.jsx(fWe,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:f,onScrollButtonChange:k,children:l.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:l.jsx(ut.div,{...i,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});yfe.displayName=dWe;var hWe="SelectPopperPosition",QM=C.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Gl,...s}=e,a=x5(n);return l.jsx(SU,{...a,...s,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});QM.displayName=hWe;var[fWe,$H]=y0(im,{}),$M="SelectViewport",vfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,s=nA($M,n),a=$H($M,n),o=Qt(t,s.onViewportChange),c=C.useRef(0);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),l.jsx(y5.Slot,{scope:n,children:l.jsx(ut.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:et(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:A}=a;if(A!=null&&A.current&&h){const f=Math.abs(c.current-d.scrollTop);if(f>0){const p=window.innerHeight-Gl*2,m=parseFloat(h.style.minHeight),g=parseFloat(h.style.height),y=Math.max(m,g);if(y<p){const v=y+f,x=Math.min(p,v),w=v-x;h.style.height=x+"px",h.style.bottom==="0px"&&(d.scrollTop=w>0?w:0,h.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});vfe.displayName=$M;var xfe="SelectGroup",[AWe,pWe]=y0(xfe),mWe=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=yl();return l.jsx(AWe,{scope:n,id:i,children:l.jsx(ut.div,{role:"group","aria-labelledby":i,...r,ref:t})})});mWe.displayName=xfe;var wfe="SelectLabel",bfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=pWe(wfe,n);return l.jsx(ut.div,{id:i.id,...r,ref:t})});bfe.displayName=wfe;var kB="SelectItem",[gWe,Cfe]=y0(kB),Sfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...a}=e,o=tA(kB,n),c=nA(kB,n),u=o.value===r,[d,h]=C.useState(s??""),[A,f]=C.useState(!1),p=Qt(t,v=>{var x;return(x=c.itemRefCallback)==null?void 0:x.call(c,v,r,i)}),m=yl(),g=C.useRef("touch"),y=()=>{i||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return l.jsx(gWe,{scope:n,value:r,disabled:i,textId:m,isSelected:u,onItemTextChange:C.useCallback(v=>{h(x=>x||((v==null?void 0:v.textContent)??"").trim())},[]),children:l.jsx(y5.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:l.jsx(ut.div,{role:"option","aria-labelledby":m,"data-highlighted":A?"":void 0,"aria-selected":u&&A,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:p,onFocus:et(a.onFocus,()=>f(!0)),onBlur:et(a.onBlur,()=>f(!1)),onClick:et(a.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:et(a.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:et(a.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:et(a.onPointerMove,v=>{var x;g.current=v.pointerType,i?(x=c.onItemLeave)==null||x.call(c):g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:et(a.onPointerLeave,v=>{var x;v.currentTarget===document.activeElement&&((x=c.onItemLeave)==null||x.call(c))}),onKeyDown:et(a.onKeyDown,v=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&v.key===" "||(nWe.includes(v.key)&&y(),v.key===" "&&v.preventDefault())})})})})});Sfe.displayName=kB;var cw="SelectItemText",kfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...s}=e,a=tA(cw,n),o=nA(cw,n),c=Cfe(cw,n),u=aWe(cw,n),[d,h]=C.useState(null),A=Qt(t,y=>h(y),c.onItemTextChange,y=>{var v;return(v=o.itemTextRefCallback)==null?void 0:v.call(o,y,c.value,c.disabled)}),f=d==null?void 0:d.textContent,p=C.useMemo(()=>l.jsx("option",{value:c.value,disabled:c.disabled,children:f},c.value),[c.disabled,c.value,f]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=u;return qi(()=>(m(p),()=>g(p)),[m,g,p]),l.jsxs(l.Fragment,{children:[l.jsx(ut.span,{id:c.textId,...s,ref:A}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Hf.createPortal(s.children,a.valueNode):null]})});kfe.displayName=cw;var _fe="SelectItemIndicator",jfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Cfe(_fe,n).isSelected?l.jsx(ut.span,{"aria-hidden":!0,...r,ref:t}):null});jfe.displayName=_fe;var zM="SelectScrollUpButton",Bfe=C.forwardRef((e,t)=>{const n=nA(zM,e.__scopeSelect),r=$H(zM,e.__scopeSelect),[i,s]=C.useState(!1),a=Qt(t,r.onScrollButtonChange);return qi(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=c.scrollTop>0;s(u)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?l.jsx(Efe,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});Bfe.displayName=zM;var VM="SelectScrollDownButton",Nfe=C.forwardRef((e,t)=>{const n=nA(VM,e.__scopeSelect),r=$H(VM,e.__scopeSelect),[i,s]=C.useState(!1),a=Qt(t,r.onScrollButtonChange);return qi(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;s(d)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?l.jsx(Efe,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});Nfe.displayName=VM;var Efe=C.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,s=nA("SelectScrollButton",n),a=C.useRef(null),o=v5(n),c=C.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return C.useEffect(()=>()=>c(),[c]),qi(()=>{var d;const u=o().find(h=>h.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[o]),l.jsx(ut.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:et(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:et(i.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:et(i.onPointerLeave,()=>{c()})})}),yWe="SelectSeparator",Tfe=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return l.jsx(ut.div,{"aria-hidden":!0,...r,ref:t})});Tfe.displayName=yWe;var KM="SelectArrow",vWe=C.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=x5(n),s=tA(KM,n),a=nA(KM,n);return s.open&&a.position==="popper"?l.jsx(kU,{...i,...r,ref:t}):null});vWe.displayName=KM;var xWe="SelectBubbleInput",Pfe=C.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=C.useRef(null),s=Qt(r,i),a=D2(t);return C.useEffect(()=>{const o=i.current;if(!o)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&d){const h=new Event("change",{bubbles:!0});d.call(o,t),o.dispatchEvent(h)}},[a,t]),l.jsx(ut.select,{...n,style:{...ere,...n.style},ref:s,defaultValue:t})});Pfe.displayName=xWe;function Ife(e){return e===""||e===void 0}function Ofe(e){const t=$i(e),n=C.useRef(""),r=C.useRef(0),i=C.useCallback(a=>{const o=n.current+a;t(o),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(o)},[t]),s=C.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}function Ffe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let a=wWe(e,Math.max(s,0));i.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function wWe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var bWe=lfe,Mfe=ufe,CWe=hfe,SWe=ffe,kWe=Afe,Lfe=pfe,_We=vfe,Rfe=bfe,Dfe=Sfe,jWe=kfe,BWe=jfe,Ufe=Bfe,Hfe=Nfe,Qfe=Tfe;const Fr=bWe,Mr=CWe,Br=C.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Mfe,{ref:r,className:it("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,l.jsx(SWe,{asChild:!0,children:l.jsx(hc,{className:"h-4 w-4 opacity-50"})})]}));Br.displayName=Mfe.displayName;const $fe=C.forwardRef(({className:e,...t},n)=>l.jsx(Ufe,{ref:n,className:it("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(v2e,{className:"h-4 w-4"})}));$fe.displayName=Ufe.displayName;const zfe=C.forwardRef(({className:e,...t},n)=>l.jsx(Hfe,{ref:n,className:it("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(hc,{className:"h-4 w-4"})}));zfe.displayName=Hfe.displayName;const Nr=C.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>l.jsx(kWe,{children:l.jsxs(Lfe,{ref:i,className:it("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[l.jsx($fe,{}),l.jsx(_We,{className:it("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),l.jsx(zfe,{})]})}));Nr.displayName=Lfe.displayName;const NWe=C.forwardRef(({className:e,...t},n)=>l.jsx(Rfe,{ref:n,className:it("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));NWe.displayName=Rfe.displayName;const ft=C.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(Dfe,{ref:r,className:it("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[l.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(BWe,{children:l.jsx(Fo,{className:"h-4 w-4"})})}),l.jsx(jWe,{children:t})]}));ft.displayName=Dfe.displayName;const EWe=C.forwardRef(({className:e,...t},n)=>l.jsx(Qfe,{ref:n,className:it("-mx-1 my-1 h-px bg-muted",e),...t}));EWe.displayName=Qfe.displayName;function TWe(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var zH="ScrollArea",[Vfe,fPt]=Wi(zH),[PWe,Tl]=Vfe(zH),Kfe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:s=600,...a}=e,[o,c]=C.useState(null),[u,d]=C.useState(null),[h,A]=C.useState(null),[f,p]=C.useState(null),[m,g]=C.useState(null),[y,v]=C.useState(0),[x,w]=C.useState(0),[b,k]=C.useState(!1),[j,B]=C.useState(!1),E=Qt(t,T=>c(T)),I=gm(i);return l.jsx(PWe,{scope:n,type:r,dir:I,scrollHideDelay:s,scrollArea:o,viewport:u,onViewportChange:d,content:h,onContentChange:A,scrollbarX:f,onScrollbarXChange:p,scrollbarXEnabled:b,onScrollbarXEnabledChange:k,scrollbarY:m,onScrollbarYChange:g,scrollbarYEnabled:j,onScrollbarYEnabledChange:B,onCornerWidthChange:v,onCornerHeightChange:w,children:l.jsx(ut.div,{dir:I,...a,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});Kfe.displayName=zH;var qfe="ScrollAreaViewport",Wfe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...s}=e,a=Tl(qfe,n),o=C.useRef(null),c=Qt(t,o,a.onViewportChange);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),l.jsx(ut.div,{"data-radix-scroll-area-viewport":"",...s,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Wfe.displayName=qfe;var gu="ScrollAreaScrollbar",VH=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Tl(gu,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:a}=i,o=e.orientation==="horizontal";return C.useEffect(()=>(o?s(!0):a(!0),()=>{o?s(!1):a(!1)}),[o,s,a]),i.type==="hover"?l.jsx(IWe,{...r,ref:t,forceMount:n}):i.type==="scroll"?l.jsx(OWe,{...r,ref:t,forceMount:n}):i.type==="auto"?l.jsx(Gfe,{...r,ref:t,forceMount:n}):i.type==="always"?l.jsx(KH,{...r,ref:t}):null});VH.displayName=gu;var IWe=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Tl(gu,e.__scopeScrollArea),[s,a]=C.useState(!1);return C.useEffect(()=>{const o=i.scrollArea;let c=0;if(o){const u=()=>{window.clearTimeout(c),a(!0)},d=()=>{c=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return o.addEventListener("pointerenter",u),o.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),o.removeEventListener("pointerenter",u),o.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),l.jsx(ia,{present:n||s,children:l.jsx(Gfe,{"data-state":s?"visible":"hidden",...r,ref:t})})}),OWe=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Tl(gu,e.__scopeScrollArea),s=e.orientation==="horizontal",a=b5(()=>c("SCROLL_END"),100),[o,c]=TWe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return C.useEffect(()=>{if(o==="idle"){const u=window.setTimeout(()=>c("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(u)}},[o,i.scrollHideDelay,c]),C.useEffect(()=>{const u=i.viewport,d=s?"scrollLeft":"scrollTop";if(u){let h=u[d];const A=()=>{const f=u[d];h!==f&&(c("SCROLL"),a()),h=f};return u.addEventListener("scroll",A),()=>u.removeEventListener("scroll",A)}},[i.viewport,s,c,a]),l.jsx(ia,{present:n||o!=="hidden",children:l.jsx(KH,{"data-state":o==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:et(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:et(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Gfe=C.forwardRef((e,t)=>{const n=Tl(gu,e.__scopeScrollArea),{forceMount:r,...i}=e,[s,a]=C.useState(!1),o=e.orientation==="horizontal",c=b5(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;a(o?u:d)}},10);return bv(n.viewport,c),bv(n.content,c),l.jsx(ia,{present:r||s,children:l.jsx(KH,{"data-state":s?"visible":"hidden",...i,ref:t})})}),KH=C.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,i=Tl(gu,e.__scopeScrollArea),s=C.useRef(null),a=C.useRef(0),[o,c]=C.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=eAe(o.viewport,o.content),d={...r,sizes:o,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:A=>s.current=A,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:A=>a.current=A};function h(A,f){return UWe(A,a.current,o,f)}return n==="horizontal"?l.jsx(FWe,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const A=i.viewport.scrollLeft,f=zq(A,o,i.dir);s.current.style.transform=`translate3d(${f}px, 0, 0)`}},onWheelScroll:A=>{i.viewport&&(i.viewport.scrollLeft=A)},onDragScroll:A=>{i.viewport&&(i.viewport.scrollLeft=h(A,i.dir))}}):n==="vertical"?l.jsx(MWe,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const A=i.viewport.scrollTop,f=zq(A,o);s.current.style.transform=`translate3d(0, ${f}px, 0)`}},onWheelScroll:A=>{i.viewport&&(i.viewport.scrollTop=A)},onDragScroll:A=>{i.viewport&&(i.viewport.scrollTop=h(A))}}):null}),FWe=C.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=Tl(gu,e.__scopeScrollArea),[a,o]=C.useState(),c=C.useRef(null),u=Qt(t,c,s.onScrollbarXChange);return C.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),l.jsx(Xfe,{"data-orientation":"horizontal",...i,ref:u,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":w5(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(s.viewport){const A=s.viewport.scrollLeft+d.deltaX;e.onWheelScroll(A),nAe(A,h)&&d.preventDefault()}},onResize:()=>{c.current&&s.viewport&&a&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:jB(a.paddingLeft),paddingEnd:jB(a.paddingRight)}})}})}),MWe=C.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=Tl(gu,e.__scopeScrollArea),[a,o]=C.useState(),c=C.useRef(null),u=Qt(t,c,s.onScrollbarYChange);return C.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),l.jsx(Xfe,{"data-orientation":"vertical",...i,ref:u,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":w5(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(s.viewport){const A=s.viewport.scrollTop+d.deltaY;e.onWheelScroll(A),nAe(A,h)&&d.preventDefault()}},onResize:()=>{c.current&&s.viewport&&a&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:jB(a.paddingTop),paddingEnd:jB(a.paddingBottom)}})}})}),[LWe,Yfe]=Vfe(gu),Xfe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:s,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:h,...A}=e,f=Tl(gu,n),[p,m]=C.useState(null),g=Qt(t,E=>m(E)),y=C.useRef(null),v=C.useRef(""),x=f.viewport,w=r.content-r.viewport,b=$i(d),k=$i(c),j=b5(h,10);function B(E){if(y.current){const I=E.clientX-y.current.left,T=E.clientY-y.current.top;u({x:I,y:T})}}return C.useEffect(()=>{const E=I=>{const T=I.target;(p==null?void 0:p.contains(T))&&b(I,w)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[x,p,w,b]),C.useEffect(k,[r,k]),bv(p,j),bv(f.content,j),l.jsx(LWe,{scope:n,scrollbar:p,hasThumb:i,onThumbChange:$i(s),onThumbPointerUp:$i(a),onThumbPositionChange:k,onThumbPointerDown:$i(o),children:l.jsx(ut.div,{...A,ref:g,style:{position:"absolute",...A.style},onPointerDown:et(e.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),y.current=p.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),B(E))}),onPointerMove:et(e.onPointerMove,B),onPointerUp:et(e.onPointerUp,E=>{const I=E.target;I.hasPointerCapture(E.pointerId)&&I.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=v.current,f.viewport&&(f.viewport.style.scrollBehavior=""),y.current=null})})})}),_B="ScrollAreaThumb",Jfe=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Yfe(_B,e.__scopeScrollArea);return l.jsx(ia,{present:n||i.hasThumb,children:l.jsx(RWe,{ref:t,...r})})}),RWe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,s=Tl(_B,n),a=Yfe(_B,n),{onThumbPositionChange:o}=a,c=Qt(t,h=>a.onThumbChange(h)),u=C.useRef(void 0),d=b5(()=>{u.current&&(u.current(),u.current=void 0)},100);return C.useEffect(()=>{const h=s.viewport;if(h){const A=()=>{if(d(),!u.current){const f=HWe(h,o);u.current=f,o()}};return o(),h.addEventListener("scroll",A),()=>h.removeEventListener("scroll",A)}},[s.viewport,d,o]),l.jsx(ut.div,{"data-state":a.hasThumb?"visible":"hidden",...i,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:et(e.onPointerDownCapture,h=>{const f=h.target.getBoundingClientRect(),p=h.clientX-f.left,m=h.clientY-f.top;a.onThumbPointerDown({x:p,y:m})}),onPointerUp:et(e.onPointerUp,a.onThumbPointerUp)})});Jfe.displayName=_B;var qH="ScrollAreaCorner",Zfe=C.forwardRef((e,t)=>{const n=Tl(qH,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?l.jsx(DWe,{...e,ref:t}):null});Zfe.displayName=qH;var DWe=C.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=Tl(qH,n),[s,a]=C.useState(0),[o,c]=C.useState(0),u=!!(s&&o);return bv(i.scrollbarX,()=>{var h;const d=((h=i.scrollbarX)==null?void 0:h.offsetHeight)||0;i.onCornerHeightChange(d),c(d)}),bv(i.scrollbarY,()=>{var h;const d=((h=i.scrollbarY)==null?void 0:h.offsetWidth)||0;i.onCornerWidthChange(d),a(d)}),u?l.jsx(ut.div,{...r,ref:t,style:{width:s,height:o,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function jB(e){return e?parseInt(e,10):0}function eAe(e,t){const n=e/t;return isNaN(n)?0:n}function w5(e){const t=eAe(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function UWe(e,t,n,r="ltr"){const i=w5(n),s=i/2,a=t||s,o=i-a,c=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-o,d=n.content-n.viewport,h=r==="ltr"?[0,d]:[d*-1,0];return tAe([c,u],h)(e)}function zq(e,t,n="ltr"){const r=w5(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,a=t.content-t.viewport,o=s-r,c=n==="ltr"?[0,a]:[a*-1,0],u=p1(e,c);return tAe([0,a],[0,o])(u)}function tAe(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function nAe(e,t){return e>0&&e<t}var HWe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const s={left:e.scrollLeft,top:e.scrollTop},a=n.left!==s.left,o=n.top!==s.top;(a||o)&&t(),n=s,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function b5(e,t){const n=$i(e),r=C.useRef(0);return C.useEffect(()=>()=>window.clearTimeout(r.current),[]),C.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function bv(e,t){const n=$i(t);qi(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var rAe=Kfe,QWe=Wfe,$We=Zfe;const iAe=C.forwardRef(({className:e,children:t,...n},r)=>l.jsxs(rAe,{ref:r,className:it("relative overflow-hidden",e),...n,children:[l.jsx(QWe,{className:"h-full w-full rounded-[inherit]",children:t}),l.jsx(sAe,{}),l.jsx($We,{})]}));iAe.displayName=rAe.displayName;const sAe=C.forwardRef(({className:e,orientation:t="vertical",...n},r)=>l.jsx(VH,{ref:r,orientation:t,className:it("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:l.jsx(Jfe,{className:"relative flex-1 rounded-full bg-border"})}));sAe.displayName=VH.displayName;const BB=({selectedId:e,onSelect:t,label:n})=>{const[r,i]=C.useState(!1),{data:s}=f0(),a=(s||[]).filter(u=>u.media_type==="stock_photo"),o=a.find(u=>u.id===e),c=o?vc(o.file_path):null;return l.jsxs("div",{className:"space-y-1.5",children:[n&&l.jsx("label",{className:"text-xs font-medium text-muted-foreground block",children:n}),l.jsxs(UM,{open:r,onOpenChange:i,children:[l.jsx(HM,{asChild:!0,children:l.jsx(xe,{variant:"outline",className:it("relative h-auto min-h-[80px] w-full justify-start p-0 overflow-hidden",!c&&"border-dashed"),children:c?l.jsxs("div",{className:"relative w-full",children:[l.jsx("img",{src:c,alt:(o==null?void 0:o.alt_text)||"Selected",className:"w-full h-24 object-cover"}),l.jsx("button",{type:"button",className:"absolute top-1 right-1 bg-background/80 rounded-full p-1 hover:bg-destructive hover:text-destructive-foreground transition-colors",onClick:u=>{u.stopPropagation(),t(null)},children:l.jsx(ta,{className:"w-3 h-3"})})]}):l.jsxs("div",{className:"flex flex-col items-center justify-center w-full py-4 text-muted-foreground",children:[l.jsx(P2e,{className:"w-5 h-5 mb-1"}),l.jsx("span",{className:"text-xs",children:"Pick image"})]})})}),l.jsx(CB,{className:"w-80 p-2",align:"start",children:l.jsx(iAe,{className:"h-64",children:a.length===0?l.jsx("p",{className:"text-xs text-muted-foreground text-center py-8",children:"No stock photos uploaded yet."}):l.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:a.map(u=>{const d=vc(u.file_path),h=u.id===e;return l.jsx("button",{type:"button",className:it("aspect-square overflow-hidden rounded border-2 transition-all",h?"border-primary ring-2 ring-primary/30":"border-transparent hover:border-accent/50"),onClick:()=>{t(u.id),i(!1)},children:l.jsx("img",{src:d,alt:u.alt_text||u.file_name,className:"w-full h-full object-cover",loading:"lazy"})},u.id)})})})})]})]})},aAe=({category:e})=>{const t=ofe(),[n,r]=C.useState(e.context||""),[i,s]=C.useState(e.intro_text||""),[a,o]=C.useState(e.faq_json||[]),[c,u]=C.useState(e.faq_title||""),[d,h]=C.useState(e.video_url||""),[A,f]=C.useState(e.video_orientation||"horizontal"),[p,m]=C.useState(e.video_transcript||""),[g,y]=C.useState(e.video_headline||""),[v,x]=C.useState(e.cta_headline||""),[w,b]=C.useState(e.cover_image_id||null),[k,j]=C.useState(e.content_image_ids||[]),[B,E]=C.useState(e.stats_json||[]),[I,T]=C.useState(""),[N,F]=C.useState(!1),[L,U]=C.useState(!1),[H,K]=C.useState(!1),[$,z]=C.useState(null),[Q,oe]=C.useState([]);C.useEffect(()=>{r(e.context||""),s(e.intro_text||""),o(e.faq_json||[]),u(e.faq_title||""),h(e.video_url||""),f(e.video_orientation||"horizontal"),m(e.video_transcript||""),y(e.video_headline||""),x(e.cta_headline||""),b(e.cover_image_id||null),j(e.content_image_ids||[]),E(e.stats_json||[])},[e.id]);const R=i.split(`

`).filter(Boolean);C.useEffect(()=>{j(ae=>{const he=[...ae];for(;he.length<R.length;)he.push(null);return he.slice(0,R.length)})},[R.length]);const M=()=>o([...a,{question:"",answer:""}]),Y=(ae,he,ie)=>{const Ce=[...a];Ce[ae]={...Ce[ae],[he]:ie},o(Ce)},X=ae=>o(a.filter((he,ie)=>ie!==ae)),q=async()=>{if(!I.trim()){De({title:"Enter a prompt",description:"Describe the FAQ topics you want generated.",variant:"destructive"});return}F(!0),z(null);try{const{data:ae,error:he}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"generate-category-faq",prompt:I.trim(),category_name:e.name,category_slug:e.slug,category_context:n||e.context||null,count:6}});if(he)throw he;if(ae!=null&&ae.error)throw new Error(ae.error);z(ae.faq_items||[]),De({title:"FAQ generated!",description:"Review the items below, then approve to add them."})}catch(ae){De({title:"Generation failed",description:ae.message,variant:"destructive"})}finally{F(!1)}},Z=()=>{$&&(o($),u(I.trim()),z(null),T(""),De({title:"FAQ applied",description:"Don't forget to save!"}))},de=()=>{z(null)},ue=async()=>{const ae=a.map(je=>`${je.question} ${je.answer}`).join(" "),he=`${i} ${ae}`,ie=Ff(he);oe(ie),ie.length>0&&De({title:"Fair Housing warnings found",description:"Review the warnings below. Critical issues should be fixed.",variant:"destructive"});const Ce=i.split(`

`).filter(Boolean);let Oe=[];if(Ce.length>0)try{const{data:je,error:tt}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"generate-section-headings",paragraphs:Ce,category_name:e.name,category_context:n||e.context||null}});!tt&&(je!=null&&je.headings)&&(Oe=je.headings)}catch{}const te=k.slice(0,Ce.length).map(je=>je||null).filter(je=>je!==null);try{await t.mutateAsync({id:e.id,context:n||null,intro_text:i||null,faq_json:a.filter(je=>je.question.trim()&&je.answer.trim()),faq_title:c||null,video_url:d||null,video_orientation:A,video_transcript:p||null,video_headline:g||null,cta_headline:v||null,section_headings:Oe,cover_image_id:w||null,content_image_ids:te,stats_json:B.filter(je=>je.label.trim()&&je.value.trim())}),De({title:"Category content saved"})}catch(je){De({title:"Error",description:je.message,variant:"destructive"})}};return l.jsxs("div",{className:"space-y-6 pt-4 border-t border-border/50 mt-4",children:[l.jsx("div",{children:l.jsx(BB,{selectedId:w,onSelect:b,label:"Cover Image (hero banner)"})}),l.jsxs("div",{children:[l.jsxs("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:["Category Context ",l.jsx("span",{className:"text-muted-foreground/60",children:"(not visible on site — guides AI generation)"})]}),l.jsx(Vi,{value:n,onChange:ae=>r(ae.target.value),placeholder:"Describe what this category is about, who it's for, and what angle to take.",className:"min-h-[80px] text-sm"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Category Intro (visible on landing page)"}),l.jsxs(xe,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:L,onClick:async()=>{U(!0);try{const{data:ae,error:he}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"generate-category-intro",category_name:e.name,category_slug:e.slug,category_context:n||e.context||null}});if(he)throw he;if(ae!=null&&ae.error)throw new Error(ae.error);s(ae.intro_text),De({title:"Intro generated!",description:"Review and edit, then save."})}catch(ae){De({title:"Generation failed",description:ae.message,variant:"destructive"})}finally{U(!1)}},children:[l.jsx(Ts,{className:"w-3 h-3 mr-1"}),L?"Generating...":"Generate with AI"]})]}),l.jsx(Vi,{value:i,onChange:ae=>s(ae.target.value),placeholder:"2-3 paragraphs about this topic in West Michigan. Separate paragraphs with a blank line.",className:"min-h-[120px] text-sm"})]}),R.length>0&&l.jsxs("div",{children:[l.jsxs("label",{className:"text-xs font-medium text-muted-foreground mb-2 block",children:["Content Block Images (",R.length," paragraphs)"]}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:R.map((ae,he)=>l.jsx(BB,{selectedId:k[he]||null,onSelect:ie=>{j(Ce=>{const Oe=[...Ce];return Oe[he]=ie,Oe})},label:`Block ${he+1}`},he))})]}),l.jsxs("div",{className:"border border-dashed border-border rounded p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Sre,{className:"w-4 h-4 text-muted-foreground"}),l.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Quick Stats ",l.jsx("span",{className:"text-muted-foreground/60",children:"(shown as stat pills on cards & stats band)"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(xe,{variant:"ghost",size:"sm",className:"h-7 text-xs",disabled:H,onClick:async()=>{K(!0);try{const ae=!e.parent_id,{data:he,error:ie}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"generate-neighborhood-stats",community_name:e.name,is_metro:ae}});if(ie)throw ie;if(he!=null&&he.error)throw new Error(he.error);E(he.stats||[]),De({title:"Stats generated!",description:"Review and edit, then save."})}catch(ae){De({title:"Generation failed",description:ae.message,variant:"destructive"})}finally{K(!1)}},children:[l.jsx(Ts,{className:"w-3 h-3 mr-1"}),H?"Looking up…":"Generate Stats"]}),l.jsxs(xe,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>E([...B,{label:"",value:"",icon:"pin"}]),children:[l.jsx(zp,{className:"w-3 h-3 mr-1"})," Add Manual"]})]})]}),B.map((ae,he)=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Xe,{value:ae.label,onChange:ie=>{const Ce=[...B];Ce[he]={...Ce[he],label:ie.target.value},E(Ce)},placeholder:"Label (e.g. Commute)",className:"text-sm flex-1"}),l.jsx(Xe,{value:ae.value,onChange:ie=>{const Ce=[...B];Ce[he]={...Ce[he],value:ie.target.value},E(Ce)},placeholder:"Value (e.g. 15 min)",className:"text-sm flex-1"}),l.jsxs(Fr,{value:ae.icon||"pin",onValueChange:ie=>{const Ce=[...B];Ce[he]={...Ce[he],icon:ie},E(Ce)},children:[l.jsx(Br,{className:"w-[100px] text-sm",children:l.jsx(Mr,{})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"car",children:"🚗 Commute"}),l.jsx(ft,{value:"trees",children:"🌳 Setting"}),l.jsx(ft,{value:"building",children:"🏗️ Build"}),l.jsx(ft,{value:"heart",children:"❤️ Vibe"}),l.jsx(ft,{value:"users",children:"👥 Population"}),l.jsx(ft,{value:"school",children:"🎓 Schools"}),l.jsx(ft,{value:"pin",children:"📍 Location"})]})]}),l.jsx(xe,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>E(B.filter((ie,Ce)=>Ce!==he)),children:l.jsx(jl,{className:"w-3.5 h-3.5"})})]},he)),B.length===0&&l.jsx("p",{className:"text-xs text-muted-foreground",children:"No stats yet. Add stats like commute time, setting, vibe, etc."})]}),l.jsxs("div",{className:"border border-dashed border-border rounded p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(Y2e,{className:"w-4 h-4 text-muted-foreground"}),l.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Category Video ",l.jsx("span",{className:"text-muted-foreground/60",children:"(optional YouTube embed)"})]})]}),l.jsx(Xe,{value:g,onChange:ae=>y(ae.target.value),placeholder:"Video headline, e.g. Watch: Your Guide to Downsizing in West Michigan",className:"text-sm"}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx(Xe,{value:d,onChange:ae=>h(ae.target.value),placeholder:"YouTube URL, e.g. https://youtube.com/watch?v=...",className:"text-sm flex-1"}),l.jsxs(Fr,{value:A,onValueChange:f,children:[l.jsx(Br,{className:"w-[140px] text-sm",children:l.jsx(Mr,{})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"horizontal",children:"Horizontal"}),l.jsx(ft,{value:"vertical",children:"Vertical"})]})]})]}),l.jsx(Vi,{value:p,onChange:ae=>m(ae.target.value),placeholder:"Paste the video transcript here (shown in an expandable accordion below the video)",className:"min-h-[80px] text-sm"})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"text-xs font-medium text-muted-foreground mb-1.5 block",children:["CTA Section Headline ",l.jsx("span",{className:"text-muted-foreground/60",children:"(bottom of category page)"})]}),l.jsx(Xe,{value:v,onChange:ae=>x(ae.target.value),placeholder:`e.g. Ready to Start Your ${e.name} Journey?`,className:"text-sm"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("label",{className:"text-xs font-medium text-muted-foreground",children:["Category FAQ (",a.length," items)"]}),l.jsxs(xe,{variant:"ghost",size:"sm",onClick:M,className:"h-7 text-xs",children:[l.jsx(zp,{className:"w-3 h-3 mr-1"})," Add Manual"]})]}),l.jsxs("div",{className:"border border-dashed border-border rounded p-3 mb-4 space-y-2",children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground block",children:"Generate FAQ with AI"}),l.jsx(Xe,{value:I,onChange:ae=>T(ae.target.value),placeholder:"e.g. Common questions about downsizing in the Grand Rapids market",className:"text-sm",onKeyDown:ae=>ae.key==="Enter"&&!N&&q()}),l.jsxs(xe,{size:"sm",onClick:q,disabled:!I.trim()||N,className:"btn-gold border-0 text-xs",children:[l.jsx(Ts,{className:"w-3 h-3 mr-1"}),N?"Generating...":"Generate FAQ"]})]}),$&&l.jsxs("div",{className:"border border-primary/30 bg-primary/5 rounded p-4 mb-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-xs font-medium text-primary",children:["Generated ",$.length," FAQ items — review below"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(xe,{size:"sm",variant:"outline",onClick:de,className:"h-7 text-xs",children:[l.jsx(ta,{className:"w-3 h-3 mr-1"})," Discard"]}),l.jsxs(xe,{size:"sm",onClick:Z,className:"h-7 text-xs btn-gold border-0",children:[l.jsx(Fo,{className:"w-3 h-3 mr-1"})," Approve & Replace"]})]})]}),$.map((ae,he)=>l.jsxs("div",{className:"border border-border/50 rounded p-3 space-y-1 bg-background",children:[l.jsx("p",{className:"text-sm font-medium",children:ae.question}),l.jsx("p",{className:"text-sm text-muted-foreground",children:ae.answer})]},he))]}),l.jsx("div",{className:"space-y-3",children:a.map((ae,he)=>l.jsxs("div",{className:"border border-border/50 rounded p-3 space-y-2",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(Xe,{value:ae.question,onChange:ie=>Y(he,"question",ie.target.value),placeholder:"Question...",className:"text-sm"}),l.jsx(xe,{variant:"ghost",size:"icon",className:"h-9 w-9 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>X(he),children:l.jsx(jl,{className:"w-3.5 h-3.5"})})]}),l.jsx(Vi,{value:ae.answer,onChange:ie=>Y(he,"answer",ie.target.value),placeholder:"Answer...",className:"text-sm min-h-[60px]"})]},he))})]}),l.jsx(Rhe,{violations:Q}),l.jsxs(xe,{onClick:ue,disabled:t.isPending,size:"sm",children:[l.jsx(Pb,{className:"w-3.5 h-3.5 mr-1.5"}),t.isPending?"Saving...":"Save Content"]})]})},zWe=()=>{const{data:e}=eA(),{configMap:t}=Os(),n=sfe(),r=g5(),[i,s]=C.useState(""),[a,o]=C.useState(""),[c,u]=C.useState(""),[d,h]=C.useState(""),[A,f]=C.useState(""),[p,m]=C.useState(""),[g,y]=C.useState(null),[v,x]=C.useState(!1),w=(e||[]).find(k=>k.slug==="news"&&k.parent_id!==null),b=async()=>{if(!i.trim()||!a.trim()){De({title:"Title and press release content are required",variant:"destructive"});return}if(!w){De({title:"News category not found",variant:"destructive"});return}x(!0);try{const k={national:d.trim()||null,local:A.trim()||null,source:p.trim()||null},{data:j,error:B}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"create-press-release",title:i.trim(),press_content:a.trim(),press_links:k,date_published:c||new Date().toISOString().split("T")[0],agent_name:t.agent_name,agent_market:t.agent_market}});if(B)throw B;if(j!=null&&j.error)throw new Error(j.error);const E=j.slug||i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),I=await n.mutateAsync({category_id:w.id,title:i.trim(),slug:E,h1:j.h1||i.trim(),is_parent:!1,status:"draft",cover_image_id:g});await r.mutateAsync({id:I.id,h1:j.h1,subheadline:j.subheadline,intro_text:j.intro_text,body_content:j.body_content,faq_json:j.faq_json,meta_title:j.meta_title,meta_description:j.meta_description,schema_markup:j.schema_markup,press_links:j.press_links}),De({title:"Press release created!",description:`Slug: /about/news/${E} — ready for review in Page Generator.`}),s(""),o(""),u(""),h(""),f(""),m(""),y(null)}catch(k){De({title:"Error",description:k.message,variant:"destructive"})}finally{x(!1)}};return l.jsxs("div",{className:"border border-border rounded p-6 space-y-6",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(U2e,{className:"w-5 h-5 text-accent"}),l.jsx("h3",{className:"font-serif text-xl",children:"New Press Release"})]}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Paste your press release below. The system will wrap it with your entity information, generate FAQs, and build proper NewsArticle schema automatically."}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(ht,{className:"text-xs uppercase tracking-wider",children:"Headline / Title"}),l.jsx(Xe,{value:i,onChange:k=>s(k.target.value),placeholder:"e.g., Holden Smith Named Top Agent in Grand Rapids for 2026"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(ht,{className:"text-xs uppercase tracking-wider",children:"Date Published"}),l.jsx(Xe,{type:"date",value:c,onChange:k=>u(k.target.value)})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(ht,{className:"text-xs uppercase tracking-wider",children:"Press Release Content"}),l.jsx(Vi,{value:a,onChange:k=>o(k.target.value),placeholder:"Paste the full press release text here...",rows:12,className:"font-mono text-sm"})]}),l.jsxs("div",{className:"border border-border/50 rounded p-4 space-y-3 bg-muted/30",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(eo,{className:"w-4 h-4 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"Pickup Links"})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Where was this press release picked up? Add links to each version."}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(ht,{className:"text-xs uppercase tracking-wider",children:"National"}),l.jsx(Xe,{value:d,onChange:k=>h(k.target.value),placeholder:"https://prnewswire.com/..."})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(ht,{className:"text-xs uppercase tracking-wider",children:"Local"}),l.jsx(Xe,{value:A,onChange:k=>f(k.target.value),placeholder:"https://localnews.com/..."})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx(ht,{className:"text-xs uppercase tracking-wider",children:"Source"}),l.jsx(Xe,{value:p,onChange:k=>m(k.target.value),placeholder:"https://yourbrokerage.com/..."})]})]})]}),l.jsxs("div",{className:"flex items-end gap-4",children:[l.jsx("div",{className:"w-40",children:l.jsx(BB,{selectedId:g,onSelect:y,label:"Cover Image"})}),l.jsxs(xe,{onClick:b,disabled:!i.trim()||!a.trim()||v,className:"btn-gold border-0",children:[l.jsx(Ts,{className:"w-4 h-4 mr-2"}),v?"Processing...":"Create Press Release"]})]})]})]})},VWe=({categoryId:e})=>{const{data:t}=Cc(),n=g5(),r=afe(),i=(t||[]).filter(o=>o.category_id===e).sort((o,c)=>new Date(c.created_at).getTime()-new Date(o.created_at).getTime()),s=async o=>{await n.mutateAsync({id:o.id,status:"published",published_at:new Date().toISOString()}),De({title:"Published!",description:`"${o.title}" is now live.`})},a=async o=>{await r.mutateAsync(o),De({title:"Press release deleted"})};return l.jsxs("div",{className:"space-y-6 pt-4 border-t border-border/50 mt-4",children:[l.jsx(zWe,{}),i.length>0&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("h4",{className:"font-serif text-lg",children:["Press Releases (",i.length,")"]}),l.jsx("div",{className:"space-y-2",children:i.map(o=>l.jsxs("div",{className:"flex items-center justify-between p-3 border border-border rounded",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[l.jsx(qt,{variant:o.status==="published"?"default":"secondary",className:"text-xs capitalize",children:o.status}),l.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(o.created_at).toLocaleDateString()})]}),l.jsx("p",{className:"font-serif text-sm truncate",children:o.title}),o.press_links&&l.jsxs("div",{className:"flex gap-3 mt-1",children:[o.press_links.national&&l.jsx("a",{href:o.press_links.national,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-accent hover:underline",children:"National ↗"}),o.press_links.local&&l.jsx("a",{href:o.press_links.local,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-accent hover:underline",children:"Local ↗"}),o.press_links.source&&l.jsx("a",{href:o.press_links.source,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-accent hover:underline",children:"Source ↗"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[o.status==="draft"&&l.jsxs(xe,{size:"sm",onClick:()=>s(o),className:"btn-gold border-0 text-xs",children:[l.jsx(C2,{className:"w-3 h-3 mr-1"})," Publish"]}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>a(o.id),children:l.jsx(jl,{className:"w-3 h-3"})})]})]},o.id))})]})]})},Xw=doe,Jw=w6,Zw=C6;var C5="Checkbox",[KWe,APt]=Wi(C5),[qWe,WH]=KWe(C5);function WWe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:s,form:a,name:o,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:h}=e,[A,f]=ja({prop:n,defaultProp:i??!1,onChange:c,caller:C5}),[p,m]=C.useState(null),[g,y]=C.useState(null),v=C.useRef(!1),x=p?!!a||!!p.closest("form"):!0,w={checked:A,disabled:s,setChecked:f,control:p,setControl:m,name:o,form:a,value:d,hasConsumerStoppedPropagationRef:v,required:u,defaultChecked:mf(i)?!1:i,isFormControl:x,bubbleInput:g,setBubbleInput:y};return l.jsx(qWe,{scope:t,...w,children:GWe(h)?h(w):r})}var oAe="CheckboxTrigger",lAe=C.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:s,value:a,disabled:o,checked:c,required:u,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:A,isFormControl:f,bubbleInput:p}=WH(oAe,e),m=Qt(i,d),g=C.useRef(c);return C.useEffect(()=>{const y=s==null?void 0:s.form;if(y){const v=()=>h(g.current);return y.addEventListener("reset",v),()=>y.removeEventListener("reset",v)}},[s,h]),l.jsx(ut.button,{type:"button",role:"checkbox","aria-checked":mf(c)?"mixed":c,"aria-required":u,"data-state":fAe(c),"data-disabled":o?"":void 0,disabled:o,value:a,...r,ref:m,onKeyDown:et(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:et(n,y=>{h(v=>mf(v)?!0:!v),p&&f&&(A.current=y.isPropagationStopped(),A.current||y.stopPropagation())})})});lAe.displayName=oAe;var GH=C.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:c,onCheckedChange:u,form:d,...h}=e;return l.jsx(WWe,{__scopeCheckbox:n,checked:i,defaultChecked:s,disabled:o,required:a,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:A})=>l.jsxs(l.Fragment,{children:[l.jsx(lAe,{...h,ref:t,__scopeCheckbox:n}),A&&l.jsx(hAe,{__scopeCheckbox:n})]})})});GH.displayName=C5;var cAe="CheckboxIndicator",uAe=C.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,s=WH(cAe,n);return l.jsx(ia,{present:r||mf(s.checked)||s.checked===!0,children:l.jsx(ut.span,{"data-state":fAe(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});uAe.displayName=cAe;var dAe="CheckboxBubbleInput",hAe=C.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:a,required:o,disabled:c,name:u,value:d,form:h,bubbleInput:A,setBubbleInput:f}=WH(dAe,e),p=Qt(n,f),m=D2(s),g=k2(r);C.useEffect(()=>{const v=A;if(!v)return;const x=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(x,"checked").set,k=!i.current;if(m!==s&&b){const j=new Event("click",{bubbles:k});v.indeterminate=mf(s),b.call(v,mf(s)?!1:s),v.dispatchEvent(j)}},[A,m,s,i]);const y=C.useRef(mf(s)?!1:s);return l.jsx(ut.input,{type:"checkbox","aria-hidden":!0,defaultChecked:a??y.current,required:o,disabled:c,name:u,value:d,form:h,...t,tabIndex:-1,ref:p,style:{...t.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});hAe.displayName=dAe;function GWe(e){return typeof e=="function"}function mf(e){return e==="indeterminate"}function fAe(e){return mf(e)?"indeterminate":e?"checked":"unchecked"}const no=C.forwardRef(({className:e,...t},n)=>l.jsx(GH,{ref:n,className:it("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:l.jsx(uAe,{className:it("flex items-center justify-center text-current"),children:l.jsx(Fo,{className:"h-4 w-4"})})}));no.displayName=GH.displayName;var YH="Progress",XH=100,[YWe,pPt]=Wi(YH),[XWe,JWe]=YWe(YH),AAe=C.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:s=ZWe,...a}=e;(i||i===0)&&!Vq(i)&&console.error(eGe(`${i}`,"Progress"));const o=Vq(i)?i:XH;r!==null&&!Kq(r,o)&&console.error(tGe(`${r}`,"Progress"));const c=Kq(r,o)?r:null,u=NB(c)?s(c,o):void 0;return l.jsx(XWe,{scope:n,value:c,max:o,children:l.jsx(ut.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":NB(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":gAe(c,o),"data-value":c??void 0,"data-max":o,...a,ref:t})})});AAe.displayName=YH;var pAe="ProgressIndicator",mAe=C.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=JWe(pAe,n);return l.jsx(ut.div,{"data-state":gAe(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});mAe.displayName=pAe;function ZWe(e,t){return`${Math.round(e/t*100)}%`}function gAe(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function NB(e){return typeof e=="number"}function Vq(e){return NB(e)&&!isNaN(e)&&e>0}function Kq(e,t){return NB(e)&&!isNaN(e)&&e<=t&&e>=0}function eGe(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${XH}\`.`}function tGe(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
  - a positive number
  - less than the value passed to \`max\` (or ${XH} if no \`max\` prop is set)
  - \`null\` or \`undefined\` if the progress is indeterminate.

Defaulting to \`null\`.`}var yAe=AAe,nGe=mAe;const Cv=C.forwardRef(({className:e,value:t,...n},r)=>l.jsx(yAe,{ref:r,className:it("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:l.jsx(nGe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Cv.displayName=yAe.displayName;const vAe="aeo-blueprint-suggestions";function v_(){try{return JSON.parse(localStorage.getItem(vAe)||"[]")}catch{return[]}}function x_(e){localStorage.setItem(vAe,JSON.stringify(e)),window.dispatchEvent(new Event("blueprint-suggestions-updated"))}const qq={buying:"bg-blue-100 text-blue-800",selling:"bg-green-100 text-green-800",neighborhoods:"bg-purple-100 text-purple-800","market-insights":"bg-orange-100 text-orange-800",luxury:"bg-amber-100 text-amber-800",general:"bg-gray-100 text-gray-800"},xAe=({open:e,onOpenChange:t,siteDomain:n,questions:r,metro:i,state:s,onImported:a})=>{const[o,c]=C.useState("generating"),[u,d]=C.useState(null),[h,A]=C.useState([]),[f,p]=C.useState(0),[m,g]=C.useState(0),[y,v]=C.useState(""),[x,w]=C.useState(new Set),[b,k]=C.useState({}),[j,B]=C.useState(!1),{data:E}=Cc(),I="khmmwvmdbhaplcfcndjx",T="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",N=C.useMemo(()=>{const R=new Set;return(E||[]).forEach(M=>R.add(M.title.toLowerCase().trim())),R},[E]),F=R=>N.has(R.toLowerCase().trim());C.useEffect(()=>{e&&r.length>0&&(c("generating"),d(null),A([]),p(0),g(0),v(""),w(new Set),k({}),L())},[e]);const L=async()=>{try{const R=await fetch(`https://${I}.supabase.co/functions/v1/generate-blueprint`,{method:"POST",headers:{"Content-Type":"application/json",apikey:T},body:JSON.stringify({questions:r.map(Z=>({question:Z.question,category:Z.category,citability_score:Z.citability_score})),metro:i,state:s,site_domain:n})});if(!R.ok||!R.body)throw new Error(await R.text()||"Failed to start blueprint generation");const M=R.body.getReader(),Y=new TextDecoder;let X="",q=null;for(;;){const{done:Z,value:de}=await M.read();if(Z)break;X+=Y.decode(de,{stream:!0});let ue;for(;(ue=X.indexOf(`

`))!==-1;){const ae=X.slice(0,ue).trim();if(X=X.slice(ue+2),!ae.startsWith("data: "))continue;const he=ae.slice(6).trim();if(he!=="[DONE]")try{const ie=JSON.parse(he);switch(ie.type){case"status":v(ie.message),ie.total&&g(ie.total);break;case"progress":v(ie.message),p(ie.completed),ie.total&&g(ie.total);break;case"title_complete":A(Ce=>[...Ce,{original_question:ie.original_question,page_title:ie.page_title,category:ie.category,citability_score:ie.citability_score}]),p(ie.index+1);break;case"filter_complete":v(ie.message);break;case"error":throw new Error(ie.message);case"result":q=ie;break}}catch(ie){if(ie.message&&!ie.message.includes("JSON"))throw ie}}}if(q){d(q);const Z=new Set;q.titles.forEach((de,ue)=>{F(de.page_title)||Z.add(ue)}),w(Z),c("review")}else throw new Error("No results received")}catch(R){De({title:"Blueprint generation failed",description:R.message,variant:"destructive"}),t(!1)}},U=R=>{w(M=>{const Y=new Set(M);return Y.has(R)?Y.delete(R):Y.add(R),Y})},H=()=>{if(!u)return;const R=u.titles.every((M,Y)=>x.has(Y));w(R?new Set:new Set(u.titles.map((M,Y)=>Y)))},K=(u==null?void 0:u.titles)||[],$=C.useMemo(()=>{let R=0;return K.forEach((M,Y)=>{if(!x.has(Y))return;const X=b[Y]??M.page_title;F(X)||R++}),R},[K,x,b,N]),z=()=>{if(!u||$===0)return;B(!0);const R=v_(),M=new Set(R.map(X=>X.page_title.toLowerCase().trim())),Y=[];K.forEach((X,q)=>{if(!x.has(q))return;const Z=b[q]??X.page_title;F(Z)||M.has(Z.toLowerCase().trim())||Y.push({original_question:X.original_question,page_title:Z,category:X.category,citability_score:X.citability_score})}),x_([...R,...Y]),De({title:"Suggestions saved!",description:`Added ${Y.length} title suggestions to the Blueprint tab.`}),B(!1),a(),t(!1)},Q=m>0?Math.round(f/m*100):0,oe=R=>R>=4?"bg-green-500":R>=3?"bg-yellow-500":"bg-orange-500";return l.jsx(No,{open:e,onOpenChange:t,children:l.jsxs(Ka,{className:"max-w-4xl max-h-[90vh] flex flex-col p-0",children:[l.jsx(qa,{className:"px-6 pt-6 pb-4 border-b",children:l.jsxs(Wa,{className:"flex items-center gap-2",children:[l.jsx(Ts,{className:"w-5 h-5 text-primary"})," FAQ Page Title Generator"]})}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[o==="generating"&&l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 space-y-4 max-w-lg mx-auto",children:[l.jsx(Ba,{className:"w-10 h-10 animate-spin text-primary"}),l.jsxs("div",{className:"text-center space-y-2 w-full",children:[l.jsx("p",{className:"font-medium",children:"Generating FAQ page titles..."}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Analyzing ",r.length," questions one at a time"]}),m>0&&l.jsxs("div",{className:"space-y-1 pt-2",children:[l.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[l.jsxs("span",{children:[f,"/",m," titles"]}),l.jsxs("span",{children:[Q,"%"]})]}),l.jsx(Cv,{value:Q,className:"h-3"})]}),y&&l.jsx("p",{className:"text-xs text-muted-foreground truncate pt-1",children:y})]})]}),h.length>0&&l.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[l.jsxs("div",{className:"bg-muted/40 px-3 py-2 text-xs font-medium text-muted-foreground",children:["Titles generated so far (",h.length,")"]}),l.jsx("div",{className:"max-h-64 overflow-y-auto divide-y",children:h.map((R,M)=>l.jsxs("div",{className:"px-3 py-2 flex items-center gap-3 text-sm",children:[l.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${oe(R.citability_score)}`}),l.jsx("span",{className:"text-muted-foreground truncate flex-1",children:R.original_question}),l.jsx(Va,{className:"w-3 h-3 text-muted-foreground shrink-0"}),l.jsx("span",{className:"font-medium truncate flex-1",children:R.page_title})]},M))})]})]}),o==="review"&&u&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4 space-y-1",children:[l.jsxs("p",{className:"font-medium",children:[u.total_titles," FAQ Page Titles Generated"]}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:[u.metro,", ",u.state]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Review and edit titles, then save them as suggestions in the Blueprint tab."})]}),l.jsxs("div",{className:"flex items-center gap-2 px-1",children:[l.jsx(no,{checked:K.length>0&&K.every((R,M)=>x.has(M)),onCheckedChange:H}),l.jsxs("span",{className:"text-sm text-muted-foreground",children:["Select all (",K.length,")"]}),l.jsxs("span",{className:"text-xs text-muted-foreground ml-auto",children:[x.size," selected"]})]}),l.jsx("div",{className:"border rounded-lg divide-y max-h-[50vh] overflow-y-auto",children:K.map((R,M)=>{const Y=b[M]??R.page_title,X=F(Y),q=qq[R.category]||qq.general;return l.jsxs("div",{className:"px-3 py-2.5 flex items-start gap-2.5 hover:bg-muted/20",children:[l.jsx(no,{checked:x.has(M),onCheckedChange:()=>U(M),className:"mt-1"}),l.jsx($p,{className:"w-3.5 h-3.5 text-muted-foreground mt-1.5 shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{className:"flex-1 bg-transparent border-none outline-none text-sm font-medium focus:ring-1 focus:ring-primary rounded px-1 py-0.5",value:Y,onChange:Z=>k(de=>({...de,[M]:Z.target.value}))}),X&&l.jsx(qt,{variant:"outline",className:"text-[10px] shrink-0 border-amber-400 text-amber-600",children:"Already exists"})]}),l.jsxs("p",{className:"text-[11px] text-muted-foreground truncate",children:["Original: ",R.original_question]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0 mt-1",children:[l.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-[10px] ${q}`,children:R.category}),l.jsx("div",{className:`w-2 h-2 rounded-full ${oe(R.citability_score)}`}),l.jsx("span",{className:"text-xs text-muted-foreground w-6 text-right",children:R.citability_score.toFixed(1)})]})]},M)})})]})]}),o==="review"&&u&&l.jsxs("div",{className:"border-t bg-background px-6 py-4 flex items-center justify-between",children:[l.jsxs("p",{className:"text-sm text-muted-foreground",children:[$," title suggestions to save"]}),l.jsxs(xe,{onClick:z,disabled:$===0||j,children:[j?l.jsx(Ba,{className:"w-4 h-4 mr-2 animate-spin"}):l.jsx(Fo,{className:"w-4 h-4 mr-2"}),"Save Suggestions"]})]})]})})},Wq=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),rGe=(e,t,n)=>e<t?l.jsxs(qt,{variant:"outline",className:"text-xs border-yellow-500 text-yellow-600",children:["Low (",e,")"]}):e>n?l.jsxs(qt,{variant:"outline",className:"text-xs border-destructive text-destructive",children:["Over (",e,")"]}):l.jsxs(qt,{variant:"outline",className:"text-xs border-green-500 text-green-600",children:["Healthy (",e,")"]}),iGe=({sub:e,pages:t,onUpdate:n,onDelete:r})=>{const i=t.filter(o=>o.category_id===e.id).length,[s,a]=C.useState(!1);return l.jsxs("div",{className:`border rounded p-3 space-y-2 ml-4 transition-opacity ${e.enabled?"border-border/60":"border-border/30 opacity-60"}`,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-sm",children:e.icon||"📁"}),l.jsx("span",{className:"font-serif text-sm font-medium",children:e.name}),l.jsx(qt,{variant:"outline",className:"text-xs",children:"Sub"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("span",{className:"text-xs text-muted-foreground",children:[i," page(s)"]}),l.jsx(xe,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>r(e,i),children:l.jsx(jl,{className:"w-3 h-3"})}),l.jsx(pc,{checked:e.enabled,onCheckedChange:o=>n(e.id,{enabled:o})})]})]}),l.jsx(xe,{variant:"ghost",size:"sm",className:"text-xs w-full justify-start text-muted-foreground hover:text-foreground",onClick:()=>a(!s),children:s?"▾ Hide Content":"▸ Edit Content"}),s&&(e.slug==="news"?l.jsx(VWe,{categoryId:e.id}):l.jsx(aAe,{category:e}))]})},sGe=({cat:e,allCategories:t,pages:n,onUpdate:r,onDelete:i,isAeo:s,onAddSubcategory:a})=>{const o=n.filter(f=>f.category_id===e.id).length,c=t.filter(f=>f.parent_id===e.id),[u,d]=C.useState(!1),[h,A]=C.useState(!1);return l.jsxs("div",{className:`border rounded p-4 space-y-3 transition-opacity ${e.enabled?"border-border":"border-border/50 opacity-60"}`,children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-lg",children:e.icon||"📄"}),l.jsx("span",{className:"font-serif font-medium",children:e.name})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(xe,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:()=>i(e,o),children:l.jsx(jl,{className:"w-3.5 h-3.5"})}),l.jsx(pc,{checked:e.enabled,onCheckedChange:f=>r(e.id,{enabled:f})})]})]}),e.description&&l.jsx("p",{className:"text-xs text-muted-foreground",children:e.description}),s&&l.jsxs("div",{className:"flex items-center gap-3 text-xs",children:[l.jsxs("label",{className:"flex items-center gap-1",children:["Min",l.jsx(Xe,{type:"number",className:"w-16 h-7 text-xs",value:e.min_pages,onChange:f=>r(e.id,{min_pages:parseInt(f.target.value)||0})})]}),l.jsx("span",{className:"text-muted-foreground",children:"—"}),l.jsxs("label",{className:"flex items-center gap-1",children:["Max",l.jsx(Xe,{type:"number",className:"w-16 h-7 text-xs",value:e.max_pages,onChange:f=>r(e.id,{max_pages:parseInt(f.target.value)||0})})]}),l.jsx("div",{className:"ml-auto",children:rGe(o,e.min_pages,e.max_pages)})]}),(c.length>0||e.enabled)&&l.jsxs(Xw,{open:h,onOpenChange:A,children:[l.jsx(Jw,{asChild:!0,children:l.jsxs(xe,{variant:"ghost",size:"sm",className:"text-xs w-full justify-start text-muted-foreground hover:text-foreground gap-1",children:[l.jsx(hc,{className:`w-3 h-3 transition-transform ${h?"":"-rotate-90"}`}),"Sub-Categories (",c.length,")"]})}),l.jsxs(Zw,{className:"space-y-2 mt-2",children:[c.map(f=>l.jsx(iGe,{sub:f,pages:n,onUpdate:r,onDelete:i},f.id)),l.jsxs(xe,{variant:"outline",size:"sm",className:"text-xs ml-4",onClick:()=>a(e.id),children:[l.jsx(zp,{className:"w-3 h-3 mr-1"})," Add Sub-Category"]})]})]}),l.jsx(xe,{variant:"ghost",size:"sm",className:"text-xs w-full justify-start text-muted-foreground hover:text-foreground",onClick:()=>d(!u),children:u?"▾ Hide Landing Page Content":"▸ Edit Landing Page Content"}),u&&l.jsx(aAe,{category:e})]})},aGe=()=>{var N;const{data:e,isLoading:t}=eA(),{data:n}=Cc(),{isAeo:r}=ife(),i=ofe(),s=eWe(),a=Zqe(),[o,c]=C.useState(""),[u,d]=C.useState(""),[h,A]=C.useState(null),[f,p]=C.useState(null),[m,g]=C.useState(v_);C.useEffect(()=>{const F="aeo-blueprint-suggestions-seeded";if(localStorage.getItem(F))return;if(v_().length>0){localStorage.setItem(F,"1");return}const U=[{page_title:"What Grand Rapids neighborhoods are best for rental income?",category:"buying",original_question:"Which Grand Rapids neighborhoods currently offer the highest rental yields?",citability_score:4},{page_title:"How Can I Buy a Home in Grand Rapids Remotely?",category:"buying",original_question:"Can you recommend a relocation specialist in Grand Rapids who can help me buy a home remotely?",citability_score:4},{page_title:"How do I find a good real estate agent in Grand Rapids?",category:"buying",original_question:"How do I find and vet local agents who work specifically with first-time buyers in Grand Rapids?",citability_score:4},{page_title:"What are commute times like from nearby Grand Rapids suburbs?",category:"buying",original_question:"Can you connect me with agents who can advise on commute times from East Grand Rapids, Kentwood, or Wyoming?",citability_score:4},{page_title:"What are Grand Rapids investment property cap rates?",category:"buying",original_question:"What are the typical cap rates for different property types in various Grand Rapids neighborhoods?",citability_score:4},{page_title:"What Grand Rapids agents know about suburban commutes?",category:"buying",original_question:"Can you connect me with a Grand Rapids agent who knows commute times to downtown from suburbs?",citability_score:4},{page_title:"What's life like in Grand Rapids neighborhoods?",category:"buying",original_question:"Who is a trusted Grand Rapids realtor to explain what daily life is like in different neighborhoods?",citability_score:4},{page_title:"Where can I find Grand Rapids housing market data?",category:"buying",original_question:"Who can I contact in Grand Rapids to get neighborhood-by-neighborhood cost-of-living and housing market comparisons?",citability_score:4},{page_title:"Who Can Help Me Buy a Home in Grand Rapids Remotely?",category:"buying",original_question:"Can you recommend a Grand Rapids buyer's agent who specializes in out-of-state relocations?",citability_score:4},{page_title:"Who can help me find a Grand Rapids neighborhood for my lifestyle?",category:"buying",original_question:"Who are agents that specialize in relocations for tech professionals?",citability_score:4},{page_title:"Who Can Help Me Find Investment Properties in Grand Rapids?",category:"buying",original_question:"Could you recommend a real estate agent familiar with off-market or foreclosed investment property opportunities?",citability_score:4},{page_title:"Who Can Help Me Relocate to Grand Rapids?",category:"buying",original_question:"Recommend a realtor in Grand Rapids who specializes in helping people relocate from other states.",citability_score:4},{page_title:"Who can help me understand Grand Rapids costs for out-of-staters?",category:"buying",original_question:"Suggest a local expert in Grand Rapids to compare cost of living and home prices for out-of-staters.",citability_score:4},{page_title:"Who Helps Buyers Relocating to Grand Rapids?",category:"buying",original_question:"What agent in Grand Rapids helps with the full remote buying process for interstate moves?",citability_score:4},{page_title:"Who Helps Investors Buy Rental Properties in Grand Rapids?",category:"buying",original_question:"Are there any experienced real estate agents in Grand Rapids who primarily work with out-of-state investors?",citability_score:4},{page_title:"Who Specializes in Distressed Properties in Grand Rapids?",category:"buying",original_question:"I'm interested in understanding the current inventory of distressed properties suitable for renovation and resale.",citability_score:4},{page_title:"Who can help me sell my home in Grand Rapids?",category:"selling",original_question:"Which Grand Rapids realtors are known for getting multiple offers in the North Hill area?",citability_score:4},{page_title:"Who is the best Grand Rapids agent for life changes?",category:"selling",original_question:"Can you recommend a Grand Rapids real estate agent known for their compassionate approach with clients going through life transitions?",citability_score:4},{page_title:"Who can help me sell a home with many possessions in Grand Rapids?",category:"selling",original_question:"Can you suggest a Grand Rapids realtor who has experience with estate sales?",citability_score:4},{page_title:"What extra services do Grand Rapids agents offer?",category:"selling",original_question:"Who is a Grand Rapids agent that offers services beyond just buying and selling?",citability_score:4},{page_title:"What Grand Rapids realtors offer specialized senior services?",category:"selling",original_question:"Which Grand Rapids realtors will provide referrals for aging-in-place remodelers and senior support services?",citability_score:4},{page_title:"What's the best way to sell my Grand Rapids home?",category:"selling",original_question:"Can you suggest Grand Rapids agents who can evaluate whether a cash offer, an as-is sale, or a traditional MLS listing is best?",citability_score:4},{page_title:"Is East Grand Rapids a good place to live?",category:"neighborhoods",original_question:"Is East Grand Rapids a good place to raise a family?",citability_score:4},{page_title:"What's it like to live in Ada (Forest Hills)?",category:"neighborhoods",original_question:"What is it like to live in Ada MI (Forest Hills)?",citability_score:4},{page_title:"What's Forest Hills like for homebuyers?",category:"neighborhoods",original_question:"What are the schools, home styles, and commute times in Forest Hills?",citability_score:4},{page_title:"What's Eastown Grand Rapids Like for Homebuyers?",category:"neighborhoods",original_question:"Is Eastown in Grand Rapids safe and walkable, what are typical home prices?",citability_score:4},{page_title:"What should I know about buying in Heritage Hill?",category:"neighborhoods",original_question:"What should I know about buying and restoring a historic home in Heritage Hill?",citability_score:4},{page_title:"What's the downtown Grand Rapids market like?",category:"neighborhoods",original_question:"What's the downtown Grand Rapids condo market like?",citability_score:4},{page_title:"What's Kentwood like for homebuyers?",category:"neighborhoods",original_question:"How are the schools, neighborhoods, and home values in Kentwood?",citability_score:4},{page_title:"Is Wyoming, MI a good place to live for families?",category:"neighborhoods",original_question:"Is Wyoming MI a good suburban choice for families and affordability?",citability_score:4},{page_title:"Is Grandville a good place to buy a starter home?",category:"neighborhoods",original_question:"Is Grandville a good place to buy a starter home near Grand Rapids?",citability_score:4},{page_title:"What's it like to live in Rockford, MI?",category:"neighborhoods",original_question:"What is it like to live in Rockford MI—schools, downtown vibe, outdoor recreation?",citability_score:4},{page_title:"What's Holland MI like for buyers?",category:"neighborhoods",original_question:"How are the neighborhoods, schools, and commute options in Holland MI?",citability_score:4},{page_title:"Who Can Help Me Find a Home Near Steelcase?",category:"neighborhoods",original_question:"Do you know a specific realtor who has a strong track record of finding homes near Steelcase?",citability_score:4},{page_title:"Who Can Help Me Find a Home Near Major Highways in Grand Rapids?",category:"neighborhoods",original_question:"Can you connect me with a realty professional who specializes in homes with easy access to US-131?",citability_score:4},{page_title:"Which Grand Rapids agent can help me find a home near work?",category:"neighborhoods",original_question:"Which Grand Rapids real estate agent can map out commute times to SpartanNash headquarters?",citability_score:4},{page_title:"Who Helps Beaumont Health Employees Buy Homes?",category:"neighborhoods",original_question:"Which real estate agent specializes in helping Beaumont Health employees find homes?",citability_score:4},{page_title:"What Grand Rapids neighborhoods suit my commute?",category:"neighborhoods",original_question:"Are there Grand Rapids neighborhoods that offer a quick reverse commute to suburban job centers?",citability_score:4},{page_title:"What Grand Rapids neighborhoods are good for commuting to Walker?",category:"neighborhoods",original_question:"Where should I look if I need a 20-30 minute drive to the Meijer corporate campus in Walker?",citability_score:4},{page_title:"Who Sells Luxury Homes in Grand Rapids?",category:"luxury",original_question:"Can you recommend a specialist for off-market luxury homes in Grand Rapids?",citability_score:4},{page_title:"Who Sells Lakefront Homes Near Grand Rapids?",category:"luxury",original_question:"Who is the leading luxury home agent for lakefront properties near Grand Rapids?",citability_score:4},{page_title:"Who is the best agent to sell my Forest Hills home?",category:"luxury",original_question:"Recommend a local agent for selling my high-end home in Forest Hills discreetly.",citability_score:4},{page_title:"Who Sells Luxury Homes in Kent County?",category:"luxury",original_question:"Top luxury realtor for new development estates in Kent County near Grand Rapids?",citability_score:4}];x_(U),g(U),localStorage.setItem(F,"1")},[]),C.useEffect(()=>{const F=()=>g(v_());return window.addEventListener("blueprint-suggestions-updated",F),()=>window.removeEventListener("blueprint-suggestions-updated",F)},[]);const y=C.useCallback(F=>{const L=m.filter((U,H)=>H!==F);x_(L),g(L)},[m]),v=C.useCallback(()=>{x_([]),g([])},[]),x=n||[],w=e||[],b=w.filter(F=>!F.parent_id),k=b.filter(F=>F.enabled),j=(F,L)=>{i.mutate({id:F,...L})},B=(F,L)=>{const H=w.filter(K=>K.parent_id===F.id).reduce((K,$)=>K+x.filter(z=>z.category_id===$.id).length,0);p({cat:F,pageCount:L+H})},E=async()=>{if(f){if(f.pageCount>0){De({title:"Cannot delete",description:"Please delete or reassign all pages in this category first.",variant:"destructive"}),p(null);return}try{await a.mutateAsync(f.cat.id),De({title:`"${f.cat.name}" deleted`})}catch(F){De({title:"Error",description:F.message,variant:"destructive"})}p(null)}},I=async()=>{if(o.trim())try{await s.mutateAsync({name:o.trim(),slug:Wq(o),icon:"📄"}),De({title:"Category created!"}),c("")}catch(F){De({title:"Error",description:F.message,variant:"destructive"})}},T=async()=>{if(!(!u.trim()||!h))try{await s.mutateAsync({name:u.trim(),slug:Wq(u),icon:"📁",parent_id:h}),De({title:"Sub-category created!"}),d(""),A(null)}catch(F){De({title:"Error",description:F.message,variant:"destructive"})}};return t?l.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((F,L)=>l.jsx(lt,{className:"h-24 w-full"},L))}):l.jsxs("div",{className:"space-y-8",children:[l.jsx("div",{className:"flex items-center gap-6 text-sm",children:r?l.jsxs(l.Fragment,{children:[l.jsxs("span",{children:["Total Pages: ",l.jsx("strong",{children:x.length})," of ",b.reduce((F,L)=>F+L.min_pages,0),"–",b.reduce((F,L)=>F+L.max_pages,0)]}),l.jsxs("span",{children:["Categories Active: ",l.jsx("strong",{children:k.length})," of ",b.length]})]}):l.jsxs("span",{children:["Categories Active: ",l.jsx("strong",{children:k.length})," of ",b.length]})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:b.map(F=>l.jsx(sGe,{cat:F,allCategories:w,pages:x,onUpdate:j,onDelete:B,isAeo:r,onAddSubcategory:L=>A(L)},F.id))}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Xe,{value:o,onChange:F=>c(F.target.value),placeholder:"New category name...",className:"max-w-xs",onKeyDown:F=>F.key==="Enter"&&I()}),l.jsxs(xe,{variant:"outline",onClick:I,disabled:!o.trim(),children:[l.jsx(zp,{className:"w-4 h-4 mr-1"})," Add Niche"]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"font-serif text-xl mb-4",children:"Page Hierarchy"}),l.jsx("div",{className:"space-y-3",children:b.map(F=>{const L=w.filter(z=>z.parent_id===F.id),U=x.filter(z=>z.category_id===F.id),H=U.filter(z=>z.is_parent),K=U.filter(z=>!z.is_parent&&!z.parent_id),$=U.length+L.reduce((z,Q)=>z+x.filter(oe=>oe.category_id===Q.id).length,0);return l.jsxs("div",{className:"border border-border rounded p-3",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[l.jsx("span",{children:F.icon||"📄"}),l.jsx(At,{to:`/${F.slug}`,className:"font-serif font-medium text-sm hover:text-accent transition-colors",children:F.name}),l.jsxs("span",{className:"text-xs text-muted-foreground ml-auto",children:[$," page(s)"]})]}),l.jsxs("div",{className:"ml-4 space-y-1",children:[L.map(z=>{const Q=x.filter(oe=>oe.category_id===z.id);return l.jsxs("div",{className:"mb-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(fc,{className:"w-3 h-3 text-accent"}),l.jsxs(At,{to:`/${F.slug}/${z.slug}`,className:"font-medium hover:text-accent transition-colors",children:[z.icon," ",z.name]}),l.jsx(qt,{variant:"outline",className:"text-xs",children:"Sub"}),l.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:Q.length})]}),Q.map(oe=>l.jsxs("div",{className:"flex items-center gap-2 text-sm ml-6 text-muted-foreground",children:[l.jsx("span",{className:"w-3 h-px bg-border"}),l.jsx(At,{to:`/${F.slug}/${z.slug}/${oe.slug}`,className:"hover:text-accent transition-colors",children:oe.title}),l.jsx(zS,{status:oe.status})]},oe.id))]},z.id)}),H.map(z=>{const Q=U.filter(oe=>oe.parent_id===z.id);return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(fc,{className:"w-3 h-3 text-muted-foreground"}),l.jsx(At,{to:`/${F.slug}/${z.slug}`,className:"font-medium hover:text-accent transition-colors",children:z.title}),l.jsx(zS,{status:z.status})]}),Q.map(oe=>l.jsxs("div",{className:"flex items-center gap-2 text-sm ml-6 text-muted-foreground",children:[l.jsx("span",{className:"w-3 h-px bg-border"}),l.jsx(At,{to:`/${F.slug}/${oe.slug}`,className:"hover:text-accent transition-colors",children:oe.title}),l.jsx(zS,{status:oe.status})]},oe.id))]},z.id)}),K.map(z=>l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx(fc,{className:"w-3 h-3 text-muted-foreground"}),l.jsx(At,{to:`/${F.slug}/${z.slug}`,className:"hover:text-accent transition-colors",children:z.title}),l.jsx(zS,{status:z.status})]},z.id)),U.length===0&&L.length===0&&l.jsx("p",{className:"text-xs text-muted-foreground",children:r?"No pages yet — use the Page Generator tab to create content.":"No pages yet — landing page content can be edited above."})]})]},F.id)})})]}),m.length>0&&l.jsxs("div",{className:"border border-dashed border-accent rounded-lg p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(E7,{className:"w-4 h-4 text-accent"}),l.jsx("h3",{className:"font-serif text-lg font-medium",children:"Suggested Page Titles"}),l.jsx(qt,{variant:"outline",className:"text-xs",children:m.length})]}),l.jsx(xe,{variant:"ghost",size:"sm",className:"text-xs text-muted-foreground",onClick:v,children:"Clear All"})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Generated FAQ page titles from Prompt Discovery. Use these as starting points when creating new pages."}),l.jsx("div",{className:"divide-y rounded border bg-background",children:m.map((F,L)=>{const U={buying:"bg-blue-100 text-blue-800",selling:"bg-green-100 text-green-800",neighborhoods:"bg-purple-100 text-purple-800","market-insights":"bg-orange-100 text-orange-800",luxury:"bg-amber-100 text-amber-800",general:"bg-muted text-muted-foreground"},H=U[F.category]||U.general;return l.jsxs("div",{className:"px-3 py-2 flex items-center gap-3 text-sm group",children:[l.jsx(E7,{className:"w-3 h-3 text-accent shrink-0"}),l.jsx("span",{className:"font-medium flex-1",children:F.page_title}),l.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-[10px] shrink-0 ${H}`,children:F.category}),l.jsx(xe,{variant:"ghost",size:"icon",className:"h-5 w-5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0",onClick:()=>y(L),children:l.jsx(ta,{className:"w-3 h-3"})})]},L)})})]}),l.jsx(SB,{open:!!h,onOpenChange:F=>!F&&A(null),children:l.jsxs(c1,{children:[l.jsxs(u1,{children:[l.jsx(h1,{children:"Add Sub-Category"}),l.jsxs(f1,{children:["Create a sub-category under ",l.jsx("strong",{children:(N=w.find(F=>F.id===h))==null?void 0:N.name}),". Sub-categories get their own landing page and can contain FAQ pages."]})]}),l.jsx(Xe,{value:u,onChange:F=>d(F.target.value),placeholder:"Sub-category name (e.g., Waterfront)",onKeyDown:F=>F.key==="Enter"&&T()}),l.jsxs(d1,{children:[l.jsx(A1,{onClick:()=>d(""),children:"Cancel"}),l.jsx(Ty,{onClick:T,disabled:!u.trim(),children:"Create Sub-Category"})]})]})}),l.jsx(SB,{open:!!f,onOpenChange:F=>!F&&p(null),children:l.jsxs(c1,{children:[l.jsxs(u1,{children:[l.jsx(h1,{children:f!=null&&f.pageCount?"Category Has Pages":`Delete "${f==null?void 0:f.cat.name}"?`}),l.jsx(f1,{children:f!=null&&f.pageCount?l.jsxs(l.Fragment,{children:[l.jsx("strong",{children:f.cat.name})," has ",l.jsxs("strong",{children:[f.pageCount," page(s)"]})," attached. Deleting this category will undo all parent-to-children routing and cross-linking for those pages.",l.jsx("br",{}),l.jsx("br",{}),"You must ",l.jsx("strong",{children:"delete or reassign"})," all pages in this category before it can be removed."]}):"This category has no pages and can be safely removed. This action cannot be undone."})]}),l.jsxs(d1,{children:[l.jsx(A1,{children:"Cancel"}),f!=null&&f.pageCount?l.jsx(Ty,{onClick:()=>p(null),children:"Understood"}):l.jsx(Ty,{onClick:E,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Category"})]})]})})]})},zS=({status:e})=>l.jsx("span",{className:`text-xs px-1.5 py-0.5 ml-auto rounded ${e==="published"?"bg-green-100 text-green-800":"bg-muted text-muted-foreground"}`,children:e}),oGe=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,""),lGe=()=>{const{data:e,isLoading:t}=Cc(),{data:n}=eA(),{configMap:r}=Os(),i=sfe(),s=g5(),a=afe(),[o,c]=C.useState(null),[u,d]=C.useState(null),[h,A]=C.useState(""),[f,p]=C.useState(""),[m,g]=C.useState(null),[y,v]=C.useState(!1),x=N=>N.faq_json&&N.faq_json.length>0||!!N.intro_text,w=(e||[]).filter(N=>N.status==="draft"&&!x(N)),b=(e||[]).filter(N=>N.status==="draft"&&x(N)),k=(e||[]).filter(N=>N.status==="published"),j=async()=>{if(!h.trim()||!f){De({title:"Enter a question and select a category",variant:"destructive"});return}v(!0);try{const N=(n||[]).find(K=>K.id===f),{data:F,error:L}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"generate",category_slug:(N==null?void 0:N.slug)||"",topic:h.trim(),agent_name:r.agent_name,agent_market:r.agent_market}});if(L)throw L;if(F!=null&&F.error)throw new Error(F.error);const U=F.slug||oGe(h),H=await i.mutateAsync({category_id:f,title:h.trim(),slug:U,h1:F.h1||h.trim(),is_parent:!1,status:"draft",cover_image_id:m});await s.mutateAsync({id:H.id,h1:F.h1,subheadline:F.subheadline,intro_text:F.intro_text,faq_json:F.faq_json,meta_title:F.meta_title,meta_description:F.meta_description,schema_markup:F.schema_markup}),De({title:"Page created & content generated!",description:`Slug: /${N==null?void 0:N.slug}/${U}`}),A(""),p(""),g(null)}catch(N){De({title:"Error",description:N.message,variant:"destructive"})}finally{v(!1)}},B=async N=>{var F;c(N.id);try{const{data:L,error:U}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"generate",category_slug:((F=N.category)==null?void 0:F.slug)||"",topic:N.title,parent_id:N.parent_id,agent_name:r.agent_name,agent_market:r.agent_market}});if(U)throw U;if(L!=null&&L.error)throw new Error(L.error);await s.mutateAsync({id:N.id,h1:L.h1,intro_text:L.intro_text,body_content:L.body_content,faq_json:L.faq_json,meta_title:L.meta_title,meta_description:L.meta_description,schema_markup:L.schema_markup}),De({title:"Content generated!",description:`"${N.title}" is ready for review.`})}catch(L){De({title:"Generation failed",description:L.message,variant:"destructive"})}finally{c(null)}},E=async N=>{const F=`${N.h1} ${N.intro_text||""} ${N.body_content||""} ${(N.faq_json||[]).map(U=>U.question+" "+U.answer).join(" ")}`,L=Ff(F);if(Lhe(L)){De({title:"Fair Housing Violation Detected",description:`${L.length} issue(s) found. Please review and fix before publishing.`,variant:"destructive"});return}await s.mutateAsync({id:N.id,status:"published",published_at:new Date().toISOString()}),De({title:"Published!",description:`"${N.title}" is now live.`})},I=async N=>{await a.mutateAsync(N),De({title:"Page deleted"})};if(t)return l.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((N,F)=>l.jsx(lt,{className:"h-16 w-full"},F))});const T=({page:N,actions:F})=>{var H;const L=`${N.h1} ${N.intro_text||""} ${N.body_content||""}`,U=N.body_content?Ff(L):[];return l.jsxs("div",{className:"flex items-center justify-between p-4 border border-border",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx("span",{className:"text-caption text-accent",children:(H=N.category)==null?void 0:H.name}),N.is_parent&&l.jsx(qt,{variant:"outline",className:"text-xs",children:"Parent"}),l.jsx(qt,{variant:N.status==="published"?"default":"secondary",className:"text-xs capitalize",children:N.status==="draft"&&x(N)?"Ready":N.status}),U.length>0&&l.jsxs("span",{className:"flex items-center gap-1 text-xs text-destructive",children:[l.jsx(Vp,{className:"w-3 h-3"}),U.length," issue(s)"]})]}),l.jsx("p",{className:"font-serif text-sm truncate",children:N.title})]}),l.jsx("div",{className:"flex items-center gap-2 ml-4",children:F})]})};return l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{className:"border border-border rounded p-6 space-y-4",children:[l.jsx("h3",{className:"font-serif text-xl",children:"Create New Page"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter a question — it becomes the page title, H1, and drives the AI-generated content."}),l.jsx(Xe,{value:h,onChange:N=>A(N.target.value),placeholder:"Your Question (e.g., 'What are the best neighborhoods in Austin?')",className:"text-base"}),h&&l.jsx("p",{className:"text-xs text-muted-foreground",children:"The AI will generate an optimized short slug from your question."}),l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsxs("div",{className:"flex-1 space-y-3",children:[l.jsx("div",{className:"flex items-center gap-3",children:l.jsxs(Fr,{value:f,onValueChange:N=>{p(N)},children:[l.jsx(Br,{className:"w-48",children:l.jsx(Mr,{placeholder:"Category"})}),l.jsxs(Nr,{children:[(n||[]).filter(N=>!N.parent_id).map(N=>l.jsxs(ft,{value:N.id,children:[N.icon," ",N.name]},N.id)),(n||[]).filter(N=>N.parent_id).map(N=>{const F=(n||[]).find(L=>L.id===N.parent_id);return l.jsxs(ft,{value:N.id,children:["  ↳ ",N.icon," ",N.name," ",F?`(${F.name})`:""]},N.id)})]})]})}),l.jsxs(xe,{onClick:j,disabled:!h.trim()||!f||y,className:"btn-gold border-0",children:[l.jsx(Ts,{className:"w-4 h-4 mr-2"}),y?"Generating...":"Generate Unique FAQs"]})]}),l.jsx("div",{className:"w-40",children:l.jsx(BB,{selectedId:m,onSelect:g,label:"Cover Image"})})]})]}),w.length>0&&l.jsxs("div",{children:[l.jsxs("h3",{className:"font-serif text-xl mb-4",children:["Needs Content (",w.length,")"]}),l.jsx("div",{className:"space-y-2",children:w.map(N=>l.jsx(T,{page:N,actions:l.jsxs(l.Fragment,{children:[l.jsxs(xe,{size:"sm",onClick:()=>B(N),disabled:o===N.id,className:"btn-gold border-0 text-xs",children:[l.jsx(Ts,{className:"w-3 h-3 mr-1"}),o===N.id?"Generating...":"Generate"]}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>I(N.id),children:l.jsx(jl,{className:"w-3 h-3"})})]})},N.id))})]}),b.length>0&&l.jsxs("div",{children:[l.jsxs("h3",{className:"font-serif text-xl mb-4",children:["Ready for Review (",b.length,")"]}),l.jsx("div",{className:"space-y-2",children:b.map(N=>l.jsx(T,{page:N,actions:l.jsxs(l.Fragment,{children:[l.jsxs(xe,{size:"sm",variant:"outline",onClick:()=>d(N),children:[l.jsx(Tb,{className:"w-3 h-3 mr-1"})," Preview"]}),l.jsxs(xe,{size:"sm",onClick:()=>E(N),className:"btn-gold border-0 text-xs",children:[l.jsx(C2,{className:"w-3 h-3 mr-1"})," Publish"]}),l.jsxs(xe,{size:"sm",variant:"outline",onClick:()=>B(N),disabled:o===N.id,className:"text-xs",children:[l.jsx(Ts,{className:"w-3 h-3 mr-1"}),o===N.id?"...":"Regenerate"]}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>I(N.id),children:l.jsx(jl,{className:"w-3 h-3"})})]})},N.id))})]}),k.length>0&&l.jsxs("div",{children:[l.jsxs("h3",{className:"font-serif text-xl mb-4",children:["Published (",k.length,")"]}),l.jsx("div",{className:"space-y-2",children:k.map(N=>l.jsx(T,{page:N,actions:l.jsxs(l.Fragment,{children:[l.jsx(cU,{className:"w-4 h-4 text-green-600"}),l.jsx(xe,{size:"sm",variant:"outline",onClick:()=>d(N),children:l.jsx(Tb,{className:"w-3 h-3"})})]})},N.id))})]}),(e||[]).length===0&&!h&&l.jsx("p",{className:"text-muted-foreground text-center py-12",children:"No pages yet. Enter a question above to create your first AEO page."}),l.jsx(No,{open:!!u,onOpenChange:()=>d(null),children:l.jsxs(Ka,{className:"max-w-3xl max-h-[80vh] overflow-y-auto",children:[l.jsx(qa,{children:l.jsx(Wa,{className:"font-serif",children:u==null?void 0:u.h1})}),u&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Meta Title:"})," ",u.meta_title]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Meta Desc:"})," ",u.meta_description]})]}),u.intro_text&&l.jsx("p",{className:"text-muted-foreground italic",children:u.intro_text}),u.body_content&&l.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:u.body_content}}),u.faq_json&&u.faq_json.length>0&&l.jsxs("div",{children:[l.jsx("h4",{className:"font-serif font-medium mb-2",children:"FAQ"}),u.faq_json.map((N,F)=>l.jsxs("div",{className:"mb-3",children:[l.jsx("p",{className:"font-medium text-sm",children:N.question}),l.jsx("p",{className:"text-sm text-muted-foreground",children:N.answer})]},F))]}),l.jsxs("div",{className:"border-t border-border pt-4 space-y-3",children:[l.jsx("h4",{className:"font-serif font-medium",children:"YouTube Video (optional)"}),l.jsxs("div",{className:"flex gap-3",children:[l.jsx(Xe,{value:u.video_url||"",onChange:N=>d({...u,video_url:N.target.value}),placeholder:"https://www.youtube.com/watch?v=...",className:"flex-1"}),l.jsxs(Fr,{value:u.video_orientation||"horizontal",onValueChange:N=>d({...u,video_orientation:N}),children:[l.jsx(Br,{className:"w-[140px] text-sm",children:l.jsx(Mr,{})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"horizontal",children:"Horizontal"}),l.jsx(ft,{value:"vertical",children:"Vertical (Short)"})]})]})]}),u.video_url&&(()=>{const N=u.video_url.match(/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|shorts\/|watch\?v=|watch\?.+&v=))([^&?\s]+)/),F=N==null?void 0:N[1],L=u.video_orientation==="vertical";return F?l.jsx("div",{className:`relative overflow-hidden rounded-lg mx-auto ${L?"max-w-sm aspect-[9/16]":"w-full aspect-video"}`,children:l.jsx("iframe",{src:`https://www.youtube.com/embed/${F}`,title:"Preview",className:"absolute inset-0 w-full h-full border border-border",allowFullScreen:!0})}):null})(),l.jsx("textarea",{value:u.video_transcript||"",onChange:N=>d({...u,video_transcript:N.target.value}),placeholder:"Paste video transcript here...",rows:4,className:"flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"}),l.jsx(xe,{size:"sm",variant:"outline",onClick:async()=>{try{await s.mutateAsync({id:u.id,video_url:u.video_url||null,video_transcript:u.video_transcript||null,video_orientation:u.video_orientation||"horizontal"}),De({title:"Video fields saved!"})}catch(N){De({title:"Error saving",description:N.message,variant:"destructive"})}},children:"Save Video Fields"})]})]})]})})]})},cGe=()=>{const[e,t]=C.useState([]),[n,r]=C.useState([]),[i,s]=C.useState(!1),[a,o]=C.useState(!1),[c,u]=C.useState(null),{data:d}=Cc(),h=g5(),A=async()=>{s(!0);try{const{data:g,error:y}=await Me.functions.invoke("scan-cannibalization");if(y)throw y;if(g!=null&&g.error)throw new Error(g.error);t(g.page_results||[]),r(g.faq_results||[]),o(!0),(g.page_results||[]).length===0&&(g.faq_results||[]).length===0&&De({title:"No cannibalization issues found!"})}catch(g){De({title:"Scan failed",description:g.message,variant:"destructive"})}finally{s(!1)}},f=async(g,y)=>{const v=d==null?void 0:d.find(w=>w.id===g);if(!v)return;const x=[...v.faq_json];x.splice(y,1);try{await h.mutateAsync({id:g,faq_json:x}),De({title:"FAQ deleted"}),r(w=>w.filter(b=>!(b.faq_a.page_id===g&&b.faq_a.question_index===y)&&!(b.faq_b.page_id===g&&b.faq_b.question_index===y)))}catch(w){De({title:"Delete failed",description:w.message,variant:"destructive"})}},p=async(g,y,v)=>{const x=d==null?void 0:d.find(w=>w.id===g);if(x){u(v);try{const w=x.faq_json.map(B=>B.question),{data:b,error:k}=await Me.functions.invoke("generate-aeo-content",{body:{mode:"replace-faq",existing_questions:w,page_topic:x.title}});if(k)throw k;if(b!=null&&b.error)throw new Error(b.error);const j=[...x.faq_json];j[y]={question:b.question,answer:b.answer},await h.mutateAsync({id:g,faq_json:j}),De({title:"FAQ replaced with new unique question!"}),r(B=>B.filter((E,I)=>I!==v))}catch(w){De({title:"Replace failed",description:w.message,variant:"destructive"})}finally{u(null)}}},m=a&&!i&&e.length===0&&n.length===0;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"font-serif text-xl mb-2",children:"Duplicate Question Scanner"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Find FAQ questions that appear nearly identical across different pages, then remove or replace them."}),l.jsxs(xe,{onClick:A,disabled:i,className:"btn-gold border-0",children:[l.jsx(hE,{className:"w-4 h-4 mr-2"}),i?"Scanning...":"Scan for Duplicates"]})]}),i&&l.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((g,y)=>l.jsx(lt,{className:"h-16 w-full"},y))}),m&&l.jsxs("div",{className:"flex items-center gap-3 p-6 border border-green-200 bg-green-50",children:[l.jsx(cU,{className:"w-5 h-5 text-green-600"}),l.jsx("p",{className:"text-sm text-green-800",children:"No cannibalization issues detected. Your content is well-differentiated!"})]}),e.length>0&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("h4",{className:"font-serif text-lg",children:"Page-Level Overlap"}),e.map((g,y)=>l.jsx("div",{className:"p-4 border border-border",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(Vp,{className:`w-4 h-4 mt-0.5 ${g.similarity>60?"text-destructive":"text-yellow-500"}`}),l.jsxs("div",{className:"flex-1",children:[l.jsx("div",{className:"flex items-center gap-2 mb-1",children:l.jsxs("span",{className:"font-medium text-sm",children:[g.similarity,"% overlap"]})}),l.jsxs("p",{className:"text-sm text-muted-foreground mb-1",children:[l.jsxs("strong",{children:['"',g.page_a.title,'"']})," vs ",l.jsxs("strong",{children:['"',g.page_b.title,'"']})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:g.recommendation})]})]})},y))]}),n.length>0&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("h4",{className:"font-serif text-lg",children:"FAQ-Level Duplicates"}),n.map((g,y)=>l.jsxs("div",{className:"p-4 border border-border space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Vp,{className:"w-4 h-4 text-yellow-500"}),l.jsxs("span",{className:"font-medium text-sm",children:[g.similarity,"% similar"]})]}),l.jsxs("div",{className:"flex items-start justify-between gap-3 pl-4 border-l-2 border-border",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("p",{className:"text-xs text-muted-foreground mb-1",children:["On: ",g.faq_a.page_title]}),l.jsxs("p",{className:"text-sm font-medium",children:['"',g.faq_a.question,'"']})]}),l.jsxs("div",{className:"flex gap-1 shrink-0",children:[l.jsx(xe,{variant:"ghost",size:"sm",onClick:()=>f(g.faq_a.page_id,g.faq_a.question_index),children:l.jsx(jl,{className:"w-3.5 h-3.5"})}),l.jsx(xe,{variant:"ghost",size:"sm",disabled:c===y,onClick:()=>p(g.faq_a.page_id,g.faq_a.question_index,y),children:l.jsx(Xc,{className:`w-3.5 h-3.5 ${c===y?"animate-spin":""}`})})]})]}),l.jsxs("div",{className:"flex items-start justify-between gap-3 pl-4 border-l-2 border-border",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("p",{className:"text-xs text-muted-foreground mb-1",children:["On: ",g.faq_b.page_title]}),l.jsxs("p",{className:"text-sm font-medium",children:['"',g.faq_b.question,'"']})]}),l.jsxs("div",{className:"flex gap-1 shrink-0",children:[l.jsx(xe,{variant:"ghost",size:"sm",onClick:()=>f(g.faq_b.page_id,g.faq_b.question_index),children:l.jsx(jl,{className:"w-3.5 h-3.5"})}),l.jsx(xe,{variant:"ghost",size:"sm",disabled:c===y,onClick:()=>p(g.faq_b.page_id,g.faq_b.question_index,y),children:l.jsx(Xc,{className:`w-3.5 h-3.5 ${c===y?"animate-spin":""}`})})]})]})]},y))]})]})},uGe=()=>l.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[l.jsx(C2e,{className:"w-12 h-12 text-muted-foreground/40 mb-4"}),l.jsx("h3",{className:"font-serif text-xl mb-2",children:"Backups Coming Soon"}),l.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:"Auto-backup scheduling, manual snapshots, and one-click restore will be available here."})]}),Gq=[{value:"all",label:"All"},{value:"logo",label:"Logos & Branding"},{value:"stock_photo",label:"Stock Photos"},{value:"headshot",label:"Agent Headshots"}],dGe=[{value:"cover",label:"Cover Image",description:"Hero banners on category/topic pages"},{value:"content",label:"Content Block",description:"Alternating text+image sections"},{value:"featured",label:"Featured",description:"Priority image for any page"},{value:"headshot",label:"Agent Headshot",description:"Profile photos for contact/about pages"}],hGe=["modern interior","exterior","city shot","aerial","neighborhood","kitchen","bathroom","living room","bedroom","office","grand rapids","west michigan","lakefront","condo","new build","header logo","favicon","footer logo","watermark"],fGe=7,AGe=7,pGe=3,Yq=({selectedTags:e,onToggle:t,categorySlugs:n})=>{const[r,i]=C.useState("");return l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Usage"}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:dGe.map(s=>{const a=e.includes(s.value);return l.jsxs("button",{onClick:()=>t(s.value),title:s.description,className:`text-[10px] px-2 py-1 rounded-full border transition-colors flex items-center gap-1 ${a?"border-accent bg-accent/15 text-accent font-medium":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30"}`,children:[a&&l.jsx(Fo,{className:"w-2.5 h-2.5"}),s.label]},s.value)})})]}),n.length>0&&l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Category"}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:n.map(s=>{const a=e.includes(s);return l.jsxs("button",{onClick:()=>t(s),className:`text-[10px] px-2 py-1 rounded-full border transition-colors flex items-center gap-1 ${a?"border-accent bg-accent/15 text-accent font-medium":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30"}`,children:[a&&l.jsx(Fo,{className:"w-2.5 h-2.5"}),s]},s)})})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Scene"}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:hGe.map(s=>{const a=e.includes(s);return l.jsxs("button",{onClick:()=>t(s),className:`text-[10px] px-2 py-0.5 rounded-full border transition-colors flex items-center gap-1 ${a?"border-accent bg-accent/15 text-accent font-medium":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30"}`,children:[a&&l.jsx(Fo,{className:"w-2.5 h-2.5"}),s]},s)})})]}),l.jsxs("div",{className:"flex gap-1",children:[l.jsx(Xe,{value:r,onChange:s=>i(s.target.value),placeholder:"Custom tag...",className:"text-xs h-7 max-w-[140px]",onKeyDown:s=>{if(s.key==="Enter"){s.preventDefault();const a=r.trim().toLowerCase();a&&(t(a),i(""))}}}),l.jsx(xe,{variant:"ghost",size:"sm",className:"h-7 px-2",disabled:!r.trim(),onClick:()=>{const s=r.trim().toLowerCase();s&&(t(s),i(""))},children:l.jsx(zp,{className:"w-3 h-3"})})]})]})},mGe=({media:e})=>{const t=e.filter(s=>{var a;return(a=s.tags)==null?void 0:a.includes("cover")}).length,n=e.filter(s=>{var a;return(a=s.tags)==null?void 0:a.includes("content")}).length,r=e.filter(s=>{var a;return((a=s.tags)==null?void 0:a.includes("headshot"))||s.media_type==="headshot"}).length,i=({label:s,count:a,min:o})=>{const c=a>=o;return l.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 rounded border text-xs ${c?"border-green-500/30 bg-green-500/5 text-green-700":"border-amber-500/30 bg-amber-500/5 text-amber-700"}`,children:[c?l.jsx(e0,{className:"w-3.5 h-3.5"}):l.jsx(Vp,{className:"w-3.5 h-3.5"}),l.jsxs("span",{className:"font-medium",children:[s,":"]}),l.jsxs("span",{children:[a,"/",o]}),!c&&l.jsxs("span",{className:"text-[10px] opacity-70",children:["(",o-a," more needed)"]})]})};return l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsx(i,{label:"Cover images",count:t,min:fGe}),l.jsx(i,{label:"Content blocks",count:n,min:AGe}),l.jsx(i,{label:"Agent headshots",count:r,min:pGe})]})},gGe=()=>{const[e,t]=C.useState("all"),[n,r]=C.useState(""),{data:i,isLoading:s}=f0(e==="all"?void 0:e),{data:a}=eA(),o=(a||[]).filter(H=>H.slug!=="about").map(H=>H.slug),c=QOe(),u=zOe(),d=$Oe(),h=C.useRef(null),[A,f]=C.useState("stock_photo"),[p,m]=C.useState([]),[g,y]=C.useState(!1),[v,x]=C.useState(null),[w,b]=C.useState([]),[k,j]=C.useState(""),[B,E]=C.useState(null),I=(i||[]).filter(H=>n?H.tags.some(K=>K.toLowerCase().includes(n.toLowerCase())):!0),T=(H,K)=>{K==="upload"?m($=>$.includes(H)?$.filter(z=>z!==H):[...$,H]):b($=>$.includes(H)?$.filter(z=>z!==H):[...$,H])},N=async H=>{const K=H.target.files;if(!K||K.length===0)return;y(!0);let $=0;for(const z of Array.from(K))try{await c.mutateAsync({file:z,tags:p,mediaType:A}),$++}catch(Q){De({title:`Failed to upload ${z.name}`,description:Q.message,variant:"destructive"})}$>0&&De({title:`${$} file(s) uploaded`}),y(!1),m([]),h.current&&(h.current.value="")},F=async H=>{try{await d.mutateAsync({id:H,tags:w,alt_text:k}),De({title:"Updated"}),x(null)}catch(K){De({title:"Error",description:K.message,variant:"destructive"})}},L=async()=>{if(B){try{await u.mutateAsync({id:B.id,filePath:B.filePath}),De({title:`"${B.name}" deleted`})}catch(H){De({title:"Error",description:H.message,variant:"destructive"})}E(null)}},U=[...new Set((i||[]).flatMap(H=>H.tags))].sort();return l.jsxs("div",{className:"space-y-8",children:[(i||[]).length>0&&l.jsx(mGe,{media:i||[]}),l.jsxs("div",{className:"border border-dashed border-border rounded-lg p-6 space-y-4",children:[l.jsx("h3",{className:"font-serif text-xl",children:"Upload Media"}),l.jsx("div",{className:"flex flex-wrap items-center gap-3",children:l.jsx("div",{className:"flex gap-2",children:Gq.filter(H=>H.value!=="all").map(H=>l.jsx(xe,{variant:A===H.value?"default":"outline",size:"sm",onClick:()=>f(H.value),className:"text-xs",children:H.label},H.value))})}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-xs font-medium text-muted-foreground",children:"Tags (applied to all uploads in this batch)"}),p.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:p.map(H=>l.jsxs(qt,{variant:"secondary",className:"text-xs gap-1",children:[H,l.jsx("button",{onClick:()=>T(H,"upload"),children:l.jsx(ta,{className:"w-2.5 h-2.5"})})]},H))}),l.jsx(Yq,{selectedTags:p,onToggle:H=>T(H,"upload"),categorySlugs:o})]}),l.jsx("input",{ref:h,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:N}),l.jsxs(xe,{onClick:()=>{var H;return(H=h.current)==null?void 0:H.click()},disabled:g,className:"btn-gold border-0",children:[l.jsx(Hre,{className:"w-4 h-4 mr-2"}),g?"Uploading...":"Choose Files"]})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsx("div",{className:"flex gap-1",children:Gq.map(H=>l.jsx(xe,{variant:e===H.value?"default":"ghost",size:"sm",onClick:()=>t(H.value),className:"text-xs",children:H.label},H.value))}),l.jsx(Xe,{value:n,onChange:H=>r(H.target.value),placeholder:"Filter by tag...",className:"max-w-[200px] h-8 text-xs"}),U.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1",children:U.slice(0,8).map(H=>l.jsx("button",{onClick:()=>r(n===H?"":H),className:`text-[10px] px-2 py-0.5 rounded-full border transition-colors ${n===H?"border-accent text-accent bg-accent/10":"border-border text-muted-foreground hover:text-foreground"}`,children:H},H))}),l.jsxs("span",{className:"text-xs text-muted-foreground ml-auto",children:[I.length," item(s)"]})]}),s?l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-3",children:Array.from({length:6}).map((H,K)=>l.jsx(lt,{className:"aspect-square rounded"},K))}):I.length===0?l.jsxs("div",{className:"text-center py-16 text-muted-foreground",children:[l.jsx(dU,{className:"w-10 h-10 mx-auto mb-3 opacity-40"}),l.jsx("p",{className:"text-sm",children:"No media yet. Upload images above to build your library."})]}):l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-3",children:I.map(H=>{const K=v===H.id;return l.jsxs("div",{className:"group relative border border-border rounded overflow-hidden bg-muted/30",children:[l.jsx("div",{className:"aspect-square",children:l.jsx("img",{src:vc(H.file_path),alt:H.alt_text||H.file_name,className:"w-full h-full object-cover",loading:"lazy"})}),l.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/50 transition-colors flex items-end",children:l.jsx("div",{className:"w-full p-2 opacity-0 group-hover:opacity-100 transition-opacity",children:l.jsxs("div",{className:"flex gap-1",children:[l.jsxs(xe,{size:"sm",variant:"secondary",className:"h-6 text-[10px] flex-1",onClick:()=>{x(H.id),b([...H.tags]),j(H.alt_text||"")},children:[l.jsx(fE,{className:"w-2.5 h-2.5 mr-0.5"})," Edit"]}),l.jsx(xe,{size:"sm",variant:"destructive",className:"h-6 text-[10px] px-2",onClick:()=>E({id:H.id,filePath:H.file_path,name:H.file_name}),children:l.jsx(jl,{className:"w-2.5 h-2.5"})})]})})}),l.jsx("div",{className:"absolute top-1 left-1",children:l.jsx(qt,{variant:"secondary",className:"text-[9px] px-1.5 py-0 bg-background/80 backdrop-blur-sm",children:H.media_type==="logo"?"Logo":"Stock"})}),H.tags.length>0&&l.jsxs("div",{className:"absolute top-1 right-1 flex flex-wrap gap-0.5 justify-end max-w-[70%]",children:[H.tags.slice(0,2).map($=>l.jsx(qt,{variant:"outline",className:`text-[8px] px-1 py-0 bg-background/80 backdrop-blur-sm ${$==="cover"||$==="content"?"border-accent text-accent font-semibold":"border-accent/30 text-accent"}`,children:$},$)),H.tags.length>2&&l.jsxs(qt,{variant:"outline",className:"text-[8px] px-1 py-0 bg-background/80 backdrop-blur-sm",children:["+",H.tags.length-2]})]}),K&&l.jsxs("div",{className:"absolute inset-0 bg-background/95 backdrop-blur-sm p-3 flex flex-col gap-2 z-10 overflow-y-auto",children:[l.jsx(Xe,{value:k,onChange:$=>j($.target.value),placeholder:"Alt text...",className:"text-xs h-7"}),w.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1",children:w.map($=>l.jsxs(qt,{variant:"secondary",className:"text-[9px] gap-0.5",children:[$,l.jsx("button",{onClick:()=>T($,"edit"),children:l.jsx(ta,{className:"w-2 h-2"})})]},$))}),l.jsx(Yq,{selectedTags:w,onToggle:$=>T($,"edit"),categorySlugs:o}),l.jsxs("div",{className:"flex gap-1 mt-auto pt-2",children:[l.jsx(xe,{size:"sm",className:"h-6 text-[10px] flex-1",onClick:()=>F(H.id),children:"Save"}),l.jsx(xe,{size:"sm",variant:"ghost",className:"h-6 text-[10px]",onClick:()=>x(null),children:"Cancel"})]})]})]},H.id)})}),l.jsx(SB,{open:!!B,onOpenChange:H=>!H&&E(null),children:l.jsxs(c1,{children:[l.jsxs(u1,{children:[l.jsxs(h1,{children:['Delete "',B==null?void 0:B.name,'"?']}),l.jsx(f1,{children:"This will permanently remove the file from storage. This action cannot be undone."})]}),l.jsxs(d1,{children:[l.jsx(A1,{children:"Cancel"}),l.jsx(Ty,{onClick:L,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})};function JH(){return gr({queryKey:["indexing-status"],queryFn:async()=>{const{data:e,error:t}=await Me.from("page_indexing_status").select("*").order("created_at");if(t)throw t;return e||[]}})}function yGe(){const e=cs();return Is({mutationFn:async t=>{const{data:n}=await Me.from("page_indexing_status").select("id").eq("page_id",t.page_id).maybeSingle();if(n){const{error:r}=await Me.from("page_indexing_status").update({...t,updated_at:new Date().toISOString()}).eq("page_id",t.page_id);if(r)throw r}else{const{error:r}=await Me.from("page_indexing_status").insert(t);if(r)throw r}},onSuccess:()=>e.invalidateQueries({queryKey:["indexing-status"]})})}function wAe(){const{data:e}=eA(),{data:t}=Cc();Os();const{data:n}=JH();return C.useMemo(()=>{const r=e||[],i=t||[],s=i.filter(k=>k.status==="published"),a=n||[],o=r.reduce((k,j)=>k+(j.min_pages||0),0),c=o>0?Math.min(100,i.length/o*100):100,u=s.filter(k=>k.schema_markup),d=s.length>0?u.length/s.length*100:100;let h=0;for(const k of s){const j=[k.intro_text,k.body_content,...Array.isArray(k.faq_json)?k.faq_json.map(B=>`${B.question} ${B.answer}`):[]].filter(Boolean).join(" ");h+=Ff(j).filter(B=>B.severity==="critical").length}const A=Math.max(0,100-h*10),f=100,p=r.filter(k=>k.cover_image_id&&(k.content_image_ids||[]).length>0),m=r.length>0?p.length/r.length*100:100,g=i.filter(k=>k.meta_title&&k.meta_description),y=i.length>0?g.length/i.length*100:100,v=a.filter(k=>k.google_indexed||k.bing_indexed),x=s.length>0?v.length/s.length*100:0,w=[{label:"Pages",weight:15,score:c},{label:"Schema",weight:25,score:d},{label:"Fair Housing",weight:15,score:A},{label:"Cannibalization",weight:10,score:f},{label:"Images",weight:10,score:m},{label:"Meta",weight:15,score:y},{label:"Indexing",weight:10,score:x}],b=w.reduce((k,j)=>k+j.score*j.weight/100,0);return{total:Math.round(b),factors:w}},[e,t,n])}const vGe=()=>{const{total:e,factors:t}=wAe(),n=e>=75?"text-green-600":e>=50?"text-yellow-600":"text-destructive";return l.jsx(jU,{children:l.jsxs("div",{className:"border rounded-lg p-6 space-y-4 bg-card",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider text-muted-foreground",children:"Site Readiness Score"}),l.jsxs("span",{className:`text-3xl font-bold ${n}`,children:[e,l.jsx("span",{className:"text-lg text-muted-foreground",children:"/100"})]})]}),l.jsx(Cv,{value:e,className:"h-3"}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-7 gap-3",children:t.map(r=>l.jsxs(BU,{children:[l.jsx(NU,{asChild:!0,children:l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[l.jsx("span",{children:r.label}),l.jsxs("span",{children:[Math.round(r.score),"%"]})]}),l.jsx(Cv,{value:r.score,className:"h-1.5"})]})}),l.jsx(bE,{children:l.jsxs("p",{children:[r.label,": ",Math.round(r.score),"% (weight ",r.weight,"%)"]})})]},r.label))})]})})};function xGe(e,t){const n=(e.intro_text||"").split(/\n\n+/).filter(Boolean),r=e.faq_json||[],i=t.filter(u=>u.category_id===e.id);i.filter(u=>u.status==="published");const s=[e.intro_text,...r.map(u=>`${u.question} ${u.answer}`)].filter(Boolean).join(" "),o=Ff(s).filter(u=>u.severity==="critical");return[{label:"Intro text with 3+ paragraphs",passed:n.length>=3,fix:"Add at least 3 paragraphs of intro text"},{label:"Section headings assigned",passed:(e.section_headings||[]).length>0,fix:"Add section headings in Blueprint tab"},{label:"Cover image assigned",passed:!!e.cover_image_id,fix:"Pick a cover image in Content editor"},{label:"Content images for paragraphs",passed:(e.content_image_ids||[]).length>=Math.min(n.length,1),fix:"Assign content images in Content editor"},{label:"FAQs (3+ questions)",passed:r.length>=3,fix:"Add at least 3 FAQ items"},{label:"Video + VideoObject schema",passed:!e.video_url||!!e.video_url,fix:e.video_url?"Ensure VideoObject schema is generated":"Optional — add a video URL"},{label:"Child pages created",passed:i.length>0,fix:"Generate sub-pages in Page Generator tab"},{label:"Fair Housing compliance",passed:o.length===0,fix:`${o.length} critical violation(s) — review flagged terms`}]}function wGe(e){const t=e.faq_json||[],n=(e.body_content||"").split(/\n\n+/).filter(Boolean),r=[e.intro_text,e.body_content,...t.map(s=>`${s.question} ${s.answer}`)].filter(Boolean).join(" "),i=Ff(r).filter(s=>s.severity==="critical");return[{label:"Has h1",passed:!!e.h1,fix:"Set the h1 field"},{label:"Has subheadline",passed:!!e.subheadline,fix:"Add a subheadline"},{label:"Has intro text",passed:!!(e.intro_text&&e.intro_text.length>50),fix:"Write intro text (50+ chars)"},{label:"Body content with 2+ sections",passed:n.length>=2,fix:"Add more body content sections"},{label:"FAQs with FAQPage schema",passed:t.length>=2&&!!e.schema_markup,fix:"Add FAQs and generate schema"},{label:"Has schema markup",passed:!!e.schema_markup,fix:"Generate schema in Page Generator"},{label:"Meta title",passed:!!e.meta_title,fix:"Set meta title"},{label:"Meta description",passed:!!e.meta_description,fix:"Set meta description"},{label:"Fair Housing compliance",passed:i.length===0,fix:`${i.length} critical violation(s)`}]}function bGe(e,t){return e==="Home"?[{label:"WebSite schema with SearchAction",passed:!1,fix:"Add WebSite JSON-LD with SearchAction to Home page"},{label:"Organization/RealEstateAgent schema",passed:!!t.agent_name,fix:"Set agent name in Agent Config"},{label:"Has og:image",passed:!1,fix:"Add og:image meta tag to Home"},{label:"Has meta description",passed:!1,fix:"Add meta description to Home"}]:e==="About"?[{label:"RealEstateAgent/Person schema",passed:!!t.agent_name,fix:"Ensure About page has Person schema"},{label:"Has sameAs links",passed:!1,fix:"Add social profile URLs to Agent Config"},{label:"Has BreadcrumbList",passed:!1,fix:"Add BreadcrumbList schema"},{label:"Has og:title and og:description",passed:!1,fix:"Add Open Graph meta tags"}]:e==="Contact"?[{label:"LocalBusiness schema with address",passed:!!t.agent_market,fix:"Add LocalBusiness schema with NAP"},{label:"Has phone/email",passed:!!(t.agent_phone||t.agent_email),fix:"Set phone/email in Agent Config"},{label:"Has BreadcrumbList",passed:!1,fix:"Add BreadcrumbList schema"}]:[]}const A4=({type:e,category:t,page:n,pages:r,staticPageName:i,configMap:s})=>{let a=[];e==="category"&&t&&r?a=xGe(t,r):e==="subpage"&&n?a=wGe(n):e==="static"&&i&&s&&(a=bGe(i,s));const o=a.filter(d=>d.passed).length,c=a.length,u=c>0?Math.round(o/c*100):0;return l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[l.jsxs("span",{children:[o,"/",c," checks passed"]}),l.jsxs("span",{className:u===100?"text-green-600 font-medium":u>=60?"text-yellow-600":"text-destructive font-medium",children:[u,"%"]})]}),l.jsx("div",{className:"space-y-1",children:a.map((d,h)=>l.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[d.passed?l.jsx(e0,{className:"w-4 h-4 text-green-500 mt-0.5 shrink-0"}):l.jsx(b2,{className:"w-4 h-4 text-destructive mt-0.5 shrink-0"}),l.jsxs("div",{children:[l.jsx("span",{className:d.passed?"text-muted-foreground":"text-foreground",children:d.label}),!d.passed&&l.jsx("p",{className:"text-xs text-muted-foreground",children:d.fix})]})]},h))})]})};function CGe(){return gr({queryKey:["site-wins"],queryFn:async()=>{const{data:e,error:t}=await Me.from("site_wins").select("*").order("created_at",{ascending:!1});if(t)throw t;return e||[]}})}function SGe(){const e=cs();return Is({mutationFn:async t=>{const{error:n}=await Me.from("site_wins").insert(t);if(n)throw n},onSuccess:()=>e.invalidateQueries({queryKey:["site-wins"]})})}const kGe=()=>{const{data:e}=Cc(),{data:t}=JH(),n=yGe(),r=SGe(),[i,s]=C.useState({}),a=e||[],o=(t||[]).reduce((f,p)=>(f[p.page_id]=p,f),{}),c=(f,p)=>{var m;return i[f]&&p in i[f]?i[f][p]:((m=o[f])==null?void 0:m[p])??(p==="notes"?"":!1)},u=(f,p,m)=>{s(g=>({...g,[f]:{...g[f],[p]:m}}))},d=async(f,p,m)=>{const g=o[f],y=i[f]||{};try{await n.mutateAsync({page_id:f,page_path:p,...y}),y.google_indexed&&!(g!=null&&g.google_indexed)&&await r.mutateAsync({win_type:"indexed",title:`${m} indexed on Google`,page_path:p}),y.bing_indexed&&!(g!=null&&g.bing_indexed)&&await r.mutateAsync({win_type:"indexed",title:`${m} indexed on Bing`,page_path:p}),y.rich_results&&!(g!=null&&g.rich_results)&&await r.mutateAsync({win_type:"rich_results",title:`Rich results detected for ${m}`,page_path:p}),s(v=>{const x={...v};return delete x[f],x}),Ew.success("Saved")}catch{Ew.error("Failed to save")}},A=[...[{id:"static-home",title:"Home",path:"/"},{id:"static-about",title:"About",path:"/about"},{id:"static-contact",title:"Contact",path:"/contact"}].map(f=>({id:f.id,title:f.title,path:f.path,status:"published"})),...a.map(f=>{var p;return{id:f.id,title:f.title,path:`/${((p=f.category)==null?void 0:p.slug)||"page"}/${f.slug}`,status:f.status}})];return l.jsxs("div",{className:"space-y-4",children:[l.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider text-muted-foreground",children:"Indexing Tracker"}),l.jsx("div",{className:"border rounded-lg overflow-hidden",children:l.jsxs(qf,{children:[l.jsx(Wf,{children:l.jsxs(Ei,{children:[l.jsx(yn,{className:"w-[200px]",children:"Page"}),l.jsx(yn,{className:"w-[80px]",children:"Status"}),l.jsx(yn,{className:"w-[80px] text-center",children:"Google"}),l.jsx(yn,{className:"w-[80px] text-center",children:"Bing"}),l.jsx(yn,{className:"w-[80px] text-center",children:"Rich"}),l.jsx(yn,{className:"w-[140px]",children:"First Indexed"}),l.jsx(yn,{children:"Notes"}),l.jsx(yn,{className:"w-[60px]"})]})}),l.jsx(Gf,{children:A.map(f=>l.jsxs(Ei,{children:[l.jsx(sn,{children:l.jsxs("div",{children:[l.jsx("p",{className:"font-medium text-sm",children:f.title}),l.jsx("p",{className:"text-xs text-muted-foreground",children:f.path})]})}),l.jsx(sn,{children:l.jsx("span",{className:`text-xs uppercase tracking-wider ${f.status==="published"?"text-green-600":"text-muted-foreground"}`,children:f.status})}),l.jsx(sn,{className:"text-center",children:l.jsx(pc,{checked:!!c(f.id,"google_indexed"),onCheckedChange:p=>u(f.id,"google_indexed",p)})}),l.jsx(sn,{className:"text-center",children:l.jsx(pc,{checked:!!c(f.id,"bing_indexed"),onCheckedChange:p=>u(f.id,"bing_indexed",p)})}),l.jsx(sn,{className:"text-center",children:l.jsx(pc,{checked:!!c(f.id,"rich_results"),onCheckedChange:p=>u(f.id,"rich_results",p)})}),l.jsx(sn,{children:l.jsx(Xe,{type:"date",className:"h-8 text-xs",value:(c(f.id,"first_indexed_at")||"").slice(0,10),onChange:p=>u(f.id,"first_indexed_at",p.target.value?new Date(p.target.value).toISOString():null)})}),l.jsx(sn,{children:l.jsx(Vi,{className:"h-8 min-h-[2rem] text-xs resize-none",placeholder:"Notes...",value:c(f.id,"notes")||"",onChange:p=>u(f.id,"notes",p.target.value)})}),l.jsx(sn,{children:i[f.id]&&l.jsx(xe,{size:"icon",variant:"ghost",onClick:()=>d(f.id,f.path,f.title),children:l.jsx(Pb,{className:"w-4 h-4"})})})]},f.id))})]})})]})};function tr(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 wd(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function _Ge(e,t){const n=tr(e);return isNaN(t)?wd(e,NaN):(n.setDate(n.getDate()+t),n)}const bAe=6048e5,jGe=864e5,VS=43200,Xq=1440;let BGe={};function V2(){return BGe}function m1(e,t){var o,c,u,d;const n=V2(),r=(t==null?void 0:t.weekStartsOn)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,i=tr(e),s=i.getDay(),a=(s<r?7:0)+s-r;return i.setDate(i.getDate()-a),i.setHours(0,0,0,0),i}function EB(e){return m1(e,{weekStartsOn:1})}function CAe(e){const t=tr(e),n=t.getFullYear(),r=wd(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=EB(r),s=wd(e,0);s.setFullYear(n,0,4),s.setHours(0,0,0,0);const a=EB(s);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function Jq(e){const t=tr(e);return t.setHours(0,0,0,0),t}function TB(e){const t=tr(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function NGe(e,t){const n=Jq(e),r=Jq(t),i=+n-TB(n),s=+r-TB(r);return Math.round((i-s)/jGe)}function EGe(e){const t=CAe(e),n=wd(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),EB(n)}function w_(e,t){const n=tr(e),r=tr(t),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function TGe(e){return wd(e,Date.now())}function PGe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function IGe(e){if(!PGe(e)&&typeof e!="number")return!1;const t=tr(e);return!isNaN(Number(t))}function OGe(e,t){const n=tr(e),r=tr(t),i=n.getFullYear()-r.getFullYear(),s=n.getMonth()-r.getMonth();return i*12+s}function FGe(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function MGe(e,t){return+tr(e)-+tr(t)}function LGe(e){const t=tr(e);return t.setHours(23,59,59,999),t}function RGe(e){const t=tr(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function DGe(e){const t=tr(e);return+LGe(t)==+RGe(t)}function UGe(e,t){const n=tr(e),r=tr(t),i=w_(n,r),s=Math.abs(OGe(n,r));let a;if(s<1)a=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-i*s);let o=w_(n,r)===-i;DGe(tr(e))&&s===1&&w_(e,r)===1&&(o=!1),a=i*(s-Number(o))}return a===0?0:a}function HGe(e,t,n){const r=MGe(e,t)/1e3;return FGe(n==null?void 0:n.roundingMethod)(r)}function QGe(e){const t=tr(e),n=wd(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const $Ge={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"}},zGe=(e,t,n)=>{let r;const i=$Ge[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function p4(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const VGe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},KGe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},qGe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},WGe={date:p4({formats:VGe,defaultWidth:"full"}),time:p4({formats:KGe,defaultWidth:"full"}),dateTime:p4({formats:qGe,defaultWidth:"full"})},GGe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},YGe=(e,t,n,r)=>GGe[e];function Bx(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const XGe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},JGe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ZGe={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"]},eYe={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"]},tYe={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"}},nYe={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"}},rYe=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},iYe={ordinalNumber:rYe,era:Bx({values:XGe,defaultWidth:"wide"}),quarter:Bx({values:JGe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Bx({values:ZGe,defaultWidth:"wide"}),day:Bx({values:eYe,defaultWidth:"wide"}),dayPeriod:Bx({values:tYe,defaultWidth:"wide",formattingValues:nYe,defaultFormattingWidth:"wide"})};function Nx(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const a=s[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(o)?aYe(o,h=>h.test(a)):sYe(o,h=>h.test(a));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(a.length);return{value:u,rest:d}}}function sYe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function aYe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function oYe(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(i.length);return{value:a,rest:o}}}const lYe=/^(\d+)(th|st|nd|rd)?/i,cYe=/\d+/i,uYe={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},dYe={any:[/^b/i,/^(a|c)/i]},hYe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fYe={any:[/1/i,/2/i,/3/i,/4/i]},AYe={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},pYe={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]},mYe={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},gYe={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]},yYe={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},vYe={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}},xYe={ordinalNumber:oYe({matchPattern:lYe,parsePattern:cYe,valueCallback:e=>parseInt(e,10)}),era:Nx({matchPatterns:uYe,defaultMatchWidth:"wide",parsePatterns:dYe,defaultParseWidth:"any"}),quarter:Nx({matchPatterns:hYe,defaultMatchWidth:"wide",parsePatterns:fYe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Nx({matchPatterns:AYe,defaultMatchWidth:"wide",parsePatterns:pYe,defaultParseWidth:"any"}),day:Nx({matchPatterns:mYe,defaultMatchWidth:"wide",parsePatterns:gYe,defaultParseWidth:"any"}),dayPeriod:Nx({matchPatterns:yYe,defaultMatchWidth:"any",parsePatterns:vYe,defaultParseWidth:"any"})},SAe={code:"en-US",formatDistance:zGe,formatLong:WGe,formatRelative:YGe,localize:iYe,match:xYe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function wYe(e){const t=tr(e);return NGe(t,QGe(t))+1}function bYe(e){const t=tr(e),n=+EB(t)-+EGe(t);return Math.round(n/bAe)+1}function kAe(e,t){var d,h,A,f;const n=tr(e),r=n.getFullYear(),i=V2(),s=(t==null?void 0:t.firstWeekContainsDate)??((h=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((f=(A=i.locale)==null?void 0:A.options)==null?void 0:f.firstWeekContainsDate)??1,a=wd(e,0);a.setFullYear(r+1,0,s),a.setHours(0,0,0,0);const o=m1(a,t),c=wd(e,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const u=m1(c,t);return n.getTime()>=o.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function CYe(e,t){var o,c,u,d;const n=V2(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,i=kAe(e,t),s=wd(e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),m1(s,t)}function SYe(e,t){const n=tr(e),r=+m1(n,t)-+CYe(n,t);return Math.round(r/bAe)+1}function Wn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const rh={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Wn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Wn(n+1,2)},d(e,t){return Wn(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Wn(e.getHours()%12||12,t.length)},H(e,t){return Wn(e.getHours(),t.length)},m(e,t){return Wn(e.getMinutes(),t.length)},s(e,t){return Wn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return Wn(i,t.length)}},fg={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Zq={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return rh.y(e,t)},Y:function(e,t,n,r){const i=kAe(e,r),s=i>0?i:1-i;if(t==="YY"){const a=s%100;return Wn(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Wn(s,t.length)},R:function(e,t){const n=CAe(e);return Wn(n,t.length)},u:function(e,t){const n=e.getFullYear();return Wn(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Wn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Wn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return rh.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Wn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=SYe(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):Wn(i,t.length)},I:function(e,t,n){const r=bYe(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Wn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):rh.d(e,t)},D:function(e,t,n){const r=wYe(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Wn(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Wn(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Wn(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return Wn(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=fg.noon:r===0?i=fg.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=fg.evening:r>=12?i=fg.afternoon:r>=4?i=fg.morning:i=fg.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return rh.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):rh.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Wn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Wn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):rh.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):rh.s(e,t)},S:function(e,t){return rh.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return tW(r);case"XXXX":case"XX":return LA(r);case"XXXXX":case"XXX":default:return LA(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return tW(r);case"xxxx":case"xx":return LA(r);case"xxxxx":case"xxx":default:return LA(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+eW(r,":");case"OOOO":default:return"GMT"+LA(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+eW(r,":");case"zzzz":default:return"GMT"+LA(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Wn(r,t.length)},T:function(e,t,n){const r=e.getTime();return Wn(r,t.length)}};function eW(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+Wn(s,2)}function tW(e,t){return e%60===0?(e>0?"-":"+")+Wn(Math.abs(e)/60,2):LA(e,t)}function LA(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Wn(Math.trunc(r/60),2),s=Wn(r%60,2);return n+i+t+s}const nW=(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"})}},_Ae=(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"})}},kYe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return nW(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",nW(r,t)).replace("{{time}}",_Ae(i,t))},_Ye={p:_Ae,P:kYe},jYe=/^D+$/,BYe=/^Y+$/,NYe=["D","DD","YY","YYYY"];function EYe(e){return jYe.test(e)}function TYe(e){return BYe.test(e)}function PYe(e,t,n){const r=IYe(e,t,n);if(console.warn(r),NYe.includes(e))throw new RangeError(r)}function IYe(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const OYe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,FYe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,MYe=/^'([^]*?)'?$/,LYe=/''/g,RYe=/[a-zA-Z]/;function DYe(e,t,n){var d,h,A,f;const r=V2(),i=r.locale??SAe,s=r.firstWeekContainsDate??((h=(d=r.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,a=r.weekStartsOn??((f=(A=r.locale)==null?void 0:A.options)==null?void 0:f.weekStartsOn)??0,o=tr(e);if(!IGe(o))throw new RangeError("Invalid time value");let c=t.match(FYe).map(p=>{const m=p[0];if(m==="p"||m==="P"){const g=_Ye[m];return g(p,i.formatLong)}return p}).join("").match(OYe).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const m=p[0];if(m==="'")return{isToken:!1,value:UYe(p)};if(Zq[m])return{isToken:!0,value:p};if(m.match(RYe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:p}});i.localize.preprocessor&&(c=i.localize.preprocessor(o,c));const u={firstWeekContainsDate:s,weekStartsOn:a,locale:i};return c.map(p=>{if(!p.isToken)return p.value;const m=p.value;(TYe(m)||EYe(m))&&PYe(m,t,String(e));const g=Zq[m[0]];return g(o,m,i.localize,u)}).join("")}function UYe(e){const t=e.match(MYe);return t?t[1].replace(LYe,"'"):e}function HYe(e,t,n){const r=V2(),i=(n==null?void 0:n.locale)??r.locale??SAe,s=2520,a=w_(e,t);if(isNaN(a))throw new RangeError("Invalid time value");const o=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:a});let c,u;a>0?(c=tr(t),u=tr(e)):(c=tr(e),u=tr(t));const d=HGe(u,c),h=(TB(u)-TB(c))/1e3,A=Math.round((d-h)/60);let f;if(A<2)return n!=null&&n.includeSeconds?d<5?i.formatDistance("lessThanXSeconds",5,o):d<10?i.formatDistance("lessThanXSeconds",10,o):d<20?i.formatDistance("lessThanXSeconds",20,o):d<40?i.formatDistance("halfAMinute",0,o):d<60?i.formatDistance("lessThanXMinutes",1,o):i.formatDistance("xMinutes",1,o):A===0?i.formatDistance("lessThanXMinutes",1,o):i.formatDistance("xMinutes",A,o);if(A<45)return i.formatDistance("xMinutes",A,o);if(A<90)return i.formatDistance("aboutXHours",1,o);if(A<Xq){const p=Math.round(A/60);return i.formatDistance("aboutXHours",p,o)}else{if(A<s)return i.formatDistance("xDays",1,o);if(A<VS){const p=Math.round(A/Xq);return i.formatDistance("xDays",p,o)}else if(A<VS*2)return f=Math.round(A/VS),i.formatDistance("aboutXMonths",f,o)}if(f=UGe(u,c),f<12){const p=Math.round(A/VS);return i.formatDistance("xMonths",p,o)}else{const p=f%12,m=Math.trunc(f/12);return p<3?i.formatDistance("aboutXYears",m,o):p<9?i.formatDistance("overXYears",m,o):i.formatDistance("almostXYears",m+1,o)}}function Py(e,t){return HYe(e,TGe(e),t)}const QYe={indexed:l.jsx(C2,{className:"w-4 h-4 text-green-500"}),rich_results:l.jsx(Ts,{className:"w-4 h-4 text-yellow-500"}),published:l.jsx(_2e,{className:"w-4 h-4 text-blue-500"}),schema:l.jsx(Ure,{className:"w-4 h-4 text-purple-500"})},$Ye=()=>{const{data:e}=CGe(),{data:t}=JH(),{data:n}=Cc(),{total:r}=wAe(),i=(n||[]).filter(c=>c.status==="published").length,s=(t||[]).filter(c=>c.google_indexed||c.bing_indexed).length,a=(t||[]).filter(c=>c.rich_results).length,o=r>=75?"text-green-600":r>=50?"text-yellow-600":"text-destructive";return l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[l.jsx("div",{className:`text-6xl font-bold ${o}`,children:r}),l.jsx("p",{className:"text-sm text-muted-foreground uppercase tracking-wider",children:"Site Readiness Score"}),l.jsx(Cv,{value:r,className:"h-3 w-64"})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[l.jsxs("div",{className:"border rounded-lg p-4 text-center bg-card",children:[l.jsx("p",{className:"text-2xl font-bold",children:i}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Published"})]}),l.jsxs("div",{className:"border rounded-lg p-4 text-center bg-card",children:[l.jsx("p",{className:"text-2xl font-bold",children:s}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Indexed"})]}),l.jsxs("div",{className:"border rounded-lg p-4 text-center bg-card",children:[l.jsx("p",{className:"text-2xl font-bold",children:a}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Rich Results"})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx("h3",{className:"text-sm font-medium uppercase tracking-wider text-muted-foreground",children:"Recent Wins"}),(!e||e.length===0)&&l.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No wins yet — they'll appear here as pages get indexed and milestones are hit."}),l.jsx("div",{className:"space-y-2",children:(e||[]).map(c=>l.jsxs("div",{className:"flex items-start gap-3 border rounded-lg p-3 bg-card",children:[l.jsx("div",{className:"mt-0.5",children:QYe[c.win_type]||l.jsx(Ure,{className:"w-4 h-4 text-muted-foreground"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium",children:c.title}),c.description&&l.jsx("p",{className:"text-xs text-muted-foreground",children:c.description})]}),l.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:DYe(new Date(c.created_at),"MMM d")})]},c.id))})]})]})},zYe=()=>{const{data:e}=eA(),{data:t}=Cc(),{configMap:n}=Os(),[r,i]=C.useState("admin"),s=e||[],a=t||[];return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:()=>i("admin"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded text-xs uppercase tracking-wider font-medium transition-colors ${r==="admin"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:[l.jsx(hU,{className:"w-3.5 h-3.5"}),"Admin"]}),l.jsxs("button",{onClick:()=>i("client"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded text-xs uppercase tracking-wider font-medium transition-colors ${r==="client"?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:[l.jsx(Tb,{className:"w-3.5 h-3.5"}),"Client"]})]}),r==="client"?l.jsx($Ye,{}):l.jsxs("div",{className:"space-y-8",children:[l.jsx(vGe,{}),l.jsxs(ym,{defaultValue:"categories",className:"space-y-4",children:[l.jsxs(Vf,{className:"bg-muted/50 p-1",children:[l.jsx(Hn,{value:"categories",className:"text-xs uppercase tracking-wider",children:"Categories"}),l.jsx(Hn,{value:"subpages",className:"text-xs uppercase tracking-wider",children:"Sub-Pages"}),l.jsx(Hn,{value:"static",className:"text-xs uppercase tracking-wider",children:"Static Pages"}),l.jsx(Hn,{value:"indexing",className:"text-xs uppercase tracking-wider",children:"Indexing"})]}),l.jsxs(Qn,{value:"categories",className:"space-y-3",children:[s.map(o=>l.jsxs(Xw,{children:[l.jsxs(Jw,{className:"flex items-center justify-between w-full border rounded-lg p-3 bg-card hover:bg-muted/30 transition-colors",children:[l.jsx("span",{className:"text-sm font-medium",children:o.name}),l.jsx(hc,{className:"w-4 h-4 text-muted-foreground"})]}),l.jsx(Zw,{className:"border border-t-0 rounded-b-lg p-4 bg-card",children:l.jsx(A4,{type:"category",category:o,pages:a})})]},o.id)),s.length===0&&l.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No categories created yet."})]}),l.jsxs(Qn,{value:"subpages",className:"space-y-3",children:[a.filter(o=>!o.is_parent).map(o=>l.jsxs(Xw,{children:[l.jsxs(Jw,{className:"flex items-center justify-between w-full border rounded-lg p-3 bg-card hover:bg-muted/30 transition-colors",children:[l.jsxs("div",{className:"text-left",children:[l.jsx("span",{className:"text-sm font-medium",children:o.title}),l.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:["(",o.status,")"]})]}),l.jsx(hc,{className:"w-4 h-4 text-muted-foreground"})]}),l.jsx(Zw,{className:"border border-t-0 rounded-b-lg p-4 bg-card",children:l.jsx(A4,{type:"subpage",page:o})})]},o.id)),a.filter(o=>!o.is_parent).length===0&&l.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No sub-pages created yet."})]}),l.jsx(Qn,{value:"static",className:"space-y-3",children:["Home","About","Contact"].map(o=>l.jsxs(Xw,{children:[l.jsxs(Jw,{className:"flex items-center justify-between w-full border rounded-lg p-3 bg-card hover:bg-muted/30 transition-colors",children:[l.jsx("span",{className:"text-sm font-medium",children:o}),l.jsx(hc,{className:"w-4 h-4 text-muted-foreground"})]}),l.jsx(Zw,{className:"border border-t-0 rounded-b-lg p-4 bg-card",children:l.jsx(A4,{type:"static",staticPageName:o,configMap:n})})]},o))}),l.jsx(Qn,{value:"indexing",children:l.jsx(kGe,{})})]})]})]})};function Ag({value:e,label:t}){return e===null?l.jsxs("span",{title:`${t}: N/A`,className:"inline-flex items-center gap-1",children:[l.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 uppercase",children:t}),l.jsx(jre,{size:14,className:"text-muted-foreground/40"})]}):l.jsxs("span",{title:`${t}: ${e?"Pass":"Fail"}`,className:"inline-flex items-center gap-1",children:[l.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 uppercase",children:t}),e?l.jsx(e0,{size:14,className:"text-emerald-500"}):l.jsx(b2,{size:14,className:"text-red-500"})]})}function rW({label:e,state:t,onClick:n}){const r={none:"text-red-500",submitted:"text-yellow-500",indexed:"text-emerald-500"},i={none:"Not submitted",submitted:"Submitted (pending)",indexed:"Indexed"},s=t==="indexed"?e0:t==="submitted"?uU:b2;return l.jsxs("button",{onClick:n,title:`${e}: ${i[t]} — Click to advance`,className:"inline-flex items-center gap-1 hover:opacity-80 transition-opacity",children:[l.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 uppercase",children:e}),l.jsx(s,{size:14,className:r[t],fill:t==="submitted"?"currentColor":"none"})]})}function iW(e,t){return t?"indexed":e?"submitted":"none"}function sW(e){return e==="none"?{submitted:!0,indexed:!1}:e==="submitted"?{submitted:!0,indexed:!0}:{submitted:!1,indexed:!1}}const PB=["/idx","/home-valuation"];function Ex({entry:e,onToggleIndex:t}){const n=e.scan,r=["aeo","category","subcategory"].includes(e.page_type),i=PB.includes(e.page_path),s=PB.includes(e.page_path),a=iW((n==null?void 0:n.google_submitted)??!1,(n==null?void 0:n.google_indexed)??!1),o=iW((n==null?void 0:n.bing_submitted)??!1,(n==null?void 0:n.bing_indexed)??!1);return l.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 border-b border-border/40 hover:bg-muted/30 transition-colors",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"font-mono text-sm truncate",children:e.page_path}),l.jsx(qt,{variant:"outline",className:"text-[10px] uppercase tracking-wider shrink-0",children:e.page_type})]}),e.page_title&&l.jsx("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:e.page_title})]}),l.jsxs("div",{className:"flex items-center gap-2.5 shrink-0 flex-wrap justify-end",children:[l.jsx(rW,{label:"G",state:a,onClick:()=>t(e.page_path,"google",sW(a))}),l.jsx(rW,{label:"B",state:o,onClick:()=>t(e.page_path,"bing",sW(o))}),l.jsx(Ag,{value:n?i?null:n.has_schema:null,label:"S"}),l.jsx(Ag,{value:n&&r?n.faq_schema_matches:null,label:"F"}),l.jsx(Ag,{value:n?n.has_meta_title&&n.has_meta_description:null,label:"M"}),l.jsx(Ag,{value:(n==null?void 0:n.in_sitemap)??null,label:"SM"}),l.jsx(Ag,{value:n?s?null:n.in_aeo_sitemap??!1:null,label:"AEO"}),l.jsx(Ag,{value:(n==null?void 0:n.in_llms_txt)??null,label:"LLM"})]})]})}function KS({title:e,count:t}){return l.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-muted/50 border-b border-border",children:[l.jsx("span",{className:"text-xs font-semibold uppercase tracking-widest text-muted-foreground",children:e}),l.jsx(qt,{variant:"secondary",className:"text-[10px]",children:t})]})}const aW=[{path:"/",title:"Home"},{path:"/about",title:"About"},{path:"/about/testimonials",title:"Testimonials"},{path:"/contact",title:"Contact"},{path:"/idx",title:"Home Search"},{path:"/home-valuation",title:"Home Valuation"},{path:"/privacy-policy",title:"Privacy Policy"},{path:"/terms-of-service",title:"Terms of Service"},{path:"/accessibility",title:"Accessibility"}],jAe=[{path:"/blog",title:"Blog"},{path:"/properties",title:"Properties"}];jAe.map(e=>e.path);function VYe(){var x;const e=cs(),{data:t,isLoading:n}=gr({queryKey:["crawl-scan-results"],queryFn:async()=>{const{data:w,error:b}=await Me.from("crawl_scan_results").select("*").order("page_type").order("page_path");if(b)throw b;return w||[]}}),{data:r,isLoading:i}=eA(),{data:s,isLoading:a}=Cc(),o=n||i||a,c=C.useMemo(()=>{const w={};for(const b of t||[])w[b.page_path]=b;return w},[t]),u=C.useMemo(()=>{const w=[],b=new Set;for(const T of aW)w.push({page_path:T.path,page_title:T.title,page_type:"static",scan:c[T.path]}),b.add(T.path);const k=new Set(aW.map(T=>T.path)),j=(r||[]).filter(T=>T.enabled),B={};for(const T of j)B[T.id]=T;const E=j.filter(T=>!T.parent_id),I=j.filter(T=>T.parent_id);for(const T of E){const N=`/${T.slug}`;b.has(N)||k.has(N)||(w.push({page_path:N,page_title:T.name,page_type:"category",scan:c[N]}),b.add(N))}for(const T of I){const N=B[T.parent_id];if(!N)continue;const F=`/${N.slug}/${T.slug}`;b.has(F)||k.has(F)||(w.push({page_path:F,page_title:T.name,page_type:"subcategory",scan:c[F]}),b.add(F))}for(const T of s||[]){const N=(r||[]).find(L=>L.id===T.category_id);if(!(N!=null&&N.enabled))continue;let F;if(N.parent_id){const L=B[N.parent_id];F=L?`/${L.slug}/${N.slug}/${T.slug}`:`/${N.slug}/${T.slug}`}else F=`/${N.slug}/${T.slug}`;b.has(F)||(w.push({page_path:F,page_title:T.title,page_type:"aeo",scan:c[F]}),b.add(F))}for(const T of jAe)b.has(T.path)||(w.push({page_path:T.path,page_title:T.title,page_type:"dormant",scan:c[T.path]}),b.add(T.path));return w},[t,r,s,c]),d=Is({mutationFn:async({page_path:w,field:b,next:k})=>{const j={};j[`${b}_submitted`]=k.submitted,j[`${b}_indexed`]=k.indexed;const{data:B}=await Me.from("crawl_scan_results").select("id").eq("page_path",w).maybeSingle();if(B){const{error:E}=await Me.from("crawl_scan_results").update(j).eq("page_path",w);if(E)throw E}else{const E=u.find(T=>T.page_path===w),{error:I}=await Me.from("crawl_scan_results").insert({page_path:w,page_title:(E==null?void 0:E.page_title)||w,page_type:(E==null?void 0:E.page_type)==="dormant"?"static":(E==null?void 0:E.page_type)||"static",...j});if(I)throw I}},onSuccess:()=>e.invalidateQueries({queryKey:["crawl-scan-results"]}),onError:w=>Ew.error(`Update failed: ${w.message}`)}),h=(w,b,k)=>{d.mutate({page_path:w,field:b,next:k})},A=Is({mutationFn:async()=>{const{data:{session:w}}=await Me.auth.getSession();if(!w)throw new Error("Not authenticated");const b=await Me.functions.invoke("run-crawl-scan",{headers:{Authorization:`Bearer ${w.access_token}`}});if(b.error)throw b.error;return b.data},onSuccess:w=>{e.invalidateQueries({queryKey:["crawl-scan-results"]});const b=w.cleaned>0?` · ${w.cleaned} orphan(s) removed`:"";Ew.success(`Scan complete: ${w.scanned} pages checked${b}`)},onError:w=>Ew.error(`Scan failed: ${w.message}`)}),f=u.filter(w=>w.page_type!=="dormant"),p=u.filter(w=>w.page_type==="dormant"),m={static:f.filter(w=>w.page_type==="static"),category:f.filter(w=>w.page_type==="category"||w.page_type==="subcategory"),aeo:f.filter(w=>w.page_type==="aeo"),blog:f.filter(w=>w.page_type==="blog")},g=f.filter(w=>{if(!w.scan)return!1;const b=w.scan,j=!PB.includes(w.page_path)?b.has_schema:!0,B=b.has_meta_title&&b.has_meta_description,E=b.in_sitemap||b.in_aeo_sitemap,T=!PB.includes(w.page_path)&&w.page_path!=="/"?b.has_shadow_html:!0;return j&&B&&E&&T}).length,y=f.length,v=(x=t==null?void 0:t[0])==null?void 0:x.scan_timestamp;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:"Crawlability Map"}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"3-layer AEO visibility: Schema · Sitemaps · Shadow HTML · LLMs.txt"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[v&&l.jsxs("span",{className:"text-xs text-muted-foreground",children:["Last scan: ",new Date(v).toLocaleString()]}),l.jsxs(xe,{onClick:()=>A.mutate(),disabled:A.isPending,className:"gap-2",children:[A.isPending?l.jsx(Ba,{size:16,className:"animate-spin"}):l.jsx(Xc,{size:16}),"Run Full Scan"]})]})]}),y>0&&l.jsxs("div",{className:"flex items-center gap-4 p-4 rounded-lg bg-muted/30 border",children:[l.jsxs("div",{className:"text-center",children:[l.jsxs("div",{className:"text-3xl font-bold",children:[g,"/",y]}),l.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Pages Healthy"})]}),l.jsx("div",{className:"flex-1 h-3 bg-muted rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full bg-emerald-500 rounded-full transition-all",style:{width:`${y>0?g/y*100:0}%`}})}),l.jsxs("div",{className:"text-sm font-medium",children:[y>0?Math.round(g/y*100):0,"%"]})]}),l.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted-foreground p-3 rounded-md bg-muted/20 border",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"G"})," Google"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"B"})," Bing"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"S"})," JSON-LD Schema"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"F"})," FAQ Schema"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"M"})," Meta Tags"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"SM"})," Sitemap"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"AEO"})," AEO Sitemap / Shadow HTML"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"font-mono font-bold",children:"LLM"})," In llms.txt"]}),l.jsxs("span",{className:"flex items-center gap-1.5 ml-2 border-l pl-3 border-border",children:[l.jsx(b2,{size:12,className:"text-red-500"})," Not Submitted",l.jsx(uU,{size:12,className:"text-yellow-500 fill-yellow-500"})," Submitted",l.jsx(e0,{size:12,className:"text-emerald-500"})," Indexed / Pass",l.jsx(jre,{size:12,className:"text-muted-foreground/40"})," N/A"]})]}),o?l.jsx("div",{className:"flex items-center justify-center py-16",children:l.jsx(Ba,{className:"animate-spin text-muted-foreground",size:24})}):l.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[m.static.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(KS,{title:"Static Pages",count:m.static.length}),m.static.map(w=>l.jsx(Ex,{entry:w,onToggleIndex:h},w.page_path))]}),m.category.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(KS,{title:"Category Pages",count:m.category.length}),m.category.map(w=>l.jsx(Ex,{entry:w,onToggleIndex:h},w.page_path))]}),m.aeo.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(KS,{title:"AEO / FAQ Pages",count:m.aeo.length}),m.aeo.map(w=>l.jsx(Ex,{entry:w,onToggleIndex:h},w.page_path))]}),m.blog.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(KS,{title:"Blog Posts",count:m.blog.length}),m.blog.map(w=>l.jsx(Ex,{entry:w,onToggleIndex:h},w.page_path))]}),p.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-muted/30 border-b border-border",children:[l.jsx("span",{className:"text-xs font-semibold uppercase tracking-widest text-muted-foreground/60",children:"Dormant Pages"}),l.jsx(qt,{variant:"outline",className:"text-[10px] text-muted-foreground/60",children:p.length})]}),p.map(w=>l.jsx("div",{className:"opacity-50",children:l.jsx(Ex,{entry:w,onToggleIndex:h})},w.page_path))]})]})]})}const KYe=()=>{const{configMap:e,isLoading:t}=Os(),{data:n,isLoading:r}=Cc(),i=(n||[]).filter(u=>u.status==="published"),s=i.filter(u=>u.schema_markup),a=C.useMemo(()=>{if(!n||i.length===0)return{clean:!0,count:0};let u=0;for(const d of i){const h=[d.intro_text,d.body_content,...Array.isArray(d.faq_json)?d.faq_json.map(A=>`${A.question} ${A.answer}`):[]].filter(Boolean).join(" ");u+=Ff(h).filter(A=>A.severity==="critical").length}return{clean:u===0,count:u}},[n,i]);if(t||r)return null;const o=[{label:"Config",healthy:!!(e.agent_name&&e.agent_market),tooltip:e.agent_name&&e.agent_market?"Agent name and market are configured":"Set agent name and market in Agent Config tab"},{label:"Pages",healthy:(n||[]).length>0,tooltip:(n||[]).length>0?`${(n||[]).length} page(s) created`:"No AEO pages created yet"},{label:"Schema",healthy:i.length===0||s.length===i.length,tooltip:i.length===0?"No published pages to check":`${s.length}/${i.length} published pages have schema markup`},{label:"Fair Housing",healthy:a.clean,tooltip:a.clean?"All published content passes Fair Housing compliance":`${a.count} critical Fair Housing issue(s) found in published content`}],c=o.every(u=>u.healthy);return l.jsx(jU,{children:l.jsxs("div",{className:`flex items-center gap-6 px-4 py-2.5 border rounded text-xs tracking-wider uppercase ${c?"border-border bg-muted/30":"border-destructive/30 bg-destructive/5"}`,children:[l.jsx("span",{className:"font-medium text-muted-foreground",children:"Site Health"}),o.map(u=>l.jsxs(BU,{children:[l.jsx(NU,{asChild:!0,children:l.jsxs("div",{className:"flex items-center gap-1.5 cursor-default",children:[l.jsx("span",{className:`w-2 h-2 rounded-full ${u.healthy?"bg-green-500":"bg-destructive"}`}),l.jsx("span",{className:"text-muted-foreground",children:u.label})]})}),l.jsx(bE,{children:l.jsx("p",{children:u.tooltip})})]},u.label))]})})},qYe=({open:e,onOpenChange:t,syncReport:n,setSyncReport:r,isSyncing:i})=>{const[s,a]=C.useState(!1),[o,c]=C.useState(!1),[u,d]=C.useState(!1),[h,A]=C.useState(null),f="khmmwvmdbhaplcfcndjx",p="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",m=async()=>{var b,k;a(!0);try{const j=(b=n==null?void 0:n.audit)==null?void 0:b.some(N=>{var F,L;return((F=N.contentSync)==null?void 0:F.includes("llms"))||((L=N.contentSync)==null?void 0:L.includes("both"))}),B=(k=n==null?void 0:n.audit)==null?void 0:k.some(N=>{var F,L;return((F=N.contentSync)==null?void 0:F.includes("html"))||((L=N.contentSync)==null?void 0:L.includes("both"))}),I=await fetch(`https://${f}.supabase.co/functions/v1/sync-site-content?fix=${j&&B?"all":j?"llms":B?"html":"all"}`,{headers:{apikey:p}});if(!I.ok)throw new Error(await I.text());const T=await I.json();r(T),De({title:"Content mismatches fixed",description:`${T.summary.content_mismatches} remaining mismatches`})}catch(j){De({title:"Fix failed",description:j.message,variant:"destructive"})}finally{a(!1)}},g=async()=>{c(!0);try{const b=await fetch(`https://${f}.supabase.co/functions/v1/sync-site-content?fix=html`,{headers:{apikey:p}});if(!b.ok)throw new Error(await b.text());const k=await b.json();r(k),De({title:"HTML issues fixed",description:`${k.summary.html_issues||0} remaining issues`})}catch(b){De({title:"Fix failed",description:b.message,variant:"destructive"})}finally{c(!1)}},y=async()=>{d(!0);try{await fetch(`https://${f}.supabase.co/functions/v1/sitemap`,{headers:{apikey:p}});const b=await fetch(`https://${f}.supabase.co/functions/v1/sync-site-content?fix=all`,{headers:{apikey:p}});if(!b.ok)throw new Error(await b.text());const k=await b.json();r(k),De({title:"All issues fixed",description:"Sitemaps rebuilt, HTML & llms files regenerated."})}catch(b){De({title:"Fix All failed",description:b.message,variant:"destructive"})}finally{d(!1)}},v=async b=>{const k=b.path;A(k);try{const j=b.sourceId?`&id=${b.sourceId}`:"",B=b.type==="core"?"core":"aeo";await fetch(`https://${f}.supabase.co/functions/v1/generate-static-html?type=${B}${j}`,{headers:{apikey:p}}),await Promise.all([fetch(`https://${f}.supabase.co/functions/v1/generate-llms-txt?type=index&rebuild=true`,{headers:{apikey:p}}),fetch(`https://${f}.supabase.co/functions/v1/generate-llms-txt?type=full&rebuild=true`,{headers:{apikey:p}})]),De({title:`Regenerated assets for "${b.title}"`});const E=await fetch(`https://${f}.supabase.co/functions/v1/sync-site-content`,{headers:{apikey:p}});if(E.ok){const I=await E.json();r(I)}}catch(j){De({title:"Row fix failed",description:j.message,variant:"destructive"})}finally{A(null)}},x=b=>{var k,j;return b.llmsIndex==="❌"||b.llmsFull==="❌"||b.staticHtml==="❌"||b.redirect==="❌"||((k=b.contentSync)==null?void 0:k.includes("❌"))||((j=b.contentSync)==null?void 0:j.includes("⚠️"))},w=n?(n.summary.has_gaps||0)+(n.summary.html_issues||0)+(n.summary.content_mismatches||0):0;return l.jsx(No,{open:e,onOpenChange:t,children:l.jsxs(Ka,{className:"max-w-4xl max-h-[85vh] overflow-y-auto",children:[l.jsx(qa,{children:l.jsx(Wa,{children:"Site Sync & Coverage Audit"})}),i?l.jsxs("div",{className:"py-12 flex flex-col items-center justify-center text-muted-foreground gap-4",children:[l.jsx(Xc,{className:"w-8 h-8 animate-spin text-primary"}),l.jsx("p",{children:"Synchronizing sitemap, static HTML files, and AI models text..."})]}):n?l.jsxs("div",{className:"space-y-6 mt-4",children:[l.jsxs("div",{className:"grid grid-cols-3 md:grid-cols-6 gap-4",children:[l.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[l.jsx("p",{className:"text-2xl font-bold",children:n.summary.total_pages}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Total Pages"})]}),l.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[l.jsx("p",{className:"text-2xl font-bold text-green-600",children:n.summary.fully_covered}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Covered"})]}),l.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[l.jsx("p",{className:`text-2xl font-bold ${n.summary.has_gaps>0?"text-destructive":"text-green-600"}`,children:n.summary.has_gaps}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Missing Items"})]}),l.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[l.jsx("p",{className:"text-2xl font-bold",children:n.summary.generated_html_files}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"HTML Files"})]}),l.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[l.jsx("p",{className:`text-2xl font-bold ${(n.summary.html_issues||0)>0?"text-destructive":"text-green-600"}`,children:n.summary.html_issues||0}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"HTML Issues"})]}),l.jsxs("div",{className:"bg-muted p-4 rounded-lg text-center",children:[l.jsx("p",{className:`text-2xl font-bold ${n.summary.content_mismatches>0?"text-destructive":"text-green-600"}`,children:n.summary.content_mismatches}),l.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Content Mismatches"})]})]}),w>0&&l.jsxs("div",{className:"flex items-center gap-3 p-4 bg-primary/10 border border-primary/20 rounded-lg",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("p",{className:"text-sm font-medium",children:[w," total issue",w!==1?"s":""," detected across all checks"]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Rebuilds sitemaps, regenerates all HTML files, and refreshes llms.txt files in one pass."})]}),l.jsxs(xe,{size:"sm",onClick:y,disabled:u,children:[l.jsx(P7,{className:`w-3.5 h-3.5 mr-1.5 ${u?"animate-spin":""}`}),u?"Fixing Everything...":"Fix All Issues"]})]}),n.summary.content_mismatches>0&&l.jsxs("div",{className:"flex items-center gap-3 p-4 bg-destructive/10 border border-destructive/20 rounded-lg",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("p",{className:"text-sm font-medium",children:[n.summary.content_mismatches," content mismatch",n.summary.content_mismatches!==1?"es":""," detected"]}),l.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"The database (source of truth) will be used to regenerate stale llms and/or HTML files."})]}),l.jsxs(xe,{size:"sm",variant:"destructive",onClick:m,disabled:s,children:[l.jsx(Xc,{className:`w-3.5 h-3.5 mr-1.5 ${s?"animate-spin":""}`}),s?"Fixing...":"Fix Mismatches"]})]}),(n.summary.html_issues||0)>0&&l.jsxs("div",{className:"flex items-center gap-3 p-4 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("p",{className:"text-sm font-medium",children:[n.summary.html_issues," HTML issue",n.summary.html_issues!==1?"s":""," detected"]}),l.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[n.summary.missing_html>0&&`${n.summary.missing_html} missing file${n.summary.missing_html!==1?"s":""}`,n.summary.missing_html>0&&n.summary.missing_redirects>0&&" · ",n.summary.missing_redirects>0&&`${n.summary.missing_redirects} missing redirect${n.summary.missing_redirects!==1?"s":""}`," — ","Regenerating will create missing files and inject redirect scripts."]})]}),l.jsxs(xe,{size:"sm",variant:"outline",className:"border-amber-500/30 hover:bg-amber-500/10",onClick:g,disabled:o,children:[l.jsx(Xc,{className:`w-3.5 h-3.5 mr-1.5 ${o?"animate-spin":""}`}),o?"Fixing...":"Fix All HTML Issues"]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-medium mb-3",children:"Coverage Audit"}),l.jsx("div",{className:"border rounded-md overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"bg-muted",children:l.jsxs("tr",{children:[l.jsx("th",{className:"p-3 text-left font-medium",children:"Page Title"}),l.jsx("th",{className:"p-3 text-left font-medium",children:"Path"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"Sitemap"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"AEO Sitemap"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"llms.txt"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"llms-full"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"HTML"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"Redirect"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"Content Sync"}),l.jsx("th",{className:"p-3 text-center font-medium",children:"Fix"})]})}),l.jsx("tbody",{className:"divide-y",children:n.audit.map((b,k)=>l.jsxs("tr",{className:"hover:bg-muted/50",children:[l.jsx("td",{className:"p-3 font-medium",children:b.title}),l.jsx("td",{className:"p-3 text-muted-foreground font-mono text-xs",children:b.path}),l.jsx("td",{className:"p-3 text-center",children:b.sitemap}),l.jsx("td",{className:"p-3 text-center",children:b.sitemapAeo||"—"}),l.jsx("td",{className:"p-3 text-center",title:b.llmsIndexDetail||"",children:b.llmsIndex}),l.jsx("td",{className:"p-3 text-center",title:b.llmsFullDetail||"",children:b.llmsFull}),l.jsx("td",{className:"p-3 text-center",children:b.staticHtml}),l.jsx("td",{className:"p-3 text-center",children:b.redirect}),l.jsx("td",{className:"p-3 text-center",title:b.contentDetail||"",children:b.contentSync}),l.jsx("td",{className:"p-3 text-center",children:x(b)?l.jsx(xe,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>v(b),disabled:h===b.path,title:`Fix ${b.title}`,children:h===b.path?l.jsx(Xc,{className:"w-3.5 h-3.5 animate-spin"}):l.jsx(P7,{className:"w-3.5 h-3.5"})}):l.jsx("span",{className:"text-muted-foreground text-xs",children:"—"})})]},k))})]})})]})]}):null]})})};var WYe=Array.isArray,so=WYe,GYe=typeof Dh=="object"&&Dh&&Dh.Object===Object&&Dh,BAe=GYe,YYe=BAe,XYe=typeof self=="object"&&self&&self.Object===Object&&self,JYe=YYe||XYe||Function("return this")(),yu=JYe,ZYe=yu,eXe=ZYe.Symbol,K2=eXe,oW=K2,NAe=Object.prototype,tXe=NAe.hasOwnProperty,nXe=NAe.toString,Tx=oW?oW.toStringTag:void 0;function rXe(e){var t=tXe.call(e,Tx),n=e[Tx];try{e[Tx]=void 0;var r=!0}catch{}var i=nXe.call(e);return r&&(t?e[Tx]=n:delete e[Tx]),i}var iXe=rXe,sXe=Object.prototype,aXe=sXe.toString;function oXe(e){return aXe.call(e)}var lXe=oXe,lW=K2,cXe=iXe,uXe=lXe,dXe="[object Null]",hXe="[object Undefined]",cW=lW?lW.toStringTag:void 0;function fXe(e){return e==null?e===void 0?hXe:dXe:cW&&cW in Object(e)?cXe(e):uXe(e)}var Id=fXe;function AXe(e){return e!=null&&typeof e=="object"}var Od=AXe,pXe=Id,mXe=Od,gXe="[object Symbol]";function yXe(e){return typeof e=="symbol"||mXe(e)&&pXe(e)==gXe}var v0=yXe,vXe=so,xXe=v0,wXe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bXe=/^\w*$/;function CXe(e,t){if(vXe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||xXe(e)?!0:bXe.test(e)||!wXe.test(e)||t!=null&&e in Object(t)}var ZH=CXe;function SXe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var rA=SXe;const x0=In(rA);var kXe=Id,_Xe=rA,jXe="[object AsyncFunction]",BXe="[object Function]",NXe="[object GeneratorFunction]",EXe="[object Proxy]";function TXe(e){if(!_Xe(e))return!1;var t=kXe(e);return t==BXe||t==NXe||t==jXe||t==EXe}var eQ=TXe;const gn=In(eQ);var PXe=yu,IXe=PXe["__core-js_shared__"],OXe=IXe,m4=OXe,uW=function(){var e=/[^.]+$/.exec(m4&&m4.keys&&m4.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function FXe(e){return!!uW&&uW in e}var MXe=FXe,LXe=Function.prototype,RXe=LXe.toString;function DXe(e){if(e!=null){try{return RXe.call(e)}catch{}try{return e+""}catch{}}return""}var EAe=DXe,UXe=eQ,HXe=MXe,QXe=rA,$Xe=EAe,zXe=/[\\^$.*+?()[\]{}|]/g,VXe=/^\[object .+?Constructor\]$/,KXe=Function.prototype,qXe=Object.prototype,WXe=KXe.toString,GXe=qXe.hasOwnProperty,YXe=RegExp("^"+WXe.call(GXe).replace(zXe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function XXe(e){if(!QXe(e)||HXe(e))return!1;var t=UXe(e)?YXe:VXe;return t.test($Xe(e))}var JXe=XXe;function ZXe(e,t){return e==null?void 0:e[t]}var eJe=ZXe,tJe=JXe,nJe=eJe;function rJe(e,t){var n=nJe(e,t);return tJe(n)?n:void 0}var Cm=rJe,iJe=Cm,sJe=iJe(Object,"create"),S5=sJe,dW=S5;function aJe(){this.__data__=dW?dW(null):{},this.size=0}var oJe=aJe;function lJe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var cJe=lJe,uJe=S5,dJe="__lodash_hash_undefined__",hJe=Object.prototype,fJe=hJe.hasOwnProperty;function AJe(e){var t=this.__data__;if(uJe){var n=t[e];return n===dJe?void 0:n}return fJe.call(t,e)?t[e]:void 0}var pJe=AJe,mJe=S5,gJe=Object.prototype,yJe=gJe.hasOwnProperty;function vJe(e){var t=this.__data__;return mJe?t[e]!==void 0:yJe.call(t,e)}var xJe=vJe,wJe=S5,bJe="__lodash_hash_undefined__";function CJe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=wJe&&t===void 0?bJe:t,this}var SJe=CJe,kJe=oJe,_Je=cJe,jJe=pJe,BJe=xJe,NJe=SJe;function w0(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}w0.prototype.clear=kJe;w0.prototype.delete=_Je;w0.prototype.get=jJe;w0.prototype.has=BJe;w0.prototype.set=NJe;var EJe=w0;function TJe(){this.__data__=[],this.size=0}var PJe=TJe;function IJe(e,t){return e===t||e!==e&&t!==t}var tQ=IJe,OJe=tQ;function FJe(e,t){for(var n=e.length;n--;)if(OJe(e[n][0],t))return n;return-1}var k5=FJe,MJe=k5,LJe=Array.prototype,RJe=LJe.splice;function DJe(e){var t=this.__data__,n=MJe(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():RJe.call(t,n,1),--this.size,!0}var UJe=DJe,HJe=k5;function QJe(e){var t=this.__data__,n=HJe(t,e);return n<0?void 0:t[n][1]}var $Je=QJe,zJe=k5;function VJe(e){return zJe(this.__data__,e)>-1}var KJe=VJe,qJe=k5;function WJe(e,t){var n=this.__data__,r=qJe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var GJe=WJe,YJe=PJe,XJe=UJe,JJe=$Je,ZJe=KJe,eZe=GJe;function b0(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}b0.prototype.clear=YJe;b0.prototype.delete=XJe;b0.prototype.get=JJe;b0.prototype.has=ZJe;b0.prototype.set=eZe;var _5=b0,tZe=Cm,nZe=yu,rZe=tZe(nZe,"Map"),nQ=rZe,hW=EJe,iZe=_5,sZe=nQ;function aZe(){this.size=0,this.__data__={hash:new hW,map:new(sZe||iZe),string:new hW}}var oZe=aZe;function lZe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var cZe=lZe,uZe=cZe;function dZe(e,t){var n=e.__data__;return uZe(t)?n[typeof t=="string"?"string":"hash"]:n.map}var j5=dZe,hZe=j5;function fZe(e){var t=hZe(this,e).delete(e);return this.size-=t?1:0,t}var AZe=fZe,pZe=j5;function mZe(e){return pZe(this,e).get(e)}var gZe=mZe,yZe=j5;function vZe(e){return yZe(this,e).has(e)}var xZe=vZe,wZe=j5;function bZe(e,t){var n=wZe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var CZe=bZe,SZe=oZe,kZe=AZe,_Ze=gZe,jZe=xZe,BZe=CZe;function C0(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}C0.prototype.clear=SZe;C0.prototype.delete=kZe;C0.prototype.get=_Ze;C0.prototype.has=jZe;C0.prototype.set=BZe;var rQ=C0,TAe=rQ,NZe="Expected a function";function iQ(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(NZe);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=e.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(iQ.Cache||TAe),n}iQ.Cache=TAe;var PAe=iQ;const EZe=In(PAe);var TZe=PAe,PZe=500;function IZe(e){var t=TZe(e,function(r){return n.size===PZe&&n.clear(),r}),n=t.cache;return t}var OZe=IZe,FZe=OZe,MZe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,LZe=/\\(\\)?/g,RZe=FZe(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(MZe,function(n,r,i,s){t.push(i?s.replace(LZe,"$1"):r||n)}),t}),DZe=RZe;function UZe(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var sQ=UZe,fW=K2,HZe=sQ,QZe=so,$Ze=v0,zZe=1/0,AW=fW?fW.prototype:void 0,pW=AW?AW.toString:void 0;function IAe(e){if(typeof e=="string")return e;if(QZe(e))return HZe(e,IAe)+"";if($Ze(e))return pW?pW.call(e):"";var t=e+"";return t=="0"&&1/e==-zZe?"-0":t}var VZe=IAe,KZe=VZe;function qZe(e){return e==null?"":KZe(e)}var OAe=qZe,WZe=so,GZe=ZH,YZe=DZe,XZe=OAe;function JZe(e,t){return WZe(e)?e:GZe(e,t)?[e]:YZe(XZe(e))}var FAe=JZe,ZZe=v0,eet=1/0;function tet(e){if(typeof e=="string"||ZZe(e))return e;var t=e+"";return t=="0"&&1/e==-eet?"-0":t}var B5=tet,net=FAe,ret=B5;function iet(e,t){t=net(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ret(t[n++])];return n&&n==r?e:void 0}var aQ=iet,set=aQ;function aet(e,t,n){var r=e==null?void 0:set(e,t);return r===void 0?n:r}var MAe=aet;const Cl=In(MAe);function oet(e){return e==null}var cet=oet;const Cn=In(cet);var uet=Id,det=so,het=Od,fet="[object String]";function Aet(e){return typeof e=="string"||!det(e)&&het(e)&&uet(e)==fet}var pet=Aet;const q2=In(pet);var LAe={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 oQ=Symbol.for("react.element"),lQ=Symbol.for("react.portal"),N5=Symbol.for("react.fragment"),E5=Symbol.for("react.strict_mode"),T5=Symbol.for("react.profiler"),P5=Symbol.for("react.provider"),I5=Symbol.for("react.context"),met=Symbol.for("react.server_context"),O5=Symbol.for("react.forward_ref"),F5=Symbol.for("react.suspense"),M5=Symbol.for("react.suspense_list"),L5=Symbol.for("react.memo"),R5=Symbol.for("react.lazy"),get=Symbol.for("react.offscreen"),RAe;RAe=Symbol.for("react.module.reference");function Pl(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case oQ:switch(e=e.type,e){case N5:case T5:case E5:case F5:case M5:return e;default:switch(e=e&&e.$$typeof,e){case met:case I5:case O5:case R5:case L5:case P5:return e;default:return t}}case lQ:return t}}}Xn.ContextConsumer=I5;Xn.ContextProvider=P5;Xn.Element=oQ;Xn.ForwardRef=O5;Xn.Fragment=N5;Xn.Lazy=R5;Xn.Memo=L5;Xn.Portal=lQ;Xn.Profiler=T5;Xn.StrictMode=E5;Xn.Suspense=F5;Xn.SuspenseList=M5;Xn.isAsyncMode=function(){return!1};Xn.isConcurrentMode=function(){return!1};Xn.isContextConsumer=function(e){return Pl(e)===I5};Xn.isContextProvider=function(e){return Pl(e)===P5};Xn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===oQ};Xn.isForwardRef=function(e){return Pl(e)===O5};Xn.isFragment=function(e){return Pl(e)===N5};Xn.isLazy=function(e){return Pl(e)===R5};Xn.isMemo=function(e){return Pl(e)===L5};Xn.isPortal=function(e){return Pl(e)===lQ};Xn.isProfiler=function(e){return Pl(e)===T5};Xn.isStrictMode=function(e){return Pl(e)===E5};Xn.isSuspense=function(e){return Pl(e)===F5};Xn.isSuspenseList=function(e){return Pl(e)===M5};Xn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===N5||e===T5||e===E5||e===F5||e===M5||e===get||typeof e=="object"&&e!==null&&(e.$$typeof===R5||e.$$typeof===L5||e.$$typeof===P5||e.$$typeof===I5||e.$$typeof===O5||e.$$typeof===RAe||e.getModuleId!==void 0)};Xn.typeOf=Pl;LAe.exports=Xn;var yet=LAe.exports,vet=Id,xet=Od,wet="[object Number]";function bet(e){return typeof e=="number"||xet(e)&&vet(e)==wet}var DAe=bet;const Cet=In(DAe);var ket=DAe;function _et(e){return ket(e)&&e!=+e}var jet=_et;const W2=In(jet);var cc=function(t){return t===0?0:t>0?1:-1},ip=function(t){return q2(t)&&t.indexOf("%")===t.length-1},Ze=function(t){return Cet(t)&&!W2(t)},Ki=function(t){return Ze(t)||q2(t)},Bet=0,G2=function(t){var n=++Bet;return"".concat(t||"").concat(n)},sm=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ze(t)&&!q2(t))return r;var s;if(ip(t)){var a=t.indexOf("%");s=n*parseFloat(t.slice(0,a))/100}else s=+t;return W2(s)&&(s=r),i&&s>n&&(s=n),s},jh=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},Net=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},i=0;i<n;i++)if(!r[t[i]])r[t[i]]=!0;else return!0;return!1},ic=function(t,n){return Ze(t)&&Ze(n)?function(r){return t+r*(n-t)}:function(){return n}};function IB(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Cl(r,t))===n})}function Iy(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function qM(e){"@babel/helpers - typeof";return qM=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},qM(e)}var Eet=["viewBox","children"],Tet=["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"],mW=["points","pathLength"],g4={svg:Eet,polygon:mW,polyline:mW},cQ=["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"],OB=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(C.isValidElement(t)&&(r=t.props),!x0(r))return null;var i={};return Object.keys(r).forEach(function(s){cQ.includes(s)&&(i[s]=n||function(a){return r[s](r,a)})}),i},Pet=function(t,n,r){return function(i){return t(n,r,i),null}},FB=function(t,n,r){if(!x0(t)||qM(t)!=="object")return null;var i=null;return Object.keys(t).forEach(function(s){var a=t[s];cQ.includes(s)&&typeof a=="function"&&(i||(i={}),i[s]=Pet(a,n,r))}),i},Iet=["children"],Oet=["children"];function gW(e,t){if(e==null)return{};var n=Fet(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Fet(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}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 yW={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"},ld=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},vW=null,y4=null,uQ=function e(t){if(t===vW&&Array.isArray(y4))return y4;var n=[];return C.Children.forEach(t,function(r){Cn(r)||(yet.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),y4=n,vW=t,n};function Sl(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(i){return ld(i)}):r=[ld(t)],uQ(e).forEach(function(i){var s=Cl(i,"type.displayName")||Cl(i,"type.name");r.indexOf(s)!==-1&&n.push(i)}),n}function So(e,t){var n=Sl(e,t);return n&&n[0]}var xW=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,i=n.height;return!(!Ze(r)||r<=0||!Ze(i)||i<=0)},Met=["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"],Let=function(t){return t&&t.type&&q2(t.type)&&Met.indexOf(t.type)>=0},Ret=function(t){return t&&WM(t)==="object"&&"clipDot"in t},Det=function(t,n,r,i){var s,a=(s=g4==null?void 0:g4[i])!==null&&s!==void 0?s:[];return!gn(t)&&(i&&a.includes(n)||Tet.includes(n))||r&&cQ.includes(n)},jn=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(C.isValidElement(t)&&(i=t.props),!x0(i))return null;var s={};return Object.keys(i).forEach(function(a){var o;Det((o=i)===null||o===void 0?void 0:o[a],a,n,r)&&(s[a]=i[a])}),s},GM=function e(t,n){if(t===n)return!0;var r=C.Children.count(t);if(r!==C.Children.count(n))return!1;if(r===0)return!0;if(r===1)return wW(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var s=t[i],a=n[i];if(Array.isArray(s)||Array.isArray(a)){if(!e(s,a))return!1}else if(!wW(s,a))return!1}return!0},wW=function(t,n){if(Cn(t)&&Cn(n))return!0;if(!Cn(t)&&!Cn(n)){var r=t.props||{},i=r.children,s=gW(r,Iet),a=n.props||{},o=a.children,c=gW(a,Oet);return i&&o?Iy(s,c)&&GM(i,o):!i&&!o?Iy(s,c):!1}return!1},bW=function(t,n){var r=[],i={};return uQ(t).forEach(function(s,a){if(Let(s))r.push(s);else if(s){var o=ld(s.type),c=n[o]||{},u=c.handler,d=c.once;if(u&&(!d||!i[o])){var h=u(s,o,a);r.push(h),i[o]=!0}}}),r},Uet=function(t){var n=t&&t.type;return n&&yW[n]?yW[n]:null},Het=function(t,n){return uQ(n).indexOf(t)},Qet=["children","width","height","viewBox","className","style","title","desc"];function YM(){return YM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YM.apply(this,arguments)}function $et(e,t){if(e==null)return{};var n=zet(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zet(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function XM(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,s=e.className,a=e.style,o=e.title,c=e.desc,u=$et(e,Qet),d=i||{width:n,height:r,x:0,y:0},h=Pn("recharts-surface",s);return re.createElement("svg",YM({},jn(u,!0,"svg"),{className:h,width:n,height:r,style:a,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),re.createElement("title",null,o),re.createElement("desc",null,c),t)}var Vet=["children","className"];function JM(){return JM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},JM.apply(this,arguments)}function Ket(e,t){if(e==null)return{};var n=qet(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qet(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var gi=re.forwardRef(function(e,t){var n=e.children,r=e.className,i=Ket(e,Vet),s=Pn("recharts-layer",r);return re.createElement("g",JM({className:s},jn(i,!0),{ref:t}),n)}),cd=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s]};function Wet(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r<i;)s[r]=e[r+t];return s}var Get=Wet,Yet=Get;function Xet(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:Yet(e,t,n)}var Jet=Xet,Zet="\\ud800-\\udfff",ett="\\u0300-\\u036f",ttt="\\ufe20-\\ufe2f",ntt="\\u20d0-\\u20ff",rtt=ett+ttt+ntt,itt="\\ufe0e\\ufe0f",stt="\\u200d",att=RegExp("["+stt+Zet+rtt+itt+"]");function ott(e){return att.test(e)}var UAe=ott;function ltt(e){return e.split("")}var ctt=ltt,HAe="\\ud800-\\udfff",utt="\\u0300-\\u036f",dtt="\\ufe20-\\ufe2f",htt="\\u20d0-\\u20ff",ftt=utt+dtt+htt,Att="\\ufe0e\\ufe0f",ptt="["+HAe+"]",ZM="["+ftt+"]",eL="\\ud83c[\\udffb-\\udfff]",mtt="(?:"+ZM+"|"+eL+")",QAe="[^"+HAe+"]",$Ae="(?:\\ud83c[\\udde6-\\uddff]){2}",zAe="[\\ud800-\\udbff][\\udc00-\\udfff]",gtt="\\u200d",VAe=mtt+"?",KAe="["+Att+"]?",ytt="(?:"+gtt+"(?:"+[QAe,$Ae,zAe].join("|")+")"+KAe+VAe+")*",vtt=KAe+VAe+ytt,xtt="(?:"+[QAe+ZM+"?",ZM,$Ae,zAe,ptt].join("|")+")",wtt=RegExp(eL+"(?="+eL+")|"+xtt+vtt,"g");function btt(e){return e.match(wtt)||[]}var Ctt=btt,Stt=ctt,ktt=UAe,_tt=Ctt;function jtt(e){return ktt(e)?_tt(e):Stt(e)}var Btt=jtt,Ntt=Jet,Ett=UAe,Ttt=Btt,Ptt=OAe;function Itt(e){return function(t){t=Ptt(t);var n=Ett(t)?Ttt(t):void 0,r=n?n[0]:t.charAt(0),i=n?Ntt(n,1).join(""):t.slice(1);return r[e]()+i}}var Ott=Itt,Ftt=Ott,Mtt=Ftt("toUpperCase"),Ltt=Mtt;const D5=In(Ltt);function Ar(e){return function(){return e}}const qAe=Math.cos,MB=Math.sin,Sc=Math.sqrt,LB=Math.PI,U5=2*LB,tL=Math.PI,nL=2*tL,RA=1e-6,Rtt=nL-RA;function WAe(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Dtt(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return WAe;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class Utt{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?WAe:Dtt(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,s,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+s},${this._y1=+a}`}arcTo(t,n,r,i,s){if(t=+t,n=+n,r=+r,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let a=this._x1,o=this._y1,c=r-t,u=i-n,d=a-t,h=o-n,A=d*d+h*h;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(A>RA)if(!(Math.abs(h*c-u*d)>RA)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let f=r-a,p=i-o,m=c*c+u*u,g=f*f+p*p,y=Math.sqrt(m),v=Math.sqrt(A),x=s*Math.tan((tL-Math.acos((m+A-g)/(2*y*v)))/2),w=x/v,b=x/y;Math.abs(w-1)>RA&&this._append`L${t+w*d},${n+w*h}`,this._append`A${s},${s},0,0,${+(h*f>d*p)},${this._x1=t+b*c},${this._y1=n+b*u}`}}arc(t,n,r,i,s,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let o=r*Math.cos(i),c=r*Math.sin(i),u=t+o,d=n+c,h=1^a,A=a?i-s:s-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>RA||Math.abs(this._y1-d)>RA)&&this._append`L${u},${d}`,r&&(A<0&&(A=A%nL+nL),A>Rtt?this._append`A${r},${r},0,1,${h},${t-o},${n-c}A${r},${r},0,1,${h},${this._x1=u},${this._y1=d}`:A>RA&&this._append`A${r},${r},0,${+(A>=tL)},${h},${this._x1=t+r*Math.cos(s)},${this._y1=n+r*Math.sin(s)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function dQ(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new Utt(t)}function hQ(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function GAe(e){this._context=e}GAe.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 H5(e){return new GAe(e)}function YAe(e){return e[0]}function XAe(e){return e[1]}function JAe(e,t){var n=Ar(!0),r=null,i=H5,s=null,a=dQ(o);e=typeof e=="function"?e:e===void 0?YAe:Ar(e),t=typeof t=="function"?t:t===void 0?XAe:Ar(t);function o(c){var u,d=(c=hQ(c)).length,h,A=!1,f;for(r==null&&(s=i(f=a())),u=0;u<=d;++u)!(u<d&&n(h=c[u],u,c))===A&&((A=!A)?s.lineStart():s.lineEnd()),A&&s.point(+e(h,u,c),+t(h,u,c));if(f)return s=null,f+""||null}return o.x=function(c){return arguments.length?(e=typeof c=="function"?c:Ar(+c),o):e},o.y=function(c){return arguments.length?(t=typeof c=="function"?c:Ar(+c),o):t},o.defined=function(c){return arguments.length?(n=typeof c=="function"?c:Ar(!!c),o):n},o.curve=function(c){return arguments.length?(i=c,r!=null&&(s=i(r)),o):i},o.context=function(c){return arguments.length?(c==null?r=s=null:s=i(r=c),o):r},o}function qS(e,t,n){var r=null,i=Ar(!0),s=null,a=H5,o=null,c=dQ(u);e=typeof e=="function"?e:e===void 0?YAe:Ar(+e),t=typeof t=="function"?t:Ar(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?XAe:Ar(+n);function u(h){var A,f,p,m=(h=hQ(h)).length,g,y=!1,v,x=new Array(m),w=new Array(m);for(s==null&&(o=a(v=c())),A=0;A<=m;++A){if(!(A<m&&i(g=h[A],A,h))===y)if(y=!y)f=A,o.areaStart(),o.lineStart();else{for(o.lineEnd(),o.lineStart(),p=A-1;p>=f;--p)o.point(x[p],w[p]);o.lineEnd(),o.areaEnd()}y&&(x[A]=+e(g,A,h),w[A]=+t(g,A,h),o.point(r?+r(g,A,h):x[A],n?+n(g,A,h):w[A]))}if(v)return o=null,v+""||null}function d(){return JAe().defined(i).curve(a).context(s)}return u.x=function(h){return arguments.length?(e=typeof h=="function"?h:Ar(+h),r=null,u):e},u.x0=function(h){return arguments.length?(e=typeof h=="function"?h:Ar(+h),u):e},u.x1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:Ar(+h),u):r},u.y=function(h){return arguments.length?(t=typeof h=="function"?h:Ar(+h),n=null,u):t},u.y0=function(h){return arguments.length?(t=typeof h=="function"?h:Ar(+h),u):t},u.y1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:Ar(+h),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(h){return arguments.length?(i=typeof h=="function"?h:Ar(!!h),u):i},u.curve=function(h){return arguments.length?(a=h,s!=null&&(o=a(s)),u):a},u.context=function(h){return arguments.length?(h==null?s=o=null:o=a(s=h),u):s},u}class ZAe{constructor(t,n){this._context=t,this._x=n}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,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function Htt(e){return new ZAe(e,!0)}function Qtt(e){return new ZAe(e,!1)}const fQ={draw(e,t){const n=Sc(t/LB);e.moveTo(n,0),e.arc(0,0,n,0,U5)}},$tt={draw(e,t){const n=Sc(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},epe=Sc(1/3),ztt=epe*2,Vtt={draw(e,t){const n=Sc(t/ztt),r=n*epe;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Ktt={draw(e,t){const n=Sc(t),r=-n/2;e.rect(r,r,n,n)}},qtt=.8908130915292852,tpe=MB(LB/10)/MB(7*LB/10),Wtt=MB(U5/10)*tpe,Gtt=-qAe(U5/10)*tpe,Ytt={draw(e,t){const n=Sc(t*qtt),r=Wtt*n,i=Gtt*n;e.moveTo(0,-n),e.lineTo(r,i);for(let s=1;s<5;++s){const a=U5*s/5,o=qAe(a),c=MB(a);e.lineTo(c*n,-o*n),e.lineTo(o*r-c*i,c*r+o*i)}e.closePath()}},v4=Sc(3),Xtt={draw(e,t){const n=-Sc(t/(v4*3));e.moveTo(0,n*2),e.lineTo(-v4*n,-n),e.lineTo(v4*n,-n),e.closePath()}},Wo=-.5,Go=Sc(3)/2,rL=1/Sc(12),Jtt=(rL/2+1)*3,Ztt={draw(e,t){const n=Sc(t/Jtt),r=n/2,i=n*rL,s=r,a=n*rL+n,o=-s,c=a;e.moveTo(r,i),e.lineTo(s,a),e.lineTo(o,c),e.lineTo(Wo*r-Go*i,Go*r+Wo*i),e.lineTo(Wo*s-Go*a,Go*s+Wo*a),e.lineTo(Wo*o-Go*c,Go*o+Wo*c),e.lineTo(Wo*r+Go*i,Wo*i-Go*r),e.lineTo(Wo*s+Go*a,Wo*a-Go*s),e.lineTo(Wo*o+Go*c,Wo*c-Go*o),e.closePath()}};function ent(e,t){let n=null,r=dQ(i);e=typeof e=="function"?e:Ar(e||fQ),t=typeof t=="function"?t:Ar(t===void 0?64:+t);function i(){let s;if(n||(n=s=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:Ar(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:Ar(+s),i):t},i.context=function(s){return arguments.length?(n=s??null,i):n},i}function RB(){}function DB(e,t,n){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+n)/6)}function npe(e){this._context=e}npe.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:DB(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:DB(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tnt(e){return new npe(e)}function rpe(e){this._context=e}rpe.prototype={areaStart:RB,areaEnd:RB,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:DB(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function nnt(e){return new rpe(e)}function ipe(e){this._context=e}ipe.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 n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:DB(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function rnt(e){return new ipe(e)}function spe(e){this._context=e}spe.prototype={areaStart:RB,areaEnd:RB,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 int(e){return new spe(e)}function CW(e){return e<0?-1:1}function SW(e,t,n){var r=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),o=(s*i+a*r)/(r+i);return(CW(s)+CW(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function kW(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function x4(e,t,n){var r=e._x0,i=e._y0,s=e._x1,a=e._y1,o=(s-r)/3;e._context.bezierCurveTo(r+o,i+o*t,s-o,a-o*n,s,a)}function UB(e){this._context=e}UB.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:x4(this,this._t0,kW(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 n=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,x4(this,kW(this,n=SW(this,e,t)),n);break;default:x4(this,this._t0,n=SW(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function ape(e){this._context=new ope(e)}(ape.prototype=Object.create(UB.prototype)).point=function(e,t){UB.prototype.point.call(this,t,e)};function ope(e){this._context=e}ope.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,n,r,i,s){this._context.bezierCurveTo(t,e,r,n,s,i)}};function snt(e){return new UB(e)}function ant(e){return new ape(e)}function lpe(e){this._context=e}lpe.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,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=_W(e),i=_W(t),s=0,a=1;a<n;++s,++a)this._context.bezierCurveTo(r[0][s],i[0][s],r[1][s],i[1][s],e[a],t[a]);(this._line||this._line!==0&&n===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 _W(e){var t,n=e.length-1,r,i=new Array(n),s=new Array(n),a=new Array(n);for(i[0]=0,s[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,s[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,s[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/s[t-1],s[t]-=r,a[t]-=r*a[t-1];for(i[n-1]=a[n-1]/s[n-1],t=n-2;t>=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function ont(e){return new lpe(e)}function Q5(e,t){this._context=e,this._t=t}Q5.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 n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function lnt(e){return new Q5(e,.5)}function cnt(e){return new Q5(e,0)}function unt(e){return new Q5(e,1)}function Sv(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n<a;++n)for(i=s,s=e[t[n]],r=0;r<o;++r)s[r][1]+=s[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function iL(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function dnt(e,t){return e[t]}function hnt(e){const t=[];return t.key=e,t}function fnt(){var e=Ar([]),t=iL,n=Sv,r=dnt;function i(s){var a=Array.from(e.apply(this,arguments),hnt),o,c=a.length,u=-1,d;for(const h of s)for(o=0,++u;o<c;++o)(a[o][u]=[0,+r(h,a[o].key,u,s)]).data=h;for(o=0,d=hQ(t(a));o<c;++o)a[d[o]].index=o;return n(a,d),a}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:Ar(Array.from(s)),i):e},i.value=function(s){return arguments.length?(r=typeof s=="function"?s:Ar(+s),i):r},i.order=function(s){return arguments.length?(t=s==null?iL:typeof s=="function"?s:Ar(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(n=s??Sv,i):n},i}function Ant(e,t){if((r=e.length)>0){for(var n,r,i=0,s=e[0].length,a;i<s;++i){for(a=n=0;n<r;++n)a+=e[n][i][1]||0;if(a)for(n=0;n<r;++n)e[n][i][1]/=a}Sv(e,t)}}function pnt(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,s=r.length;n<s;++n){for(var a=0,o=0;a<i;++a)o+=e[a][n][1]||0;r[n][1]+=r[n][0]=-o/2}Sv(e,t)}}function mnt(e,t){if(!(!((a=e.length)>0)||!((s=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,s,a;r<s;++r){for(var o=0,c=0,u=0;o<a;++o){for(var d=e[t[o]],h=d[r][1]||0,A=d[r-1][1]||0,f=(h-A)/2,p=0;p<o;++p){var m=e[t[p]],g=m[r][1]||0,y=m[r-1][1]||0;f+=g-y}c+=h,u+=f*h}i[r-1][1]+=i[r-1][0]=n,c&&(n-=u/c)}i[r-1][1]+=i[r-1][0]=n,Sv(e,t)}}function g1(e){"@babel/helpers - typeof";return g1=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},g1(e)}var gnt=["type","size","sizeType"];function sL(){return sL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sL.apply(this,arguments)}function jW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BW(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jW(Object(n),!0).forEach(function(r){ynt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jW(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ynt(e,t,n){return t=vnt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vnt(e){var t=xnt(e,"string");return g1(t)=="symbol"?t:t+""}function xnt(e,t){if(g1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(g1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wnt(e,t){if(e==null)return{};var n=bnt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function bnt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var cpe={symbolCircle:fQ,symbolCross:$tt,symbolDiamond:Vtt,symbolSquare:Ktt,symbolStar:Ytt,symbolTriangle:Xtt,symbolWye:Ztt},Cnt=Math.PI/180,Snt=function(t){var n="symbol".concat(D5(t));return cpe[n]||fQ},knt=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*Cnt;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),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}},_nt=function(t,n){cpe["symbol".concat(D5(t))]=n},AQ=function(t){var n=t.type,r=n===void 0?"circle":n,i=t.size,s=i===void 0?64:i,a=t.sizeType,o=a===void 0?"area":a,c=wnt(t,gnt),u=BW(BW({},c),{},{type:r,size:s,sizeType:o}),d=function(){var g=Snt(r),y=ent().type(g).size(knt(s,o,r));return y()},h=u.className,A=u.cx,f=u.cy,p=jn(u,!0);return A===+A&&f===+f&&s===+s?re.createElement("path",sL({},p,{className:Pn("recharts-symbols",h),transform:"translate(".concat(A,", ").concat(f,")"),d:d()})):null};AQ.registerSymbol=_nt;function kv(e){"@babel/helpers - typeof";return kv=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},kv(e)}function aL(){return aL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aL.apply(this,arguments)}function NW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jnt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NW(Object(n),!0).forEach(function(r){y1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NW(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bnt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nnt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,dpe(r.key),r)}}function Ent(e,t,n){return t&&Nnt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tnt(e,t,n){return t=HB(t),Pnt(e,upe()?Reflect.construct(t,n||[],HB(e).constructor):t.apply(e,n))}function Pnt(e,t){if(t&&(kv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Int(e)}function Int(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function upe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(upe=function(){return!!e})()}function HB(e){return HB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},HB(e)}function Ont(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&&oL(e,t)}function oL(e,t){return oL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},oL(e,t)}function y1(e,t,n){return t=dpe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dpe(e){var t=Fnt(e,"string");return kv(t)=="symbol"?t:t+""}function Fnt(e,t){if(kv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(kv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yo=32,pQ=function(e){function t(){return Bnt(this,t),Tnt(this,t,arguments)}return Ont(t,e),Ent(t,[{key:"renderIcon",value:function(r){var i=this.props.inactiveColor,s=Yo/2,a=Yo/6,o=Yo/3,c=r.inactive?i:r.color;if(r.type==="plainline")return re.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:s,x2:Yo,y2:s,className:"recharts-legend-icon"});if(r.type==="line")return re.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(s,"h").concat(o,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(s,`
            H`).concat(Yo,"M").concat(2*o,",").concat(s,`
            A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(s),className:"recharts-legend-icon"});if(r.type==="rect")return re.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Yo/8,"h").concat(Yo,"v").concat(Yo*3/4,"h").concat(-Yo,"z"),className:"recharts-legend-icon"});if(re.isValidElement(r.legendIcon)){var u=jnt({},r);return delete u.legendIcon,re.cloneElement(r.legendIcon,u)}return re.createElement(AQ,{fill:c,cx:s,cy:s,size:Yo,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,i=this.props,s=i.payload,a=i.iconSize,o=i.layout,c=i.formatter,u=i.inactiveColor,d={x:0,y:0,width:Yo,height:Yo},h={display:o==="horizontal"?"inline-block":"block",marginRight:10},A={display:"inline-block",verticalAlign:"middle",marginRight:4};return s.map(function(f,p){var m=f.formatter||c,g=Pn(y1(y1({"recharts-legend-item":!0},"legend-item-".concat(p),!0),"inactive",f.inactive));if(f.type==="none")return null;var y=gn(f.value)?null:f.value;cd(!gn(f.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 v=f.inactive?u:f.color;return re.createElement("li",aL({className:g,style:h,key:"legend-item-".concat(p)},FB(r.props,f,p)),re.createElement(XM,{width:a,height:a,viewBox:d,style:A},r.renderIcon(f)),re.createElement("span",{className:"recharts-legend-item-text",style:{color:v}},m?m(y,f,p):y))})}},{key:"render",value:function(){var r=this.props,i=r.payload,s=r.layout,a=r.align;if(!i||!i.length)return null;var o={padding:0,margin:0,textAlign:s==="horizontal"?a:"left"};return re.createElement("ul",{className:"recharts-default-legend",style:o},this.renderItems())}}])}(C.PureComponent);y1(pQ,"displayName","Legend");y1(pQ,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Mnt=_5;function Lnt(){this.__data__=new Mnt,this.size=0}var Rnt=Lnt;function Dnt(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var Unt=Dnt;function Hnt(e){return this.__data__.get(e)}var Qnt=Hnt;function $nt(e){return this.__data__.has(e)}var znt=$nt,Vnt=_5,Knt=nQ,qnt=rQ,Wnt=200;function Gnt(e,t){var n=this.__data__;if(n instanceof Vnt){var r=n.__data__;if(!Knt||r.length<Wnt-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qnt(r)}return n.set(e,t),this.size=n.size,this}var Ynt=Gnt,Xnt=_5,Jnt=Rnt,Znt=Unt,ert=Qnt,trt=znt,nrt=Ynt;function S0(e){var t=this.__data__=new Xnt(e);this.size=t.size}S0.prototype.clear=Jnt;S0.prototype.delete=Znt;S0.prototype.get=ert;S0.prototype.has=trt;S0.prototype.set=nrt;var hpe=S0,rrt="__lodash_hash_undefined__";function irt(e){return this.__data__.set(e,rrt),this}var srt=irt;function art(e){return this.__data__.has(e)}var ort=art,lrt=rQ,crt=srt,urt=ort;function QB(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new lrt;++t<n;)this.add(e[t])}QB.prototype.add=QB.prototype.push=crt;QB.prototype.has=urt;var fpe=QB;function drt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Ape=drt;function hrt(e,t){return e.has(t)}var ppe=hrt,frt=fpe,Art=Ape,prt=ppe,mrt=1,grt=2;function yrt(e,t,n,r,i,s){var a=n&mrt,o=e.length,c=t.length;if(o!=c&&!(a&&c>o))return!1;var u=s.get(e),d=s.get(t);if(u&&d)return u==t&&d==e;var h=-1,A=!0,f=n&grt?new frt:void 0;for(s.set(e,t),s.set(t,e);++h<o;){var p=e[h],m=t[h];if(r)var g=a?r(m,p,h,t,e,s):r(p,m,h,e,t,s);if(g!==void 0){if(g)continue;A=!1;break}if(f){if(!Art(t,function(y,v){if(!prt(f,v)&&(p===y||i(p,y,n,r,s)))return f.push(v)})){A=!1;break}}else if(!(p===m||i(p,m,n,r,s))){A=!1;break}}return s.delete(e),s.delete(t),A}var mpe=yrt,vrt=yu,xrt=vrt.Uint8Array,wrt=xrt;function brt(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var Crt=brt;function Srt(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var mQ=Srt,EW=K2,TW=wrt,krt=tQ,_rt=mpe,jrt=Crt,Brt=mQ,Nrt=1,Ert=2,Trt="[object Boolean]",Prt="[object Date]",Irt="[object Error]",Ort="[object Map]",Frt="[object Number]",Mrt="[object RegExp]",Lrt="[object Set]",Rrt="[object String]",Drt="[object Symbol]",Urt="[object ArrayBuffer]",Hrt="[object DataView]",PW=EW?EW.prototype:void 0,w4=PW?PW.valueOf:void 0;function Qrt(e,t,n,r,i,s,a){switch(n){case Hrt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Urt:return!(e.byteLength!=t.byteLength||!s(new TW(e),new TW(t)));case Trt:case Prt:case Frt:return krt(+e,+t);case Irt:return e.name==t.name&&e.message==t.message;case Mrt:case Rrt:return e==t+"";case Ort:var o=jrt;case Lrt:var c=r&Nrt;if(o||(o=Brt),e.size!=t.size&&!c)return!1;var u=a.get(e);if(u)return u==t;r|=Ert,a.set(e,t);var d=_rt(o(e),o(t),r,i,s,a);return a.delete(e),d;case Drt:if(w4)return w4.call(e)==w4.call(t)}return!1}var $rt=Qrt;function zrt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var gpe=zrt,Vrt=gpe,Krt=so;function qrt(e,t,n){var r=t(e);return Krt(e)?r:Vrt(r,n(e))}var Wrt=qrt;function Grt(e,t){for(var n=-1,r=e==null?0:e.length,i=0,s=[];++n<r;){var a=e[n];t(a,n,e)&&(s[i++]=a)}return s}var Yrt=Grt;function Xrt(){return[]}var Jrt=Xrt,Zrt=Yrt,eit=Jrt,tit=Object.prototype,nit=tit.propertyIsEnumerable,IW=Object.getOwnPropertySymbols,rit=IW?function(e){return e==null?[]:(e=Object(e),Zrt(IW(e),function(t){return nit.call(e,t)}))}:eit,iit=rit;function sit(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var ait=sit,oit=Id,lit=Od,cit="[object Arguments]";function uit(e){return lit(e)&&oit(e)==cit}var dit=uit,OW=dit,hit=Od,ype=Object.prototype,fit=ype.hasOwnProperty,Ait=ype.propertyIsEnumerable,pit=OW(function(){return arguments}())?OW:function(e){return hit(e)&&fit.call(e,"callee")&&!Ait.call(e,"callee")},gQ=pit,$B={exports:{}};function mit(){return!1}var git=mit;$B.exports;(function(e,t){var n=yu,r=git,i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,a=s&&s.exports===i,o=a?n.Buffer:void 0,c=o?o.isBuffer:void 0,u=c||r;e.exports=u})($B,$B.exports);var vpe=$B.exports,yit=9007199254740991,vit=/^(?:0|[1-9]\d*)$/;function xit(e,t){var n=typeof e;return t=t??yit,!!t&&(n=="number"||n!="symbol"&&vit.test(e))&&e>-1&&e%1==0&&e<t}var yQ=xit,wit=9007199254740991;function bit(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=wit}var vQ=bit,Cit=Id,Sit=vQ,kit=Od,_it="[object Arguments]",jit="[object Array]",Bit="[object Boolean]",Nit="[object Date]",Eit="[object Error]",Tit="[object Function]",Pit="[object Map]",Iit="[object Number]",Oit="[object Object]",Fit="[object RegExp]",Mit="[object Set]",Lit="[object String]",Rit="[object WeakMap]",Dit="[object ArrayBuffer]",Uit="[object DataView]",Hit="[object Float32Array]",Qit="[object Float64Array]",$it="[object Int8Array]",zit="[object Int16Array]",Vit="[object Int32Array]",Kit="[object Uint8Array]",qit="[object Uint8ClampedArray]",Wit="[object Uint16Array]",Git="[object Uint32Array]",br={};br[Hit]=br[Qit]=br[$it]=br[zit]=br[Vit]=br[Kit]=br[qit]=br[Wit]=br[Git]=!0;br[_it]=br[jit]=br[Dit]=br[Bit]=br[Uit]=br[Nit]=br[Eit]=br[Tit]=br[Pit]=br[Iit]=br[Oit]=br[Fit]=br[Mit]=br[Lit]=br[Rit]=!1;function Yit(e){return kit(e)&&Sit(e.length)&&!!br[Cit(e)]}var Xit=Yit;function Jit(e){return function(t){return e(t)}}var xpe=Jit,zB={exports:{}};zB.exports;(function(e,t){var n=BAe,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,a=s&&n.process,o=function(){try{var c=i&&i.require&&i.require("util").types;return c||a&&a.binding&&a.binding("util")}catch{}}();e.exports=o})(zB,zB.exports);var Zit=zB.exports,est=Xit,tst=xpe,FW=Zit,MW=FW&&FW.isTypedArray,nst=MW?tst(MW):est,wpe=nst,rst=ait,ist=gQ,sst=so,ast=vpe,ost=yQ,lst=wpe,cst=Object.prototype,ust=cst.hasOwnProperty;function dst(e,t){var n=sst(e),r=!n&&ist(e),i=!n&&!r&&ast(e),s=!n&&!r&&!i&&lst(e),a=n||r||i||s,o=a?rst(e.length,String):[],c=o.length;for(var u in e)(t||ust.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||ost(u,c)))&&o.push(u);return o}var hst=dst,fst=Object.prototype;function Ast(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||fst;return e===n}var pst=Ast;function mst(e,t){return function(n){return e(t(n))}}var bpe=mst,gst=bpe,yst=gst(Object.keys,Object),vst=yst,xst=pst,wst=vst,bst=Object.prototype,Cst=bst.hasOwnProperty;function Sst(e){if(!xst(e))return wst(e);var t=[];for(var n in Object(e))Cst.call(e,n)&&n!="constructor"&&t.push(n);return t}var kst=Sst,_st=eQ,jst=vQ;function Bst(e){return e!=null&&jst(e.length)&&!_st(e)}var Y2=Bst,Nst=hst,Est=kst,Tst=Y2;function Pst(e){return Tst(e)?Nst(e):Est(e)}var $5=Pst,Ist=Wrt,Ost=iit,Fst=$5;function Mst(e){return Ist(e,Fst,Ost)}var Lst=Mst,LW=Lst,Rst=1,Dst=Object.prototype,Ust=Dst.hasOwnProperty;function Hst(e,t,n,r,i,s){var a=n&Rst,o=LW(e),c=o.length,u=LW(t),d=u.length;if(c!=d&&!a)return!1;for(var h=c;h--;){var A=o[h];if(!(a?A in t:Ust.call(t,A)))return!1}var f=s.get(e),p=s.get(t);if(f&&p)return f==t&&p==e;var m=!0;s.set(e,t),s.set(t,e);for(var g=a;++h<c;){A=o[h];var y=e[A],v=t[A];if(r)var x=a?r(v,y,A,t,e,s):r(y,v,A,e,t,s);if(!(x===void 0?y===v||i(y,v,n,r,s):x)){m=!1;break}g||(g=A=="constructor")}if(m&&!g){var w=e.constructor,b=t.constructor;w!=b&&"constructor"in e&&"constructor"in t&&!(typeof w=="function"&&w instanceof w&&typeof b=="function"&&b instanceof b)&&(m=!1)}return s.delete(e),s.delete(t),m}var Qst=Hst,$st=Cm,zst=yu,Vst=$st(zst,"DataView"),Kst=Vst,qst=Cm,Wst=yu,Gst=qst(Wst,"Promise"),Yst=Gst,Xst=Cm,Jst=yu,Zst=Xst(Jst,"Set"),Cpe=Zst,eat=Cm,tat=yu,nat=eat(tat,"WeakMap"),rat=nat,lL=Kst,cL=nQ,uL=Yst,dL=Cpe,hL=rat,Spe=Id,k0=EAe,RW="[object Map]",iat="[object Object]",DW="[object Promise]",UW="[object Set]",HW="[object WeakMap]",QW="[object DataView]",sat=k0(lL),aat=k0(cL),oat=k0(uL),lat=k0(dL),cat=k0(hL),DA=Spe;(lL&&DA(new lL(new ArrayBuffer(1)))!=QW||cL&&DA(new cL)!=RW||uL&&DA(uL.resolve())!=DW||dL&&DA(new dL)!=UW||hL&&DA(new hL)!=HW)&&(DA=function(e){var t=Spe(e),n=t==iat?e.constructor:void 0,r=n?k0(n):"";if(r)switch(r){case sat:return QW;case aat:return RW;case oat:return DW;case lat:return UW;case cat:return HW}return t});var uat=DA,b4=hpe,dat=mpe,hat=$rt,fat=Qst,$W=uat,zW=so,VW=vpe,Aat=wpe,pat=1,KW="[object Arguments]",qW="[object Array]",WS="[object Object]",mat=Object.prototype,WW=mat.hasOwnProperty;function gat(e,t,n,r,i,s){var a=zW(e),o=zW(t),c=a?qW:$W(e),u=o?qW:$W(t);c=c==KW?WS:c,u=u==KW?WS:u;var d=c==WS,h=u==WS,A=c==u;if(A&&VW(e)){if(!VW(t))return!1;a=!0,d=!1}if(A&&!d)return s||(s=new b4),a||Aat(e)?dat(e,t,n,r,i,s):hat(e,t,c,n,r,i,s);if(!(n&pat)){var f=d&&WW.call(e,"__wrapped__"),p=h&&WW.call(t,"__wrapped__");if(f||p){var m=f?e.value():e,g=p?t.value():t;return s||(s=new b4),i(m,g,n,r,s)}}return A?(s||(s=new b4),fat(e,t,n,r,i,s)):!1}var yat=gat,vat=yat,GW=Od;function kpe(e,t,n,r,i){return e===t?!0:e==null||t==null||!GW(e)&&!GW(t)?e!==e&&t!==t:vat(e,t,n,r,kpe,i)}var xQ=kpe,xat=hpe,wat=xQ,bat=1,Cat=2;function Sat(e,t,n,r){var i=n.length,s=i,a=!r;if(e==null)return!s;for(e=Object(e);i--;){var o=n[i];if(a&&o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++i<s;){o=n[i];var c=o[0],u=e[c],d=o[1];if(a&&o[2]){if(u===void 0&&!(c in e))return!1}else{var h=new xat;if(r)var A=r(u,d,c,e,t,h);if(!(A===void 0?wat(d,u,bat|Cat,r,h):A))return!1}}return!0}var kat=Sat,_at=rA;function jat(e){return e===e&&!_at(e)}var _pe=jat,Bat=_pe,Nat=$5;function Eat(e){for(var t=Nat(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Bat(i)]}return t}var Tat=Eat;function Pat(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var jpe=Pat,Iat=kat,Oat=Tat,Fat=jpe;function Mat(e){var t=Oat(e);return t.length==1&&t[0][2]?Fat(t[0][0],t[0][1]):function(n){return n===e||Iat(n,e,t)}}var Lat=Mat;function Rat(e,t){return e!=null&&t in Object(e)}var Dat=Rat,Uat=FAe,Hat=gQ,Qat=so,$at=yQ,zat=vQ,Vat=B5;function Kat(e,t,n){t=Uat(t,e);for(var r=-1,i=t.length,s=!1;++r<i;){var a=Vat(t[r]);if(!(s=e!=null&&n(e,a)))break;e=e[a]}return s||++r!=i?s:(i=e==null?0:e.length,!!i&&zat(i)&&$at(a,i)&&(Qat(e)||Hat(e)))}var qat=Kat,Wat=Dat,Gat=qat;function Yat(e,t){return e!=null&&Gat(e,t,Wat)}var Xat=Yat,Jat=xQ,Zat=MAe,eot=Xat,tot=ZH,not=_pe,rot=jpe,iot=B5,sot=1,aot=2;function oot(e,t){return tot(e)&&not(t)?rot(iot(e),t):function(n){var r=Zat(n,e);return r===void 0&&r===t?eot(n,e):Jat(t,r,sot|aot)}}var lot=oot;function cot(e){return e}var _0=cot;function uot(e){return function(t){return t==null?void 0:t[e]}}var dot=uot,hot=aQ;function fot(e){return function(t){return hot(t,e)}}var Aot=fot,pot=dot,mot=Aot,got=ZH,yot=B5;function vot(e){return got(e)?pot(yot(e)):mot(e)}var xot=vot,wot=Lat,bot=lot,Cot=_0,Sot=so,kot=xot;function _ot(e){return typeof e=="function"?e:e==null?Cot:typeof e=="object"?Sot(e)?bot(e[0],e[1]):wot(e):kot(e)}var iA=_ot;function jot(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s<i;)if(t(e[s],s,e))return s;return-1}var Bpe=jot;function Bot(e){return e!==e}var Not=Bot;function Eot(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var Tot=Eot,Pot=Bpe,Iot=Not,Oot=Tot;function Fot(e,t,n){return t===t?Oot(e,t,n):Pot(e,Iot,n)}var Mot=Fot,Lot=Mot;function Rot(e,t){var n=e==null?0:e.length;return!!n&&Lot(e,t,0)>-1}var Dot=Rot;function Uot(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var Hot=Uot;function Qot(){}var $ot=Qot,C4=Cpe,zot=$ot,Vot=mQ,Kot=1/0,qot=C4&&1/Vot(new C4([,-0]))[1]==Kot?function(e){return new C4(e)}:zot,Wot=qot,Got=fpe,Yot=Dot,Xot=Hot,Jot=ppe,Zot=Wot,elt=mQ,tlt=200;function nlt(e,t,n){var r=-1,i=Yot,s=e.length,a=!0,o=[],c=o;if(n)a=!1,i=Xot;else if(s>=tlt){var u=t?null:Zot(e);if(u)return elt(u);a=!1,i=Jot,c=new Got}else c=t?[]:o;e:for(;++r<s;){var d=e[r],h=t?t(d):d;if(d=n||d!==0?d:0,a&&h===h){for(var A=c.length;A--;)if(c[A]===h)continue e;t&&c.push(h),o.push(d)}else i(c,h,n)||(c!==o&&c.push(h),o.push(d))}return o}var rlt=nlt,ilt=iA,slt=rlt;function alt(e,t){return e&&e.length?slt(e,ilt(t)):[]}var olt=alt;const YW=In(olt);function Npe(e,t,n){return t===!0?YW(e,n):gn(t)?YW(e,t):e}function _v(e){"@babel/helpers - typeof";return _v=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},_v(e)}var llt=["ref"];function XW(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XW(Object(n),!0).forEach(function(r){z5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XW(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function clt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JW(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Tpe(r.key),r)}}function ult(e,t,n){return t&&JW(e.prototype,t),n&&JW(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function dlt(e,t,n){return t=VB(t),hlt(e,Epe()?Reflect.construct(t,n||[],VB(e).constructor):t.apply(e,n))}function hlt(e,t){if(t&&(_v(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return flt(e)}function flt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Epe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Epe=function(){return!!e})()}function VB(e){return VB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},VB(e)}function Alt(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&&fL(e,t)}function fL(e,t){return fL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},fL(e,t)}function z5(e,t,n){return t=Tpe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tpe(e){var t=plt(e,"string");return _v(t)=="symbol"?t:t+""}function plt(e,t){if(_v(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(_v(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mlt(e,t){if(e==null)return{};var n=glt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function glt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ylt(e){return e.value}function vlt(e,t){if(re.isValidElement(e))return re.cloneElement(e,t);if(typeof e=="function")return re.createElement(e,t);t.ref;var n=mlt(t,llt);return re.createElement(pQ,n)}var ZW=1,Tp=function(e){function t(){var n;clt(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=dlt(this,t,[].concat(i)),z5(n,"lastBoundingBox",{width:-1,height:-1}),n}return Alt(t,e),ult(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,i=this.getBBox();i?(Math.abs(i.width-this.lastBoundingBox.width)>ZW||Math.abs(i.height-this.lastBoundingBox.height)>ZW)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,r&&r(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Lu({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var i=this.props,s=i.layout,a=i.align,o=i.verticalAlign,c=i.margin,u=i.chartWidth,d=i.chartHeight,h,A;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(a==="center"&&s==="vertical"){var f=this.getBBoxSnapshot();h={left:((u||0)-f.width)/2}}else h=a==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(o==="middle"){var p=this.getBBoxSnapshot();A={top:((d||0)-p.height)/2}}else A=o==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Lu(Lu({},h),A)}},{key:"render",value:function(){var r=this,i=this.props,s=i.content,a=i.width,o=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,d=i.payload,h=Lu(Lu({position:"absolute",width:a||"auto",height:o||"auto"},this.getDefaultPosition(c)),c);return re.createElement("div",{className:"recharts-legend-wrapper",style:h,ref:function(f){r.wrapperNode=f}},vlt(s,Lu(Lu({},this.props),{},{payload:Npe(d,u,ylt)})))}}],[{key:"getWithHeight",value:function(r,i){var s=Lu(Lu({},this.defaultProps),r.props),a=s.layout;return a==="vertical"&&Ze(r.props.height)?{height:r.props.height}:a==="horizontal"?{width:r.props.width||i}:null}}])}(C.PureComponent);z5(Tp,"displayName","Legend");z5(Tp,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var eG=K2,xlt=gQ,wlt=so,tG=eG?eG.isConcatSpreadable:void 0;function blt(e){return wlt(e)||xlt(e)||!!(tG&&e&&e[tG])}var Clt=blt,Slt=gpe,klt=Clt;function Ppe(e,t,n,r,i){var s=-1,a=e.length;for(n||(n=klt),i||(i=[]);++s<a;){var o=e[s];t>0&&n(o)?t>1?Ppe(o,t-1,n,r,i):Slt(i,o):r||(i[i.length]=o)}return i}var Ipe=Ppe;function _lt(e){return function(t,n,r){for(var i=-1,s=Object(t),a=r(t),o=a.length;o--;){var c=a[e?o:++i];if(n(s[c],c,s)===!1)break}return t}}var jlt=_lt,Blt=jlt,Nlt=Blt(),Elt=Nlt,Tlt=Elt,Plt=$5;function Ilt(e,t){return e&&Tlt(e,t,Plt)}var Ope=Ilt,Olt=Y2;function Flt(e,t){return function(n,r){if(n==null)return n;if(!Olt(n))return e(n,r);for(var i=n.length,s=t?i:-1,a=Object(n);(t?s--:++s<i)&&r(a[s],s,a)!==!1;);return n}}var Mlt=Flt,Llt=Ope,Rlt=Mlt,Dlt=Rlt(Llt),wQ=Dlt,Ult=wQ,Hlt=Y2;function Qlt(e,t){var n=-1,r=Hlt(e)?Array(e.length):[];return Ult(e,function(i,s,a){r[++n]=t(i,s,a)}),r}var Fpe=Qlt;function $lt(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var zlt=$lt,nG=v0;function Vlt(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,s=nG(e),a=t!==void 0,o=t===null,c=t===t,u=nG(t);if(!o&&!u&&!s&&e>t||s&&a&&c&&!o&&!u||r&&a&&c||!n&&c||!i)return 1;if(!r&&!s&&!u&&e<t||u&&n&&i&&!r&&!s||o&&n&&i||!a&&i||!c)return-1}return 0}var Klt=Vlt,qlt=Klt;function Wlt(e,t,n){for(var r=-1,i=e.criteria,s=t.criteria,a=i.length,o=n.length;++r<a;){var c=qlt(i[r],s[r]);if(c){if(r>=o)return c;var u=n[r];return c*(u=="desc"?-1:1)}}return e.index-t.index}var Glt=Wlt,S4=sQ,Ylt=aQ,Xlt=iA,Jlt=Fpe,Zlt=zlt,ect=xpe,tct=Glt,nct=_0,rct=so;function ict(e,t,n){t.length?t=S4(t,function(s){return rct(s)?function(a){return Ylt(a,s.length===1?s[0]:s)}:s}):t=[nct];var r=-1;t=S4(t,ect(Xlt));var i=Jlt(e,function(s,a,o){var c=S4(t,function(u){return u(s)});return{criteria:c,index:++r,value:s}});return Zlt(i,function(s,a){return tct(s,a,n)})}var sct=ict;function act(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var oct=act,lct=oct,rG=Math.max;function cct(e,t,n){return t=rG(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=rG(r.length-t,0),a=Array(s);++i<s;)a[i]=r[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),lct(e,this,o)}}var uct=cct;function dct(e){return function(){return e}}var hct=dct,fct=Cm,Act=function(){try{var e=fct(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Mpe=Act,pct=hct,iG=Mpe,mct=_0,gct=iG?function(e,t){return iG(e,"toString",{configurable:!0,enumerable:!1,value:pct(t),writable:!0})}:mct,yct=gct,vct=800,xct=16,wct=Date.now;function bct(e){var t=0,n=0;return function(){var r=wct(),i=xct-(r-n);if(n=r,i>0){if(++t>=vct)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Cct=bct,Sct=yct,kct=Cct,_ct=kct(Sct),jct=_ct,Bct=_0,Nct=uct,Ect=jct;function Tct(e,t){return Ect(Nct(e,t,Bct),e+"")}var Pct=Tct,Ict=tQ,Oct=Y2,Fct=yQ,Mct=rA;function Lct(e,t,n){if(!Mct(n))return!1;var r=typeof t;return(r=="number"?Oct(n)&&Fct(t,n.length):r=="string"&&t in n)?Ict(n[t],e):!1}var V5=Lct,Rct=Ipe,Dct=sct,Uct=Pct,sG=V5,Hct=Uct(function(e,t){if(e==null)return[];var n=t.length;return n>1&&sG(e,t[0],t[1])?t=[]:n>2&&sG(t[0],t[1],t[2])&&(t=[t[0]]),Dct(e,Rct(t,1),[])}),Qct=Hct;const bQ=In(Qct);function v1(e){"@babel/helpers - typeof";return v1=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},v1(e)}function AL(){return AL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},AL.apply(this,arguments)}function $ct(e,t){return qct(e)||Kct(e,t)||Vct(e,t)||zct()}function zct(){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 Vct(e,t){if(e){if(typeof e=="string")return aG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aG(e,t)}}function aG(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Kct(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function qct(e){if(Array.isArray(e))return e}function oG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function k4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oG(Object(n),!0).forEach(function(r){Wct(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oG(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wct(e,t,n){return t=Gct(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gct(e){var t=Yct(e,"string");return v1(t)=="symbol"?t:t+""}function Yct(e,t){if(v1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(v1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xct(e){return Array.isArray(e)&&Ki(e[0])&&Ki(e[1])?e.join(" ~ "):e}var Jct=function(t){var n=t.separator,r=n===void 0?" : ":n,i=t.contentStyle,s=i===void 0?{}:i,a=t.itemStyle,o=a===void 0?{}:a,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,h=t.formatter,A=t.itemSorter,f=t.wrapperClassName,p=t.labelClassName,m=t.label,g=t.labelFormatter,y=t.accessibilityLayer,v=y===void 0?!1:y,x=function(){if(d&&d.length){var N={padding:0,margin:0},F=(A?bQ(d,A):d).map(function(L,U){if(L.type==="none")return null;var H=k4({display:"block",paddingTop:4,paddingBottom:4,color:L.color||"#000"},o),K=L.formatter||h||Xct,$=L.value,z=L.name,Q=$,oe=z;if(K&&Q!=null&&oe!=null){var R=K($,z,L,U,d);if(Array.isArray(R)){var M=$ct(R,2);Q=M[0],oe=M[1]}else Q=R}return re.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(U),style:H},Ki(oe)?re.createElement("span",{className:"recharts-tooltip-item-name"},oe):null,Ki(oe)?re.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,re.createElement("span",{className:"recharts-tooltip-item-value"},Q),re.createElement("span",{className:"recharts-tooltip-item-unit"},L.unit||""))});return re.createElement("ul",{className:"recharts-tooltip-item-list",style:N},F)}return null},w=k4({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},s),b=k4({margin:0},u),k=!Cn(m),j=k?m:"",B=Pn("recharts-default-tooltip",f),E=Pn("recharts-tooltip-label",p);k&&g&&d!==void 0&&d!==null&&(j=g(m,d));var I=v?{role:"status","aria-live":"assertive"}:{};return re.createElement("div",AL({className:B,style:w},I),re.createElement("p",{className:E,style:b},re.isValidElement(j)?j:"".concat(j)),x())};function x1(e){"@babel/helpers - typeof";return x1=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},x1(e)}function GS(e,t,n){return t=Zct(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zct(e){var t=eut(e,"string");return x1(t)=="symbol"?t:t+""}function eut(e,t){if(x1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(x1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Px="recharts-tooltip-wrapper",tut={visibility:"hidden"};function nut(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Pn(Px,GS(GS(GS(GS({},"".concat(Px,"-right"),Ze(n)&&t&&Ze(t.x)&&n>=t.x),"".concat(Px,"-left"),Ze(n)&&t&&Ze(t.x)&&n<t.x),"".concat(Px,"-bottom"),Ze(r)&&t&&Ze(t.y)&&r>=t.y),"".concat(Px,"-top"),Ze(r)&&t&&Ze(t.y)&&r<t.y))}function lG(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,s=e.position,a=e.reverseDirection,o=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(s&&Ze(s[r]))return s[r];var d=n[r]-o-i,h=n[r]+i;if(t[r])return a[r]?d:h;if(a[r]){var A=d,f=c[r];return A<f?Math.max(h,c[r]):Math.max(d,c[r])}var p=h+o,m=c[r]+u;return p>m?Math.max(d,c[r]):Math.max(h,c[r])}function rut(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function iut(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,s=e.reverseDirection,a=e.tooltipBox,o=e.useTranslate3d,c=e.viewBox,u,d,h;return a.height>0&&a.width>0&&n?(d=lG({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:a.width,viewBox:c,viewBoxDimension:c.width}),h=lG({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:i,reverseDirection:s,tooltipDimension:a.height,viewBox:c,viewBoxDimension:c.height}),u=rut({translateX:d,translateY:h,useTranslate3d:o})):u=tut,{cssProperties:u,cssClasses:nut({translateX:d,translateY:h,coordinate:n})}}function jv(e){"@babel/helpers - typeof";return jv=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},jv(e)}function cG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function uG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cG(Object(n),!0).forEach(function(r){mL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cG(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sut(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aut(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Rpe(r.key),r)}}function out(e,t,n){return t&&aut(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function lut(e,t,n){return t=KB(t),cut(e,Lpe()?Reflect.construct(t,n||[],KB(e).constructor):t.apply(e,n))}function cut(e,t){if(t&&(jv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return uut(e)}function uut(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lpe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Lpe=function(){return!!e})()}function KB(e){return KB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},KB(e)}function dut(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&&pL(e,t)}function pL(e,t){return pL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},pL(e,t)}function mL(e,t,n){return t=Rpe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rpe(e){var t=hut(e,"string");return jv(t)=="symbol"?t:t+""}function hut(e,t){if(jv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(jv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var dG=1,fut=function(e){function t(){var n;sut(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=lut(this,t,[].concat(i)),mL(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),mL(n,"handleKeyDown",function(a){if(a.key==="Escape"){var o,c,u,d;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(o=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&o!==void 0?o:0,y:(u=(d=n.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),n}return dut(t,e),out(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>dG||Math.abs(r.height-this.state.lastBoundingBox.height)>dG)&&this.setState({lastBoundingBox:{width:r.width,height:r.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 r,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,i=this.props,s=i.active,a=i.allowEscapeViewBox,o=i.animationDuration,c=i.animationEasing,u=i.children,d=i.coordinate,h=i.hasPayload,A=i.isAnimationActive,f=i.offset,p=i.position,m=i.reverseDirection,g=i.useTranslate3d,y=i.viewBox,v=i.wrapperStyle,x=iut({allowEscapeViewBox:a,coordinate:d,offsetTopLeft:f,position:p,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:y}),w=x.cssClasses,b=x.cssProperties,k=uG(uG({transition:A&&s?"transform ".concat(o,"ms ").concat(c):void 0},b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&s&&h?"visible":"hidden",position:"absolute",top:0,left:0},v);return re.createElement("div",{tabIndex:-1,className:w,style:k,ref:function(B){r.wrapperNode=B}},u)}}])}(C.PureComponent),Aut=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},ud={isSsr:Aut(),get:function(t){return ud[t]},set:function(t,n){if(typeof t=="string")ud[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(i){ud[i]=t[i]})}}};function Bv(e){"@babel/helpers - typeof";return Bv=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},Bv(e)}function hG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hG(Object(n),!0).forEach(function(r){CQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hG(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function put(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mut(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Upe(r.key),r)}}function gut(e,t,n){return t&&mut(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function yut(e,t,n){return t=qB(t),vut(e,Dpe()?Reflect.construct(t,n||[],qB(e).constructor):t.apply(e,n))}function vut(e,t){if(t&&(Bv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xut(e)}function xut(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Dpe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Dpe=function(){return!!e})()}function qB(e){return qB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qB(e)}function wut(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&&gL(e,t)}function gL(e,t){return gL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},gL(e,t)}function CQ(e,t,n){return t=Upe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Upe(e){var t=but(e,"string");return Bv(t)=="symbol"?t:t+""}function but(e,t){if(Bv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Bv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cut(e){return e.dataKey}function Sut(e,t){return re.isValidElement(e)?re.cloneElement(e,t):typeof e=="function"?re.createElement(e,t):re.createElement(Jct,t)}var sl=function(e){function t(){return put(this,t),yut(this,t,arguments)}return wut(t,e),gut(t,[{key:"render",value:function(){var r=this,i=this.props,s=i.active,a=i.allowEscapeViewBox,o=i.animationDuration,c=i.animationEasing,u=i.content,d=i.coordinate,h=i.filterNull,A=i.isAnimationActive,f=i.offset,p=i.payload,m=i.payloadUniqBy,g=i.position,y=i.reverseDirection,v=i.useTranslate3d,x=i.viewBox,w=i.wrapperStyle,b=p??[];h&&b.length&&(b=Npe(p.filter(function(j){return j.value!=null&&(j.hide!==!0||r.props.includeHidden)}),m,Cut));var k=b.length>0;return re.createElement(fut,{allowEscapeViewBox:a,animationDuration:o,animationEasing:c,isAnimationActive:A,active:s,coordinate:d,hasPayload:k,offset:f,position:g,reverseDirection:y,useTranslate3d:v,viewBox:x,wrapperStyle:w},Sut(u,fG(fG({},this.props),{},{payload:b})))}}])}(C.PureComponent);CQ(sl,"displayName","Tooltip");CQ(sl,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!ud.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 kut=yu,_ut=function(){return kut.Date.now()},jut=_ut,But=/\s/;function Nut(e){for(var t=e.length;t--&&But.test(e.charAt(t)););return t}var Eut=Nut,Tut=Eut,Put=/^\s+/;function Iut(e){return e&&e.slice(0,Tut(e)+1).replace(Put,"")}var Out=Iut,Fut=Out,AG=rA,Mut=v0,pG=NaN,Lut=/^[-+]0x[0-9a-f]+$/i,Rut=/^0b[01]+$/i,Dut=/^0o[0-7]+$/i,Uut=parseInt;function Hut(e){if(typeof e=="number")return e;if(Mut(e))return pG;if(AG(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=AG(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Fut(e);var n=Rut.test(e);return n||Dut.test(e)?Uut(e.slice(2),n?2:8):Lut.test(e)?pG:+e}var Hpe=Hut,Qut=rA,_4=jut,mG=Hpe,$ut="Expected a function",zut=Math.max,Vut=Math.min;function Kut(e,t,n){var r,i,s,a,o,c,u=0,d=!1,h=!1,A=!0;if(typeof e!="function")throw new TypeError($ut);t=mG(t)||0,Qut(n)&&(d=!!n.leading,h="maxWait"in n,s=h?zut(mG(n.maxWait)||0,t):s,A="trailing"in n?!!n.trailing:A);function f(k){var j=r,B=i;return r=i=void 0,u=k,a=e.apply(B,j),a}function p(k){return u=k,o=setTimeout(y,t),d?f(k):a}function m(k){var j=k-c,B=k-u,E=t-j;return h?Vut(E,s-B):E}function g(k){var j=k-c,B=k-u;return c===void 0||j>=t||j<0||h&&B>=s}function y(){var k=_4();if(g(k))return v(k);o=setTimeout(y,m(k))}function v(k){return o=void 0,A&&r?f(k):(r=i=void 0,a)}function x(){o!==void 0&&clearTimeout(o),u=0,r=c=i=o=void 0}function w(){return o===void 0?a:v(_4())}function b(){var k=_4(),j=g(k);if(r=arguments,i=this,c=k,j){if(o===void 0)return p(c);if(h)return clearTimeout(o),o=setTimeout(y,t),f(c)}return o===void 0&&(o=setTimeout(y,t)),a}return b.cancel=x,b.flush=w,b}var qut=Kut,Wut=qut,Gut=rA,Yut="Expected a function";function Xut(e,t,n){var r=!0,i=!0;if(typeof e!="function")throw new TypeError(Yut);return Gut(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Wut(e,t,{leading:r,maxWait:t,trailing:i})}var Jut=Xut;const Qpe=In(Jut);function w1(e){"@babel/helpers - typeof";return w1=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},w1(e)}function gG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function YS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gG(Object(n),!0).forEach(function(r){Zut(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gG(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Zut(e,t,n){return t=edt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function edt(e){var t=tdt(e,"string");return w1(t)=="symbol"?t:t+""}function tdt(e,t){if(w1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(w1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ndt(e,t){return adt(e)||sdt(e,t)||idt(e,t)||rdt()}function rdt(){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 idt(e,t){if(e){if(typeof e=="string")return yG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yG(e,t)}}function yG(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sdt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function adt(e){if(Array.isArray(e))return e}var SQ=C.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,s=e.width,a=s===void 0?"100%":s,o=e.height,c=o===void 0?"100%":o,u=e.minWidth,d=u===void 0?0:u,h=e.minHeight,A=e.maxHeight,f=e.children,p=e.debounce,m=p===void 0?0:p,g=e.id,y=e.className,v=e.onResize,x=e.style,w=x===void 0?{}:x,b=C.useRef(null),k=C.useRef();k.current=v,C.useImperativeHandle(t,function(){return Object.defineProperty(b.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),b.current},configurable:!0})});var j=C.useState({containerWidth:i.width,containerHeight:i.height}),B=ndt(j,2),E=B[0],I=B[1],T=C.useCallback(function(F,L){I(function(U){var H=Math.round(F),K=Math.round(L);return U.containerWidth===H&&U.containerHeight===K?U:{containerWidth:H,containerHeight:K}})},[]);C.useEffect(function(){var F=function(z){var Q,oe=z[0].contentRect,R=oe.width,M=oe.height;T(R,M),(Q=k.current)===null||Q===void 0||Q.call(k,R,M)};m>0&&(F=Qpe(F,m,{trailing:!0,leading:!1}));var L=new ResizeObserver(F),U=b.current.getBoundingClientRect(),H=U.width,K=U.height;return T(H,K),L.observe(b.current),function(){L.disconnect()}},[T,m]);var N=C.useMemo(function(){var F=E.containerWidth,L=E.containerHeight;if(F<0||L<0)return null;cd(ip(a)||ip(c),`The width(%s) and height(%s) are both fixed numbers,
       maybe you don't need to use a ResponsiveContainer.`,a,c),cd(!n||n>0,"The aspect(%s) must be greater than zero.",n);var U=ip(a)?F:a,H=ip(c)?L:c;n&&n>0&&(U?H=U/n:H&&(U=H*n),A&&H>A&&(H=A)),cd(U>0||H>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.`,U,H,a,c,d,h,n);var K=!Array.isArray(f)&&ld(f.type).endsWith("Chart");return re.Children.map(f,function($){return re.isValidElement($)?C.cloneElement($,YS({width:U,height:H},K?{style:YS({height:"100%",width:"100%",maxHeight:H,maxWidth:U},$.props.style)}:{})):$})},[n,f,c,A,h,d,E,a]);return re.createElement("div",{id:g?"".concat(g):void 0,className:Pn("recharts-responsive-container",y),style:YS(YS({},w),{},{width:a,height:c,minWidth:d,minHeight:h,maxHeight:A}),ref:b},N)}),$pe=function(t){return null};$pe.displayName="Cell";function b1(e){"@babel/helpers - typeof";return b1=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},b1(e)}function vG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vG(Object(n),!0).forEach(function(r){odt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vG(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function odt(e,t,n){return t=ldt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ldt(e){var t=cdt(e,"string");return b1(t)=="symbol"?t:t+""}function cdt(e,t){if(b1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(b1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pg={widthCache:{},cacheCount:0},udt=2e3,ddt={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},xG="recharts_measurement_span";function hdt(e){var t=yL({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var eb=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ud.isSsr)return{width:0,height:0};var r=hdt(n),i=JSON.stringify({text:t,copyStyle:r});if(pg.widthCache[i])return pg.widthCache[i];try{var s=document.getElementById(xG);s||(s=document.createElement("span"),s.setAttribute("id",xG),s.setAttribute("aria-hidden","true"),document.body.appendChild(s));var a=yL(yL({},ddt),r);Object.assign(s.style,a),s.textContent="".concat(t);var o=s.getBoundingClientRect(),c={width:o.width,height:o.height};return pg.widthCache[i]=c,++pg.cacheCount>udt&&(pg.cacheCount=0,pg.widthCache={}),c}catch{return{width:0,height:0}}},fdt=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function C1(e){"@babel/helpers - typeof";return C1=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},C1(e)}function WB(e,t){return gdt(e)||mdt(e,t)||pdt(e,t)||Adt()}function Adt(){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 pdt(e,t){if(e){if(typeof e=="string")return wG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wG(e,t)}}function wG(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mdt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function gdt(e){if(Array.isArray(e))return e}function ydt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bG(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,xdt(r.key),r)}}function vdt(e,t,n){return t&&bG(e.prototype,t),n&&bG(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function xdt(e){var t=wdt(e,"string");return C1(t)=="symbol"?t:t+""}function wdt(e,t){if(C1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(C1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var CG=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,SG=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,bdt=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Cdt=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,zpe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Sdt=Object.keys(zpe),oy="NaN";function kdt(e,t){return e*zpe[t]}var XS=function(){function e(t,n){ydt(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!bdt.test(n)&&(this.num=NaN,this.unit=""),Sdt.includes(n)&&(this.num=kdt(t,n),this.unit="px")}return vdt(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.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(n){var r,i=(r=Cdt.exec(n))!==null&&r!==void 0?r:[],s=WB(i,3),a=s[1],o=s[2];return new e(parseFloat(a),o??"")}}])}();function Vpe(e){if(e.includes(oy))return oy;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=CG.exec(t))!==null&&n!==void 0?n:[],i=WB(r,4),s=i[1],a=i[2],o=i[3],c=XS.parse(s??""),u=XS.parse(o??""),d=a==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return oy;t=t.replace(CG,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,A=(h=SG.exec(t))!==null&&h!==void 0?h:[],f=WB(A,4),p=f[1],m=f[2],g=f[3],y=XS.parse(p??""),v=XS.parse(g??""),x=m==="+"?y.add(v):y.subtract(v);if(x.isNaN())return oy;t=t.replace(SG,x.toString())}return t}var kG=/\(([^()]*)\)/;function _dt(e){for(var t=e;t.includes("(");){var n=kG.exec(t),r=WB(n,2),i=r[1];t=t.replace(kG,Vpe(i))}return t}function jdt(e){var t=e.replace(/\s+/g,"");return t=_dt(t),t=Vpe(t),t}function Bdt(e){try{return jdt(e)}catch{return oy}}function j4(e){var t=Bdt(e.slice(5,-1));return t===oy?"":t}var Ndt=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],Edt=["dx","dy","angle","className","breakAll"];function vL(){return vL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vL.apply(this,arguments)}function _G(e,t){if(e==null)return{};var n=Tdt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Tdt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function jG(e,t){return Fdt(e)||Odt(e,t)||Idt(e,t)||Pdt()}function Pdt(){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 Idt(e,t){if(e){if(typeof e=="string")return BG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return BG(e,t)}}function BG(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Odt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Fdt(e){if(Array.isArray(e))return e}var Kpe=/[ \f\n\r\t\v\u2028\u2029]+/,qpe=function(t){var n=t.children,r=t.breakAll,i=t.style;try{var s=[];Cn(n)||(r?s=n.toString().split(""):s=n.toString().split(Kpe));var a=s.map(function(c){return{word:c,width:eb(c,i).width}}),o=r?0:eb(" ",i).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}},Mdt=function(t,n,r,i,s){var a=t.maxLines,o=t.children,c=t.style,u=t.breakAll,d=Ze(a),h=o,A=function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return U.reduce(function(H,K){var $=K.word,z=K.width,Q=H[H.length-1];if(Q&&(i==null||s||Q.width+z+r<Number(i)))Q.words.push($),Q.width+=z+r;else{var oe={words:[$],width:z};H.push(oe)}return H},[])},f=A(n),p=function(U){return U.reduce(function(H,K){return H.width>K.width?H:K})};if(!d)return f;for(var m="…",g=function(U){var H=h.slice(0,U),K=qpe({breakAll:u,style:c,children:H+m}).wordsWithComputedWidth,$=A(K),z=$.length>a||p($).width>Number(i);return[z,$]},y=0,v=h.length-1,x=0,w;y<=v&&x<=h.length-1;){var b=Math.floor((y+v)/2),k=b-1,j=g(k),B=jG(j,2),E=B[0],I=B[1],T=g(b),N=jG(T,1),F=N[0];if(!E&&!F&&(y=b+1),E&&F&&(v=b-1),!E&&F){w=I;break}x++}return w||f},NG=function(t){var n=Cn(t)?[]:t.toString().split(Kpe);return[{words:n}]},Ldt=function(t){var n=t.width,r=t.scaleToFit,i=t.children,s=t.style,a=t.breakAll,o=t.maxLines;if((n||r)&&!ud.isSsr){var c,u,d=qpe({breakAll:a,children:i,style:s});if(d){var h=d.wordsWithComputedWidth,A=d.spaceWidth;c=h,u=A}else return NG(i);return Mdt({breakAll:a,children:i,maxLines:o,style:s},c,u,n,r)}return NG(i)},EG="#808080",GB=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,s=i===void 0?0:i,a=t.lineHeight,o=a===void 0?"1em":a,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,h=d===void 0?!1:d,A=t.textAnchor,f=A===void 0?"start":A,p=t.verticalAnchor,m=p===void 0?"end":p,g=t.fill,y=g===void 0?EG:g,v=_G(t,Ndt),x=C.useMemo(function(){return Ldt({breakAll:v.breakAll,children:v.children,maxLines:v.maxLines,scaleToFit:h,style:v.style,width:v.width})},[v.breakAll,v.children,v.maxLines,h,v.style,v.width]),w=v.dx,b=v.dy,k=v.angle,j=v.className,B=v.breakAll,E=_G(v,Edt);if(!Ki(r)||!Ki(s))return null;var I=r+(Ze(w)?w:0),T=s+(Ze(b)?b:0),N;switch(m){case"start":N=j4("calc(".concat(u,")"));break;case"middle":N=j4("calc(".concat((x.length-1)/2," * -").concat(o," + (").concat(u," / 2))"));break;default:N=j4("calc(".concat(x.length-1," * -").concat(o,")"));break}var F=[];if(h){var L=x[0].width,U=v.width;F.push("scale(".concat((Ze(U)?U/L:1)/L,")"))}return k&&F.push("rotate(".concat(k,", ").concat(I,", ").concat(T,")")),F.length&&(E.transform=F.join(" ")),re.createElement("text",vL({},jn(E,!0),{x:I,y:T,className:Pn("recharts-text",j),textAnchor:f,fill:y.includes("url")?EG:y}),x.map(function(H,K){var $=H.words.join(B?"":" ");return re.createElement("tspan",{x:I,dy:K===0?N:o,key:"".concat($,"-").concat(K)},$)}))};function gf(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Rdt(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function kQ(e){let t,n,r;e.length!==2?(t=gf,n=(o,c)=>gf(e(o),c),r=(o,c)=>e(o)-c):(t=e===gf||e===Rdt?e:Ddt,n=e,r=e);function i(o,c,u=0,d=o.length){if(u<d){if(t(c,c)!==0)return d;do{const h=u+d>>>1;n(o[h],c)<0?u=h+1:d=h}while(u<d)}return u}function s(o,c,u=0,d=o.length){if(u<d){if(t(c,c)!==0)return d;do{const h=u+d>>>1;n(o[h],c)<=0?u=h+1:d=h}while(u<d)}return u}function a(o,c,u=0,d=o.length){const h=i(o,c,u,d-1);return h>u&&r(o[h-1],c)>-r(o[h],c)?h-1:h}return{left:i,center:a,right:s}}function Ddt(){return 0}function Wpe(e){return e===null?NaN:+e}function*Udt(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Hdt=kQ(gf),X2=Hdt.right;kQ(Wpe).center;class TG extends Map{constructor(t,n=zdt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(PG(this,t))}has(t){return super.has(PG(this,t))}set(t,n){return super.set(Qdt(this,t),n)}delete(t){return super.delete($dt(this,t))}}function PG({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Qdt({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function $dt({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function zdt(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Vdt(e=gf){if(e===gf)return Gpe;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function Gpe(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Kdt=Math.sqrt(50),qdt=Math.sqrt(10),Wdt=Math.sqrt(2);function YB(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=Kdt?10:s>=qdt?5:s>=Wdt?2:1;let o,c,u;return i<0?(u=Math.pow(10,-i)/a,o=Math.round(e*u),c=Math.round(t*u),o/u<e&&++o,c/u>t&&--c,u=-u):(u=Math.pow(10,i)*a,o=Math.round(e/u),c=Math.round(t/u),o*u<e&&++o,c*u>t&&--c),c<o&&.5<=n&&n<2?YB(e,t,n*2):[o,c,u]}function xL(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,s,a]=r?YB(t,e,n):YB(e,t,n);if(!(s>=i))return[];const o=s-i+1,c=new Array(o);if(r)if(a<0)for(let u=0;u<o;++u)c[u]=(s-u)/-a;else for(let u=0;u<o;++u)c[u]=(s-u)*a;else if(a<0)for(let u=0;u<o;++u)c[u]=(i+u)/-a;else for(let u=0;u<o;++u)c[u]=(i+u)*a;return c}function wL(e,t,n){return t=+t,e=+e,n=+n,YB(e,t,n)[2]}function bL(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?wL(t,e,n):wL(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function IG(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function OG(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function Ype(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?Gpe:Vdt(i);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),h=.5*Math.exp(2*d/3),A=.5*Math.sqrt(d*h*(c-h)/c)*(u-c/2<0?-1:1),f=Math.max(n,Math.floor(t-u*h/c+A)),p=Math.min(r,Math.floor(t+(c-u)*h/c+A));Ype(e,t,f,p,i)}const s=e[t];let a=n,o=r;for(Ix(e,n,t),i(e[r],s)>0&&Ix(e,n,r);a<o;){for(Ix(e,a,o),++a,--o;i(e[a],s)<0;)++a;for(;i(e[o],s)>0;)--o}i(e[n],s)===0?Ix(e,n,o):(++o,Ix(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function Ix(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Gdt(e,t,n){if(e=Float64Array.from(Udt(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return OG(e);if(t>=1)return IG(e);var r,i=(r-1)*t,s=Math.floor(i),a=IG(Ype(e,s).subarray(0,s+1)),o=OG(e.subarray(s+1));return a+(o-a)*(i-s)}}function Ydt(e,t,n=Wpe){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,s=Math.floor(i),a=+n(e[s],s,e),o=+n(e[s+1],s+1,e);return a+(o-a)*(i-s)}}function Xdt(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(i);++r<i;)s[r]=e+r*n;return s}function Il(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Fd(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 CL=Symbol("implicit");function _Q(){var e=new TG,t=[],n=[],r=CL;function i(s){let a=e.get(s);if(a===void 0){if(r!==CL)return r;e.set(s,a=t.push(s)-1)}return n[a%n.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new TG;for(const a of s)e.has(a)||e.set(a,t.push(a)-1);return i},i.range=function(s){return arguments.length?(n=Array.from(s),i):n.slice()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return _Q(t,n).unknown(r)},Il.apply(i,arguments),i}function S1(){var e=_Q().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,s,a,o=!1,c=0,u=0,d=.5;delete e.unknown;function h(){var A=t().length,f=i<r,p=f?i:r,m=f?r:i;s=(m-p)/Math.max(1,A-c+u*2),o&&(s=Math.floor(s)),p+=(m-p-s*(A-c))*d,a=s*(1-c),o&&(p=Math.round(p),a=Math.round(a));var g=Xdt(A).map(function(y){return p+s*y});return n(f?g.reverse():g)}return e.domain=function(A){return arguments.length?(t(A),h()):t()},e.range=function(A){return arguments.length?([r,i]=A,r=+r,i=+i,h()):[r,i]},e.rangeRound=function(A){return[r,i]=A,r=+r,i=+i,o=!0,h()},e.bandwidth=function(){return a},e.step=function(){return s},e.round=function(A){return arguments.length?(o=!!A,h()):o},e.padding=function(A){return arguments.length?(c=Math.min(1,u=+A),h()):c},e.paddingInner=function(A){return arguments.length?(c=Math.min(1,A),h()):c},e.paddingOuter=function(A){return arguments.length?(u=+A,h()):u},e.align=function(A){return arguments.length?(d=Math.max(0,Math.min(1,A)),h()):d},e.copy=function(){return S1(t(),[r,i]).round(o).paddingInner(c).paddingOuter(u).align(d)},Il.apply(h(),arguments)}function Xpe(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Xpe(t())},e}function tb(){return Xpe(S1.apply(null,arguments).paddingInner(1))}function jQ(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Jpe(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function J2(){}var k1=.7,XB=1/k1,Oy="\\s*([+-]?\\d+)\\s*",_1="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",au="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Jdt=/^#([0-9a-f]{3,8})$/,Zdt=new RegExp(`^rgb\\(${Oy},${Oy},${Oy}\\)$`),eht=new RegExp(`^rgb\\(${au},${au},${au}\\)$`),tht=new RegExp(`^rgba\\(${Oy},${Oy},${Oy},${_1}\\)$`),nht=new RegExp(`^rgba\\(${au},${au},${au},${_1}\\)$`),rht=new RegExp(`^hsl\\(${_1},${au},${au}\\)$`),iht=new RegExp(`^hsla\\(${_1},${au},${au},${_1}\\)$`),FG={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};jQ(J2,j1,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:MG,formatHex:MG,formatHex8:sht,formatHsl:aht,formatRgb:LG,toString:LG});function MG(){return this.rgb().formatHex()}function sht(){return this.rgb().formatHex8()}function aht(){return Zpe(this).formatHsl()}function LG(){return this.rgb().formatRgb()}function j1(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Jdt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?RG(t):n===3?new Ga(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?JS(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?JS(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=Zdt.exec(e))?new Ga(t[1],t[2],t[3],1):(t=eht.exec(e))?new Ga(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=tht.exec(e))?JS(t[1],t[2],t[3],t[4]):(t=nht.exec(e))?JS(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=rht.exec(e))?HG(t[1],t[2]/100,t[3]/100,1):(t=iht.exec(e))?HG(t[1],t[2]/100,t[3]/100,t[4]):FG.hasOwnProperty(e)?RG(FG[e]):e==="transparent"?new Ga(NaN,NaN,NaN,0):null}function RG(e){return new Ga(e>>16&255,e>>8&255,e&255,1)}function JS(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ga(e,t,n,r)}function oht(e){return e instanceof J2||(e=j1(e)),e?(e=e.rgb(),new Ga(e.r,e.g,e.b,e.opacity)):new Ga}function SL(e,t,n,r){return arguments.length===1?oht(e):new Ga(e,t,n,r??1)}function Ga(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}jQ(Ga,SL,Jpe(J2,{brighter(e){return e=e==null?XB:Math.pow(XB,e),new Ga(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?k1:Math.pow(k1,e),new Ga(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ga(Pp(this.r),Pp(this.g),Pp(this.b),JB(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:DG,formatHex:DG,formatHex8:lht,formatRgb:UG,toString:UG}));function DG(){return`#${sp(this.r)}${sp(this.g)}${sp(this.b)}`}function lht(){return`#${sp(this.r)}${sp(this.g)}${sp(this.b)}${sp((isNaN(this.opacity)?1:this.opacity)*255)}`}function UG(){const e=JB(this.opacity);return`${e===1?"rgb(":"rgba("}${Pp(this.r)}, ${Pp(this.g)}, ${Pp(this.b)}${e===1?")":`, ${e})`}`}function JB(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pp(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function sp(e){return e=Pp(e),(e<16?"0":"")+e.toString(16)}function HG(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ac(e,t,n,r)}function Zpe(e){if(e instanceof ac)return new ac(e.h,e.s,e.l,e.opacity);if(e instanceof J2||(e=j1(e)),!e)return new ac;if(e instanceof ac)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,c=(s+i)/2;return o?(t===s?a=(n-r)/o+(n<r)*6:n===s?a=(r-t)/o+2:a=(t-n)/o+4,o/=c<.5?s+i:2-s-i,a*=60):o=c>0&&c<1?0:a,new ac(a,o,c,e.opacity)}function cht(e,t,n,r){return arguments.length===1?Zpe(e):new ac(e,t,n,r??1)}function ac(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}jQ(ac,cht,Jpe(J2,{brighter(e){return e=e==null?XB:Math.pow(XB,e),new ac(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?k1:Math.pow(k1,e),new ac(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,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ga(B4(e>=240?e-240:e+120,i,r),B4(e,i,r),B4(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ac(QG(this.h),ZS(this.s),ZS(this.l),JB(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=JB(this.opacity);return`${e===1?"hsl(":"hsla("}${QG(this.h)}, ${ZS(this.s)*100}%, ${ZS(this.l)*100}%${e===1?")":`, ${e})`}`}}));function QG(e){return e=(e||0)%360,e<0?e+360:e}function ZS(e){return Math.max(0,Math.min(1,e||0))}function B4(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const BQ=e=>()=>e;function uht(e,t){return function(n){return e+n*t}}function dht(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function hht(e){return(e=+e)==1?eme:function(t,n){return n-t?dht(t,n,e):BQ(isNaN(t)?n:t)}}function eme(e,t){var n=t-e;return n?uht(e,n):BQ(isNaN(e)?t:e)}const $G=function e(t){var n=hht(t);function r(i,s){var a=n((i=SL(i)).r,(s=SL(s)).r),o=n(i.g,s.g),c=n(i.b,s.b),u=eme(i.opacity,s.opacity);return function(d){return i.r=a(d),i.g=o(d),i.b=c(d),i.opacity=u(d),i+""}}return r.gamma=e,r}(1);function fht(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function Aht(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function pht(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),a;for(a=0;a<r;++a)i[a]=j0(e[a],t[a]);for(;a<n;++a)s[a]=t[a];return function(o){for(a=0;a<r;++a)s[a]=i[a](o);return s}}function mht(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ZB(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ght(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=j0(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var kL=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,N4=new RegExp(kL.source,"g");function yht(e){return function(){return e}}function vht(e){return function(t){return e(t)+""}}function xht(e,t){var n=kL.lastIndex=N4.lastIndex=0,r,i,s,a=-1,o=[],c=[];for(e=e+"",t=t+"";(r=kL.exec(e))&&(i=N4.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),o[a]?o[a]+=s:o[++a]=s),(r=r[0])===(i=i[0])?o[a]?o[a]+=i:o[++a]=i:(o[++a]=null,c.push({i:a,x:ZB(r,i)})),n=N4.lastIndex;return n<t.length&&(s=t.slice(n),o[a]?o[a]+=s:o[++a]=s),o.length<2?c[0]?vht(c[0].x):yht(t):(t=c.length,function(u){for(var d=0,h;d<t;++d)o[(h=c[d]).i]=h.x(u);return o.join("")})}function j0(e,t){var n=typeof t,r;return t==null||n==="boolean"?BQ(t):(n==="number"?ZB:n==="string"?(r=j1(t))?(t=r,$G):xht:t instanceof j1?$G:t instanceof Date?mht:Aht(t)?fht:Array.isArray(t)?pht:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?ght:ZB)(e,t)}function NQ(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function wht(e,t){t===void 0&&(t=e,e=j0);for(var n=0,r=t.length-1,i=t[0],s=new Array(r<0?0:r);n<r;)s[n]=e(i,i=t[++n]);return function(a){var o=Math.max(0,Math.min(r-1,Math.floor(a*=r)));return s[o](a-o)}}function bht(e){return function(){return e}}function eN(e){return+e}var zG=[0,1];function Sa(e){return e}function _L(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:bht(isNaN(t)?NaN:.5)}function Cht(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function Sht(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=_L(i,r),s=n(a,s)):(r=_L(r,i),s=n(s,a)),function(o){return s(r(o))}}function kht(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=_L(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(o){var c=X2(e,o,1,r)-1;return s[c](i[c](o))}}function Z2(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function K5(){var e=zG,t=zG,n=j0,r,i,s,a=Sa,o,c,u;function d(){var A=Math.min(e.length,t.length);return a!==Sa&&(a=Cht(e[0],e[A-1])),o=A>2?kht:Sht,c=u=null,h}function h(A){return A==null||isNaN(A=+A)?s:(c||(c=o(e.map(r),t,n)))(r(a(A)))}return h.invert=function(A){return a(i((u||(u=o(t,e.map(r),ZB)))(A)))},h.domain=function(A){return arguments.length?(e=Array.from(A,eN),d()):e.slice()},h.range=function(A){return arguments.length?(t=Array.from(A),d()):t.slice()},h.rangeRound=function(A){return t=Array.from(A),n=NQ,d()},h.clamp=function(A){return arguments.length?(a=A?!0:Sa,d()):a!==Sa},h.interpolate=function(A){return arguments.length?(n=A,d()):n},h.unknown=function(A){return arguments.length?(s=A,h):s},function(A,f){return r=A,i=f,d()}}function EQ(){return K5()(Sa,Sa)}function _ht(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function tN(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Nv(e){return e=tN(Math.abs(e)),e?e[1]:NaN}function jht(e,t){return function(n,r){for(var i=n.length,s=[],a=0,o=e[0],c=0;i>0&&o>0&&(c+o+1>r&&(o=Math.max(1,r-c)),s.push(n.substring(i-=o,i+o)),!((c+=o+1)>r));)o=e[a=(a+1)%e.length];return s.reverse().join(t)}}function Bht(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Nht=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function B1(e){if(!(t=Nht.exec(e)))throw new Error("invalid format: "+e);var t;return new TQ({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]})}B1.prototype=TQ.prototype;function TQ(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+""}TQ.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 Eht(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var tme;function Tht(e,t){var n=tN(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(tme=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+tN(e,Math.max(0,t+s-1))[0]}function VG(e,t){var n=tN(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const KG={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:_ht,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)=>VG(e*100,t),r:VG,s:Tht,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function qG(e){return e}var WG=Array.prototype.map,GG=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Pht(e){var t=e.grouping===void 0||e.thousands===void 0?qG:jht(WG.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?qG:Bht(WG.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",o=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(h){h=B1(h);var A=h.fill,f=h.align,p=h.sign,m=h.symbol,g=h.zero,y=h.width,v=h.comma,x=h.precision,w=h.trim,b=h.type;b==="n"?(v=!0,b="g"):KG[b]||(x===void 0&&(x=12),w=!0,b="g"),(g||A==="0"&&f==="=")&&(g=!0,A="0",f="=");var k=m==="$"?n:m==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():"",j=m==="$"?r:/[%p]/.test(b)?a:"",B=KG[b],E=/[defgprs%]/.test(b);x=x===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function I(T){var N=k,F=j,L,U,H;if(b==="c")F=B(T)+F,T="";else{T=+T;var K=T<0||1/T<0;if(T=isNaN(T)?c:B(Math.abs(T),x),w&&(T=Eht(T)),K&&+T==0&&p!=="+"&&(K=!1),N=(K?p==="("?p:o:p==="-"||p==="("?"":p)+N,F=(b==="s"?GG[8+tme/3]:"")+F+(K&&p==="("?")":""),E){for(L=-1,U=T.length;++L<U;)if(H=T.charCodeAt(L),48>H||H>57){F=(H===46?i+T.slice(L+1):T.slice(L))+F,T=T.slice(0,L);break}}}v&&!g&&(T=t(T,1/0));var $=N.length+T.length+F.length,z=$<y?new Array(y-$+1).join(A):"";switch(v&&g&&(T=t(z+T,z.length?y-F.length:1/0),z=""),f){case"<":T=N+T+F+z;break;case"=":T=N+z+T+F;break;case"^":T=z.slice(0,$=z.length>>1)+N+T+F+z.slice($);break;default:T=z+N+T+F;break}return s(T)}return I.toString=function(){return h+""},I}function d(h,A){var f=u((h=B1(h),h.type="f",h)),p=Math.max(-8,Math.min(8,Math.floor(Nv(A)/3)))*3,m=Math.pow(10,-p),g=GG[8+p/3];return function(y){return f(m*y)+g}}return{format:u,formatPrefix:d}}var ek,PQ,nme;Iht({thousands:",",grouping:[3],currency:["$",""]});function Iht(e){return ek=Pht(e),PQ=ek.format,nme=ek.formatPrefix,ek}function Oht(e){return Math.max(0,-Nv(Math.abs(e)))}function Fht(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Nv(t)/3)))*3-Nv(Math.abs(e)))}function Mht(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Nv(t)-Nv(e))+1}function rme(e,t,n,r){var i=bL(e,t,n),s;switch(r=B1(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=Fht(i,a))&&(r.precision=s),nme(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=Mht(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=Oht(i))&&(r.precision=s-(r.type==="%")*2);break}}return PQ(r)}function sA(e){var t=e.domain;return e.ticks=function(n){var r=t();return xL(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return rme(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,s=r.length-1,a=r[i],o=r[s],c,u,d=10;for(o<a&&(u=a,a=o,o=u,u=i,i=s,s=u);d-- >0;){if(u=wL(a,o,n),u===c)return r[i]=a,r[s]=o,t(r);if(u>0)a=Math.floor(a/u)*u,o=Math.ceil(o/u)*u;else if(u<0)a=Math.ceil(a*u)/u,o=Math.floor(o*u)/u;else break;c=u}return e},e}function nN(){var e=EQ();return e.copy=function(){return Z2(e,nN())},Il.apply(e,arguments),sA(e)}function ime(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,eN),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return ime(e).unknown(t)},e=arguments.length?Array.from(e,eN):[0,1],sA(n)}function sme(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return s<i&&(a=n,n=r,r=a,a=i,i=s,s=a),e[n]=t.floor(i),e[r]=t.ceil(s),e}function YG(e){return Math.log(e)}function XG(e){return Math.exp(e)}function Lht(e){return-Math.log(-e)}function Rht(e){return-Math.exp(-e)}function Dht(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Uht(e){return e===10?Dht:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Hht(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 JG(e){return(t,n)=>-e(-t,n)}function IQ(e){const t=e(YG,XG),n=t.domain;let r=10,i,s;function a(){return i=Hht(r),s=Uht(r),n()[0]<0?(i=JG(i),s=JG(s),e(Lht,Rht)):e(YG,XG),t}return t.base=function(o){return arguments.length?(r=+o,a()):r},t.domain=function(o){return arguments.length?(n(o),a()):n()},t.ticks=o=>{const c=n();let u=c[0],d=c[c.length-1];const h=d<u;h&&([u,d]=[d,u]);let A=i(u),f=i(d),p,m;const g=o==null?10:+o;let y=[];if(!(r%1)&&f-A<g){if(A=Math.floor(A),f=Math.ceil(f),u>0){for(;A<=f;++A)for(p=1;p<r;++p)if(m=A<0?p/s(-A):p*s(A),!(m<u)){if(m>d)break;y.push(m)}}else for(;A<=f;++A)for(p=r-1;p>=1;--p)if(m=A>0?p/s(-A):p*s(A),!(m<u)){if(m>d)break;y.push(m)}y.length*2<g&&(y=xL(u,d,g))}else y=xL(A,f,Math.min(f-A,g)).map(s);return h?y.reverse():y},t.tickFormat=(o,c)=>{if(o==null&&(o=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=B1(c)).precision==null&&(c.trim=!0),c=PQ(c)),o===1/0)return c;const u=Math.max(1,r*o/t.ticks().length);return d=>{let h=d/s(Math.round(i(d)));return h*r<r-.5&&(h*=r),h<=u?c(d):""}},t.nice=()=>n(sme(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function ame(){const e=IQ(K5()).domain([1,10]);return e.copy=()=>Z2(e,ame()).base(e.base()),Il.apply(e,arguments),e}function ZG(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function eY(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function OQ(e){var t=1,n=e(ZG(t),eY(t));return n.constant=function(r){return arguments.length?e(ZG(t=+r),eY(t)):t},sA(n)}function ome(){var e=OQ(K5());return e.copy=function(){return Z2(e,ome()).constant(e.constant())},Il.apply(e,arguments)}function tY(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Qht(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function $ht(e){return e<0?-e*e:e*e}function FQ(e){var t=e(Sa,Sa),n=1;function r(){return n===1?e(Sa,Sa):n===.5?e(Qht,$ht):e(tY(n),tY(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},sA(t)}function MQ(){var e=FQ(K5());return e.copy=function(){return Z2(e,MQ()).exponent(e.exponent())},Il.apply(e,arguments),e}function zht(){return MQ.apply(null,arguments).exponent(.5)}function nY(e){return Math.sign(e)*e*e}function Vht(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function lme(){var e=EQ(),t=[0,1],n=!1,r;function i(s){var a=Vht(e(s));return isNaN(a)?r:n?Math.round(a):a}return i.invert=function(s){return e.invert(nY(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,eN)).map(nY)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(n=!!s,i):n},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return lme(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Il.apply(i,arguments),sA(i)}function cme(){var e=[],t=[],n=[],r;function i(){var a=0,o=Math.max(1,t.length);for(n=new Array(o-1);++a<o;)n[a-1]=Ydt(e,a/o);return s}function s(a){return a==null||isNaN(a=+a)?r:t[X2(n,a)]}return s.invertExtent=function(a){var o=t.indexOf(a);return o<0?[NaN,NaN]:[o>0?n[o-1]:e[0],o<n.length?n[o]:e[e.length-1]]},s.domain=function(a){if(!arguments.length)return e.slice();e=[];for(let o of a)o!=null&&!isNaN(o=+o)&&e.push(o);return e.sort(gf),i()},s.range=function(a){return arguments.length?(t=Array.from(a),i()):t.slice()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.quantiles=function(){return n.slice()},s.copy=function(){return cme().domain(e).range(t).unknown(r)},Il.apply(s,arguments)}function ume(){var e=0,t=1,n=1,r=[.5],i=[0,1],s;function a(c){return c!=null&&c<=c?i[X2(r,c,0,n)]:s}function o(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return a}return a.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,o()):[e,t]},a.range=function(c){return arguments.length?(n=(i=Array.from(c)).length-1,o()):i.slice()},a.invertExtent=function(c){var u=i.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},a.unknown=function(c){return arguments.length&&(s=c),a},a.thresholds=function(){return r.slice()},a.copy=function(){return ume().domain([e,t]).range(i).unknown(s)},Il.apply(sA(a),arguments)}function dme(){var e=[.5],t=[0,1],n,r=1;function i(s){return s!=null&&s<=s?t[X2(e,s,0,r)]:n}return i.domain=function(s){return arguments.length?(e=Array.from(s),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var a=t.indexOf(s);return[e[a-1],e[a]]},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return dme().domain(e).range(t).unknown(n)},Il.apply(i,arguments)}const E4=new Date,T4=new Date;function Yi(e,t,n,r){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const a=i(s),o=i.ceil(s);return s-a<o-s?a:o},i.offset=(s,a)=>(t(s=new Date(+s),a==null?1:Math.floor(a)),s),i.range=(s,a,o)=>{const c=[];if(s=i.ceil(s),o=o==null?1:Math.floor(o),!(s<a)||!(o>0))return c;let u;do c.push(u=new Date(+s)),t(s,o),e(s);while(u<s&&s<a);return c},i.filter=s=>Yi(a=>{if(a>=a)for(;e(a),!s(a);)a.setTime(a-1)},(a,o)=>{if(a>=a)if(o<0)for(;++o<=0;)for(;t(a,-1),!s(a););else for(;--o>=0;)for(;t(a,1),!s(a););}),n&&(i.count=(s,a)=>(E4.setTime(+s),T4.setTime(+a),e(E4),e(T4),Math.floor(n(E4,T4))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(r?a=>r(a)%s===0:a=>i.count(0,a)%s===0):i)),i}const rN=Yi(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);rN.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Yi(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):rN);rN.range;const nd=1e3,Al=nd*60,rd=Al*60,bd=rd*24,LQ=bd*7,rY=bd*30,P4=bd*365,ap=Yi(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*nd)},(e,t)=>(t-e)/nd,e=>e.getUTCSeconds());ap.range;const RQ=Yi(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*nd)},(e,t)=>{e.setTime(+e+t*Al)},(e,t)=>(t-e)/Al,e=>e.getMinutes());RQ.range;const DQ=Yi(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Al)},(e,t)=>(t-e)/Al,e=>e.getUTCMinutes());DQ.range;const UQ=Yi(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*nd-e.getMinutes()*Al)},(e,t)=>{e.setTime(+e+t*rd)},(e,t)=>(t-e)/rd,e=>e.getHours());UQ.range;const HQ=Yi(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*rd)},(e,t)=>(t-e)/rd,e=>e.getUTCHours());HQ.range;const eC=Yi(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Al)/bd,e=>e.getDate()-1);eC.range;const q5=Yi(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/bd,e=>e.getUTCDate()-1);q5.range;const hme=Yi(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/bd,e=>Math.floor(e/bd));hme.range;function Sm(e){return Yi(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Al)/LQ)}const W5=Sm(0),iN=Sm(1),Kht=Sm(2),qht=Sm(3),Ev=Sm(4),Wht=Sm(5),Ght=Sm(6);W5.range;iN.range;Kht.range;qht.range;Ev.range;Wht.range;Ght.range;function km(e){return Yi(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/LQ)}const G5=km(0),sN=km(1),Yht=km(2),Xht=km(3),Tv=km(4),Jht=km(5),Zht=km(6);G5.range;sN.range;Yht.range;Xht.range;Tv.range;Jht.range;Zht.range;const QQ=Yi(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());QQ.range;const $Q=Yi(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());$Q.range;const Cd=Yi(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());Cd.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yi(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Cd.range;const Sd=Yi(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());Sd.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yi(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Sd.range;function fme(e,t,n,r,i,s){const a=[[ap,1,nd],[ap,5,5*nd],[ap,15,15*nd],[ap,30,30*nd],[s,1,Al],[s,5,5*Al],[s,15,15*Al],[s,30,30*Al],[i,1,rd],[i,3,3*rd],[i,6,6*rd],[i,12,12*rd],[r,1,bd],[r,2,2*bd],[n,1,LQ],[t,1,rY],[t,3,3*rY],[e,1,P4]];function o(u,d,h){const A=d<u;A&&([u,d]=[d,u]);const f=h&&typeof h.range=="function"?h:c(u,d,h),p=f?f.range(u,+d+1):[];return A?p.reverse():p}function c(u,d,h){const A=Math.abs(d-u)/h,f=kQ(([,,g])=>g).right(a,A);if(f===a.length)return e.every(bL(u/P4,d/P4,h));if(f===0)return rN.every(Math.max(bL(u,d,h),1));const[p,m]=a[A/a[f-1][2]<a[f][2]/A?f-1:f];return p.every(m)}return[o,c]}const[eft,tft]=fme(Sd,$Q,G5,hme,HQ,DQ),[nft,rft]=fme(Cd,QQ,W5,eC,UQ,RQ);function I4(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 O4(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 Ox(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function ift(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,s=e.days,a=e.shortDays,o=e.months,c=e.shortMonths,u=Fx(i),d=Mx(i),h=Fx(s),A=Mx(s),f=Fx(a),p=Mx(a),m=Fx(o),g=Mx(o),y=Fx(c),v=Mx(c),x={a:K,A:$,b:z,B:Q,c:null,d:cY,e:cY,f:jft,g:Lft,G:Dft,H:Sft,I:kft,j:_ft,L:Ame,m:Bft,M:Nft,p:oe,q:R,Q:hY,s:fY,S:Eft,u:Tft,U:Pft,V:Ift,w:Oft,W:Fft,x:null,X:null,y:Mft,Y:Rft,Z:Uft,"%":dY},w={a:M,A:Y,b:X,B:q,c:null,d:uY,e:uY,f:zft,g:eAt,G:nAt,H:Hft,I:Qft,j:$ft,L:mme,m:Vft,M:Kft,p:Z,q:de,Q:hY,s:fY,S:qft,u:Wft,U:Gft,V:Yft,w:Xft,W:Jft,x:null,X:null,y:Zft,Y:tAt,Z:rAt,"%":dY},b={a:I,A:T,b:N,B:F,c:L,d:oY,e:oY,f:xft,g:aY,G:sY,H:lY,I:lY,j:mft,L:vft,m:pft,M:gft,p:E,q:Aft,Q:bft,s:Cft,S:yft,u:cft,U:uft,V:dft,w:lft,W:hft,x:U,X:H,y:aY,Y:sY,Z:fft,"%":wft};x.x=k(n,x),x.X=k(r,x),x.c=k(t,x),w.x=k(n,w),w.X=k(r,w),w.c=k(t,w);function k(ue,ae){return function(he){var ie=[],Ce=-1,Oe=0,te=ue.length,je,tt,nt;for(he instanceof Date||(he=new Date(+he));++Ce<te;)ue.charCodeAt(Ce)===37&&(ie.push(ue.slice(Oe,Ce)),(tt=iY[je=ue.charAt(++Ce)])!=null?je=ue.charAt(++Ce):tt=je==="e"?" ":"0",(nt=ae[je])&&(je=nt(he,tt)),ie.push(je),Oe=Ce+1);return ie.push(ue.slice(Oe,Ce)),ie.join("")}}function j(ue,ae){return function(he){var ie=Ox(1900,void 0,1),Ce=B(ie,ue,he+="",0),Oe,te;if(Ce!=he.length)return null;if("Q"in ie)return new Date(ie.Q);if("s"in ie)return new Date(ie.s*1e3+("L"in ie?ie.L:0));if(ae&&!("Z"in ie)&&(ie.Z=0),"p"in ie&&(ie.H=ie.H%12+ie.p*12),ie.m===void 0&&(ie.m="q"in ie?ie.q:0),"V"in ie){if(ie.V<1||ie.V>53)return null;"w"in ie||(ie.w=1),"Z"in ie?(Oe=O4(Ox(ie.y,0,1)),te=Oe.getUTCDay(),Oe=te>4||te===0?sN.ceil(Oe):sN(Oe),Oe=q5.offset(Oe,(ie.V-1)*7),ie.y=Oe.getUTCFullYear(),ie.m=Oe.getUTCMonth(),ie.d=Oe.getUTCDate()+(ie.w+6)%7):(Oe=I4(Ox(ie.y,0,1)),te=Oe.getDay(),Oe=te>4||te===0?iN.ceil(Oe):iN(Oe),Oe=eC.offset(Oe,(ie.V-1)*7),ie.y=Oe.getFullYear(),ie.m=Oe.getMonth(),ie.d=Oe.getDate()+(ie.w+6)%7)}else("W"in ie||"U"in ie)&&("w"in ie||(ie.w="u"in ie?ie.u%7:"W"in ie?1:0),te="Z"in ie?O4(Ox(ie.y,0,1)).getUTCDay():I4(Ox(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(te+5)%7:ie.w+ie.U*7-(te+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,O4(ie)):I4(ie)}}function B(ue,ae,he,ie){for(var Ce=0,Oe=ae.length,te=he.length,je,tt;Ce<Oe;){if(ie>=te)return-1;if(je=ae.charCodeAt(Ce++),je===37){if(je=ae.charAt(Ce++),tt=b[je in iY?ae.charAt(Ce++):je],!tt||(ie=tt(ue,he,ie))<0)return-1}else if(je!=he.charCodeAt(ie++))return-1}return ie}function E(ue,ae,he){var ie=u.exec(ae.slice(he));return ie?(ue.p=d.get(ie[0].toLowerCase()),he+ie[0].length):-1}function I(ue,ae,he){var ie=f.exec(ae.slice(he));return ie?(ue.w=p.get(ie[0].toLowerCase()),he+ie[0].length):-1}function T(ue,ae,he){var ie=h.exec(ae.slice(he));return ie?(ue.w=A.get(ie[0].toLowerCase()),he+ie[0].length):-1}function N(ue,ae,he){var ie=y.exec(ae.slice(he));return ie?(ue.m=v.get(ie[0].toLowerCase()),he+ie[0].length):-1}function F(ue,ae,he){var ie=m.exec(ae.slice(he));return ie?(ue.m=g.get(ie[0].toLowerCase()),he+ie[0].length):-1}function L(ue,ae,he){return B(ue,t,ae,he)}function U(ue,ae,he){return B(ue,n,ae,he)}function H(ue,ae,he){return B(ue,r,ae,he)}function K(ue){return a[ue.getDay()]}function $(ue){return s[ue.getDay()]}function z(ue){return c[ue.getMonth()]}function Q(ue){return o[ue.getMonth()]}function oe(ue){return i[+(ue.getHours()>=12)]}function R(ue){return 1+~~(ue.getMonth()/3)}function M(ue){return a[ue.getUTCDay()]}function Y(ue){return s[ue.getUTCDay()]}function X(ue){return c[ue.getUTCMonth()]}function q(ue){return o[ue.getUTCMonth()]}function Z(ue){return i[+(ue.getUTCHours()>=12)]}function de(ue){return 1+~~(ue.getUTCMonth()/3)}return{format:function(ue){var ae=k(ue+="",x);return ae.toString=function(){return ue},ae},parse:function(ue){var ae=j(ue+="",!1);return ae.toString=function(){return ue},ae},utcFormat:function(ue){var ae=k(ue+="",w);return ae.toString=function(){return ue},ae},utcParse:function(ue){var ae=j(ue+="",!0);return ae.toString=function(){return ue},ae}}}var iY={"-":"",_:" ",0:"0"},us=/^\s*\d+/,sft=/^%/,aft=/[\\^$*+?|[\]().{}]/g;function Rn(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?new Array(n-s+1).join(t)+i:i)}function oft(e){return e.replace(aft,"\\$&")}function Fx(e){return new RegExp("^(?:"+e.map(oft).join("|")+")","i")}function Mx(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function lft(e,t,n){var r=us.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function cft(e,t,n){var r=us.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function uft(e,t,n){var r=us.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function dft(e,t,n){var r=us.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function hft(e,t,n){var r=us.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function sY(e,t,n){var r=us.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function aY(e,t,n){var r=us.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function fft(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Aft(e,t,n){var r=us.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function pft(e,t,n){var r=us.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function oY(e,t,n){var r=us.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function mft(e,t,n){var r=us.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function lY(e,t,n){var r=us.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function gft(e,t,n){var r=us.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function yft(e,t,n){var r=us.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function vft(e,t,n){var r=us.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function xft(e,t,n){var r=us.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function wft(e,t,n){var r=sft.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function bft(e,t,n){var r=us.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Cft(e,t,n){var r=us.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function cY(e,t){return Rn(e.getDate(),t,2)}function Sft(e,t){return Rn(e.getHours(),t,2)}function kft(e,t){return Rn(e.getHours()%12||12,t,2)}function _ft(e,t){return Rn(1+eC.count(Cd(e),e),t,3)}function Ame(e,t){return Rn(e.getMilliseconds(),t,3)}function jft(e,t){return Ame(e,t)+"000"}function Bft(e,t){return Rn(e.getMonth()+1,t,2)}function Nft(e,t){return Rn(e.getMinutes(),t,2)}function Eft(e,t){return Rn(e.getSeconds(),t,2)}function Tft(e){var t=e.getDay();return t===0?7:t}function Pft(e,t){return Rn(W5.count(Cd(e)-1,e),t,2)}function pme(e){var t=e.getDay();return t>=4||t===0?Ev(e):Ev.ceil(e)}function Ift(e,t){return e=pme(e),Rn(Ev.count(Cd(e),e)+(Cd(e).getDay()===4),t,2)}function Oft(e){return e.getDay()}function Fft(e,t){return Rn(iN.count(Cd(e)-1,e),t,2)}function Mft(e,t){return Rn(e.getFullYear()%100,t,2)}function Lft(e,t){return e=pme(e),Rn(e.getFullYear()%100,t,2)}function Rft(e,t){return Rn(e.getFullYear()%1e4,t,4)}function Dft(e,t){var n=e.getDay();return e=n>=4||n===0?Ev(e):Ev.ceil(e),Rn(e.getFullYear()%1e4,t,4)}function Uft(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Rn(t/60|0,"0",2)+Rn(t%60,"0",2)}function uY(e,t){return Rn(e.getUTCDate(),t,2)}function Hft(e,t){return Rn(e.getUTCHours(),t,2)}function Qft(e,t){return Rn(e.getUTCHours()%12||12,t,2)}function $ft(e,t){return Rn(1+q5.count(Sd(e),e),t,3)}function mme(e,t){return Rn(e.getUTCMilliseconds(),t,3)}function zft(e,t){return mme(e,t)+"000"}function Vft(e,t){return Rn(e.getUTCMonth()+1,t,2)}function Kft(e,t){return Rn(e.getUTCMinutes(),t,2)}function qft(e,t){return Rn(e.getUTCSeconds(),t,2)}function Wft(e){var t=e.getUTCDay();return t===0?7:t}function Gft(e,t){return Rn(G5.count(Sd(e)-1,e),t,2)}function gme(e){var t=e.getUTCDay();return t>=4||t===0?Tv(e):Tv.ceil(e)}function Yft(e,t){return e=gme(e),Rn(Tv.count(Sd(e),e)+(Sd(e).getUTCDay()===4),t,2)}function Xft(e){return e.getUTCDay()}function Jft(e,t){return Rn(sN.count(Sd(e)-1,e),t,2)}function Zft(e,t){return Rn(e.getUTCFullYear()%100,t,2)}function eAt(e,t){return e=gme(e),Rn(e.getUTCFullYear()%100,t,2)}function tAt(e,t){return Rn(e.getUTCFullYear()%1e4,t,4)}function nAt(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Tv(e):Tv.ceil(e),Rn(e.getUTCFullYear()%1e4,t,4)}function rAt(){return"+0000"}function dY(){return"%"}function hY(e){return+e}function fY(e){return Math.floor(+e/1e3)}var mg,yme,vme;iAt({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 iAt(e){return mg=ift(e),yme=mg.format,mg.parse,vme=mg.utcFormat,mg.utcParse,mg}function sAt(e){return new Date(e)}function aAt(e){return e instanceof Date?+e:+new Date(+e)}function zQ(e,t,n,r,i,s,a,o,c,u){var d=EQ(),h=d.invert,A=d.domain,f=u(".%L"),p=u(":%S"),m=u("%I:%M"),g=u("%I %p"),y=u("%a %d"),v=u("%b %d"),x=u("%B"),w=u("%Y");function b(k){return(c(k)<k?f:o(k)<k?p:a(k)<k?m:s(k)<k?g:r(k)<k?i(k)<k?y:v:n(k)<k?x:w)(k)}return d.invert=function(k){return new Date(h(k))},d.domain=function(k){return arguments.length?A(Array.from(k,aAt)):A().map(sAt)},d.ticks=function(k){var j=A();return e(j[0],j[j.length-1],k??10)},d.tickFormat=function(k,j){return j==null?b:u(j)},d.nice=function(k){var j=A();return(!k||typeof k.range!="function")&&(k=t(j[0],j[j.length-1],k??10)),k?A(sme(j,k)):d},d.copy=function(){return Z2(d,zQ(e,t,n,r,i,s,a,o,c,u))},d}function oAt(){return Il.apply(zQ(nft,rft,Cd,QQ,W5,eC,UQ,RQ,ap,yme).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function lAt(){return Il.apply(zQ(eft,tft,Sd,$Q,G5,q5,HQ,DQ,ap,vme).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Y5(){var e=0,t=1,n,r,i,s,a=Sa,o=!1,c;function u(h){return h==null||isNaN(h=+h)?c:a(i===0?.5:(h=(s(h)-n)*i,o?Math.max(0,Math.min(1,h)):h))}u.domain=function(h){return arguments.length?([e,t]=h,n=s(e=+e),r=s(t=+t),i=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(h){return arguments.length?(o=!!h,u):o},u.interpolator=function(h){return arguments.length?(a=h,u):a};function d(h){return function(A){var f,p;return arguments.length?([f,p]=A,a=h(f,p),u):[a(0),a(1)]}}return u.range=d(j0),u.rangeRound=d(NQ),u.unknown=function(h){return arguments.length?(c=h,u):c},function(h){return s=h,n=h(e),r=h(t),i=n===r?0:1/(r-n),u}}function aA(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function xme(){var e=sA(Y5()(Sa));return e.copy=function(){return aA(e,xme())},Fd.apply(e,arguments)}function wme(){var e=IQ(Y5()).domain([1,10]);return e.copy=function(){return aA(e,wme()).base(e.base())},Fd.apply(e,arguments)}function bme(){var e=OQ(Y5());return e.copy=function(){return aA(e,bme()).constant(e.constant())},Fd.apply(e,arguments)}function VQ(){var e=FQ(Y5());return e.copy=function(){return aA(e,VQ()).exponent(e.exponent())},Fd.apply(e,arguments)}function cAt(){return VQ.apply(null,arguments).exponent(.5)}function Cme(){var e=[],t=Sa;function n(r){if(r!=null&&!isNaN(r=+r))return t((X2(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(gf),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,s)=>Gdt(e,s/r))},n.copy=function(){return Cme(t).domain(e)},Fd.apply(n,arguments)}function X5(){var e=0,t=.5,n=1,r=1,i,s,a,o,c,u=Sa,d,h=!1,A;function f(m){return isNaN(m=+m)?A:(m=.5+((m=+d(m))-s)*(r*m<r*s?o:c),u(h?Math.max(0,Math.min(1,m)):m))}f.domain=function(m){return arguments.length?([e,t,n]=m,i=d(e=+e),s=d(t=+t),a=d(n=+n),o=i===s?0:.5/(s-i),c=s===a?0:.5/(a-s),r=s<i?-1:1,f):[e,t,n]},f.clamp=function(m){return arguments.length?(h=!!m,f):h},f.interpolator=function(m){return arguments.length?(u=m,f):u};function p(m){return function(g){var y,v,x;return arguments.length?([y,v,x]=g,u=wht(m,[y,v,x]),f):[u(0),u(.5),u(1)]}}return f.range=p(j0),f.rangeRound=p(NQ),f.unknown=function(m){return arguments.length?(A=m,f):A},function(m){return d=m,i=m(e),s=m(t),a=m(n),o=i===s?0:.5/(s-i),c=s===a?0:.5/(a-s),r=s<i?-1:1,f}}function Sme(){var e=sA(X5()(Sa));return e.copy=function(){return aA(e,Sme())},Fd.apply(e,arguments)}function kme(){var e=IQ(X5()).domain([.1,1,10]);return e.copy=function(){return aA(e,kme()).base(e.base())},Fd.apply(e,arguments)}function _me(){var e=OQ(X5());return e.copy=function(){return aA(e,_me()).constant(e.constant())},Fd.apply(e,arguments)}function KQ(){var e=FQ(X5());return e.copy=function(){return aA(e,KQ()).exponent(e.exponent())},Fd.apply(e,arguments)}function uAt(){return KQ.apply(null,arguments).exponent(.5)}const AY=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:S1,scaleDiverging:Sme,scaleDivergingLog:kme,scaleDivergingPow:KQ,scaleDivergingSqrt:uAt,scaleDivergingSymlog:_me,scaleIdentity:ime,scaleImplicit:CL,scaleLinear:nN,scaleLog:ame,scaleOrdinal:_Q,scalePoint:tb,scalePow:MQ,scaleQuantile:cme,scaleQuantize:ume,scaleRadial:lme,scaleSequential:xme,scaleSequentialLog:wme,scaleSequentialPow:VQ,scaleSequentialQuantile:Cme,scaleSequentialSqrt:cAt,scaleSequentialSymlog:bme,scaleSqrt:zht,scaleSymlog:ome,scaleThreshold:dme,scaleTime:oAt,scaleUtc:lAt,tickFormat:rme},Symbol.toStringTag,{value:"Module"}));var dAt=v0;function hAt(e,t,n){for(var r=-1,i=e.length;++r<i;){var s=e[r],a=t(s);if(a!=null&&(o===void 0?a===a&&!dAt(a):n(a,o)))var o=a,c=s}return c}var jme=hAt;function fAt(e,t){return e>t}var AAt=fAt,pAt=jme,mAt=AAt,gAt=_0;function yAt(e){return e&&e.length?pAt(e,gAt,mAt):void 0}var vAt=yAt;const J5=In(vAt);function xAt(e,t){return e<t}var wAt=xAt,bAt=jme,CAt=wAt,SAt=_0;function kAt(e){return e&&e.length?bAt(e,SAt,CAt):void 0}var _At=kAt;const Z5=In(_At);var jAt=sQ,BAt=iA,NAt=Fpe,EAt=so;function TAt(e,t){var n=EAt(e)?jAt:NAt;return n(e,BAt(t))}var PAt=TAt,IAt=Ipe,OAt=PAt;function FAt(e,t){return IAt(OAt(e,t),1)}var MAt=FAt;const LAt=In(MAt);var RAt=xQ;function DAt(e,t){return RAt(e,t)}var UAt=DAt;const eT=In(UAt);var B0=1e9,HAt={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},WQ,Lr=!0,Bl="[DecimalError] ",Ip=Bl+"Invalid argument: ",qQ=Bl+"Exponent out of range: ",N0=Math.floor,UA=Math.pow,QAt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,jo,ts=1e7,Sr=7,Bme=9007199254740991,aN=N0(Bme/Sr),pt={};pt.absoluteValue=pt.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};pt.comparedTo=pt.cmp=function(e){var t,n,r,i,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(r=s.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return r===i?0:r>i^s.s<0?1:-1};pt.decimalPlaces=pt.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Sr;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};pt.dividedBy=pt.div=function(e){return dd(this,new this.constructor(e))};pt.dividedToIntegerBy=pt.idiv=function(e){var t=this,n=t.constructor;return ar(dd(t,new n(e),0,1),n.precision)};pt.equals=pt.eq=function(e){return!this.cmp(e)};pt.exponent=function(){return Ti(this)};pt.greaterThan=pt.gt=function(e){return this.cmp(e)>0};pt.greaterThanOrEqualTo=pt.gte=function(e){return this.cmp(e)>=0};pt.isInteger=pt.isint=function(){return this.e>this.d.length-2};pt.isNegative=pt.isneg=function(){return this.s<0};pt.isPositive=pt.ispos=function(){return this.s>0};pt.isZero=function(){return this.s===0};pt.lessThan=pt.lt=function(e){return this.cmp(e)<0};pt.lessThanOrEqualTo=pt.lte=function(e){return this.cmp(e)<1};pt.logarithm=pt.log=function(e){var t,n=this,r=n.constructor,i=r.precision,s=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(jo))throw Error(Bl+"NaN");if(n.s<1)throw Error(Bl+(n.s?"NaN":"-Infinity"));return n.eq(jo)?new r(0):(Lr=!1,t=dd(N1(n,s),N1(e,s),s),Lr=!0,ar(t,i))};pt.minus=pt.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Tme(t,e):Nme(t,(e.s=-e.s,e))};pt.modulo=pt.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Bl+"NaN");return n.s?(Lr=!1,t=dd(n,e,0,1).times(e),Lr=!0,n.minus(t)):ar(new r(n),i)};pt.naturalExponential=pt.exp=function(){return Eme(this)};pt.naturalLogarithm=pt.ln=function(){return N1(this)};pt.negated=pt.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};pt.plus=pt.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Nme(t,e):Tme(t,(e.s=-e.s,e))};pt.precision=pt.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ip+e);if(t=Ti(i)+1,r=i.d.length-1,n=r*Sr+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};pt.squareRoot=pt.sqrt=function(){var e,t,n,r,i,s,a,o=this,c=o.constructor;if(o.s<1){if(!o.s)return new c(0);throw Error(Bl+"NaN")}for(e=Ti(o),Lr=!1,i=Math.sqrt(+o),i==0||i==1/0?(t=Zc(o.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=N0((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=a=n+3;;)if(s=r,r=s.plus(dd(o,s,a+2)).times(.5),Zc(s.d).slice(0,a)===(t=Zc(r.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&t=="4999"){if(ar(s,n+1,0),s.times(s).eq(o)){r=s;break}}else if(t!="9999")break;a+=4}return Lr=!0,ar(r,n)};pt.times=pt.mul=function(e){var t,n,r,i,s,a,o,c,u,d=this,h=d.constructor,A=d.d,f=(e=new h(e)).d;if(!d.s||!e.s)return new h(0);for(e.s*=d.s,n=d.e+e.e,c=A.length,u=f.length,c<u&&(s=A,A=f,f=s,a=c,c=u,u=a),s=[],a=c+u,r=a;r--;)s.push(0);for(r=u;--r>=0;){for(t=0,i=c+r;i>r;)o=s[i]+f[r]*A[i-r-1]+t,s[i--]=o%ts|0,t=o/ts|0;s[i]=(s[i]+t)%ts|0}for(;!s[--a];)s.pop();return t?++n:s.shift(),e.d=s,e.e=n,Lr?ar(e,h.precision):e};pt.toDecimalPlaces=pt.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Au(e,0,B0),t===void 0?t=r.rounding:Au(t,0,8),ar(n,e+Ti(n)+1,t))};pt.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=am(r,!0):(Au(e,0,B0),t===void 0?t=i.rounding:Au(t,0,8),r=ar(new i(r),e+1,t),n=am(r,!0,e+1)),n};pt.toFixed=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?am(i):(Au(e,0,B0),t===void 0?t=s.rounding:Au(t,0,8),r=ar(new s(i),e+Ti(i)+1,t),n=am(r.abs(),!1,e+Ti(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};pt.toInteger=pt.toint=function(){var e=this,t=e.constructor;return ar(new t(e),Ti(e)+1,t.rounding)};pt.toNumber=function(){return+this};pt.toPower=pt.pow=function(e){var t,n,r,i,s,a,o=this,c=o.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(jo);if(o=new c(o),!o.s){if(e.s<1)throw Error(Bl+"Infinity");return o}if(o.eq(jo))return o;if(r=c.precision,e.eq(jo))return ar(o,r);if(t=e.e,n=e.d.length-1,a=t>=n,s=o.s,a){if((n=d<0?-d:d)<=Bme){for(i=new c(jo),t=Math.ceil(r/Sr+4),Lr=!1;n%2&&(i=i.times(o),mY(i.d,t)),n=N0(n/2),n!==0;)o=o.times(o),mY(o.d,t);return Lr=!0,e.s<0?new c(jo).div(i):ar(i,r)}}else if(s<0)throw Error(Bl+"NaN");return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,o.s=1,Lr=!1,i=e.times(N1(o,r+u)),Lr=!0,i=Eme(i),i.s=s,i};pt.toPrecision=function(e,t){var n,r,i=this,s=i.constructor;return e===void 0?(n=Ti(i),r=am(i,n<=s.toExpNeg||n>=s.toExpPos)):(Au(e,1,B0),t===void 0?t=s.rounding:Au(t,0,8),i=ar(new s(i),e,t),n=Ti(i),r=am(i,e<=n||n<=s.toExpNeg,e)),r};pt.toSignificantDigits=pt.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Au(e,1,B0),t===void 0?t=r.rounding:Au(t,0,8)),ar(new r(n),e,t)};pt.toString=pt.valueOf=pt.val=pt.toJSON=pt[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Ti(e),n=e.constructor;return am(e,t<=n.toExpNeg||t>=n.toExpPos)};function Nme(e,t){var n,r,i,s,a,o,c,u,d=e.constructor,h=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),Lr?ar(t,h):t;if(c=e.d,u=t.d,a=e.e,i=t.e,c=c.slice(),s=a-i,s){for(s<0?(r=c,s=-s,o=u.length):(r=u,i=a,o=c.length),a=Math.ceil(h/Sr),o=a>o?a+1:o+1,s>o&&(s=o,r.length=1),r.reverse();s--;)r.push(0);r.reverse()}for(o=c.length,s=u.length,o-s<0&&(s=o,r=u,u=c,c=r),n=0;s;)n=(c[--s]=c[s]+u[s]+n)/ts|0,c[s]%=ts;for(n&&(c.unshift(n),++i),o=c.length;c[--o]==0;)c.pop();return t.d=c,t.e=i,Lr?ar(t,h):t}function Au(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Ip+e)}function Zc(e){var t,n,r,i=e.length-1,s="",a=e[0];if(i>0){for(s+=a,t=1;t<i;t++)r=e[t]+"",n=Sr-r.length,n&&(s+=xh(n)),s+=r;a=e[t],r=a+"",n=Sr-r.length,n&&(s+=xh(n))}else if(a===0)return"0";for(;a%10===0;)a/=10;return s+a}var dd=function(){function e(r,i){var s,a=0,o=r.length;for(r=r.slice();o--;)s=r[o]*i+a,r[o]=s%ts|0,a=s/ts|0;return a&&r.unshift(a),r}function t(r,i,s,a){var o,c;if(s!=a)c=s>a?1:-1;else for(o=c=0;o<s;o++)if(r[o]!=i[o]){c=r[o]>i[o]?1:-1;break}return c}function n(r,i,s){for(var a=0;s--;)r[s]-=a,a=r[s]<i[s]?1:0,r[s]=a*ts+r[s]-i[s];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,s,a){var o,c,u,d,h,A,f,p,m,g,y,v,x,w,b,k,j,B,E=r.constructor,I=r.s==i.s?1:-1,T=r.d,N=i.d;if(!r.s)return new E(r);if(!i.s)throw Error(Bl+"Division by zero");for(c=r.e-i.e,j=N.length,b=T.length,f=new E(I),p=f.d=[],u=0;N[u]==(T[u]||0);)++u;if(N[u]>(T[u]||0)&&--c,s==null?v=s=E.precision:a?v=s+(Ti(r)-Ti(i))+1:v=s,v<0)return new E(0);if(v=v/Sr+2|0,u=0,j==1)for(d=0,N=N[0],v++;(u<b||d)&&v--;u++)x=d*ts+(T[u]||0),p[u]=x/N|0,d=x%N|0;else{for(d=ts/(N[0]+1)|0,d>1&&(N=e(N,d),T=e(T,d),j=N.length,b=T.length),w=j,m=T.slice(0,j),g=m.length;g<j;)m[g++]=0;B=N.slice(),B.unshift(0),k=N[0],N[1]>=ts/2&&++k;do d=0,o=t(N,m,j,g),o<0?(y=m[0],j!=g&&(y=y*ts+(m[1]||0)),d=y/k|0,d>1?(d>=ts&&(d=ts-1),h=e(N,d),A=h.length,g=m.length,o=t(h,m,A,g),o==1&&(d--,n(h,j<A?B:N,A))):(d==0&&(o=d=1),h=N.slice()),A=h.length,A<g&&h.unshift(0),n(m,h,g),o==-1&&(g=m.length,o=t(N,m,j,g),o<1&&(d++,n(m,j<g?B:N,g))),g=m.length):o===0&&(d++,m=[0]),p[u++]=d,o&&m[0]?m[g++]=T[w]||0:(m=[T[w]],g=1);while((w++<b||m[0]!==void 0)&&v--)}return p[0]||p.shift(),f.e=c,ar(f,a?s+Ti(f)+1:s)}}();function Eme(e,t){var n,r,i,s,a,o,c=0,u=0,d=e.constructor,h=d.precision;if(Ti(e)>16)throw Error(qQ+Ti(e));if(!e.s)return new d(jo);for(t==null?(Lr=!1,o=h):o=t,a=new d(.03125);e.abs().gte(.1);)e=e.times(a),u+=5;for(r=Math.log(UA(2,u))/Math.LN10*2+5|0,o+=r,n=i=s=new d(jo),d.precision=o;;){if(i=ar(i.times(e),o),n=n.times(++c),a=s.plus(dd(i,n,o)),Zc(a.d).slice(0,o)===Zc(s.d).slice(0,o)){for(;u--;)s=ar(s.times(s),o);return d.precision=h,t==null?(Lr=!0,ar(s,h)):s}s=a}}function Ti(e){for(var t=e.e*Sr,n=e.d[0];n>=10;n/=10)t++;return t}function F4(e,t,n){if(t>e.LN10.sd())throw Lr=!0,n&&(e.precision=n),Error(Bl+"LN10 precision limit exceeded");return ar(new e(e.LN10),t)}function xh(e){for(var t="";e--;)t+="0";return t}function N1(e,t){var n,r,i,s,a,o,c,u,d,h=1,A=10,f=e,p=f.d,m=f.constructor,g=m.precision;if(f.s<1)throw Error(Bl+(f.s?"NaN":"-Infinity"));if(f.eq(jo))return new m(0);if(t==null?(Lr=!1,u=g):u=t,f.eq(10))return t==null&&(Lr=!0),F4(m,u);if(u+=A,m.precision=u,n=Zc(p),r=n.charAt(0),s=Ti(f),Math.abs(s)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)f=f.times(e),n=Zc(f.d),r=n.charAt(0),h++;s=Ti(f),r>1?(f=new m("0."+n),s++):f=new m(r+"."+n.slice(1))}else return c=F4(m,u+2,g).times(s+""),f=N1(new m(r+"."+n.slice(1)),u-A).plus(c),m.precision=g,t==null?(Lr=!0,ar(f,g)):f;for(o=a=f=dd(f.minus(jo),f.plus(jo),u),d=ar(f.times(f),u),i=3;;){if(a=ar(a.times(d),u),c=o.plus(dd(a,new m(i),u)),Zc(c.d).slice(0,u)===Zc(o.d).slice(0,u))return o=o.times(2),s!==0&&(o=o.plus(F4(m,u+2,g).times(s+""))),o=dd(o,new m(h),u),m.precision=g,t==null?(Lr=!0,ar(o,g)):o;o=c,i+=2}}function pY(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=N0(n/Sr),e.d=[],r=(n+1)%Sr,n<0&&(r+=Sr),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Sr;r<i;)e.d.push(+t.slice(r,r+=Sr));t=t.slice(r),r=Sr-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),Lr&&(e.e>aN||e.e<-aN))throw Error(qQ+n)}else e.s=0,e.e=0,e.d=[0];return e}function ar(e,t,n){var r,i,s,a,o,c,u,d,h=e.d;for(a=1,s=h[0];s>=10;s/=10)a++;if(r=t-a,r<0)r+=Sr,i=t,u=h[d=0];else{if(d=Math.ceil((r+1)/Sr),s=h.length,d>=s)return e;for(u=s=h[d],a=1;s>=10;s/=10)a++;r%=Sr,i=r-Sr+a}if(n!==void 0&&(s=UA(10,a-i-1),o=u/s%10|0,c=t<0||h[d+1]!==void 0||u%s,c=n<4?(o||c)&&(n==0||n==(e.s<0?3:2)):o>5||o==5&&(n==4||c||n==6&&(r>0?i>0?u/UA(10,a-i):0:h[d-1])%10&1||n==(e.s<0?8:7))),t<1||!h[0])return c?(s=Ti(e),h.length=1,t=t-s-1,h[0]=UA(10,(Sr-t%Sr)%Sr),e.e=N0(-t/Sr)||0):(h.length=1,h[0]=e.e=e.s=0),e;if(r==0?(h.length=d,s=1,d--):(h.length=d+1,s=UA(10,Sr-r),h[d]=i>0?(u/UA(10,a-i)%UA(10,i)|0)*s:0),c)for(;;)if(d==0){(h[0]+=s)==ts&&(h[0]=1,++e.e);break}else{if(h[d]+=s,h[d]!=ts)break;h[d--]=0,s=1}for(r=h.length;h[--r]===0;)h.pop();if(Lr&&(e.e>aN||e.e<-aN))throw Error(qQ+Ti(e));return e}function Tme(e,t){var n,r,i,s,a,o,c,u,d,h,A=e.constructor,f=A.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new A(e),Lr?ar(t,f):t;if(c=e.d,h=t.d,r=t.e,u=e.e,c=c.slice(),a=u-r,a){for(d=a<0,d?(n=c,a=-a,o=h.length):(n=h,r=u,o=c.length),i=Math.max(Math.ceil(f/Sr),o)+2,a>i&&(a=i,n.length=1),n.reverse(),i=a;i--;)n.push(0);n.reverse()}else{for(i=c.length,o=h.length,d=i<o,d&&(o=i),i=0;i<o;i++)if(c[i]!=h[i]){d=c[i]<h[i];break}a=0}for(d&&(n=c,c=h,h=n,t.s=-t.s),o=c.length,i=h.length-o;i>0;--i)c[o++]=0;for(i=h.length;i>a;){if(c[--i]<h[i]){for(s=i;s&&c[--s]===0;)c[s]=ts-1;--c[s],c[i]+=ts}c[i]-=h[i]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,Lr?ar(t,f):t):new A(0)}function am(e,t,n){var r,i=Ti(e),s=Zc(e.d),a=s.length;return t?(n&&(r=n-a)>0?s=s.charAt(0)+"."+s.slice(1)+xh(r):a>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+xh(-i-1)+s,n&&(r=n-a)>0&&(s+=xh(r))):i>=a?(s+=xh(i+1-a),n&&(r=n-i-1)>0&&(s=s+"."+xh(r))):((r=i+1)<a&&(s=s.slice(0,r)+"."+s.slice(r)),n&&(r=n-a)>0&&(i+1===a&&(s+="."),s+=xh(r))),e.s<0?"-"+s:s}function mY(e,t){if(e.length>t)return e.length=t,!0}function Pme(e){var t,n,r;function i(s){var a=this;if(!(a instanceof i))return new i(s);if(a.constructor=i,s instanceof i){a.s=s.s,a.e=s.e,a.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(Ip+s);if(s>0)a.s=1;else if(s<0)s=-s,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(s===~~s&&s<1e7){a.e=0,a.d=[s];return}return pY(a,s.toString())}else if(typeof s!="string")throw Error(Ip+s);if(s.charCodeAt(0)===45?(s=s.slice(1),a.s=-1):a.s=1,QAt.test(s))pY(a,s);else throw Error(Ip+s)}if(i.prototype=pt,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=Pme,i.config=i.set=$At,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function $At(e){if(!e||typeof e!="object")throw Error(Bl+"Object expected");var t,n,r,i=["precision",1,B0,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(N0(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Ip+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Ip+n+": "+r);return this}var WQ=Pme(HAt);jo=new WQ(1);const Zn=WQ;function zAt(e){return WAt(e)||qAt(e)||KAt(e)||VAt()}function VAt(){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 KAt(e,t){if(e){if(typeof e=="string")return jL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jL(e,t)}}function qAt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function WAt(e){if(Array.isArray(e))return jL(e)}function jL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var GAt=function(t){return t},Ime={"@@functional/placeholder":!0},Ome=function(t){return t===Ime},gY=function(t){return function n(){return arguments.length===0||arguments.length===1&&Ome(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},YAt=function e(t,n){return t===1?n:gY(function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];var a=i.filter(function(o){return o!==Ime}).length;return a>=t?n.apply(void 0,i):e(t-a,gY(function(){for(var o=arguments.length,c=new Array(o),u=0;u<o;u++)c[u]=arguments[u];var d=i.map(function(h){return Ome(h)?c.shift():h});return n.apply(void 0,zAt(d).concat(c))}))})},tT=function(t){return YAt(t.length,t)},BL=function(t,n){for(var r=[],i=t;i<n;++i)r[i-t]=i;return r},XAt=tT(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),JAt=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return GAt;var i=n.reverse(),s=i[0],a=i.slice(1);return function(){return a.reduce(function(o,c){return c(o)},s.apply(void 0,arguments))}},NL=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},Fme=function(t){var n=null,r=null;return function(){for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return n&&s.every(function(o,c){return o===n[c]})||(n=s,r=t.apply(void 0,s)),r}};function ZAt(e){var t;return e===0?t=1:t=Math.floor(new Zn(e).abs().log(10).toNumber())+1,t}function ept(e,t,n){for(var r=new Zn(e),i=0,s=[];r.lt(t)&&i<1e5;)s.push(r.toNumber()),r=r.add(n),i++;return s}var tpt=tT(function(e,t,n){var r=+e,i=+t;return r+n*(i-r)}),npt=tT(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),rpt=tT(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const nT={rangeStep:ept,getDigitCount:ZAt,interpolateNumber:tpt,uninterpolateNumber:npt,uninterpolateTruncation:rpt};function EL(e){return apt(e)||spt(e)||Mme(e)||ipt()}function ipt(){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 spt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function apt(e){if(Array.isArray(e))return TL(e)}function E1(e,t){return cpt(e)||lpt(e,t)||Mme(e,t)||opt()}function opt(){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 Mme(e,t){if(e){if(typeof e=="string")return TL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return TL(e,t)}}function TL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lpt(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,s=void 0;try{for(var a=e[Symbol.iterator](),o;!(r=(o=a.next()).done)&&(n.push(o.value),!(t&&n.length===t));r=!0);}catch(c){i=!0,s=c}finally{try{!r&&a.return!=null&&a.return()}finally{if(i)throw s}}return n}}function cpt(e){if(Array.isArray(e))return e}function Lme(e){var t=E1(e,2),n=t[0],r=t[1],i=n,s=r;return n>r&&(i=r,s=n),[i,s]}function Rme(e,t,n){if(e.lte(0))return new Zn(0);var r=nT.getDigitCount(e.toNumber()),i=new Zn(10).pow(r),s=e.div(i),a=r!==1?.05:.1,o=new Zn(Math.ceil(s.div(a).toNumber())).add(n).mul(a),c=o.mul(i);return t?c:new Zn(Math.ceil(c))}function upt(e,t,n){var r=1,i=new Zn(e);if(!i.isint()&&n){var s=Math.abs(e);s<1?(r=new Zn(10).pow(nT.getDigitCount(e)-1),i=new Zn(Math.floor(i.div(r).toNumber())).mul(r)):s>1&&(i=new Zn(Math.floor(e)))}else e===0?i=new Zn(Math.floor((t-1)/2)):n||(i=new Zn(Math.floor(e)));var a=Math.floor((t-1)/2),o=JAt(XAt(function(c){return i.add(new Zn(c-a).mul(r)).toNumber()}),BL);return o(0,t)}function Dme(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Zn(0),tickMin:new Zn(0),tickMax:new Zn(0)};var s=Rme(new Zn(t).sub(e).div(n-1),r,i),a;e<=0&&t>=0?a=new Zn(0):(a=new Zn(e).add(t).div(2),a=a.sub(new Zn(a).mod(s)));var o=Math.ceil(a.sub(e).div(s).toNumber()),c=Math.ceil(new Zn(t).sub(a).div(s).toNumber()),u=o+c+1;return u>n?Dme(e,t,n,r,i+1):(u<n&&(c=t>0?c+(n-u):c,o=t>0?o:o+(n-u)),{step:s,tickMin:a.sub(new Zn(o).mul(s)),tickMax:a.add(new Zn(c).mul(s))})}function dpt(e){var t=E1(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(i,2),o=Lme([n,r]),c=E1(o,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var h=d===1/0?[u].concat(EL(BL(0,i-1).map(function(){return 1/0}))):[].concat(EL(BL(0,i-1).map(function(){return-1/0})),[d]);return n>r?NL(h):h}if(u===d)return upt(u,i,s);var A=Dme(u,d,a,s),f=A.step,p=A.tickMin,m=A.tickMax,g=nT.rangeStep(p,m.add(new Zn(.1).mul(f)),f);return n>r?NL(g):g}function hpt(e,t){var n=E1(e,2),r=n[0],i=n[1],s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Lme([r,i]),o=E1(a,2),c=o[0],u=o[1];if(c===-1/0||u===1/0)return[r,i];if(c===u)return[c];var d=Math.max(t,2),h=Rme(new Zn(u).sub(c).div(d-1),s,0),A=[].concat(EL(nT.rangeStep(new Zn(c),new Zn(u).sub(new Zn(.99).mul(h)),h)),[u]);return r>i?NL(A):A}var fpt=Fme(dpt),Apt=Fme(hpt),ppt="Invariant failed";function om(e,t){throw new Error(ppt)}var mpt=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Pv(e){"@babel/helpers - typeof";return Pv=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},Pv(e)}function oN(){return oN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oN.apply(this,arguments)}function gpt(e,t){return wpt(e)||xpt(e,t)||vpt(e,t)||ypt()}function ypt(){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 vpt(e,t){if(e){if(typeof e=="string")return yY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yY(e,t)}}function yY(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xpt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function wpt(e){if(Array.isArray(e))return e}function bpt(e,t){if(e==null)return{};var n=Cpt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Cpt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Spt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kpt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Qme(r.key),r)}}function _pt(e,t,n){return t&&kpt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function jpt(e,t,n){return t=lN(t),Bpt(e,Ume()?Reflect.construct(t,n||[],lN(e).constructor):t.apply(e,n))}function Bpt(e,t){if(t&&(Pv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Npt(e)}function Npt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ume(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ume=function(){return!!e})()}function lN(e){return lN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lN(e)}function Ept(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&&PL(e,t)}function PL(e,t){return PL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},PL(e,t)}function Hme(e,t,n){return t=Qme(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qme(e){var t=Tpt(e,"string");return Pv(t)=="symbol"?t:t+""}function Tpt(e,t){if(Pv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Pv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tC=function(e){function t(){return Spt(this,t),jpt(this,t,arguments)}return Ept(t,e),_pt(t,[{key:"render",value:function(){var r=this.props,i=r.offset,s=r.layout,a=r.width,o=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,h=r.yAxis,A=bpt(r,mpt),f=jn(A,!1);this.props.direction==="x"&&d.type!=="number"&&om();var p=c.map(function(m){var g=u(m,o),y=g.x,v=g.y,x=g.value,w=g.errorVal;if(!w)return null;var b=[],k,j;if(Array.isArray(w)){var B=gpt(w,2);k=B[0],j=B[1]}else k=j=w;if(s==="vertical"){var E=d.scale,I=v+i,T=I+a,N=I-a,F=E(x-k),L=E(x+j);b.push({x1:L,y1:T,x2:L,y2:N}),b.push({x1:F,y1:I,x2:L,y2:I}),b.push({x1:F,y1:T,x2:F,y2:N})}else if(s==="horizontal"){var U=h.scale,H=y+i,K=H-a,$=H+a,z=U(x-k),Q=U(x+j);b.push({x1:K,y1:Q,x2:$,y2:Q}),b.push({x1:H,y1:z,x2:H,y2:Q}),b.push({x1:K,y1:z,x2:$,y2:z})}return re.createElement(gi,oN({className:"recharts-errorBar",key:"bar-".concat(b.map(function(oe){return"".concat(oe.x1,"-").concat(oe.x2,"-").concat(oe.y1,"-").concat(oe.y2)}))},f),b.map(function(oe){return re.createElement("line",oN({},oe,{key:"line-".concat(oe.x1,"-").concat(oe.x2,"-").concat(oe.y1,"-").concat(oe.y2)}))}))});return re.createElement(gi,{className:"recharts-errorBars"},p)}}])}(re.Component);Hme(tC,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});Hme(tC,"displayName","ErrorBar");function T1(e){"@babel/helpers - typeof";return T1=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},T1(e)}function vY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function EA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vY(Object(n),!0).forEach(function(r){Ppt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ppt(e,t,n){return t=Ipt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ipt(e){var t=Opt(e,"string");return T1(t)=="symbol"?t:t+""}function Opt(e,t){if(T1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(T1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $me=function(t){var n=t.children,r=t.formattedGraphicalItems,i=t.legendWidth,s=t.legendContent,a=So(n,Tp);if(!a)return null;var o=Tp.defaultProps,c=o!==void 0?EA(EA({},o),a.props):{},u;return a.props&&a.props.payload?u=a.props&&a.props.payload:s==="children"?u=(r||[]).reduce(function(d,h){var A=h.item,f=h.props,p=f.sectors||f.data||[];return d.concat(p.map(function(m){return{type:a.props.iconType||A.props.legendType,value:m.name,color:m.fill,payload:m}}))},[]):u=(r||[]).map(function(d){var h=d.item,A=h.type.defaultProps,f=A!==void 0?EA(EA({},A),h.props):{},p=f.dataKey,m=f.name,g=f.legendType,y=f.hide;return{inactive:y,dataKey:p,type:c.iconType||g||"square",color:GQ(h),value:m||p,payload:f}}),EA(EA(EA({},c),Tp.getWithHeight(a,i)),{},{payload:u,item:a})};function P1(e){"@babel/helpers - typeof";return P1=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},P1(e)}function xY(e){return Rpt(e)||Lpt(e)||Mpt(e)||Fpt()}function Fpt(){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 Mpt(e,t){if(e){if(typeof e=="string")return IL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return IL(e,t)}}function Lpt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Rpt(e){if(Array.isArray(e))return IL(e)}function IL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ri(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wY(Object(n),!0).forEach(function(r){Fy(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fy(e,t,n){return t=Dpt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dpt(e){var t=Upt(e,"string");return P1(t)=="symbol"?t:t+""}function Upt(e,t){if(P1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(P1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Do(e,t,n){return Cn(e)||Cn(t)?n:Ki(t)?Cl(e,t,n):gn(t)?t(e):n}function nb(e,t,n,r){var i=LAt(e,function(o){return Do(o,t)});if(n==="number"){var s=i.filter(function(o){return Ze(o)||parseFloat(o)});return s.length?[Z5(s),J5(s)]:[1/0,-1/0]}var a=r?i.filter(function(o){return!Cn(o)}):i;return a.map(function(o){return Ki(o)||o instanceof Date?o:""})}var Hpt=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,a=-1,o=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(o<=1)return 0;if(s&&s.axisType==="angleAxis"&&Math.abs(Math.abs(s.range[1]-s.range[0])-360)<=1e-6)for(var c=s.range,u=0;u<o;u++){var d=u>0?i[u-1].coordinate:i[o-1].coordinate,h=i[u].coordinate,A=u>=o-1?i[0].coordinate:i[u+1].coordinate,f=void 0;if(cc(h-d)!==cc(A-h)){var p=[];if(cc(A-h)===cc(c[1]-c[0])){f=A;var m=h+c[1]-c[0];p[0]=Math.min(m,(m+d)/2),p[1]=Math.max(m,(m+d)/2)}else{f=d;var g=A+c[1]-c[0];p[0]=Math.min(h,(g+h)/2),p[1]=Math.max(h,(g+h)/2)}var y=[Math.min(h,(f+h)/2),Math.max(h,(f+h)/2)];if(t>y[0]&&t<=y[1]||t>=p[0]&&t<=p[1]){a=i[u].index;break}}else{var v=Math.min(d,A),x=Math.max(d,A);if(t>(v+h)/2&&t<=(x+h)/2){a=i[u].index;break}}}else for(var w=0;w<o;w++)if(w===0&&t<=(r[w].coordinate+r[w+1].coordinate)/2||w>0&&w<o-1&&t>(r[w].coordinate+r[w-1].coordinate)/2&&t<=(r[w].coordinate+r[w+1].coordinate)/2||w===o-1&&t>(r[w].coordinate+r[w-1].coordinate)/2){a=r[w].index;break}return a},GQ=function(t){var n,r=t,i=r.type.displayName,s=(n=t.type)!==null&&n!==void 0&&n.defaultProps?ri(ri({},t.type.defaultProps),t.props):t.props,a=s.stroke,o=s.fill,c;switch(i){case"Line":c=a;break;case"Area":case"Radar":c=a&&a!=="none"?a:o;break;default:c=o;break}return c},Qpt=function(t){var n=t.barSize,r=t.totalSize,i=t.stackGroups,s=i===void 0?{}:i;if(!s)return{};for(var a={},o=Object.keys(s),c=0,u=o.length;c<u;c++)for(var d=s[o[c]].stackGroups,h=Object.keys(d),A=0,f=h.length;A<f;A++){var p=d[h[A]],m=p.items,g=p.cateAxisId,y=m.filter(function(j){return ld(j.type).indexOf("Bar")>=0});if(y&&y.length){var v=y[0].type.defaultProps,x=v!==void 0?ri(ri({},v),y[0].props):y[0].props,w=x.barSize,b=x[g];a[b]||(a[b]=[]);var k=Cn(w)?n:w;a[b].push({item:y[0],stackList:y.slice(1),barSize:Cn(k)?void 0:sm(k,r,0)})}}return a},$pt=function(t){var n=t.barGap,r=t.barCategoryGap,i=t.bandSize,s=t.sizeList,a=s===void 0?[]:s,o=t.maxBarSize,c=a.length;if(c<1)return null;var u=sm(n,i,0,!0),d,h=[];if(a[0].barSize===+a[0].barSize){var A=!1,f=i/c,p=a.reduce(function(w,b){return w+b.barSize||0},0);p+=(c-1)*u,p>=i&&(p-=(c-1)*u,u=0),p>=i&&f>0&&(A=!0,f*=.9,p=c*f);var m=(i-p)/2>>0,g={offset:m-u,size:0};d=a.reduce(function(w,b){var k={item:b.item,position:{offset:g.offset+g.size+u,size:A?f:b.barSize}},j=[].concat(xY(w),[k]);return g=j[j.length-1].position,b.stackList&&b.stackList.length&&b.stackList.forEach(function(B){j.push({item:B,position:g})}),j},h)}else{var y=sm(r,i,0,!0);i-2*y-(c-1)*u<=0&&(u=0);var v=(i-2*y-(c-1)*u)/c;v>1&&(v>>=0);var x=o===+o?Math.min(v,o):v;d=a.reduce(function(w,b,k){var j=[].concat(xY(w),[{item:b.item,position:{offset:y+(v+u)*k+(v-x)/2,size:x}}]);return b.stackList&&b.stackList.length&&b.stackList.forEach(function(B){j.push({item:B,position:j[j.length-1].position})}),j},h)}return d},zpt=function(t,n,r,i){var s=r.children,a=r.width,o=r.margin,c=a-(o.left||0)-(o.right||0),u=$me({children:s,legendWidth:c});if(u){var d=i||{},h=d.width,A=d.height,f=u.align,p=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&p==="middle")&&f!=="center"&&Ze(t[f]))return ri(ri({},t),{},Fy({},f,t[f]+(h||0)));if((m==="horizontal"||m==="vertical"&&f==="center")&&p!=="middle"&&Ze(t[p]))return ri(ri({},t),{},Fy({},p,t[p]+(A||0)))}return t},Vpt=function(t,n,r){return Cn(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},zme=function(t,n,r,i,s){var a=n.props.children,o=Sl(a,tC).filter(function(u){return Vpt(i,s,u.props.direction)});if(o&&o.length){var c=o.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var h=Do(d,r);if(Cn(h))return u;var A=Array.isArray(h)?[Z5(h),J5(h)]:[h,h],f=c.reduce(function(p,m){var g=Do(d,m,0),y=A[0]-Math.abs(Array.isArray(g)?g[0]:g),v=A[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(y,p[0]),Math.max(v,p[1])]},[1/0,-1/0]);return[Math.min(f[0],u[0]),Math.max(f[1],u[1])]},[1/0,-1/0])}return null},Kpt=function(t,n,r,i,s){var a=n.map(function(o){return zme(t,o,r,s,i)}).filter(function(o){return!Cn(o)});return a&&a.length?a.reduce(function(o,c){return[Math.min(o[0],c[0]),Math.max(o[1],c[1])]},[1/0,-1/0]):null},Vme=function(t,n,r,i,s){var a=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&zme(t,c,u,i)||nb(t,u,r,s)});if(r==="number")return a.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var o={};return a.reduce(function(c,u){for(var d=0,h=u.length;d<h;d++)o[u[d]]||(o[u[d]]=!0,c.push(u[d]));return c},[])},Kme=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},qme=function(t,n,r,i){if(i)return t.map(function(c){return c.coordinate});var s,a,o=t.map(function(c){return c.coordinate===n&&(s=!0),c.coordinate===r&&(a=!0),c.coordinate});return s||o.push(n),a||o.push(r),o},id=function(t,n,r){if(!t)return null;var i=t.scale,s=t.duplicateDomain,a=t.type,o=t.range,c=t.realScaleType==="scaleBand"?i.bandwidth()/2:2,u=(n||r)&&a==="category"&&i.bandwidth?i.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(o==null?void 0:o.length)>=2?cc(o[0]-o[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(h){var A=s?s.indexOf(h):h;return{coordinate:i(A)+u,value:h,offset:u}});return d.filter(function(h){return!W2(h.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(h,A){return{coordinate:i(h)+u,value:h,index:A,offset:u}}):i.ticks&&!r?i.ticks(t.tickCount).map(function(h){return{coordinate:i(h)+u,value:h,offset:u}}):i.domain().map(function(h,A){return{coordinate:i(h)+u,value:s?s[h]:h,index:A,offset:u}})},M4=new WeakMap,tk=function(t,n){if(typeof n!="function")return t;M4.has(t)||M4.set(t,new WeakMap);var r=M4.get(t);if(r.has(n))return r.get(n);var i=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,i),i},qpt=function(t,n,r){var i=t.scale,s=t.type,a=t.layout,o=t.axisType;if(i==="auto")return a==="radial"&&o==="radiusAxis"?{scale:S1(),realScaleType:"band"}:a==="radial"&&o==="angleAxis"?{scale:nN(),realScaleType:"linear"}:s==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:tb(),realScaleType:"point"}:s==="category"?{scale:S1(),realScaleType:"band"}:{scale:nN(),realScaleType:"linear"};if(q2(i)){var c="scale".concat(D5(i));return{scale:(AY[c]||tb)(),realScaleType:AY[c]?c:"point"}}return gn(i)?{scale:i}:{scale:tb(),realScaleType:"point"}},bY=1e-4,Wpt=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,i=t.range(),s=Math.min(i[0],i[1])-bY,a=Math.max(i[0],i[1])+bY,o=t(n[0]),c=t(n[r-1]);(o<s||o>a||c<s||c>a)&&t.domain([n[0],n[r-1]])}},Gpt=function(t,n){if(!t)return null;for(var r=0,i=t.length;r<i;r++)if(t[r].item===n)return t[r].position;return null},Ypt=function(t,n){if(!n||n.length!==2||!Ze(n[0])||!Ze(n[1]))return t;var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]),s=[t[0],t[1]];return(!Ze(t[0])||t[0]<r)&&(s[0]=r),(!Ze(t[1])||t[1]>i)&&(s[1]=i),s[0]>i&&(s[0]=i),s[1]<r&&(s[1]=r),s},Xpt=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var s=0,a=0,o=0;o<n;++o){var c=W2(t[o][r][1])?t[o][r][0]:t[o][r][1];c>=0?(t[o][r][0]=s,t[o][r][1]=s+c,s=t[o][r][1]):(t[o][r][0]=a,t[o][r][1]=a+c,a=t[o][r][1])}},Jpt=function(t){var n=t.length;if(!(n<=0))for(var r=0,i=t[0].length;r<i;++r)for(var s=0,a=0;a<n;++a){var o=W2(t[a][r][1])?t[a][r][0]:t[a][r][1];o>=0?(t[a][r][0]=s,t[a][r][1]=s+o,s=t[a][r][1]):(t[a][r][0]=0,t[a][r][1]=0)}},Zpt={sign:Xpt,expand:Ant,none:Sv,silhouette:pnt,wiggle:mnt,positive:Jpt},emt=function(t,n,r){var i=n.map(function(o){return o.props.dataKey}),s=Zpt[r],a=fnt().keys(i).value(function(o,c){return+Do(o,c,0)}).order(iL).offset(s);return a(t)},tmt=function(t,n,r,i,s,a){if(!t)return null;var o=a?n.reverse():n,c={},u=o.reduce(function(h,A){var f,p=(f=A.type)!==null&&f!==void 0&&f.defaultProps?ri(ri({},A.type.defaultProps),A.props):A.props,m=p.stackId,g=p.hide;if(g)return h;var y=p[r],v=h[y]||{hasStack:!1,stackGroups:{}};if(Ki(m)){var x=v.stackGroups[m]||{numericAxisId:r,cateAxisId:i,items:[]};x.items.push(A),v.hasStack=!0,v.stackGroups[m]=x}else v.stackGroups[G2("_stackId_")]={numericAxisId:r,cateAxisId:i,items:[A]};return ri(ri({},h),{},Fy({},y,v))},c),d={};return Object.keys(u).reduce(function(h,A){var f=u[A];if(f.hasStack){var p={};f.stackGroups=Object.keys(f.stackGroups).reduce(function(m,g){var y=f.stackGroups[g];return ri(ri({},m),{},Fy({},g,{numericAxisId:r,cateAxisId:i,items:y.items,stackedData:emt(t,y.items,s)}))},p)}return ri(ri({},h),{},Fy({},A,f))},d)},nmt=function(t,n){var r=n.realScaleType,i=n.type,s=n.tickCount,a=n.originalDomain,o=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(s&&i==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=fpt(u,s,o);return t.domain([Z5(d),J5(d)]),{niceTicks:d}}if(s&&i==="number"){var h=t.domain(),A=Apt(h,s,o);return{niceTicks:A}}return null};function CY(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,s=e.index,a=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Cn(i[t.dataKey])){var o=IB(n,"value",i[t.dataKey]);if(o)return o.coordinate+r/2}return n[s]?n[s].coordinate+r/2:null}var c=Do(i,Cn(a)?t.dataKey:a);return Cn(c)?null:t.scale(c)}var SY=function(t){var n=t.axis,r=t.ticks,i=t.offset,s=t.bandSize,a=t.entry,o=t.index;if(n.type==="category")return r[o]?r[o].coordinate+i:null;var c=Do(a,n.dataKey,n.domain[o]);return Cn(c)?null:n.scale(c)-s/2+i},rmt=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var i=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]);return i<=0&&s>=0?0:s<0?s:i}return r[0]},imt=function(t,n){var r,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?ri(ri({},t.type.defaultProps),t.props):t.props,s=i.stackId;if(Ki(s)){var a=n[s];if(a){var o=a.items.indexOf(t);return o>=0?a.stackedData[o]:null}}return null},smt=function(t){return t.reduce(function(n,r){return[Z5(r.concat([n[0]]).filter(Ze)),J5(r.concat([n[1]]).filter(Ze))]},[1/0,-1/0])},Wme=function(t,n,r){return Object.keys(t).reduce(function(i,s){var a=t[s],o=a.stackedData,c=o.reduce(function(u,d){var h=smt(d.slice(n,r+1));return[Math.min(u[0],h[0]),Math.max(u[1],h[1])]},[1/0,-1/0]);return[Math.min(c[0],i[0]),Math.max(c[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},kY=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,_Y=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,OL=function(t,n,r){if(gn(t))return t(n,r);if(!Array.isArray(t))return n;var i=[];if(Ze(t[0]))i[0]=r?t[0]:Math.min(t[0],n[0]);else if(kY.test(t[0])){var s=+kY.exec(t[0])[1];i[0]=n[0]-s}else gn(t[0])?i[0]=t[0](n[0]):i[0]=n[0];if(Ze(t[1]))i[1]=r?t[1]:Math.max(t[1],n[1]);else if(_Y.test(t[1])){var a=+_Y.exec(t[1])[1];i[1]=n[1]+a}else gn(t[1])?i[1]=t[1](n[1]):i[1]=n[1];return i},cN=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!r||i>0)return i}if(t&&n&&n.length>=2){for(var s=bQ(n,function(h){return h.coordinate}),a=1/0,o=1,c=s.length;o<c;o++){var u=s[o],d=s[o-1];a=Math.min((u.coordinate||0)-(d.coordinate||0),a)}return a===1/0?0:a}return r?void 0:0},jY=function(t,n,r){return!t||!t.length||eT(t,Cl(r,"type.defaultProps.domain"))?n:t},Gme=function(t,n){var r=t.type.defaultProps?ri(ri({},t.type.defaultProps),t.props):t.props,i=r.dataKey,s=r.name,a=r.unit,o=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return ri(ri({},jn(t,!1)),{},{dataKey:i,unit:a,formatter:o,name:s||i,color:GQ(t),value:Do(n,i),type:c,payload:n,chartType:u,hide:d})};function I1(e){"@babel/helpers - typeof";return I1=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},I1(e)}function BY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function NY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BY(Object(n),!0).forEach(function(r){amt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function amt(e,t,n){return t=omt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function omt(e){var t=lmt(e,"string");return I1(t)=="symbol"?t:t+""}function lmt(e,t){if(I1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(I1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uN=Math.PI/180,cmt=function(t){return t*180/Math.PI},Bs=function(t,n,r,i){return{x:t+Math.cos(-uN*i)*r,y:n+Math.sin(-uN*i)*r}},umt=function(t,n){var r=t.x,i=t.y,s=n.x,a=n.y;return Math.sqrt(Math.pow(r-s,2)+Math.pow(i-a,2))},dmt=function(t,n){var r=t.x,i=t.y,s=n.cx,a=n.cy,o=umt({x:r,y:i},{x:s,y:a});if(o<=0)return{radius:o};var c=(r-s)/o,u=Math.acos(c);return i>a&&(u=2*Math.PI-u),{radius:o,angle:cmt(u),angleInRadian:u}},hmt=function(t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),s=Math.floor(r/360),a=Math.min(i,s);return{startAngle:n-a*360,endAngle:r-a*360}},fmt=function(t,n){var r=n.startAngle,i=n.endAngle,s=Math.floor(r/360),a=Math.floor(i/360),o=Math.min(s,a);return t+o*360},EY=function(t,n){var r=t.x,i=t.y,s=dmt({x:r,y:i},n),a=s.radius,o=s.angle,c=n.innerRadius,u=n.outerRadius;if(a<c||a>u)return!1;if(a===0)return!0;var d=hmt(n),h=d.startAngle,A=d.endAngle,f=o,p;if(h<=A){for(;f>A;)f-=360;for(;f<h;)f+=360;p=f>=h&&f<=A}else{for(;f>h;)f-=360;for(;f<A;)f+=360;p=f>=A&&f<=h}return p?NY(NY({},n),{},{radius:a,angle:fmt(f,n)}):null};function O1(e){"@babel/helpers - typeof";return O1=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},O1(e)}var Amt=["offset"];function pmt(e){return vmt(e)||ymt(e)||gmt(e)||mmt()}function mmt(){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 gmt(e,t){if(e){if(typeof e=="string")return FL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return FL(e,t)}}function ymt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vmt(e){if(Array.isArray(e))return FL(e)}function FL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xmt(e,t){if(e==null)return{};var n=wmt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wmt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function TY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Li(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TY(Object(n),!0).forEach(function(r){bmt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bmt(e,t,n){return t=Cmt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cmt(e){var t=Smt(e,"string");return O1(t)=="symbol"?t:t+""}function Smt(e,t){if(O1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(O1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function F1(){return F1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F1.apply(this,arguments)}var kmt=function(t){var n=t.value,r=t.formatter,i=Cn(t.children)?n:t.children;return gn(r)?r(i):i},_mt=function(t,n){var r=cc(n-t),i=Math.min(Math.abs(n-t),360);return r*i},jmt=function(t,n,r){var i=t.position,s=t.viewBox,a=t.offset,o=t.className,c=s,u=c.cx,d=c.cy,h=c.innerRadius,A=c.outerRadius,f=c.startAngle,p=c.endAngle,m=c.clockWise,g=(h+A)/2,y=_mt(f,p),v=y>=0?1:-1,x,w;i==="insideStart"?(x=f+v*a,w=m):i==="insideEnd"?(x=p-v*a,w=!m):i==="end"&&(x=p+v*a,w=m),w=y<=0?w:!w;var b=Bs(u,d,g,x),k=Bs(u,d,g,x+(w?1:-1)*359),j="M".concat(b.x,",").concat(b.y,`
    A`).concat(g,",").concat(g,",0,1,").concat(w?0:1,`,
    `).concat(k.x,",").concat(k.y),B=Cn(t.id)?G2("recharts-radial-line-"):t.id;return re.createElement("text",F1({},r,{dominantBaseline:"central",className:Pn("recharts-radial-bar-label",o)}),re.createElement("defs",null,re.createElement("path",{id:B,d:j})),re.createElement("textPath",{xlinkHref:"#".concat(B)},n))},Bmt=function(t){var n=t.viewBox,r=t.offset,i=t.position,s=n,a=s.cx,o=s.cy,c=s.innerRadius,u=s.outerRadius,d=s.startAngle,h=s.endAngle,A=(d+h)/2;if(i==="outside"){var f=Bs(a,o,u+r,A),p=f.x,m=f.y;return{x:p,y:m,textAnchor:p>=a?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:a,y:o,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:a,y:o,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:a,y:o,textAnchor:"middle",verticalAnchor:"end"};var g=(c+u)/2,y=Bs(a,o,g,A),v=y.x,x=y.y;return{x:v,y:x,textAnchor:"middle",verticalAnchor:"middle"}},Nmt=function(t){var n=t.viewBox,r=t.parentViewBox,i=t.offset,s=t.position,a=n,o=a.x,c=a.y,u=a.width,d=a.height,h=d>=0?1:-1,A=h*i,f=h>0?"end":"start",p=h>0?"start":"end",m=u>=0?1:-1,g=m*i,y=m>0?"end":"start",v=m>0?"start":"end";if(s==="top"){var x={x:o+u/2,y:c-h*i,textAnchor:"middle",verticalAnchor:f};return Li(Li({},x),r?{height:Math.max(c-r.y,0),width:u}:{})}if(s==="bottom"){var w={x:o+u/2,y:c+d+A,textAnchor:"middle",verticalAnchor:p};return Li(Li({},w),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(s==="left"){var b={x:o-g,y:c+d/2,textAnchor:y,verticalAnchor:"middle"};return Li(Li({},b),r?{width:Math.max(b.x-r.x,0),height:d}:{})}if(s==="right"){var k={x:o+u+g,y:c+d/2,textAnchor:v,verticalAnchor:"middle"};return Li(Li({},k),r?{width:Math.max(r.x+r.width-k.x,0),height:d}:{})}var j=r?{width:u,height:d}:{};return s==="insideLeft"?Li({x:o+g,y:c+d/2,textAnchor:v,verticalAnchor:"middle"},j):s==="insideRight"?Li({x:o+u-g,y:c+d/2,textAnchor:y,verticalAnchor:"middle"},j):s==="insideTop"?Li({x:o+u/2,y:c+A,textAnchor:"middle",verticalAnchor:p},j):s==="insideBottom"?Li({x:o+u/2,y:c+d-A,textAnchor:"middle",verticalAnchor:f},j):s==="insideTopLeft"?Li({x:o+g,y:c+A,textAnchor:v,verticalAnchor:p},j):s==="insideTopRight"?Li({x:o+u-g,y:c+A,textAnchor:y,verticalAnchor:p},j):s==="insideBottomLeft"?Li({x:o+g,y:c+d-A,textAnchor:v,verticalAnchor:f},j):s==="insideBottomRight"?Li({x:o+u-g,y:c+d-A,textAnchor:y,verticalAnchor:f},j):x0(s)&&(Ze(s.x)||ip(s.x))&&(Ze(s.y)||ip(s.y))?Li({x:o+sm(s.x,u),y:c+sm(s.y,d),textAnchor:"end",verticalAnchor:"end"},j):Li({x:o+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},j)},Emt=function(t){return"cx"in t&&Ze(t.cx)};function Xs(e){var t=e.offset,n=t===void 0?5:t,r=xmt(e,Amt),i=Li({offset:n},r),s=i.viewBox,a=i.position,o=i.value,c=i.children,u=i.content,d=i.className,h=d===void 0?"":d,A=i.textBreakAll;if(!s||Cn(o)&&Cn(c)&&!C.isValidElement(u)&&!gn(u))return null;if(C.isValidElement(u))return C.cloneElement(u,i);var f;if(gn(u)){if(f=C.createElement(u,i),C.isValidElement(f))return f}else f=kmt(i);var p=Emt(s),m=jn(i,!0);if(p&&(a==="insideStart"||a==="insideEnd"||a==="end"))return jmt(i,f,m);var g=p?Bmt(i):Nmt(i);return re.createElement(GB,F1({className:Pn("recharts-label",h)},m,g,{breakAll:A}),f)}Xs.displayName="Label";var Yme=function(t){var n=t.cx,r=t.cy,i=t.angle,s=t.startAngle,a=t.endAngle,o=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,h=t.x,A=t.y,f=t.top,p=t.left,m=t.width,g=t.height,y=t.clockWise,v=t.labelViewBox;if(v)return v;if(Ze(m)&&Ze(g)){if(Ze(h)&&Ze(A))return{x:h,y:A,width:m,height:g};if(Ze(f)&&Ze(p))return{x:f,y:p,width:m,height:g}}return Ze(h)&&Ze(A)?{x:h,y:A,width:0,height:0}:Ze(n)&&Ze(r)?{cx:n,cy:r,startAngle:s||i||0,endAngle:a||i||0,innerRadius:u||0,outerRadius:d||c||o||0,clockWise:y}:t.viewBox?t.viewBox:{}},Tmt=function(t,n){return t?t===!0?re.createElement(Xs,{key:"label-implicit",viewBox:n}):Ki(t)?re.createElement(Xs,{key:"label-implicit",viewBox:n,value:t}):C.isValidElement(t)?t.type===Xs?C.cloneElement(t,{key:"label-implicit",viewBox:n}):re.createElement(Xs,{key:"label-implicit",content:t,viewBox:n}):gn(t)?re.createElement(Xs,{key:"label-implicit",content:t,viewBox:n}):x0(t)?re.createElement(Xs,F1({viewBox:n},t,{key:"label-implicit"})):null:null},Pmt=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var i=t.children,s=Yme(t),a=Sl(i,Xs).map(function(c,u){return C.cloneElement(c,{viewBox:n||s,key:"label-".concat(u)})});if(!r)return a;var o=Tmt(t.label,n||s);return[o].concat(pmt(a))};Xs.parseViewBox=Yme;Xs.renderCallByParent=Pmt;function Imt(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Omt=Imt;const Fmt=In(Omt);function M1(e){"@babel/helpers - typeof";return M1=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},M1(e)}var Mmt=["valueAccessor"],Lmt=["data","dataKey","clockWise","id","textBreakAll"];function Rmt(e){return Qmt(e)||Hmt(e)||Umt(e)||Dmt()}function Dmt(){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 Umt(e,t){if(e){if(typeof e=="string")return ML(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ML(e,t)}}function Hmt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Qmt(e){if(Array.isArray(e))return ML(e)}function ML(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function dN(){return dN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dN.apply(this,arguments)}function PY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function IY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PY(Object(n),!0).forEach(function(r){$mt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $mt(e,t,n){return t=zmt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zmt(e){var t=Vmt(e,"string");return M1(t)=="symbol"?t:t+""}function Vmt(e,t){if(M1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(M1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OY(e,t){if(e==null)return{};var n=Kmt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Kmt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var qmt=function(t){return Array.isArray(t.value)?Fmt(t.value):t.value};function yf(e){var t=e.valueAccessor,n=t===void 0?qmt:t,r=OY(e,Mmt),i=r.data,s=r.dataKey,a=r.clockWise,o=r.id,c=r.textBreakAll,u=OY(r,Lmt);return!i||!i.length?null:re.createElement(gi,{className:"recharts-label-list"},i.map(function(d,h){var A=Cn(s)?n(d,h):Do(d&&d.payload,s),f=Cn(o)?{}:{id:"".concat(o,"-").concat(h)};return re.createElement(Xs,dN({},jn(d,!0),u,f,{parentViewBox:d.parentViewBox,value:A,textBreakAll:c,viewBox:Xs.parseViewBox(Cn(a)?d:IY(IY({},d),{},{clockWise:a})),key:"label-".concat(h),index:h}))}))}yf.displayName="LabelList";function Wmt(e,t){return e?e===!0?re.createElement(yf,{key:"labelList-implicit",data:t}):re.isValidElement(e)||gn(e)?re.createElement(yf,{key:"labelList-implicit",data:t,content:e}):x0(e)?re.createElement(yf,dN({data:t},e,{key:"labelList-implicit"})):null:null}function Gmt(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,i=Sl(r,yf).map(function(a,o){return C.cloneElement(a,{data:t,key:"labelList-".concat(o)})});if(!n)return i;var s=Wmt(e.label,t);return[s].concat(Rmt(i))}yf.renderCallByParent=Gmt;function L1(e){"@babel/helpers - typeof";return L1=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},L1(e)}function LL(){return LL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},LL.apply(this,arguments)}function FY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function MY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FY(Object(n),!0).forEach(function(r){Ymt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ymt(e,t,n){return t=Xmt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xmt(e){var t=Jmt(e,"string");return L1(t)=="symbol"?t:t+""}function Jmt(e,t){if(L1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(L1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zmt=function(t,n){var r=cc(n-t),i=Math.min(Math.abs(n-t),359.999);return r*i},nk=function(t){var n=t.cx,r=t.cy,i=t.radius,s=t.angle,a=t.sign,o=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(o?1:-1)+i,h=Math.asin(c/d)/uN,A=u?s:s+a*h,f=Bs(n,r,d,A),p=Bs(n,r,i,A),m=u?s-a*h:s,g=Bs(n,r,d*Math.cos(h*uN),m);return{center:f,circleTangency:p,lineTangency:g,theta:h}},Xme=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,s=t.outerRadius,a=t.startAngle,o=t.endAngle,c=Zmt(a,o),u=a+c,d=Bs(n,r,s,a),h=Bs(n,r,s,u),A="M ".concat(d.x,",").concat(d.y,`
    A `).concat(s,",").concat(s,`,0,
    `).concat(+(Math.abs(c)>180),",").concat(+(a>u),`,
    `).concat(h.x,",").concat(h.y,`
  `);if(i>0){var f=Bs(n,r,i,a),p=Bs(n,r,i,u);A+="L ".concat(p.x,",").concat(p.y,`
            A `).concat(i,",").concat(i,`,0,
            `).concat(+(Math.abs(c)>180),",").concat(+(a<=u),`,
            `).concat(f.x,",").concat(f.y," Z")}else A+="L ".concat(n,",").concat(r," Z");return A},egt=function(t){var n=t.cx,r=t.cy,i=t.innerRadius,s=t.outerRadius,a=t.cornerRadius,o=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,h=cc(d-u),A=nk({cx:n,cy:r,radius:s,angle:u,sign:h,cornerRadius:a,cornerIsExternal:c}),f=A.circleTangency,p=A.lineTangency,m=A.theta,g=nk({cx:n,cy:r,radius:s,angle:d,sign:-h,cornerRadius:a,cornerIsExternal:c}),y=g.circleTangency,v=g.lineTangency,x=g.theta,w=c?Math.abs(u-d):Math.abs(u-d)-m-x;if(w<0)return o?"M ".concat(p.x,",").concat(p.y,`
        a`).concat(a,",").concat(a,",0,0,1,").concat(a*2,`,0
        a`).concat(a,",").concat(a,",0,0,1,").concat(-a*2,`,0
      `):Xme({cx:n,cy:r,innerRadius:i,outerRadius:s,startAngle:u,endAngle:d});var b="M ".concat(p.x,",").concat(p.y,`
    A`).concat(a,",").concat(a,",0,0,").concat(+(h<0),",").concat(f.x,",").concat(f.y,`
    A`).concat(s,",").concat(s,",0,").concat(+(w>180),",").concat(+(h<0),",").concat(y.x,",").concat(y.y,`
    A`).concat(a,",").concat(a,",0,0,").concat(+(h<0),",").concat(v.x,",").concat(v.y,`
  `);if(i>0){var k=nk({cx:n,cy:r,radius:i,angle:u,sign:h,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),j=k.circleTangency,B=k.lineTangency,E=k.theta,I=nk({cx:n,cy:r,radius:i,angle:d,sign:-h,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),T=I.circleTangency,N=I.lineTangency,F=I.theta,L=c?Math.abs(u-d):Math.abs(u-d)-E-F;if(L<0&&a===0)return"".concat(b,"L").concat(n,",").concat(r,"Z");b+="L".concat(N.x,",").concat(N.y,`
      A`).concat(a,",").concat(a,",0,0,").concat(+(h<0),",").concat(T.x,",").concat(T.y,`
      A`).concat(i,",").concat(i,",0,").concat(+(L>180),",").concat(+(h>0),",").concat(j.x,",").concat(j.y,`
      A`).concat(a,",").concat(a,",0,0,").concat(+(h<0),",").concat(B.x,",").concat(B.y,"Z")}else b+="L".concat(n,",").concat(r,"Z");return b},tgt={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Jme=function(t){var n=MY(MY({},tgt),t),r=n.cx,i=n.cy,s=n.innerRadius,a=n.outerRadius,o=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,h=n.endAngle,A=n.className;if(a<s||d===h)return null;var f=Pn("recharts-sector",A),p=a-s,m=sm(o,p,0,!0),g;return m>0&&Math.abs(d-h)<360?g=egt({cx:r,cy:i,innerRadius:s,outerRadius:a,cornerRadius:Math.min(m,p/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:h}):g=Xme({cx:r,cy:i,innerRadius:s,outerRadius:a,startAngle:d,endAngle:h}),re.createElement("path",LL({},jn(n,!0),{className:f,d:g,role:"img"}))};function R1(e){"@babel/helpers - typeof";return R1=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},R1(e)}function RL(){return RL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RL.apply(this,arguments)}function LY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function RY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LY(Object(n),!0).forEach(function(r){ngt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ngt(e,t,n){return t=rgt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rgt(e){var t=igt(e,"string");return R1(t)=="symbol"?t:t+""}function igt(e,t){if(R1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(R1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var DY={curveBasisClosed:nnt,curveBasisOpen:rnt,curveBasis:tnt,curveBumpX:Htt,curveBumpY:Qtt,curveLinearClosed:int,curveLinear:H5,curveMonotoneX:snt,curveMonotoneY:ant,curveNatural:ont,curveStep:lnt,curveStepAfter:unt,curveStepBefore:cnt},rk=function(t){return t.x===+t.x&&t.y===+t.y},Lx=function(t){return t.x},Rx=function(t){return t.y},sgt=function(t,n){if(gn(t))return t;var r="curve".concat(D5(t));return(r==="curveMonotone"||r==="curveBump")&&n?DY["".concat(r).concat(n==="vertical"?"Y":"X")]:DY[r]||H5},agt=function(t){var n=t.type,r=n===void 0?"linear":n,i=t.points,s=i===void 0?[]:i,a=t.baseLine,o=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=sgt(r,o),h=u?s.filter(function(m){return rk(m)}):s,A;if(Array.isArray(a)){var f=u?a.filter(function(m){return rk(m)}):a,p=h.map(function(m,g){return RY(RY({},m),{},{base:f[g]})});return o==="vertical"?A=qS().y(Rx).x1(Lx).x0(function(m){return m.base.x}):A=qS().x(Lx).y1(Rx).y0(function(m){return m.base.y}),A.defined(rk).curve(d),A(p)}return o==="vertical"&&Ze(a)?A=qS().y(Rx).x1(Lx).x0(a):Ze(a)?A=qS().x(Lx).y1(Rx).y0(a):A=JAe().x(Lx).y(Rx),A.defined(rk).curve(d),A(h)},DL=function(t){var n=t.className,r=t.points,i=t.path,s=t.pathRef;if((!r||!r.length)&&!i)return null;var a=r&&r.length?agt(t):i;return re.createElement("path",RL({},jn(t,!1),OB(t),{className:Pn("recharts-curve",n),d:a,ref:s}))},Zme={exports:{}},ogt="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",lgt=ogt,cgt=lgt;function ege(){}function tge(){}tge.resetWarningCache=ege;var ugt=function(){function e(r,i,s,a,o,c){if(c!==cgt){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:tge,resetWarningCache:ege};return n.PropTypes=n,n};Zme.exports=ugt();var dgt=Zme.exports;const $n=In(dgt);function hgt(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function UY(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function i(s){n<0&&(n=s),s-n>t?(e(s),n=-1):hgt(i)};requestAnimationFrame(r)}function UL(e){"@babel/helpers - typeof";return UL=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},UL(e)}function fgt(e){return ggt(e)||mgt(e)||pgt(e)||Agt()}function Agt(){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 pgt(e,t){if(e){if(typeof e=="string")return HY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HY(e,t)}}function HY(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mgt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ggt(e){if(Array.isArray(e))return e}function ygt(){var e={},t=function(){return null},n=!1,r=function i(s){if(!n){if(Array.isArray(s)){if(!s.length)return;var a=s,o=fgt(a),c=o[0],u=o.slice(1);if(typeof c=="number"){UY(i.bind(null,u),c);return}i(c),UY(i.bind(null,u));return}UL(s)==="object"&&(e=s,t(e)),typeof s=="function"&&s()}};return{stop:function(){n=!0},start:function(s){n=!1,r(s)},subscribe:function(s){return t=s,function(){t=function(){return null}}}}}function D1(e){"@babel/helpers - typeof";return D1=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},D1(e)}function QY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $Y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QY(Object(n),!0).forEach(function(r){nge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nge(e,t,n){return t=vgt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vgt(e){var t=xgt(e,"string");return D1(t)==="symbol"?t:String(t)}function xgt(e,t){if(D1(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(D1(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wgt=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,i){return r.filter(function(s){return i.includes(s)})})},bgt=function(t){return t},Cgt=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},rb=function(t,n){return Object.keys(n).reduce(function(r,i){return $Y($Y({},r),{},nge({},i,t(i,n[i])))},{})},zY=function(t,n,r){return t.map(function(i){return"".concat(Cgt(i)," ").concat(n,"ms ").concat(r)}).join(",")};function Sgt(e,t){return jgt(e)||_gt(e,t)||rge(e,t)||kgt()}function kgt(){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 _gt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function jgt(e){if(Array.isArray(e))return e}function Bgt(e){return Tgt(e)||Egt(e)||rge(e)||Ngt()}function Ngt(){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 rge(e,t){if(e){if(typeof e=="string")return HL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return HL(e,t)}}function Egt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Tgt(e){if(Array.isArray(e))return HL(e)}function HL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var hN=1e-4,ige=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},sge=function(t,n){return t.map(function(r,i){return r*Math.pow(n,i)}).reduce(function(r,i){return r+i})},VY=function(t,n){return function(r){var i=ige(t,n);return sge(i,r)}},Pgt=function(t,n){return function(r){var i=ige(t,n),s=[].concat(Bgt(i.map(function(a,o){return a*o}).slice(1)),[0]);return sge(s,r)}},KY=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0],s=n[1],a=n[2],o=n[3];if(n.length===1)switch(n[0]){case"linear":i=0,s=0,a=1,o=1;break;case"ease":i=.25,s=.1,a=.25,o=1;break;case"ease-in":i=.42,s=0,a=1,o=1;break;case"ease-out":i=.42,s=0,a=.58,o=1;break;case"ease-in-out":i=0,s=0,a=.58,o=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(g){return parseFloat(g)}),d=Sgt(u,4);i=d[0],s=d[1],a=d[2],o=d[3]}}}var h=VY(i,a),A=VY(s,o),f=Pgt(i,a),p=function(y){return y>1?1:y<0?0:y},m=function(y){for(var v=y>1?1:y,x=v,w=0;w<8;++w){var b=h(x)-v,k=f(x);if(Math.abs(b-v)<hN||k<hN)return A(x);x=p(x-b/k)}return A(x)};return m.isStepper=!1,m},Igt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,i=t.damping,s=i===void 0?8:i,a=t.dt,o=a===void 0?17:a,c=function(d,h,A){var f=-(d-h)*r,p=A*s,m=A+(f-p)*o/1e3,g=A*o/1e3+d;return Math.abs(g-h)<hN&&Math.abs(m)<hN?[h,0]:[g,m]};return c.isStepper=!0,c.dt=o,c},Ogt=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n[0];if(typeof i=="string")switch(i){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return KY(i);case"spring":return Igt();default:if(i.split("(")[0]==="cubic-bezier")return KY(i)}return typeof i=="function"?i:null};function U1(e){"@babel/helpers - typeof";return U1=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},U1(e)}function qY(e){return Lgt(e)||Mgt(e)||age(e)||Fgt()}function Fgt(){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 Mgt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Lgt(e){if(Array.isArray(e))return $L(e)}function WY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WY(Object(n),!0).forEach(function(r){QL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function QL(e,t,n){return t=Rgt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rgt(e){var t=Dgt(e,"string");return U1(t)==="symbol"?t:String(t)}function Dgt(e,t){if(U1(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(U1(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ugt(e,t){return $gt(e)||Qgt(e,t)||age(e,t)||Hgt()}function Hgt(){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 age(e,t){if(e){if(typeof e=="string")return $L(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $L(e,t)}}function $L(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Qgt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function $gt(e){if(Array.isArray(e))return e}var fN=function(t,n,r){return t+(n-t)*r},zL=function(t){var n=t.from,r=t.to;return n!==r},zgt=function e(t,n,r){var i=rb(function(s,a){if(zL(a)){var o=t(a.from,a.to,a.velocity),c=Ugt(o,2),u=c[0],d=c[1];return vs(vs({},a),{},{from:u,velocity:d})}return a},n);return r<1?rb(function(s,a){return zL(a)?vs(vs({},a),{},{velocity:fN(a.velocity,i[s].velocity,r),from:fN(a.from,i[s].from,r)}):a},n):e(t,i,r-1)};const Vgt=function(e,t,n,r,i){var s=wgt(e,t),a=s.reduce(function(g,y){return vs(vs({},g),{},QL({},y,[e[y],t[y]]))},{}),o=s.reduce(function(g,y){return vs(vs({},g),{},QL({},y,{from:e[y],velocity:0,to:t[y]}))},{}),c=-1,u,d,h=function(){return null},A=function(){return rb(function(y,v){return v.from},o)},f=function(){return!Object.values(o).filter(zL).length},p=function(y){u||(u=y);var v=y-u,x=v/n.dt;o=zgt(n,o,x),i(vs(vs(vs({},e),t),A())),u=y,f()||(c=requestAnimationFrame(h))},m=function(y){d||(d=y);var v=(y-d)/r,x=rb(function(b,k){return fN.apply(void 0,qY(k).concat([n(v)]))},a);if(i(vs(vs(vs({},e),t),x)),v<1)c=requestAnimationFrame(h);else{var w=rb(function(b,k){return fN.apply(void 0,qY(k).concat([n(1)]))},a);i(vs(vs(vs({},e),t),w))}};return h=n.isStepper?p:m,function(){return requestAnimationFrame(h),function(){cancelAnimationFrame(c)}}};function Iv(e){"@babel/helpers - typeof";return Iv=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},Iv(e)}var Kgt=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function qgt(e,t){if(e==null)return{};var n=Wgt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Wgt(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function L4(e){return Jgt(e)||Xgt(e)||Ygt(e)||Ggt()}function Ggt(){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 Ygt(e,t){if(e){if(typeof e=="string")return VL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VL(e,t)}}function Xgt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Jgt(e){if(Array.isArray(e))return VL(e)}function VL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function GY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GY(Object(n),!0).forEach(function(r){uw(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uw(e,t,n){return t=oge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zgt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eyt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,oge(r.key),r)}}function tyt(e,t,n){return t&&eyt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function oge(e){var t=nyt(e,"string");return Iv(t)==="symbol"?t:String(t)}function nyt(e,t){if(Iv(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Iv(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ryt(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&&KL(e,t)}function KL(e,t){return KL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},KL(e,t)}function iyt(e){var t=syt();return function(){var r=AN(e),i;if(t){var s=AN(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return qL(this,i)}}function qL(e,t){if(t&&(Iv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return WL(e)}function WL(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function syt(){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 AN(e){return AN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},AN(e)}var kd=function(e){ryt(n,e);var t=iyt(n);function n(r,i){var s;Zgt(this,n),s=t.call(this,r,i);var a=s.props,o=a.isActive,c=a.attributeName,u=a.from,d=a.to,h=a.steps,A=a.children,f=a.duration;if(s.handleStyleChange=s.handleStyleChange.bind(WL(s)),s.changeStyle=s.changeStyle.bind(WL(s)),!o||f<=0)return s.state={style:{}},typeof A=="function"&&(s.state={style:d}),qL(s);if(h&&h.length)s.state={style:h[0].style};else if(u){if(typeof A=="function")return s.state={style:u},qL(s);s.state={style:c?uw({},c,u):u}}else s.state={style:{}};return s}return tyt(n,[{key:"componentDidMount",value:function(){var i=this.props,s=i.isActive,a=i.canBegin;this.mounted=!0,!(!s||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var s=this.props,a=s.isActive,o=s.canBegin,c=s.attributeName,u=s.shouldReAnimate,d=s.to,h=s.from,A=this.state.style;if(o){if(!a){var f={style:c?uw({},c,d):d};this.state&&A&&(c&&A[c]!==d||!c&&A!==d)&&this.setState(f);return}if(!(zde(i.to,d)&&i.canBegin&&i.isActive)){var p=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=p||u?h:i.to;if(this.state&&A){var g={style:c?uw({},c,m):m};(c&&A[c]!==m||!c&&A!==m)&&this.setState(g)}this.runAnimation(zl(zl({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var s=this,a=i.from,o=i.to,c=i.duration,u=i.easing,d=i.begin,h=i.onAnimationEnd,A=i.onAnimationStart,f=Vgt(a,o,Ogt(u),c,this.changeStyle),p=function(){s.stopJSAnimation=f()};this.manager.start([A,d,p,c,h])}},{key:"runStepAnimation",value:function(i){var s=this,a=i.steps,o=i.begin,c=i.onAnimationStart,u=a[0],d=u.style,h=u.duration,A=h===void 0?0:h,f=function(m,g,y){if(y===0)return m;var v=g.duration,x=g.easing,w=x===void 0?"ease":x,b=g.style,k=g.properties,j=g.onAnimationEnd,B=y>0?a[y-1]:g,E=k||Object.keys(b);if(typeof w=="function"||w==="spring")return[].concat(L4(m),[s.runJSAnimation.bind(s,{from:B.style,to:b,duration:v,easing:w}),v]);var I=zY(E,v,w),T=zl(zl(zl({},B.style),b),{},{transition:I});return[].concat(L4(m),[T,v,j]).filter(bgt)};return this.manager.start([c].concat(L4(a.reduce(f,[d,Math.max(A,o)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=ygt());var s=i.begin,a=i.duration,o=i.attributeName,c=i.to,u=i.easing,d=i.onAnimationStart,h=i.onAnimationEnd,A=i.steps,f=i.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),typeof u=="function"||typeof f=="function"||u==="spring"){this.runJSAnimation(i);return}if(A.length>1){this.runStepAnimation(i);return}var m=o?uw({},o,c):c,g=zY(Object.keys(m),a,u);p.start([d,s,zl(zl({},m),{},{transition:g}),a,h])}},{key:"render",value:function(){var i=this.props,s=i.children;i.begin;var a=i.duration;i.attributeName,i.easing;var o=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var c=qgt(i,Kgt),u=C.Children.count(s),d=this.state.style;if(typeof s=="function")return s(d);if(!o||u===0||a<=0)return s;var h=function(f){var p=f.props,m=p.style,g=m===void 0?{}:m,y=p.className,v=C.cloneElement(f,zl(zl({},c),{},{style:zl(zl({},g),d),className:y}));return v};return u===1?h(C.Children.only(s)):re.createElement("div",null,C.Children.map(s,function(A){return h(A)}))}}]),n}(C.PureComponent);kd.displayName="Animate";kd.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};kd.propTypes={from:$n.oneOfType([$n.object,$n.string]),to:$n.oneOfType([$n.object,$n.string]),attributeName:$n.string,duration:$n.number,begin:$n.number,easing:$n.oneOfType([$n.string,$n.func]),steps:$n.arrayOf($n.shape({duration:$n.number.isRequired,style:$n.object.isRequired,easing:$n.oneOfType([$n.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),$n.func]),properties:$n.arrayOf("string"),onAnimationEnd:$n.func})),children:$n.oneOfType([$n.node,$n.func]),isActive:$n.bool,canBegin:$n.bool,onAnimationEnd:$n.func,shouldReAnimate:$n.bool,onAnimationStart:$n.func,onAnimationReStart:$n.func};function H1(e){"@babel/helpers - typeof";return H1=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},H1(e)}function pN(){return pN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pN.apply(this,arguments)}function ayt(e,t){return uyt(e)||cyt(e,t)||lyt(e,t)||oyt()}function oyt(){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 lyt(e,t){if(e){if(typeof e=="string")return YY(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return YY(e,t)}}function YY(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cyt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function uyt(e){if(Array.isArray(e))return e}function XY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function JY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XY(Object(n),!0).forEach(function(r){dyt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XY(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dyt(e,t,n){return t=hyt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hyt(e){var t=fyt(e,"string");return H1(t)=="symbol"?t:t+""}function fyt(e,t){if(H1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(H1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ZY=function(t,n,r,i,s){var a=Math.min(Math.abs(r)/2,Math.abs(i)/2),o=i>=0?1:-1,c=r>=0?1:-1,u=i>=0&&r>=0||i<0&&r<0?1:0,d;if(a>0&&s instanceof Array){for(var h=[0,0,0,0],A=0,f=4;A<f;A++)h[A]=s[A]>a?a:s[A];d="M".concat(t,",").concat(n+o*h[0]),h[0]>0&&(d+="A ".concat(h[0],",").concat(h[0],",0,0,").concat(u,",").concat(t+c*h[0],",").concat(n)),d+="L ".concat(t+r-c*h[1],",").concat(n),h[1]>0&&(d+="A ".concat(h[1],",").concat(h[1],",0,0,").concat(u,`,
        `).concat(t+r,",").concat(n+o*h[1])),d+="L ".concat(t+r,",").concat(n+i-o*h[2]),h[2]>0&&(d+="A ".concat(h[2],",").concat(h[2],",0,0,").concat(u,`,
        `).concat(t+r-c*h[2],",").concat(n+i)),d+="L ".concat(t+c*h[3],",").concat(n+i),h[3]>0&&(d+="A ".concat(h[3],",").concat(h[3],",0,0,").concat(u,`,
        `).concat(t,",").concat(n+i-o*h[3])),d+="Z"}else if(a>0&&s===+s&&s>0){var p=Math.min(a,s);d="M ".concat(t,",").concat(n+o*p,`
            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+c*p,",").concat(n,`
            L `).concat(t+r-c*p,",").concat(n,`
            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+r,",").concat(n+o*p,`
            L `).concat(t+r,",").concat(n+i-o*p,`
            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+r-c*p,",").concat(n+i,`
            L `).concat(t+c*p,",").concat(n+i,`
            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t,",").concat(n+i-o*p," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(i," h ").concat(-r," Z");return d},Ayt=function(t,n){if(!t||!n)return!1;var r=t.x,i=t.y,s=n.x,a=n.y,o=n.width,c=n.height;if(Math.abs(o)>0&&Math.abs(c)>0){var u=Math.min(s,s+o),d=Math.max(s,s+o),h=Math.min(a,a+c),A=Math.max(a,a+c);return r>=u&&r<=d&&i>=h&&i<=A}return!1},pyt={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},YQ=function(t){var n=JY(JY({},pyt),t),r=C.useRef(),i=C.useState(-1),s=ayt(i,2),a=s[0],o=s[1];C.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var w=r.current.getTotalLength();w&&o(w)}catch{}},[]);var c=n.x,u=n.y,d=n.width,h=n.height,A=n.radius,f=n.className,p=n.animationEasing,m=n.animationDuration,g=n.animationBegin,y=n.isAnimationActive,v=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||h!==+h||d===0||h===0)return null;var x=Pn("recharts-rectangle",f);return v?re.createElement(kd,{canBegin:a>0,from:{width:d,height:h,x:c,y:u},to:{width:d,height:h,x:c,y:u},duration:m,animationEasing:p,isActive:v},function(w){var b=w.width,k=w.height,j=w.x,B=w.y;return re.createElement(kd,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:m,isActive:y,easing:p},re.createElement("path",pN({},jn(n,!0),{className:x,d:ZY(j,B,b,k,A),ref:r})))}):re.createElement("path",pN({},jn(n,!0),{className:x,d:ZY(c,u,d,h,A)}))};function GL(){return GL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},GL.apply(this,arguments)}var XQ=function(t){var n=t.cx,r=t.cy,i=t.r,s=t.className,a=Pn("recharts-dot",s);return n===+n&&r===+r&&i===+i?re.createElement("circle",GL({},jn(t,!1),OB(t),{className:a,cx:n,cy:r,r:i})):null};function Q1(e){"@babel/helpers - typeof";return Q1=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},Q1(e)}var myt=["x","y","top","left","width","height","className"];function YL(){return YL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},YL.apply(this,arguments)}function eX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gyt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eX(Object(n),!0).forEach(function(r){yyt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yyt(e,t,n){return t=vyt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vyt(e){var t=xyt(e,"string");return Q1(t)=="symbol"?t:t+""}function xyt(e,t){if(Q1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Q1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wyt(e,t){if(e==null)return{};var n=byt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function byt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Cyt=function(t,n,r,i,s,a){return"M".concat(t,",").concat(s,"v").concat(i,"M").concat(a,",").concat(n,"h").concat(r)},Syt=function(t){var n=t.x,r=n===void 0?0:n,i=t.y,s=i===void 0?0:i,a=t.top,o=a===void 0?0:a,c=t.left,u=c===void 0?0:c,d=t.width,h=d===void 0?0:d,A=t.height,f=A===void 0?0:A,p=t.className,m=wyt(t,myt),g=gyt({x:r,y:s,top:o,left:u,width:h,height:f},m);return!Ze(r)||!Ze(s)||!Ze(h)||!Ze(f)||!Ze(o)||!Ze(u)?null:re.createElement("path",YL({},jn(g,!0),{className:Pn("recharts-cross",p),d:Cyt(r,s,h,f,o,u)}))},kyt=bpe,_yt=kyt(Object.getPrototypeOf,Object),jyt=_yt,Byt=Id,Nyt=jyt,Eyt=Od,Tyt="[object Object]",Pyt=Function.prototype,Iyt=Object.prototype,lge=Pyt.toString,Oyt=Iyt.hasOwnProperty,Fyt=lge.call(Object);function Myt(e){if(!Eyt(e)||Byt(e)!=Tyt)return!1;var t=Nyt(e);if(t===null)return!0;var n=Oyt.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&lge.call(n)==Fyt}var Lyt=Myt;const Ryt=In(Lyt);var Dyt=Id,Uyt=Od,Hyt="[object Boolean]";function Qyt(e){return e===!0||e===!1||Uyt(e)&&Dyt(e)==Hyt}var $yt=Qyt;const zyt=In($yt);function $1(e){"@babel/helpers - typeof";return $1=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},$1(e)}function mN(){return mN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mN.apply(this,arguments)}function Vyt(e,t){return Gyt(e)||Wyt(e,t)||qyt(e,t)||Kyt()}function Kyt(){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 qyt(e,t){if(e){if(typeof e=="string")return tX(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tX(e,t)}}function tX(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Wyt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Gyt(e){if(Array.isArray(e))return e}function nX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nX(Object(n),!0).forEach(function(r){Yyt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yyt(e,t,n){return t=Xyt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xyt(e){var t=Jyt(e,"string");return $1(t)=="symbol"?t:t+""}function Jyt(e,t){if($1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iX=function(t,n,r,i,s){var a=r-i,o;return o="M ".concat(t,",").concat(n),o+="L ".concat(t+r,",").concat(n),o+="L ".concat(t+r-a/2,",").concat(n+s),o+="L ".concat(t+r-a/2-i,",").concat(n+s),o+="L ".concat(t,",").concat(n," Z"),o},Zyt={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},evt=function(t){var n=rX(rX({},Zyt),t),r=C.useRef(),i=C.useState(-1),s=Vyt(i,2),a=s[0],o=s[1];C.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var x=r.current.getTotalLength();x&&o(x)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,h=n.lowerWidth,A=n.height,f=n.className,p=n.animationEasing,m=n.animationDuration,g=n.animationBegin,y=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||h!==+h||A!==+A||d===0&&h===0||A===0)return null;var v=Pn("recharts-trapezoid",f);return y?re.createElement(kd,{canBegin:a>0,from:{upperWidth:0,lowerWidth:0,height:A,x:c,y:u},to:{upperWidth:d,lowerWidth:h,height:A,x:c,y:u},duration:m,animationEasing:p,isActive:y},function(x){var w=x.upperWidth,b=x.lowerWidth,k=x.height,j=x.x,B=x.y;return re.createElement(kd,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:m,easing:p},re.createElement("path",mN({},jn(n,!0),{className:v,d:iX(j,B,w,b,k),ref:r})))}):re.createElement("g",null,re.createElement("path",mN({},jn(n,!0),{className:v,d:iX(c,u,d,h,A)})))},tvt=["option","shapeType","propTransformer","activeClassName","isActive"];function z1(e){"@babel/helpers - typeof";return z1=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},z1(e)}function nvt(e,t){if(e==null)return{};var n=rvt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function rvt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function sX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sX(Object(n),!0).forEach(function(r){ivt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ivt(e,t,n){return t=svt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function svt(e){var t=avt(e,"string");return z1(t)=="symbol"?t:t+""}function avt(e,t){if(z1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(z1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ovt(e,t){return gN(gN({},t),e)}function lvt(e,t){return e==="symbols"}function aX(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return re.createElement(YQ,n);case"trapezoid":return re.createElement(evt,n);case"sector":return re.createElement(Jme,n);case"symbols":if(lvt(t))return re.createElement(AQ,n);break;default:return null}}function cvt(e){return C.isValidElement(e)?e.props:e}function uvt(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?ovt:r,s=e.activeClassName,a=s===void 0?"recharts-active-shape":s,o=e.isActive,c=nvt(e,tvt),u;if(C.isValidElement(t))u=C.cloneElement(t,gN(gN({},c),cvt(t)));else if(gn(t))u=t(c);else if(Ryt(t)&&!zyt(t)){var d=i(t,c);u=re.createElement(aX,{shapeType:n,elementProps:d})}else{var h=c;u=re.createElement(aX,{shapeType:n,elementProps:h})}return o?re.createElement(gi,{className:a},u):u}function rT(e,t){return t!=null&&"trapezoids"in e.props}function iT(e,t){return t!=null&&"sectors"in e.props}function V1(e,t){return t!=null&&"points"in e.props}function dvt(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,s=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return i&&s}function hvt(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function fvt(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function Avt(e,t){var n;return rT(e,t)?n=dvt:iT(e,t)?n=hvt:V1(e,t)&&(n=fvt),n}function pvt(e,t){var n;return rT(e,t)?n="trapezoids":iT(e,t)?n="sectors":V1(e,t)&&(n="points"),n}function mvt(e,t){if(rT(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}if(iT(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}return V1(e,t)?t.payload:{}}function gvt(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=pvt(n,t),s=mvt(n,t),a=r.filter(function(c,u){var d=eT(s,c),h=n.props[i].filter(function(p){var m=Avt(n,t);return m(p,t)}),A=n.props[i].indexOf(h[h.length-1]),f=u===A;return d&&f}),o=r.indexOf(a[a.length-1]);return o}var yvt=Math.ceil,vvt=Math.max;function xvt(e,t,n,r){for(var i=-1,s=vvt(yvt((t-e)/(n||1)),0),a=Array(s);s--;)a[r?s:++i]=e,e+=n;return a}var wvt=xvt,bvt=Hpe,oX=1/0,Cvt=17976931348623157e292;function Svt(e){if(!e)return e===0?e:0;if(e=bvt(e),e===oX||e===-oX){var t=e<0?-1:1;return t*Cvt}return e===e?e:0}var cge=Svt,kvt=wvt,_vt=V5,R4=cge;function jvt(e){return function(t,n,r){return r&&typeof r!="number"&&_vt(t,n,r)&&(n=r=void 0),t=R4(t),n===void 0?(n=t,t=0):n=R4(n),r=r===void 0?t<n?1:-1:R4(r),kvt(t,n,r,e)}}var Bvt=jvt,Nvt=Bvt,Evt=Nvt(),Tvt=Evt;const yN=In(Tvt);function K1(e){"@babel/helpers - typeof";return K1=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},K1(e)}function lX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lX(Object(n),!0).forEach(function(r){uge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uge(e,t,n){return t=Pvt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pvt(e){var t=Ivt(e,"string");return K1(t)=="symbol"?t:t+""}function Ivt(e,t){if(K1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(K1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ovt=["Webkit","Moz","O","ms"],Fvt=function(t,n){var r=t.replace(/(\w)/,function(s){return s.toUpperCase()}),i=Ovt.reduce(function(s,a){return cX(cX({},s),{},uge({},a+r,n))},{});return i[t]=n,i};function Ov(e){"@babel/helpers - typeof";return Ov=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},Ov(e)}function vN(){return vN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vN.apply(this,arguments)}function uX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function D4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uX(Object(n),!0).forEach(function(r){wo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mvt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hge(r.key),r)}}function Lvt(e,t,n){return t&&dX(e.prototype,t),n&&dX(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rvt(e,t,n){return t=xN(t),Dvt(e,dge()?Reflect.construct(t,n||[],xN(e).constructor):t.apply(e,n))}function Dvt(e,t){if(t&&(Ov(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Uvt(e)}function Uvt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dge=function(){return!!e})()}function xN(e){return xN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},xN(e)}function Hvt(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&&XL(e,t)}function XL(e,t){return XL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},XL(e,t)}function wo(e,t,n){return t=hge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hge(e){var t=Qvt(e,"string");return Ov(t)=="symbol"?t:t+""}function Qvt(e,t){if(Ov(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ov(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $vt=function(t){var n=t.data,r=t.startIndex,i=t.endIndex,s=t.x,a=t.width,o=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=tb().domain(yN(0,c)).range([s,s+a-o]),d=u.domain().map(function(h){return u(h)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(i),scale:u,scaleValues:d}},hX=function(t){return t.changedTouches&&!!t.changedTouches.length},Fv=function(e){function t(n){var r;return Mvt(this,t),r=Rvt(this,t,[n]),wo(r,"handleDrag",function(i){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(i):r.state.isSlideMoving&&r.handleSlideDrag(i)}),wo(r,"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&r.handleDrag(i.changedTouches[0])}),wo(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=r.props,s=i.endIndex,a=i.onDragEnd,o=i.startIndex;a==null||a({endIndex:s,startIndex:o})}),r.detachDragEndListener()}),wo(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),wo(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),wo(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),wo(r,"handleSlideDragStart",function(i){var s=hX(i)?i.changedTouches[0]:i;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:s.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return Hvt(t,e),Lvt(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var i=r.startX,s=r.endX,a=this.state.scaleValues,o=this.props,c=o.gap,u=o.data,d=u.length-1,h=Math.min(i,s),A=Math.max(i,s),f=t.getIndexInRange(a,h),p=t.getIndexInRange(a,A);return{startIndex:f-f%c,endIndex:p===d?d:p-p%c}}},{key:"getTextOfTick",value:function(r){var i=this.props,s=i.data,a=i.tickFormatter,o=i.dataKey,c=Do(s[r],o,r);return gn(a)?a(c,r):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(r){var i=this.state,s=i.slideMoveStartX,a=i.startX,o=i.endX,c=this.props,u=c.x,d=c.width,h=c.travellerWidth,A=c.startIndex,f=c.endIndex,p=c.onChange,m=r.pageX-s;m>0?m=Math.min(m,u+d-h-o,u+d-h-a):m<0&&(m=Math.max(m,u-a,u-o));var g=this.getIndex({startX:a+m,endX:o+m});(g.startIndex!==A||g.endIndex!==f)&&p&&p(g),this.setState({startX:a+m,endX:o+m,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,i){var s=hX(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:s.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var i=this.state,s=i.brushMoveStartX,a=i.movingTravellerId,o=i.endX,c=i.startX,u=this.state[a],d=this.props,h=d.x,A=d.width,f=d.travellerWidth,p=d.onChange,m=d.gap,g=d.data,y={startX:this.state.startX,endX:this.state.endX},v=r.pageX-s;v>0?v=Math.min(v,h+A-f-u):v<0&&(v=Math.max(v,h-u)),y[a]=u+v;var x=this.getIndex(y),w=x.startIndex,b=x.endIndex,k=function(){var B=g.length-1;return a==="startX"&&(o>c?w%m===0:b%m===0)||o<c&&b===B||a==="endX"&&(o>c?b%m===0:w%m===0)||o>c&&b===B};this.setState(wo(wo({},a,u+v),"brushMoveStartX",r.pageX),function(){p&&k()&&p(x)})}},{key:"handleTravellerMoveKeyboard",value:function(r,i){var s=this,a=this.state,o=a.scaleValues,c=a.startX,u=a.endX,d=this.state[i],h=o.indexOf(d);if(h!==-1){var A=h+r;if(!(A===-1||A>=o.length)){var f=o[A];i==="startX"&&f>=u||i==="endX"&&f<=c||this.setState(wo({},i,f),function(){s.props.onChange(s.getIndex({startX:s.state.startX,endX:s.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,i=r.x,s=r.y,a=r.width,o=r.height,c=r.fill,u=r.stroke;return re.createElement("rect",{stroke:u,fill:c,x:i,y:s,width:a,height:o})}},{key:"renderPanorama",value:function(){var r=this.props,i=r.x,s=r.y,a=r.width,o=r.height,c=r.data,u=r.children,d=r.padding,h=C.Children.only(u);return h?re.cloneElement(h,{x:i,y:s,width:a,height:o,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,i){var s,a,o=this,c=this.props,u=c.y,d=c.travellerWidth,h=c.height,A=c.traveller,f=c.ariaLabel,p=c.data,m=c.startIndex,g=c.endIndex,y=Math.max(r,this.props.x),v=D4(D4({},jn(this.props,!1)),{},{x:y,y:u,width:d,height:h}),x=f||"Min value: ".concat((s=p[m])===null||s===void 0?void 0:s.name,", Max value: ").concat((a=p[g])===null||a===void 0?void 0:a.name);return re.createElement(gi,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(b){["ArrowLeft","ArrowRight"].includes(b.key)&&(b.preventDefault(),b.stopPropagation(),o.handleTravellerMoveKeyboard(b.key==="ArrowRight"?1:-1,i))},onFocus:function(){o.setState({isTravellerFocused:!0})},onBlur:function(){o.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(A,v))}},{key:"renderSlide",value:function(r,i){var s=this.props,a=s.y,o=s.height,c=s.stroke,u=s.travellerWidth,d=Math.min(r,i)+u,h=Math.max(Math.abs(i-r)-u,0);return re.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:a,width:h,height:o})}},{key:"renderText",value:function(){var r=this.props,i=r.startIndex,s=r.endIndex,a=r.y,o=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,h=d.startX,A=d.endX,f=5,p={pointerEvents:"none",fill:u};return re.createElement(gi,{className:"recharts-brush-texts"},re.createElement(GB,vN({textAnchor:"end",verticalAnchor:"middle",x:Math.min(h,A)-f,y:a+o/2},p),this.getTextOfTick(i)),re.createElement(GB,vN({textAnchor:"start",verticalAnchor:"middle",x:Math.max(h,A)+c+f,y:a+o/2},p),this.getTextOfTick(s)))}},{key:"render",value:function(){var r=this.props,i=r.data,s=r.className,a=r.children,o=r.x,c=r.y,u=r.width,d=r.height,h=r.alwaysShowText,A=this.state,f=A.startX,p=A.endX,m=A.isTextActive,g=A.isSlideMoving,y=A.isTravellerMoving,v=A.isTravellerFocused;if(!i||!i.length||!Ze(o)||!Ze(c)||!Ze(u)||!Ze(d)||u<=0||d<=0)return null;var x=Pn("recharts-brush",s),w=re.Children.count(a)===1,b=Fvt("userSelect","none");return re.createElement(gi,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),w&&this.renderPanorama(),this.renderSlide(f,p),this.renderTravellerLayer(f,"startX"),this.renderTravellerLayer(p,"endX"),(m||g||y||v||h)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var i=r.x,s=r.y,a=r.width,o=r.height,c=r.stroke,u=Math.floor(s+o/2)-1;return re.createElement(re.Fragment,null,re.createElement("rect",{x:i,y:s,width:a,height:o,fill:c,stroke:"none"}),re.createElement("line",{x1:i+1,y1:u,x2:i+a-1,y2:u,fill:"none",stroke:"#fff"}),re.createElement("line",{x1:i+1,y1:u+2,x2:i+a-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,i){var s;return re.isValidElement(r)?s=re.cloneElement(r,i):gn(r)?s=r(i):s=t.renderDefaultTraveller(i),s}},{key:"getDerivedStateFromProps",value:function(r,i){var s=r.data,a=r.width,o=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,h=r.endIndex;if(s!==i.prevData||u!==i.prevUpdateId)return D4({prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:o,prevWidth:a},s&&s.length?$vt({data:s,width:a,x:o,travellerWidth:c,startIndex:d,endIndex:h}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||o!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([o,o+a-c]);var A=i.scale.domain().map(function(f){return i.scale(f)});return{prevData:s,prevTravellerWidth:c,prevUpdateId:u,prevX:o,prevWidth:a,startX:i.scale(r.startIndex),endX:i.scale(r.endIndex),scaleValues:A}}return null}},{key:"getIndexInRange",value:function(r,i){for(var s=r.length,a=0,o=s-1;o-a>1;){var c=Math.floor((a+o)/2);r[c]>i?o=c:a=c}return i>=r[o]?o:a}}])}(C.PureComponent);wo(Fv,"displayName","Brush");wo(Fv,"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 zvt=wQ;function Vvt(e,t){var n;return zvt(e,function(r,i,s){return n=t(r,i,s),!n}),!!n}var Kvt=Vvt,qvt=Ape,Wvt=iA,Gvt=Kvt,Yvt=so,Xvt=V5;function Jvt(e,t,n){var r=Yvt(e)?qvt:Gvt;return n&&Xvt(e,t,n)&&(t=void 0),r(e,Wvt(t))}var Zvt=Jvt;const e0t=In(Zvt);var ou=function(t,n){var r=t.alwaysShow,i=t.ifOverflow;return r&&(i="extendDomain"),i===n},fX=Mpe;function t0t(e,t,n){t=="__proto__"&&fX?fX(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var n0t=t0t,r0t=n0t,i0t=Ope,s0t=iA;function a0t(e,t){var n={};return t=s0t(t),i0t(e,function(r,i,s){r0t(n,i,t(r,i,s))}),n}var o0t=a0t;const l0t=In(o0t);function c0t(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var u0t=c0t,d0t=wQ;function h0t(e,t){var n=!0;return d0t(e,function(r,i,s){return n=!!t(r,i,s),n}),n}var f0t=h0t,A0t=u0t,p0t=f0t,m0t=iA,g0t=so,y0t=V5;function v0t(e,t,n){var r=g0t(e)?A0t:p0t;return n&&y0t(e,t,n)&&(t=void 0),r(e,m0t(t))}var x0t=v0t;const fge=In(x0t);var w0t=["x","y"];function q1(e){"@babel/helpers - typeof";return q1=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},q1(e)}function JL(){return JL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},JL.apply(this,arguments)}function AX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Dx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AX(Object(n),!0).forEach(function(r){b0t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function b0t(e,t,n){return t=C0t(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C0t(e){var t=S0t(e,"string");return q1(t)=="symbol"?t:t+""}function S0t(e,t){if(q1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(q1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function k0t(e,t){if(e==null)return{};var n=_0t(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _0t(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function j0t(e,t){var n=e.x,r=e.y,i=k0t(e,w0t),s="".concat(n),a=parseInt(s,10),o="".concat(r),c=parseInt(o,10),u="".concat(t.height||i.height),d=parseInt(u,10),h="".concat(t.width||i.width),A=parseInt(h,10);return Dx(Dx(Dx(Dx(Dx({},t),i),a?{x:a}:{}),c?{y:c}:{}),{},{height:d,width:A,name:t.name,radius:t.radius})}function pX(e){return re.createElement(uvt,JL({shapeType:"rectangle",propTransformer:j0t,activeClassName:"recharts-active-bar"},e))}var B0t=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,i){if(typeof t=="number")return t;var s=typeof r=="number";return s?t(r,i):(s||om(),n)}},N0t=["value","background"],Age;function Mv(e){"@babel/helpers - typeof";return Mv=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},Mv(e)}function E0t(e,t){if(e==null)return{};var n=T0t(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function T0t(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function wN(){return wN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wN.apply(this,arguments)}function mX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Si(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mX(Object(n),!0).forEach(function(r){qh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function P0t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mge(r.key),r)}}function I0t(e,t,n){return t&&gX(e.prototype,t),n&&gX(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function O0t(e,t,n){return t=bN(t),F0t(e,pge()?Reflect.construct(t,n||[],bN(e).constructor):t.apply(e,n))}function F0t(e,t){if(t&&(Mv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return M0t(e)}function M0t(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(pge=function(){return!!e})()}function bN(e){return bN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},bN(e)}function L0t(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&&ZL(e,t)}function ZL(e,t){return ZL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},ZL(e,t)}function qh(e,t,n){return t=mge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mge(e){var t=R0t(e,"string");return Mv(t)=="symbol"?t:t+""}function R0t(e,t){if(Mv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Mv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _m=function(e){function t(){var n;P0t(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=O0t(this,t,[].concat(i)),qh(n,"state",{isAnimationFinished:!1}),qh(n,"id",G2("recharts-bar-")),qh(n,"handleAnimationEnd",function(){var a=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),a&&a()}),qh(n,"handleAnimationStart",function(){var a=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),a&&a()}),n}return L0t(t,e),I0t(t,[{key:"renderRectanglesStatically",value:function(r){var i=this,s=this.props,a=s.shape,o=s.dataKey,c=s.activeIndex,u=s.activeBar,d=jn(this.props,!1);return r&&r.map(function(h,A){var f=A===c,p=f?u:a,m=Si(Si(Si({},d),h),{},{isActive:f,option:p,index:A,dataKey:o,onAnimationStart:i.handleAnimationStart,onAnimationEnd:i.handleAnimationEnd});return re.createElement(gi,wN({className:"recharts-bar-rectangle"},FB(i.props,h,A),{key:"rectangle-".concat(h==null?void 0:h.x,"-").concat(h==null?void 0:h.y,"-").concat(h==null?void 0:h.value)}),re.createElement(pX,m))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,i=this.props,s=i.data,a=i.layout,o=i.isAnimationActive,c=i.animationBegin,u=i.animationDuration,d=i.animationEasing,h=i.animationId,A=this.state.prevData;return re.createElement(kd,{begin:c,duration:u,isActive:o,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(f){var p=f.t,m=s.map(function(g,y){var v=A&&A[y];if(v){var x=ic(v.x,g.x),w=ic(v.y,g.y),b=ic(v.width,g.width),k=ic(v.height,g.height);return Si(Si({},g),{},{x:x(p),y:w(p),width:b(p),height:k(p)})}if(a==="horizontal"){var j=ic(0,g.height),B=j(p);return Si(Si({},g),{},{y:g.y+g.height-B,height:B})}var E=ic(0,g.width),I=E(p);return Si(Si({},g),{},{width:I})});return re.createElement(gi,null,r.renderRectanglesStatically(m))})}},{key:"renderRectangles",value:function(){var r=this.props,i=r.data,s=r.isAnimationActive,a=this.state.prevData;return s&&i&&i.length&&(!a||!eT(a,i))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(i)}},{key:"renderBackground",value:function(){var r=this,i=this.props,s=i.data,a=i.dataKey,o=i.activeIndex,c=jn(this.props.background,!1);return s.map(function(u,d){u.value;var h=u.background,A=E0t(u,N0t);if(!h)return null;var f=Si(Si(Si(Si(Si({},A),{},{fill:"#eee"},h),c),FB(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:a,index:d,className:"recharts-bar-background-rectangle"});return re.createElement(pX,wN({key:"background-bar-".concat(d),option:r.props.background,isActive:d===o},f))})}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,a=s.data,o=s.xAxis,c=s.yAxis,u=s.layout,d=s.children,h=Sl(d,tC);if(!h)return null;var A=u==="vertical"?a[0].height/2:a[0].width/2,f=function(g,y){var v=Array.isArray(g.value)?g.value[1]:g.value;return{x:g.x,y:g.y,value:v,errorVal:Do(g,y)}},p={clipPath:r?"url(#clipPath-".concat(i,")"):null};return re.createElement(gi,p,h.map(function(m){return re.cloneElement(m,{key:"error-bar-".concat(i,"-").concat(m.props.dataKey),data:a,xAxis:o,yAxis:c,layout:u,offset:A,dataPointFormatter:f})}))}},{key:"render",value:function(){var r=this.props,i=r.hide,s=r.data,a=r.className,o=r.xAxis,c=r.yAxis,u=r.left,d=r.top,h=r.width,A=r.height,f=r.isAnimationActive,p=r.background,m=r.id;if(i||!s||!s.length)return null;var g=this.state.isAnimationFinished,y=Pn("recharts-bar",a),v=o&&o.allowDataOverflow,x=c&&c.allowDataOverflow,w=v||x,b=Cn(m)?this.id:m;return re.createElement(gi,{className:y},v||x?re.createElement("defs",null,re.createElement("clipPath",{id:"clipPath-".concat(b)},re.createElement("rect",{x:v?u:u-h/2,y:x?d:d-A/2,width:v?h:h*2,height:x?A:A*2}))):null,re.createElement(gi,{className:"recharts-bar-rectangles",clipPath:w?"url(#clipPath-".concat(b,")"):null},p?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(w,b),(!f||g)&&yf.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:i.curData}:r.data!==i.curData?{curData:r.data}:null}}])}(C.PureComponent);Age=_m;qh(_m,"displayName","Bar");qh(_m,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!ud.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});qh(_m,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,s=e.xAxis,a=e.yAxis,o=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,h=e.displayedData,A=e.offset,f=Gpt(r,n);if(!f)return null;var p=t.layout,m=n.type.defaultProps,g=m!==void 0?Si(Si({},m),n.props):n.props,y=g.dataKey,v=g.children,x=g.minPointSize,w=p==="horizontal"?a:s,b=u?w.scale.domain():null,k=rmt({numericAxis:w}),j=Sl(v,$pe),B=h.map(function(E,I){var T,N,F,L,U,H;u?T=Ypt(u[d+I],b):(T=Do(E,y),Array.isArray(T)||(T=[k,T]));var K=B0t(x,Age.defaultProps.minPointSize)(T[1],I);if(p==="horizontal"){var $,z=[a.scale(T[0]),a.scale(T[1])],Q=z[0],oe=z[1];N=SY({axis:s,ticks:o,bandSize:i,offset:f.offset,entry:E,index:I}),F=($=oe??Q)!==null&&$!==void 0?$:void 0,L=f.size;var R=Q-oe;if(U=Number.isNaN(R)?0:R,H={x:N,y:a.y,width:L,height:a.height},Math.abs(K)>0&&Math.abs(U)<Math.abs(K)){var M=cc(U||K)*(Math.abs(K)-Math.abs(U));F-=M,U+=M}}else{var Y=[s.scale(T[0]),s.scale(T[1])],X=Y[0],q=Y[1];if(N=X,F=SY({axis:a,ticks:c,bandSize:i,offset:f.offset,entry:E,index:I}),L=q-X,U=f.size,H={x:s.x,y:F,width:s.width,height:U},Math.abs(K)>0&&Math.abs(L)<Math.abs(K)){var Z=cc(L||K)*(Math.abs(K)-Math.abs(L));L+=Z}}return Si(Si(Si({},E),{},{x:N,y:F,width:L,height:U,value:u?T:T[1],payload:E,background:H},j&&j[I]&&j[I].props),{},{tooltipPayload:[Gme(n,E)],tooltipPosition:{x:N+L/2,y:F+U/2}})});return Si({data:B,layout:p},A)});function W1(e){"@babel/helpers - typeof";return W1=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},W1(e)}function D0t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,gge(r.key),r)}}function U0t(e,t,n){return t&&yX(e.prototype,t),n&&yX(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function vX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vX(Object(n),!0).forEach(function(r){sT(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sT(e,t,n){return t=gge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gge(e){var t=H0t(e,"string");return W1(t)=="symbol"?t:t+""}function H0t(e,t){if(W1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(W1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yge=function(t,n,r,i,s){var a=t.width,o=t.height,c=t.layout,u=t.children,d=Object.keys(n),h={left:r.left,leftMirror:r.left,right:a-r.right,rightMirror:a-r.right,top:r.top,topMirror:r.top,bottom:o-r.bottom,bottomMirror:o-r.bottom},A=!!So(u,_m);return d.reduce(function(f,p){var m=n[p],g=m.orientation,y=m.domain,v=m.padding,x=v===void 0?{}:v,w=m.mirror,b=m.reversed,k="".concat(g).concat(w?"Mirror":""),j,B,E,I,T;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var N=y[1]-y[0],F=1/0,L=m.categoricalDomain.sort();if(L.forEach(function(Y,X){X>0&&(F=Math.min((Y||0)-(L[X-1]||0),F))}),Number.isFinite(F)){var U=F/N,H=m.layout==="vertical"?r.height:r.width;if(m.padding==="gap"&&(j=U*H/2),m.padding==="no-gap"){var K=sm(t.barCategoryGap,U*H),$=U*H/2;j=$-K-($-K)/H*K}}}i==="xAxis"?B=[r.left+(x.left||0)+(j||0),r.left+r.width-(x.right||0)-(j||0)]:i==="yAxis"?B=c==="horizontal"?[r.top+r.height-(x.bottom||0),r.top+(x.top||0)]:[r.top+(x.top||0)+(j||0),r.top+r.height-(x.bottom||0)-(j||0)]:B=m.range,b&&(B=[B[1],B[0]]);var z=qpt(m,s,A),Q=z.scale,oe=z.realScaleType;Q.domain(y).range(B),Wpt(Q);var R=nmt(Q,tc(tc({},m),{},{realScaleType:oe}));i==="xAxis"?(T=g==="top"&&!w||g==="bottom"&&w,E=r.left,I=h[k]-T*m.height):i==="yAxis"&&(T=g==="left"&&!w||g==="right"&&w,E=h[k]-T*m.width,I=r.top);var M=tc(tc(tc({},m),R),{},{realScaleType:oe,x:E,y:I,scale:Q,width:i==="xAxis"?r.width:m.width,height:i==="yAxis"?r.height:m.height});return M.bandSize=cN(M,R),!m.hide&&i==="xAxis"?h[k]+=(T?-1:1)*M.height:m.hide||(h[k]+=(T?-1:1)*M.width),tc(tc({},f),{},sT({},p,M))},{})},vge=function(t,n){var r=t.x,i=t.y,s=n.x,a=n.y;return{x:Math.min(r,s),y:Math.min(i,a),width:Math.abs(s-r),height:Math.abs(a-i)}},Q0t=function(t){var n=t.x1,r=t.y1,i=t.x2,s=t.y2;return vge({x:n,y:r},{x:i,y:s})},xge=function(){function e(t){D0t(this,e),this.scale=t}return U0t(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(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.bandAware,s=r.position;if(n!==void 0){if(s)switch(s){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var o=this.bandwidth?this.bandwidth():0;return this.scale(n)+o}default:return this.scale(n)}if(i){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),i=r[0],s=r[r.length-1];return i<=s?n>=i&&n<=s:n>=s&&n<=i}}],[{key:"create",value:function(n){return new e(n)}}])}();sT(xge,"EPS",1e-4);var JQ=function(t){var n=Object.keys(t).reduce(function(r,i){return tc(tc({},r),{},sT({},i,xge.create(t[i])))},{});return tc(tc({},n),{},{apply:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=s.bandAware,o=s.position;return l0t(i,function(c,u){return n[u].apply(c,{bandAware:a,position:o})})},isInRange:function(i){return fge(i,function(s,a){return n[a].isInRange(s)})}})};function $0t(e){return(e%180+180)%180}var z0t=function(t){var n=t.width,r=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=$0t(i),a=s*Math.PI/180,o=Math.atan(r/n),c=a>o&&a<Math.PI-o?r/Math.sin(a):n/Math.cos(a);return Math.abs(c)},V0t=iA,K0t=Y2,q0t=$5;function W0t(e){return function(t,n,r){var i=Object(t);if(!K0t(t)){var s=V0t(n);t=q0t(t),n=function(o){return s(i[o],o,i)}}var a=e(t,n,r);return a>-1?i[s?t[a]:a]:void 0}}var G0t=W0t,Y0t=cge;function X0t(e){var t=Y0t(e),n=t%1;return t===t?n?t-n:t:0}var J0t=X0t,Z0t=Bpe,ext=iA,txt=J0t,nxt=Math.max;function rxt(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:txt(n);return i<0&&(i=nxt(r+i,0)),Z0t(e,ext(t),i)}var ixt=rxt,sxt=G0t,axt=ixt,oxt=sxt(axt),lxt=oxt;const cxt=In(lxt);var uxt=EZe(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("")}),ZQ=C.createContext(void 0),e$=C.createContext(void 0),wge=C.createContext(void 0),bge=C.createContext({}),Cge=C.createContext(void 0),Sge=C.createContext(0),kge=C.createContext(0),xX=function(t){var n=t.state,r=n.xAxisMap,i=n.yAxisMap,s=n.offset,a=t.clipPathId,o=t.children,c=t.width,u=t.height,d=uxt(s);return re.createElement(ZQ.Provider,{value:r},re.createElement(e$.Provider,{value:i},re.createElement(bge.Provider,{value:s},re.createElement(wge.Provider,{value:d},re.createElement(Cge.Provider,{value:a},re.createElement(Sge.Provider,{value:u},re.createElement(kge.Provider,{value:c},o)))))))},dxt=function(){return C.useContext(Cge)},_ge=function(t){var n=C.useContext(ZQ);n==null&&om();var r=n[t];return r==null&&om(),r},hxt=function(){var t=C.useContext(ZQ);return jh(t)},fxt=function(){var t=C.useContext(e$),n=cxt(t,function(r){return fge(r.domain,Number.isFinite)});return n||jh(t)},jge=function(t){var n=C.useContext(e$);n==null&&om();var r=n[t];return r==null&&om(),r},Axt=function(){var t=C.useContext(wge);return t},pxt=function(){return C.useContext(bge)},t$=function(){return C.useContext(kge)},n$=function(){return C.useContext(Sge)};function Lv(e){"@babel/helpers - typeof";return Lv=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},Lv(e)}function mxt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gxt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Nge(r.key),r)}}function yxt(e,t,n){return t&&gxt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function vxt(e,t,n){return t=CN(t),xxt(e,Bge()?Reflect.construct(t,n||[],CN(e).constructor):t.apply(e,n))}function xxt(e,t){if(t&&(Lv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return wxt(e)}function wxt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Bge=function(){return!!e})()}function CN(e){return CN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},CN(e)}function bxt(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&&eR(e,t)}function eR(e,t){return eR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},eR(e,t)}function wX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wX(Object(n),!0).forEach(function(r){r$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function r$(e,t,n){return t=Nge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nge(e){var t=Cxt(e,"string");return Lv(t)=="symbol"?t:t+""}function Cxt(e,t){if(Lv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Lv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sxt(e,t){return Bxt(e)||jxt(e,t)||_xt(e,t)||kxt()}function kxt(){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 _xt(e,t){if(e){if(typeof e=="string")return CX(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return CX(e,t)}}function CX(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jxt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Bxt(e){if(Array.isArray(e))return e}function tR(){return tR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tR.apply(this,arguments)}var Nxt=function(t,n){var r;return re.isValidElement(t)?r=re.cloneElement(t,n):gn(t)?r=t(n):r=re.createElement("line",tR({},n,{className:"recharts-reference-line-line"})),r},Ext=function(t,n,r,i,s,a,o,c,u){var d=s.x,h=s.y,A=s.width,f=s.height;if(r){var p=u.y,m=t.y.apply(p,{position:a});if(ou(u,"discard")&&!t.y.isInRange(m))return null;var g=[{x:d+A,y:m},{x:d,y:m}];return c==="left"?g.reverse():g}if(n){var y=u.x,v=t.x.apply(y,{position:a});if(ou(u,"discard")&&!t.x.isInRange(v))return null;var x=[{x:v,y:h+f},{x:v,y:h}];return o==="top"?x.reverse():x}if(i){var w=u.segment,b=w.map(function(k){return t.apply(k,{position:a})});return ou(u,"discard")&&e0t(b,function(k){return!t.isInRange(k)})?null:b}return null};function Txt(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,s=e.yAxisId,a=e.shape,o=e.className,c=e.alwaysShow,u=dxt(),d=_ge(i),h=jge(s),A=Axt();if(!u||!A)return null;cd(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=JQ({x:d.scale,y:h.scale}),p=Ki(t),m=Ki(n),g=r&&r.length===2,y=Ext(f,p,m,g,A,e.position,d.orientation,h.orientation,e);if(!y)return null;var v=Sxt(y,2),x=v[0],w=x.x,b=x.y,k=v[1],j=k.x,B=k.y,E=ou(e,"hidden")?"url(#".concat(u,")"):void 0,I=bX(bX({clipPath:E},jn(e,!0)),{},{x1:w,y1:b,x2:j,y2:B});return re.createElement(gi,{className:Pn("recharts-reference-line",o)},Nxt(a,I),Xs.renderCallByParent(e,Q0t({x1:w,y1:b,x2:j,y2:B})))}var i$=function(e){function t(){return mxt(this,t),vxt(this,t,arguments)}return bxt(t,e),yxt(t,[{key:"render",value:function(){return re.createElement(Txt,this.props)}}])}(re.Component);r$(i$,"displayName","ReferenceLine");r$(i$,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function nR(){return nR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nR.apply(this,arguments)}function Rv(e){"@babel/helpers - typeof";return Rv=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},Rv(e)}function SX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SX(Object(n),!0).forEach(function(r){aT(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pxt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ixt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Tge(r.key),r)}}function Oxt(e,t,n){return t&&Ixt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fxt(e,t,n){return t=SN(t),Mxt(e,Ege()?Reflect.construct(t,n||[],SN(e).constructor):t.apply(e,n))}function Mxt(e,t){if(t&&(Rv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Lxt(e)}function Lxt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ege(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ege=function(){return!!e})()}function SN(e){return SN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},SN(e)}function Rxt(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&&rR(e,t)}function rR(e,t){return rR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},rR(e,t)}function aT(e,t,n){return t=Tge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tge(e){var t=Dxt(e,"string");return Rv(t)=="symbol"?t:t+""}function Dxt(e,t){if(Rv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Rv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Uxt=function(t){var n=t.x,r=t.y,i=t.xAxis,s=t.yAxis,a=JQ({x:i.scale,y:s.scale}),o=a.apply({x:n,y:r},{bandAware:!0});return ou(t,"discard")&&!a.isInRange(o)?null:o},oT=function(e){function t(){return Pxt(this,t),Fxt(this,t,arguments)}return Rxt(t,e),Oxt(t,[{key:"render",value:function(){var r=this.props,i=r.x,s=r.y,a=r.r,o=r.alwaysShow,c=r.clipPathId,u=Ki(i),d=Ki(s);if(cd(o===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var h=Uxt(this.props);if(!h)return null;var A=h.x,f=h.y,p=this.props,m=p.shape,g=p.className,y=ou(this.props,"hidden")?"url(#".concat(c,")"):void 0,v=kX(kX({clipPath:y},jn(this.props,!0)),{},{cx:A,cy:f});return re.createElement(gi,{className:Pn("recharts-reference-dot",g)},t.renderDot(m,v),Xs.renderCallByParent(this.props,{x:A-a,y:f-a,width:2*a,height:2*a}))}}])}(re.Component);aT(oT,"displayName","ReferenceDot");aT(oT,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});aT(oT,"renderDot",function(e,t){var n;return re.isValidElement(e)?n=re.cloneElement(e,t):gn(e)?n=e(t):n=re.createElement(XQ,nR({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function iR(){return iR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iR.apply(this,arguments)}function Dv(e){"@babel/helpers - typeof";return Dv=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},Dv(e)}function _X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_X(Object(n),!0).forEach(function(r){lT(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_X(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hxt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qxt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ige(r.key),r)}}function $xt(e,t,n){return t&&Qxt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zxt(e,t,n){return t=kN(t),Vxt(e,Pge()?Reflect.construct(t,n||[],kN(e).constructor):t.apply(e,n))}function Vxt(e,t){if(t&&(Dv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kxt(e)}function Kxt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Pge=function(){return!!e})()}function kN(e){return kN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},kN(e)}function qxt(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&&sR(e,t)}function sR(e,t){return sR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},sR(e,t)}function lT(e,t,n){return t=Ige(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ige(e){var t=Wxt(e,"string");return Dv(t)=="symbol"?t:t+""}function Wxt(e,t){if(Dv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Dv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gxt=function(t,n,r,i,s){var a=s.x1,o=s.x2,c=s.y1,u=s.y2,d=s.xAxis,h=s.yAxis;if(!d||!h)return null;var A=JQ({x:d.scale,y:h.scale}),f={x:t?A.x.apply(a,{position:"start"}):A.x.rangeMin,y:r?A.y.apply(c,{position:"start"}):A.y.rangeMin},p={x:n?A.x.apply(o,{position:"end"}):A.x.rangeMax,y:i?A.y.apply(u,{position:"end"}):A.y.rangeMax};return ou(s,"discard")&&(!A.isInRange(f)||!A.isInRange(p))?null:vge(f,p)},cT=function(e){function t(){return Hxt(this,t),zxt(this,t,arguments)}return qxt(t,e),$xt(t,[{key:"render",value:function(){var r=this.props,i=r.x1,s=r.x2,a=r.y1,o=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;cd(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=Ki(i),A=Ki(s),f=Ki(a),p=Ki(o),m=this.props.shape;if(!h&&!A&&!f&&!p&&!m)return null;var g=Gxt(h,A,f,p,this.props);if(!g&&!m)return null;var y=ou(this.props,"hidden")?"url(#".concat(d,")"):void 0;return re.createElement(gi,{className:Pn("recharts-reference-area",c)},t.renderRect(m,jX(jX({clipPath:y},jn(this.props,!0)),g)),Xs.renderCallByParent(this.props,g))}}])}(re.Component);lT(cT,"displayName","ReferenceArea");lT(cT,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});lT(cT,"renderRect",function(e,t){var n;return re.isValidElement(e)?n=re.cloneElement(e,t):gn(e)?n=e(t):n=re.createElement(YQ,iR({},t,{className:"recharts-reference-area-rect"})),n});function Oge(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)r.push(e[i]);return r}function Yxt(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return z0t(r,n)}function Xxt(e,t,n){var r=n==="width",i=e.x,s=e.y,a=e.width,o=e.height;return t===1?{start:r?i:s,end:r?i+a:s+o}:{start:r?i+a:s+o,end:r?i:s}}function _N(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var s=n();return e*(t-e*s/2-r)>=0&&e*(t+e*s/2-i)<=0}function Jxt(e,t){return Oge(e,t+1)}function Zxt(e,t,n,r,i){for(var s=(r||[]).slice(),a=t.start,o=t.end,c=0,u=1,d=a,h=function(){var p=r==null?void 0:r[c];if(p===void 0)return{v:Oge(r,u)};var m=c,g,y=function(){return g===void 0&&(g=n(p,m)),g},v=p.coordinate,x=c===0||_N(e,v,y,d,o);x||(c=0,d=a,u+=1),x&&(d=v+e*(y()/2+i),c+=u)},A;u<=s.length;)if(A=h(),A)return A.v;return[]}function G1(e){"@babel/helpers - typeof";return G1=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},G1(e)}function BX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ws(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BX(Object(n),!0).forEach(function(r){ewt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ewt(e,t,n){return t=twt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function twt(e){var t=nwt(e,"string");return G1(t)=="symbol"?t:t+""}function nwt(e,t){if(G1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(G1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rwt(e,t,n,r,i){for(var s=(r||[]).slice(),a=s.length,o=t.start,c=t.end,u=function(A){var f=s[A],p,m=function(){return p===void 0&&(p=n(f,A)),p};if(A===a-1){var g=e*(f.coordinate+e*m()/2-c);s[A]=f=Ws(Ws({},f),{},{tickCoord:g>0?f.coordinate-g*e:f.coordinate})}else s[A]=f=Ws(Ws({},f),{},{tickCoord:f.coordinate});var y=_N(e,f.tickCoord,m,o,c);y&&(c=f.tickCoord-e*(m()/2+i),s[A]=Ws(Ws({},f),{},{isShow:!0}))},d=a-1;d>=0;d--)u(d);return s}function iwt(e,t,n,r,i,s){var a=(r||[]).slice(),o=a.length,c=t.start,u=t.end;if(s){var d=r[o-1],h=n(d,o-1),A=e*(d.coordinate+e*h/2-u);a[o-1]=d=Ws(Ws({},d),{},{tickCoord:A>0?d.coordinate-A*e:d.coordinate});var f=_N(e,d.tickCoord,function(){return h},c,u);f&&(u=d.tickCoord-e*(h/2+i),a[o-1]=Ws(Ws({},d),{},{isShow:!0}))}for(var p=s?o-1:o,m=function(v){var x=a[v],w,b=function(){return w===void 0&&(w=n(x,v)),w};if(v===0){var k=e*(x.coordinate-e*b()/2-c);a[v]=x=Ws(Ws({},x),{},{tickCoord:k<0?x.coordinate-k*e:x.coordinate})}else a[v]=x=Ws(Ws({},x),{},{tickCoord:x.coordinate});var j=_N(e,x.tickCoord,b,c,u);j&&(c=x.tickCoord+e*(b()/2+i),a[v]=Ws(Ws({},x),{},{isShow:!0}))},g=0;g<p;g++)m(g);return a}function s$(e,t,n){var r=e.tick,i=e.ticks,s=e.viewBox,a=e.minTickGap,o=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,h=e.angle;if(!i||!i.length||!r)return[];if(Ze(c)||ud.isSsr)return Jxt(i,typeof c=="number"&&Ze(c)?c:0);var A=[],f=o==="top"||o==="bottom"?"width":"height",p=d&&f==="width"?eb(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},m=function(x,w){var b=gn(u)?u(x.value,w):x.value;return f==="width"?Yxt(eb(b,{fontSize:t,letterSpacing:n}),p,h):eb(b,{fontSize:t,letterSpacing:n})[f]},g=i.length>=2?cc(i[1].coordinate-i[0].coordinate):1,y=Xxt(s,g,f);return c==="equidistantPreserveStart"?Zxt(g,y,m,i,a):(c==="preserveStart"||c==="preserveStartEnd"?A=iwt(g,y,m,i,a,c==="preserveStartEnd"):A=rwt(g,y,m,i,a),A.filter(function(v){return v.isShow}))}var swt=["viewBox"],awt=["viewBox"],owt=["ticks"];function Uv(e){"@babel/helpers - typeof";return Uv=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},Uv(e)}function ly(){return ly=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ly.apply(this,arguments)}function NX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ha(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NX(Object(n),!0).forEach(function(r){a$(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function U4(e,t){if(e==null)return{};var n=lwt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function lwt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function cwt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Mge(r.key),r)}}function uwt(e,t,n){return t&&EX(e.prototype,t),n&&EX(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function dwt(e,t,n){return t=jN(t),hwt(e,Fge()?Reflect.construct(t,n||[],jN(e).constructor):t.apply(e,n))}function hwt(e,t){if(t&&(Uv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fwt(e)}function fwt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Fge=function(){return!!e})()}function jN(e){return jN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},jN(e)}function Awt(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&&aR(e,t)}function aR(e,t){return aR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},aR(e,t)}function a$(e,t,n){return t=Mge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mge(e){var t=pwt(e,"string");return Uv(t)=="symbol"?t:t+""}function pwt(e,t){if(Uv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Uv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var E0=function(e){function t(n){var r;return cwt(this,t),r=dwt(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Awt(t,e),uwt(t,[{key:"shouldComponentUpdate",value:function(r,i){var s=r.viewBox,a=U4(r,swt),o=this.props,c=o.viewBox,u=U4(o,awt);return!Iy(s,c)||!Iy(a,u)||!Iy(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,s=i.x,a=i.y,o=i.width,c=i.height,u=i.orientation,d=i.tickSize,h=i.mirror,A=i.tickMargin,f,p,m,g,y,v,x=h?-1:1,w=r.tickSize||d,b=Ze(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":f=p=r.coordinate,g=a+ +!h*c,m=g-x*w,v=m-x*A,y=b;break;case"left":m=g=r.coordinate,p=s+ +!h*o,f=p-x*w,y=f-x*A,v=b;break;case"right":m=g=r.coordinate,p=s+ +h*o,f=p+x*w,y=f+x*A,v=b;break;default:f=p=r.coordinate,g=a+ +h*c,m=g+x*w,v=m+x*A,y=b;break}return{line:{x1:f,y1:m,x2:p,y2:g},tick:{x:y,y:v}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,s=r.mirror,a;switch(i){case"left":a=s?"start":"end";break;case"right":a=s?"end":"start";break;default:a="middle";break}return a}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,s=r.mirror,a="end";switch(i){case"left":case"right":a="middle";break;case"top":a=s?"start":"end";break;default:a=s?"end":"start";break}return a}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,s=r.y,a=r.width,o=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,h=ha(ha(ha({},jn(this.props,!1)),jn(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var A=+(c==="top"&&!u||c==="bottom"&&u);h=ha(ha({},h),{},{x1:i,y1:s+A*o,x2:i+a,y2:s+A*o})}else{var f=+(c==="left"&&!u||c==="right"&&u);h=ha(ha({},h),{},{x1:i+f*a,y1:s,x2:i+f*a,y2:s+o})}return re.createElement("line",ly({},h,{className:Pn("recharts-cartesian-axis-line",Cl(d,"className"))}))}},{key:"renderTicks",value:function(r,i,s){var a=this,o=this.props,c=o.tickLine,u=o.stroke,d=o.tick,h=o.tickFormatter,A=o.unit,f=s$(ha(ha({},this.props),{},{ticks:r}),i,s),p=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),g=jn(this.props,!1),y=jn(d,!1),v=ha(ha({},g),{},{fill:"none"},jn(c,!1)),x=f.map(function(w,b){var k=a.getTickLineCoord(w),j=k.line,B=k.tick,E=ha(ha(ha(ha({textAnchor:p,verticalAnchor:m},g),{},{stroke:"none",fill:u},y),B),{},{index:b,payload:w,visibleTicksCount:f.length,tickFormatter:h});return re.createElement(gi,ly({className:"recharts-cartesian-axis-tick",key:"tick-".concat(w.value,"-").concat(w.coordinate,"-").concat(w.tickCoord)},FB(a.props,w,b)),c&&re.createElement("line",ly({},v,j,{className:Pn("recharts-cartesian-axis-tick-line",Cl(c,"className"))})),d&&t.renderTickItem(d,E,"".concat(gn(h)?h(w.value,b):w.value).concat(A||"")))});return re.createElement("g",{className:"recharts-cartesian-axis-ticks"},x)}},{key:"render",value:function(){var r=this,i=this.props,s=i.axisLine,a=i.width,o=i.height,c=i.ticksGenerator,u=i.className,d=i.hide;if(d)return null;var h=this.props,A=h.ticks,f=U4(h,owt),p=A;return gn(c)&&(p=A&&A.length>0?c(this.props):c(f)),a<=0||o<=0||!p||!p.length?null:re.createElement(gi,{className:Pn("recharts-cartesian-axis",u),ref:function(g){r.layerReference=g}},s&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),Xs.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,s){var a;return re.isValidElement(r)?a=re.cloneElement(r,i):gn(r)?a=r(i):a=re.createElement(GB,ly({},i,{className:"recharts-cartesian-axis-tick-value"}),s),a}}])}(C.Component);a$(E0,"displayName","CartesianAxis");a$(E0,"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 mwt=["x1","y1","x2","y2","key"],gwt=["offset"];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 TX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Js(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TX(Object(n),!0).forEach(function(r){ywt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ywt(e,t,n){return t=vwt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vwt(e){var t=xwt(e,"string");return lm(t)=="symbol"?t:t+""}function xwt(e,t){if(lm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(lm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function op(){return op=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},op.apply(this,arguments)}function PX(e,t){if(e==null)return{};var n=wwt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wwt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var bwt=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,s=t.y,a=t.width,o=t.height,c=t.ry;return re.createElement("rect",{x:i,y:s,ry:c,width:a,height:o,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Lge(e,t){var n;if(re.isValidElement(e))n=re.cloneElement(e,t);else if(gn(e))n=e(t);else{var r=t.x1,i=t.y1,s=t.x2,a=t.y2,o=t.key,c=PX(t,mwt),u=jn(c,!1);u.offset;var d=PX(u,gwt);n=re.createElement("line",op({},d,{x1:r,y1:i,x2:s,y2:a,fill:"none",key:o}))}return n}function Cwt(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,s=e.horizontalPoints;if(!i||!s||!s.length)return null;var a=s.map(function(o,c){var u=Js(Js({},e),{},{x1:t,y1:o,x2:t+n,y2:o,key:"line-".concat(c),index:c});return Lge(i,u)});return re.createElement("g",{className:"recharts-cartesian-grid-horizontal"},a)}function Swt(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,s=e.verticalPoints;if(!i||!s||!s.length)return null;var a=s.map(function(o,c){var u=Js(Js({},e),{},{x1:o,y1:t,x2:o,y2:t+n,key:"line-".concat(c),index:c});return Lge(i,u)});return re.createElement("g",{className:"recharts-cartesian-grid-vertical"},a)}function kwt(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,s=e.width,a=e.height,o=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=o.map(function(A){return Math.round(A+i-i)}).sort(function(A,f){return A-f});i!==d[0]&&d.unshift(0);var h=d.map(function(A,f){var p=!d[f+1],m=p?i+a-A:d[f+1]-A;if(m<=0)return null;var g=f%t.length;return re.createElement("rect",{key:"react-".concat(f),y:A,x:r,height:m,width:s,stroke:"none",fill:t[g],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return re.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},h)}function _wt(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,s=e.x,a=e.y,o=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(A){return Math.round(A+s-s)}).sort(function(A,f){return A-f});s!==d[0]&&d.unshift(0);var h=d.map(function(A,f){var p=!d[f+1],m=p?s+o-A:d[f+1]-A;if(m<=0)return null;var g=f%r.length;return re.createElement("rect",{key:"react-".concat(f),x:A,y:a,width:m,height:c,stroke:"none",fill:r[g],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return re.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},h)}var jwt=function(t,n){var r=t.xAxis,i=t.width,s=t.height,a=t.offset;return qme(s$(Js(Js(Js({},E0.defaultProps),r),{},{ticks:id(r,!0),viewBox:{x:0,y:0,width:i,height:s}})),a.left,a.left+a.width,n)},Bwt=function(t,n){var r=t.yAxis,i=t.width,s=t.height,a=t.offset;return qme(s$(Js(Js(Js({},E0.defaultProps),r),{},{ticks:id(r,!0),viewBox:{x:0,y:0,width:i,height:s}})),a.top,a.top+a.height,n)},gg={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function uT(e){var t,n,r,i,s,a,o=t$(),c=n$(),u=pxt(),d=Js(Js({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:gg.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:gg.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:gg.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:gg.horizontalFill,vertical:(s=e.vertical)!==null&&s!==void 0?s:gg.vertical,verticalFill:(a=e.verticalFill)!==null&&a!==void 0?a:gg.verticalFill,x:Ze(e.x)?e.x:u.left,y:Ze(e.y)?e.y:u.top,width:Ze(e.width)?e.width:u.width,height:Ze(e.height)?e.height:u.height}),h=d.x,A=d.y,f=d.width,p=d.height,m=d.syncWithTicks,g=d.horizontalValues,y=d.verticalValues,v=hxt(),x=fxt();if(!Ze(f)||f<=0||!Ze(p)||p<=0||!Ze(h)||h!==+h||!Ze(A)||A!==+A)return null;var w=d.verticalCoordinatesGenerator||jwt,b=d.horizontalCoordinatesGenerator||Bwt,k=d.horizontalPoints,j=d.verticalPoints;if((!k||!k.length)&&gn(b)){var B=g&&g.length,E=b({yAxis:x?Js(Js({},x),{},{ticks:B?g:x.ticks}):void 0,width:o,height:c,offset:u},B?!0:m);cd(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(lm(E),"]")),Array.isArray(E)&&(k=E)}if((!j||!j.length)&&gn(w)){var I=y&&y.length,T=w({xAxis:v?Js(Js({},v),{},{ticks:I?y:v.ticks}):void 0,width:o,height:c,offset:u},I?!0:m);cd(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(lm(T),"]")),Array.isArray(T)&&(j=T)}return re.createElement("g",{className:"recharts-cartesian-grid"},re.createElement(bwt,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),re.createElement(Cwt,op({},d,{offset:u,horizontalPoints:k,xAxis:v,yAxis:x})),re.createElement(Swt,op({},d,{offset:u,verticalPoints:j,xAxis:v,yAxis:x})),re.createElement(kwt,op({},d,{horizontalPoints:k})),re.createElement(_wt,op({},d,{verticalPoints:j})))}uT.displayName="CartesianGrid";var Nwt=["type","layout","connectNulls","ref"],Ewt=["key"];function Hv(e){"@babel/helpers - typeof";return Hv=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},Hv(e)}function IX(e,t){if(e==null)return{};var n=Twt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Twt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ib(){return ib=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ib.apply(this,arguments)}function OX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OX(Object(n),!0).forEach(function(r){nc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yg(e){return Fwt(e)||Owt(e)||Iwt(e)||Pwt()}function Pwt(){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 Iwt(e,t){if(e){if(typeof e=="string")return oR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oR(e,t)}}function Owt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Fwt(e){if(Array.isArray(e))return oR(e)}function oR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Mwt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FX(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Dge(r.key),r)}}function Lwt(e,t,n){return t&&FX(e.prototype,t),n&&FX(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rwt(e,t,n){return t=BN(t),Dwt(e,Rge()?Reflect.construct(t,n||[],BN(e).constructor):t.apply(e,n))}function Dwt(e,t){if(t&&(Hv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Uwt(e)}function Uwt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Rge=function(){return!!e})()}function BN(e){return BN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},BN(e)}function Hwt(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&&lR(e,t)}function lR(e,t){return lR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},lR(e,t)}function nc(e,t,n){return t=Dge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dge(e){var t=Qwt(e,"string");return Hv(t)=="symbol"?t:t+""}function Qwt(e,t){if(Hv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Hv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var T0=function(e){function t(){var n;Mwt(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=Rwt(this,t,[].concat(i)),nc(n,"state",{isAnimationFinished:!0,totalLength:0}),nc(n,"generateSimpleStrokeDasharray",function(a,o){return"".concat(o,"px ").concat(a-o,"px")}),nc(n,"getStrokeDasharray",function(a,o,c){var u=c.reduce(function(y,v){return y+v});if(!u)return n.generateSimpleStrokeDasharray(o,a);for(var d=Math.floor(a/u),h=a%u,A=o-a,f=[],p=0,m=0;p<c.length;m+=c[p],++p)if(m+c[p]>h){f=[].concat(yg(c.slice(0,p)),[h-m]);break}var g=f.length%2===0?[0,A]:[A];return[].concat(yg(t.repeat(c,d)),yg(f),g).map(function(y){return"".concat(y,"px")}).join(", ")}),nc(n,"id",G2("recharts-line-")),nc(n,"pathRef",function(a){n.mainCurve=a}),nc(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),nc(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Hwt(t,e),Lwt(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var s=this.props,a=s.points,o=s.xAxis,c=s.yAxis,u=s.layout,d=s.children,h=Sl(d,tC);if(!h)return null;var A=function(m,g){return{x:m.x,y:m.y,value:m.value,errorVal:Do(m.payload,g)}},f={clipPath:r?"url(#clipPath-".concat(i,")"):null};return re.createElement(gi,f,h.map(function(p){return re.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:a,xAxis:o,yAxis:c,layout:u,dataPointFormatter:A})}))}},{key:"renderDots",value:function(r,i,s){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var o=this.props,c=o.dot,u=o.points,d=o.dataKey,h=jn(this.props,!1),A=jn(c,!0),f=u.map(function(m,g){var y=vo(vo(vo({key:"dot-".concat(g),r:3},h),A),{},{value:m.value,dataKey:d,cx:m.x,cy:m.y,index:g,payload:m.payload});return t.renderDotItem(c,y)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(s,")"):null};return re.createElement(gi,ib({className:"recharts-line-dots",key:"dots"},p),f)}},{key:"renderCurveStatically",value:function(r,i,s,a){var o=this.props,c=o.type,u=o.layout,d=o.connectNulls;o.ref;var h=IX(o,Nwt),A=vo(vo(vo({},jn(h,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(s,")"):null,points:r},a),{},{type:c,layout:u,connectNulls:d});return re.createElement(DL,ib({},A,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var s=this,a=this.props,o=a.points,c=a.strokeDasharray,u=a.isAnimationActive,d=a.animationBegin,h=a.animationDuration,A=a.animationEasing,f=a.animationId,p=a.animateNewValues,m=a.width,g=a.height,y=this.state,v=y.prevPoints,x=y.totalLength;return re.createElement(kd,{begin:d,duration:h,isActive:u,easing:A,from:{t:0},to:{t:1},key:"line-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(w){var b=w.t;if(v){var k=v.length/o.length,j=o.map(function(N,F){var L=Math.floor(F*k);if(v[L]){var U=v[L],H=ic(U.x,N.x),K=ic(U.y,N.y);return vo(vo({},N),{},{x:H(b),y:K(b)})}if(p){var $=ic(m*2,N.x),z=ic(g/2,N.y);return vo(vo({},N),{},{x:$(b),y:z(b)})}return vo(vo({},N),{},{x:N.x,y:N.y})});return s.renderCurveStatically(j,r,i)}var B=ic(0,x),E=B(b),I;if(c){var T="".concat(c).split(/[,\s]+/gim).map(function(N){return parseFloat(N)});I=s.getStrokeDasharray(E,x,T)}else I=s.generateSimpleStrokeDasharray(x,E);return s.renderCurveStatically(o,r,i,{strokeDasharray:I})})}},{key:"renderCurve",value:function(r,i){var s=this.props,a=s.points,o=s.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return o&&a&&a.length&&(!u&&d>0||!eT(u,a))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(a,r,i)}},{key:"render",value:function(){var r,i=this.props,s=i.hide,a=i.dot,o=i.points,c=i.className,u=i.xAxis,d=i.yAxis,h=i.top,A=i.left,f=i.width,p=i.height,m=i.isAnimationActive,g=i.id;if(s||!o||!o.length)return null;var y=this.state.isAnimationFinished,v=o.length===1,x=Pn("recharts-line",c),w=u&&u.allowDataOverflow,b=d&&d.allowDataOverflow,k=w||b,j=Cn(g)?this.id:g,B=(r=jn(a,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},E=B.r,I=E===void 0?3:E,T=B.strokeWidth,N=T===void 0?2:T,F=Ret(a)?a:{},L=F.clipDot,U=L===void 0?!0:L,H=I*2+N;return re.createElement(gi,{className:x},w||b?re.createElement("defs",null,re.createElement("clipPath",{id:"clipPath-".concat(j)},re.createElement("rect",{x:w?A:A-f/2,y:b?h:h-p/2,width:w?f:f*2,height:b?p:p*2})),!U&&re.createElement("clipPath",{id:"clipPath-dots-".concat(j)},re.createElement("rect",{x:A-H/2,y:h-H/2,width:f+H,height:p+H}))):null,!v&&this.renderCurve(k,j),this.renderErrorBar(k,j),(v||a)&&this.renderDots(k,U,j),(!m||y)&&yf.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var s=r.length%2!==0?[].concat(yg(r),[0]):r,a=[],o=0;o<i;++o)a=[].concat(yg(a),yg(s));return a}},{key:"renderDotItem",value:function(r,i){var s;if(re.isValidElement(r))s=re.cloneElement(r,i);else if(gn(r))s=r(i);else{var a=i.key,o=IX(i,Ewt),c=Pn("recharts-line-dot",typeof r!="boolean"?r.className:"");s=re.createElement(XQ,ib({key:a},o,{className:c}))}return s}}])}(C.PureComponent);nc(T0,"displayName","Line");nc(T0,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!ud.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});nc(T0,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,s=e.yAxisTicks,a=e.dataKey,o=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout,h=c.map(function(A,f){var p=Do(A,a);return d==="horizontal"?{x:CY({axis:n,ticks:i,bandSize:o,entry:A,index:f}),y:Cn(p)?null:r.scale(p),value:p,payload:A}:{x:Cn(p)?null:n.scale(p),y:CY({axis:r,ticks:s,bandSize:o,entry:A,index:f}),value:p,payload:A}});return vo({points:h,layout:d},u)});function Qv(e){"@babel/helpers - typeof";return Qv=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},Qv(e)}function $wt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zwt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Qge(r.key),r)}}function Vwt(e,t,n){return t&&zwt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kwt(e,t,n){return t=NN(t),qwt(e,Uge()?Reflect.construct(t,n||[],NN(e).constructor):t.apply(e,n))}function qwt(e,t){if(t&&(Qv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wwt(e)}function Wwt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Uge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Uge=function(){return!!e})()}function NN(e){return NN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},NN(e)}function Gwt(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&&cR(e,t)}function cR(e,t){return cR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},cR(e,t)}function Hge(e,t,n){return t=Qge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qge(e){var t=Ywt(e,"string");return Qv(t)=="symbol"?t:t+""}function Ywt(e,t){if(Qv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uR(){return uR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uR.apply(this,arguments)}function Xwt(e){var t=e.xAxisId,n=t$(),r=n$(),i=_ge(t);return i==null?null:re.createElement(E0,uR({},i,{className:Pn("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(a){return id(a,!0)}}))}var jm=function(e){function t(){return $wt(this,t),Kwt(this,t,arguments)}return Gwt(t,e),Vwt(t,[{key:"render",value:function(){return re.createElement(Xwt,this.props)}}])}(re.Component);Hge(jm,"displayName","XAxis");Hge(jm,"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 $v(e){"@babel/helpers - typeof";return $v=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},$v(e)}function Jwt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Zwt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Vge(r.key),r)}}function ebt(e,t,n){return t&&Zwt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function tbt(e,t,n){return t=EN(t),nbt(e,$ge()?Reflect.construct(t,n||[],EN(e).constructor):t.apply(e,n))}function nbt(e,t){if(t&&($v(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rbt(e)}function rbt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $ge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($ge=function(){return!!e})()}function EN(e){return EN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},EN(e)}function ibt(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&&dR(e,t)}function dR(e,t){return dR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},dR(e,t)}function zge(e,t,n){return t=Vge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vge(e){var t=sbt(e,"string");return $v(t)=="symbol"?t:t+""}function sbt(e,t){if($v(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($v(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hR(){return hR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hR.apply(this,arguments)}var abt=function(t){var n=t.yAxisId,r=t$(),i=n$(),s=jge(n);return s==null?null:re.createElement(E0,hR({},s,{className:Pn("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(o){return id(o,!0)}}))},Bm=function(e){function t(){return Jwt(this,t),tbt(this,t,arguments)}return ibt(t,e),ebt(t,[{key:"render",value:function(){return re.createElement(abt,this.props)}}])}(re.Component);zge(Bm,"displayName","YAxis");zge(Bm,"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 MX(e){return ubt(e)||cbt(e)||lbt(e)||obt()}function obt(){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 lbt(e,t){if(e){if(typeof e=="string")return fR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return fR(e,t)}}function cbt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ubt(e){if(Array.isArray(e))return fR(e)}function fR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var AR=function(t,n,r,i,s){var a=Sl(t,i$),o=Sl(t,oT),c=[].concat(MX(a),MX(o)),u=Sl(t,cT),d="".concat(i,"Id"),h=i[0],A=n;if(c.length&&(A=c.reduce(function(m,g){if(g.props[d]===r&&ou(g.props,"extendDomain")&&Ze(g.props[h])){var y=g.props[h];return[Math.min(m[0],y),Math.max(m[1],y)]}return m},A)),u.length){var f="".concat(h,"1"),p="".concat(h,"2");A=u.reduce(function(m,g){if(g.props[d]===r&&ou(g.props,"extendDomain")&&Ze(g.props[f])&&Ze(g.props[p])){var y=g.props[f],v=g.props[p];return[Math.min(m[0],y,v),Math.max(m[1],y,v)]}return m},A)}return s&&s.length&&(A=s.reduce(function(m,g){return Ze(g)?[Math.min(m[0],g),Math.max(m[1],g)]:m},A)),A},Kge={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function s(c,u,d,h,A){if(typeof d!="function")throw new TypeError("The listener must be a function");var f=new i(d,h||c,A),p=n?n+u:u;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],f]:c._events[p].push(f):(c._events[p]=f,c._eventsCount++),c}function a(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var u=[],d,h;if(this._eventsCount===0)return u;for(h in d=this._events)t.call(d,h)&&u.push(n?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},o.prototype.listeners=function(u){var d=n?n+u:u,h=this._events[d];if(!h)return[];if(h.fn)return[h.fn];for(var A=0,f=h.length,p=new Array(f);A<f;A++)p[A]=h[A].fn;return p},o.prototype.listenerCount=function(u){var d=n?n+u:u,h=this._events[d];return h?h.fn?1:h.length:0},o.prototype.emit=function(u,d,h,A,f,p){var m=n?n+u:u;if(!this._events[m])return!1;var g=this._events[m],y=arguments.length,v,x;if(g.fn){switch(g.once&&this.removeListener(u,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,d),!0;case 3:return g.fn.call(g.context,d,h),!0;case 4:return g.fn.call(g.context,d,h,A),!0;case 5:return g.fn.call(g.context,d,h,A,f),!0;case 6:return g.fn.call(g.context,d,h,A,f,p),!0}for(x=1,v=new Array(y-1);x<y;x++)v[x-1]=arguments[x];g.fn.apply(g.context,v)}else{var w=g.length,b;for(x=0;x<w;x++)switch(g[x].once&&this.removeListener(u,g[x].fn,void 0,!0),y){case 1:g[x].fn.call(g[x].context);break;case 2:g[x].fn.call(g[x].context,d);break;case 3:g[x].fn.call(g[x].context,d,h);break;case 4:g[x].fn.call(g[x].context,d,h,A);break;default:if(!v)for(b=1,v=new Array(y-1);b<y;b++)v[b-1]=arguments[b];g[x].fn.apply(g[x].context,v)}}return!0},o.prototype.on=function(u,d,h){return s(this,u,d,h,!1)},o.prototype.once=function(u,d,h){return s(this,u,d,h,!0)},o.prototype.removeListener=function(u,d,h,A){var f=n?n+u:u;if(!this._events[f])return this;if(!d)return a(this,f),this;var p=this._events[f];if(p.fn)p.fn===d&&(!A||p.once)&&(!h||p.context===h)&&a(this,f);else{for(var m=0,g=[],y=p.length;m<y;m++)(p[m].fn!==d||A&&!p[m].once||h&&p[m].context!==h)&&g.push(p[m]);g.length?this._events[f]=g.length===1?g[0]:g:a(this,f)}return this},o.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&a(this,d)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,e.exports=o})(Kge);var dbt=Kge.exports;const hbt=In(dbt);var H4=new hbt,Q4="recharts.syncMouseEvents";function Y1(e){"@babel/helpers - typeof";return Y1=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},Y1(e)}function fbt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Abt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qge(r.key),r)}}function pbt(e,t,n){return t&&Abt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $4(e,t,n){return t=qge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qge(e){var t=mbt(e,"string");return Y1(t)=="symbol"?t:t+""}function mbt(e,t){if(Y1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Y1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var gbt=function(){function e(){fbt(this,e),$4(this,"activeIndex",0),$4(this,"coordinateList",[]),$4(this,"layout","horizontal")}return pbt(e,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,s=i===void 0?null:i,a=n.container,o=a===void 0?null:a,c=n.layout,u=c===void 0?null:c,d=n.offset,h=d===void 0?null:d,A=n.mouseHandlerCallback,f=A===void 0?null:A;this.coordinateList=(r=s??this.coordinateList)!==null&&r!==void 0?r:[],this.container=o??this.container,this.layout=u??this.layout,this.offset=h??this.offset,this.mouseHandlerCallback=f??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(n){if(this.coordinateList.length!==0)switch(n.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(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),s=i.x,a=i.y,o=i.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,d=((r=window)===null||r===void 0?void 0:r.scrollY)||0,h=s+c+u,A=a+this.offset.top+o/2+d;this.mouseHandlerCallback({pageX:h,pageY:A})}}}])}();function ybt(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],i=e==null?void 0:e[1];if(r&&i&&Ze(r)&&Ze(i))return!0}return!1}function vbt(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function Wge(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,s=e.endAngle,a=Bs(t,n,r,i),o=Bs(t,n,r,s);return{points:[a,o],cx:t,cy:n,radius:r,startAngle:i,endAngle:s}}function xbt(e,t,n){var r,i,s,a;if(e==="horizontal")r=t.x,s=r,i=n.top,a=n.top+n.height;else if(e==="vertical")i=t.y,a=i,r=n.left,s=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var o=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,h=t.angle,A=Bs(o,c,u,h),f=Bs(o,c,d,h);r=A.x,i=A.y,s=f.x,a=f.y}else return Wge(t);return[{x:r,y:i},{x:s,y:a}]}function X1(e){"@babel/helpers - typeof";return X1=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},X1(e)}function LX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ik(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LX(Object(n),!0).forEach(function(r){wbt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wbt(e,t,n){return t=bbt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bbt(e){var t=Cbt(e,"string");return X1(t)=="symbol"?t:t+""}function Cbt(e,t){if(X1(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(X1(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sbt(e){var t,n,r=e.element,i=e.tooltipEventType,s=e.isActive,a=e.activeCoordinate,o=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,h=e.layout,A=e.chartName,f=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!f||!s||!a||A!=="ScatterChart"&&i!=="axis")return null;var p,m=DL;if(A==="ScatterChart")p=a,m=Syt;else if(A==="BarChart")p=vbt(h,a,c,d),m=YQ;else if(h==="radial"){var g=Wge(a),y=g.cx,v=g.cy,x=g.radius,w=g.startAngle,b=g.endAngle;p={cx:y,cy:v,startAngle:w,endAngle:b,innerRadius:x,outerRadius:x},m=Jme}else p={points:xbt(h,a,c)},m=DL;var k=ik(ik(ik(ik({stroke:"#ccc",pointerEvents:"none"},c),p),jn(f,!1)),{},{payload:o,payloadIndex:u,className:Pn("recharts-tooltip-cursor",f.className)});return C.isValidElement(f)?C.cloneElement(f,k):C.createElement(m,k)}var kbt=["item"],_bt=["children","className","width","height","style","compact","title","desc"];function zv(e){"@babel/helpers - typeof";return zv=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},zv(e)}function cy(){return cy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cy.apply(this,arguments)}function RX(e,t){return Nbt(e)||Bbt(e,t)||Yge(e,t)||jbt()}function jbt(){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 Bbt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function Nbt(e){if(Array.isArray(e))return e}function DX(e,t){if(e==null)return{};var n=Ebt(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ebt(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Tbt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pbt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Xge(r.key),r)}}function Ibt(e,t,n){return t&&Pbt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Obt(e,t,n){return t=TN(t),Fbt(e,Gge()?Reflect.construct(t,n||[],TN(e).constructor):t.apply(e,n))}function Fbt(e,t){if(t&&(zv(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Mbt(e)}function Mbt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Gge=function(){return!!e})()}function TN(e){return TN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},TN(e)}function Lbt(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&&pR(e,t)}function pR(e,t){return pR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},pR(e,t)}function Vv(e){return Ubt(e)||Dbt(e)||Yge(e)||Rbt()}function Rbt(){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 Yge(e,t){if(e){if(typeof e=="string")return mR(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mR(e,t)}}function Dbt(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ubt(e){if(Array.isArray(e))return mR(e)}function mR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function UX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UX(Object(n),!0).forEach(function(r){zt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UX(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zt(e,t,n){return t=Xge(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xge(e){var t=Hbt(e,"string");return zv(t)=="symbol"?t:t+""}function Hbt(e,t){if(zv(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zv(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qbt={xAxis:["bottom","top"],yAxis:["left","right"]},$bt={width:"100%",height:"100%"},Jge={x:0,y:0};function sk(e){return e}var zbt=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Vbt=function(t,n,r,i){var s=n.find(function(d){return d&&d.index===r});if(s){if(t==="horizontal")return{x:s.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:s.coordinate};if(t==="centric"){var a=s.coordinate,o=i.radius;return Pe(Pe(Pe({},i),Bs(i.cx,i.cy,o,a)),{},{angle:a,radius:o})}var c=s.coordinate,u=i.angle;return Pe(Pe(Pe({},i),Bs(i.cx,i.cy,c,u)),{},{angle:u,radius:c})}return Jge},dT=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,s=n.dataEndIndex,a=(r??[]).reduce(function(o,c){var u=c.props.data;return u&&u.length?[].concat(Vv(o),Vv(u)):o},[]);return a.length>0?a:t&&t.length&&Ze(i)&&Ze(s)?t.slice(i,s+1):[]};function Zge(e){return e==="number"?[0,"auto"]:void 0}var gR=function(t,n,r,i){var s=t.graphicalItems,a=t.tooltipAxis,o=dT(n,t);return r<0||!s||!s.length||r>=o.length?null:s.reduce(function(c,u){var d,h=(d=u.props.data)!==null&&d!==void 0?d:n;h&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(h=h.slice(t.dataStartIndex,t.dataEndIndex+1));var A;if(a.dataKey&&!a.allowDuplicatedCategory){var f=h===void 0?o:h;A=IB(f,a.dataKey,i)}else A=h&&h[r]||o[r];return A?[].concat(Vv(c),[Gme(u,A)]):c},[])},HX=function(t,n,r,i){var s=i||{x:t.chartX,y:t.chartY},a=zbt(s,r),o=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=Hpt(a,o,u,c);if(d>=0&&u){var h=u[d]&&u[d].value,A=gR(t,n,d,h),f=Vbt(r,o,d,s);return{activeTooltipIndex:d,activeLabel:h,activePayload:A,activeCoordinate:f}}return null},Kbt=function(t,n){var r=n.axes,i=n.graphicalItems,s=n.axisType,a=n.axisIdKey,o=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,h=t.children,A=t.stackOffset,f=Kme(d,s);return r.reduce(function(p,m){var g,y=m.type.defaultProps!==void 0?Pe(Pe({},m.type.defaultProps),m.props):m.props,v=y.type,x=y.dataKey,w=y.allowDataOverflow,b=y.allowDuplicatedCategory,k=y.scale,j=y.ticks,B=y.includeHidden,E=y[a];if(p[E])return p;var I=dT(t.data,{graphicalItems:i.filter(function(R){var M,Y=a in R.props?R.props[a]:(M=R.type.defaultProps)===null||M===void 0?void 0:M[a];return Y===E}),dataStartIndex:c,dataEndIndex:u}),T=I.length,N,F,L;ybt(y.domain,w,v)&&(N=OL(y.domain,null,w),f&&(v==="number"||k!=="auto")&&(L=nb(I,x,"category")));var U=Zge(v);if(!N||N.length===0){var H,K=(H=y.domain)!==null&&H!==void 0?H:U;if(x){if(N=nb(I,x,v),v==="category"&&f){var $=Net(N);b&&$?(F=N,N=yN(0,T)):b||(N=jY(K,N,m).reduce(function(R,M){return R.indexOf(M)>=0?R:[].concat(Vv(R),[M])},[]))}else if(v==="category")b?N=N.filter(function(R){return R!==""&&!Cn(R)}):N=jY(K,N,m).reduce(function(R,M){return R.indexOf(M)>=0||M===""||Cn(M)?R:[].concat(Vv(R),[M])},[]);else if(v==="number"){var z=Kpt(I,i.filter(function(R){var M,Y,X=a in R.props?R.props[a]:(M=R.type.defaultProps)===null||M===void 0?void 0:M[a],q="hide"in R.props?R.props.hide:(Y=R.type.defaultProps)===null||Y===void 0?void 0:Y.hide;return X===E&&(B||!q)}),x,s,d);z&&(N=z)}f&&(v==="number"||k!=="auto")&&(L=nb(I,x,"category"))}else f?N=yN(0,T):o&&o[E]&&o[E].hasStack&&v==="number"?N=A==="expand"?[0,1]:Wme(o[E].stackGroups,c,u):N=Vme(I,i.filter(function(R){var M=a in R.props?R.props[a]:R.type.defaultProps[a],Y="hide"in R.props?R.props.hide:R.type.defaultProps.hide;return M===E&&(B||!Y)}),v,d,!0);if(v==="number")N=AR(h,N,E,s,j),K&&(N=OL(K,N,w));else if(v==="category"&&K){var Q=K,oe=N.every(function(R){return Q.indexOf(R)>=0});oe&&(N=Q)}}return Pe(Pe({},p),{},zt({},E,Pe(Pe({},y),{},{axisType:s,domain:N,categoricalDomain:L,duplicateDomain:F,originalDomain:(g=y.domain)!==null&&g!==void 0?g:U,isCategorical:f,layout:d})))},{})},qbt=function(t,n){var r=n.graphicalItems,i=n.Axis,s=n.axisType,a=n.axisIdKey,o=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,h=t.children,A=dT(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),f=A.length,p=Kme(d,s),m=-1;return r.reduce(function(g,y){var v=y.type.defaultProps!==void 0?Pe(Pe({},y.type.defaultProps),y.props):y.props,x=v[a],w=Zge("number");if(!g[x]){m++;var b;return p?b=yN(0,f):o&&o[x]&&o[x].hasStack?(b=Wme(o[x].stackGroups,c,u),b=AR(h,b,x,s)):(b=OL(w,Vme(A,r.filter(function(k){var j,B,E=a in k.props?k.props[a]:(j=k.type.defaultProps)===null||j===void 0?void 0:j[a],I="hide"in k.props?k.props.hide:(B=k.type.defaultProps)===null||B===void 0?void 0:B.hide;return E===x&&!I}),"number",d),i.defaultProps.allowDataOverflow),b=AR(h,b,x,s)),Pe(Pe({},g),{},zt({},x,Pe(Pe({axisType:s},i.defaultProps),{},{hide:!0,orientation:Cl(Qbt,"".concat(s,".").concat(m%2),null),domain:b,originalDomain:w,isCategorical:p,layout:d})))}return g},{})},Wbt=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,s=n.AxisComp,a=n.graphicalItems,o=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,h="".concat(i,"Id"),A=Sl(d,s),f={};return A&&A.length?f=Kbt(t,{axes:A,graphicalItems:a,axisType:i,axisIdKey:h,stackGroups:o,dataStartIndex:c,dataEndIndex:u}):a&&a.length&&(f=qbt(t,{Axis:s,graphicalItems:a,axisType:i,axisIdKey:h,stackGroups:o,dataStartIndex:c,dataEndIndex:u})),f},Gbt=function(t){var n=jh(t),r=id(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:bQ(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:cN(n,r)}},QX=function(t){var n=t.children,r=t.defaultShowTooltip,i=So(n,Fv),s=0,a=0;return t.data&&t.data.length!==0&&(a=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(s=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},Ybt=function(t){return!t||!t.length?!1:t.some(function(n){var r=ld(n&&n.type);return r&&r.indexOf("Bar")>=0})},$X=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"}},Xbt=function(t,n){var r=t.props,i=t.graphicalItems,s=t.xAxisMap,a=s===void 0?{}:s,o=t.yAxisMap,c=o===void 0?{}:o,u=r.width,d=r.height,h=r.children,A=r.margin||{},f=So(h,Fv),p=So(h,Tp),m=Object.keys(c).reduce(function(b,k){var j=c[k],B=j.orientation;return!j.mirror&&!j.hide?Pe(Pe({},b),{},zt({},B,b[B]+j.width)):b},{left:A.left||0,right:A.right||0}),g=Object.keys(a).reduce(function(b,k){var j=a[k],B=j.orientation;return!j.mirror&&!j.hide?Pe(Pe({},b),{},zt({},B,Cl(b,"".concat(B))+j.height)):b},{top:A.top||0,bottom:A.bottom||0}),y=Pe(Pe({},g),m),v=y.bottom;f&&(y.bottom+=f.props.height||Fv.defaultProps.height),p&&n&&(y=zpt(y,i,r,n));var x=u-y.left-y.right,w=d-y.top-y.bottom;return Pe(Pe({brushBottom:v},y),{},{width:Math.max(x,0),height:Math.max(w,0)})},Jbt=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},eye=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,s=i===void 0?"axis":i,a=t.validateTooltipEventTypes,o=a===void 0?["axis"]:a,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,h=t.defaultProps,A=function(y,v){var x=v.graphicalItems,w=v.stackGroups,b=v.offset,k=v.updateId,j=v.dataStartIndex,B=v.dataEndIndex,E=y.barSize,I=y.layout,T=y.barGap,N=y.barCategoryGap,F=y.maxBarSize,L=$X(I),U=L.numericAxisName,H=L.cateAxisName,K=Ybt(x),$=[];return x.forEach(function(z,Q){var oe=dT(y.data,{graphicalItems:[z],dataStartIndex:j,dataEndIndex:B}),R=z.type.defaultProps!==void 0?Pe(Pe({},z.type.defaultProps),z.props):z.props,M=R.dataKey,Y=R.maxBarSize,X=R["".concat(U,"Id")],q=R["".concat(H,"Id")],Z={},de=c.reduce(function(we,$e){var Ve=v["".concat($e.axisType,"Map")],$t=R["".concat($e.axisType,"Id")];Ve&&Ve[$t]||$e.axisType==="zAxis"||om();var yt=Ve[$t];return Pe(Pe({},we),{},zt(zt({},$e.axisType,yt),"".concat($e.axisType,"Ticks"),id(yt)))},Z),ue=de[H],ae=de["".concat(H,"Ticks")],he=w&&w[X]&&w[X].hasStack&&imt(z,w[X].stackGroups),ie=ld(z.type).indexOf("Bar")>=0,Ce=cN(ue,ae),Oe=[],te=K&&Qpt({barSize:E,stackGroups:w,totalSize:Jbt(de,H)});if(ie){var je,tt,nt=Cn(Y)?F:Y,Te=(je=(tt=cN(ue,ae,!0))!==null&&tt!==void 0?tt:nt)!==null&&je!==void 0?je:0;Oe=$pt({barGap:T,barCategoryGap:N,bandSize:Te!==Ce?Te:Ce,sizeList:te[q],maxBarSize:nt}),Te!==Ce&&(Oe=Oe.map(function(we){return Pe(Pe({},we),{},{position:Pe(Pe({},we.position),{},{offset:we.position.offset-Te/2})})}))}var ct=z&&z.type&&z.type.getComposedData;ct&&$.push({props:Pe(Pe({},ct(Pe(Pe({},de),{},{displayedData:oe,props:y,dataKey:M,item:z,bandSize:Ce,barPosition:Oe,offset:b,stackedData:he,layout:I,dataStartIndex:j,dataEndIndex:B}))),{},zt(zt(zt({key:z.key||"item-".concat(Q)},U,de[U]),H,de[H]),"animationId",k)),childIndex:Het(z,y.children),item:z})}),$},f=function(y,v){var x=y.props,w=y.dataStartIndex,b=y.dataEndIndex,k=y.updateId;if(!xW({props:x}))return null;var j=x.children,B=x.layout,E=x.stackOffset,I=x.data,T=x.reverseStackOrder,N=$X(B),F=N.numericAxisName,L=N.cateAxisName,U=Sl(j,r),H=tmt(I,U,"".concat(F,"Id"),"".concat(L,"Id"),E,T),K=c.reduce(function(R,M){var Y="".concat(M.axisType,"Map");return Pe(Pe({},R),{},zt({},Y,Wbt(x,Pe(Pe({},M),{},{graphicalItems:U,stackGroups:M.axisType===F&&H,dataStartIndex:w,dataEndIndex:b}))))},{}),$=Xbt(Pe(Pe({},K),{},{props:x,graphicalItems:U}),v==null?void 0:v.legendBBox);Object.keys(K).forEach(function(R){K[R]=d(x,K[R],$,R.replace("Map",""),n)});var z=K["".concat(L,"Map")],Q=Gbt(z),oe=A(x,Pe(Pe({},K),{},{dataStartIndex:w,dataEndIndex:b,updateId:k,graphicalItems:U,stackGroups:H,offset:$}));return Pe(Pe({formattedGraphicalItems:oe,graphicalItems:U,offset:$,stackGroups:H},Q),K)},p=function(g){function y(v){var x,w,b;return Tbt(this,y),b=Obt(this,y,[v]),zt(b,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),zt(b,"accessibilityManager",new gbt),zt(b,"handleLegendBBoxUpdate",function(k){if(k){var j=b.state,B=j.dataStartIndex,E=j.dataEndIndex,I=j.updateId;b.setState(Pe({legendBBox:k},f({props:b.props,dataStartIndex:B,dataEndIndex:E,updateId:I},Pe(Pe({},b.state),{},{legendBBox:k}))))}}),zt(b,"handleReceiveSyncEvent",function(k,j,B){if(b.props.syncId===k){if(B===b.eventEmitterSymbol&&typeof b.props.syncMethod!="function")return;b.applySyncEvent(j)}}),zt(b,"handleBrushChange",function(k){var j=k.startIndex,B=k.endIndex;if(j!==b.state.dataStartIndex||B!==b.state.dataEndIndex){var E=b.state.updateId;b.setState(function(){return Pe({dataStartIndex:j,dataEndIndex:B},f({props:b.props,dataStartIndex:j,dataEndIndex:B,updateId:E},b.state))}),b.triggerSyncEvent({dataStartIndex:j,dataEndIndex:B})}}),zt(b,"handleMouseEnter",function(k){var j=b.getMouseInfo(k);if(j){var B=Pe(Pe({},j),{},{isTooltipActive:!0});b.setState(B),b.triggerSyncEvent(B);var E=b.props.onMouseEnter;gn(E)&&E(B,k)}}),zt(b,"triggeredAfterMouseMove",function(k){var j=b.getMouseInfo(k),B=j?Pe(Pe({},j),{},{isTooltipActive:!0}):{isTooltipActive:!1};b.setState(B),b.triggerSyncEvent(B);var E=b.props.onMouseMove;gn(E)&&E(B,k)}),zt(b,"handleItemMouseEnter",function(k){b.setState(function(){return{isTooltipActive:!0,activeItem:k,activePayload:k.tooltipPayload,activeCoordinate:k.tooltipPosition||{x:k.cx,y:k.cy}}})}),zt(b,"handleItemMouseLeave",function(){b.setState(function(){return{isTooltipActive:!1}})}),zt(b,"handleMouseMove",function(k){k.persist(),b.throttleTriggeredAfterMouseMove(k)}),zt(b,"handleMouseLeave",function(k){b.throttleTriggeredAfterMouseMove.cancel();var j={isTooltipActive:!1};b.setState(j),b.triggerSyncEvent(j);var B=b.props.onMouseLeave;gn(B)&&B(j,k)}),zt(b,"handleOuterEvent",function(k){var j=Uet(k),B=Cl(b.props,"".concat(j));if(j&&gn(B)){var E,I;/.*touch.*/i.test(j)?I=b.getMouseInfo(k.changedTouches[0]):I=b.getMouseInfo(k),B((E=I)!==null&&E!==void 0?E:{},k)}}),zt(b,"handleClick",function(k){var j=b.getMouseInfo(k);if(j){var B=Pe(Pe({},j),{},{isTooltipActive:!0});b.setState(B),b.triggerSyncEvent(B);var E=b.props.onClick;gn(E)&&E(B,k)}}),zt(b,"handleMouseDown",function(k){var j=b.props.onMouseDown;if(gn(j)){var B=b.getMouseInfo(k);j(B,k)}}),zt(b,"handleMouseUp",function(k){var j=b.props.onMouseUp;if(gn(j)){var B=b.getMouseInfo(k);j(B,k)}}),zt(b,"handleTouchMove",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&b.throttleTriggeredAfterMouseMove(k.changedTouches[0])}),zt(b,"handleTouchStart",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&b.handleMouseDown(k.changedTouches[0])}),zt(b,"handleTouchEnd",function(k){k.changedTouches!=null&&k.changedTouches.length>0&&b.handleMouseUp(k.changedTouches[0])}),zt(b,"handleDoubleClick",function(k){var j=b.props.onDoubleClick;if(gn(j)){var B=b.getMouseInfo(k);j(B,k)}}),zt(b,"handleContextMenu",function(k){var j=b.props.onContextMenu;if(gn(j)){var B=b.getMouseInfo(k);j(B,k)}}),zt(b,"triggerSyncEvent",function(k){b.props.syncId!==void 0&&H4.emit(Q4,b.props.syncId,k,b.eventEmitterSymbol)}),zt(b,"applySyncEvent",function(k){var j=b.props,B=j.layout,E=j.syncMethod,I=b.state.updateId,T=k.dataStartIndex,N=k.dataEndIndex;if(k.dataStartIndex!==void 0||k.dataEndIndex!==void 0)b.setState(Pe({dataStartIndex:T,dataEndIndex:N},f({props:b.props,dataStartIndex:T,dataEndIndex:N,updateId:I},b.state)));else if(k.activeTooltipIndex!==void 0){var F=k.chartX,L=k.chartY,U=k.activeTooltipIndex,H=b.state,K=H.offset,$=H.tooltipTicks;if(!K)return;if(typeof E=="function")U=E($,k);else if(E==="value"){U=-1;for(var z=0;z<$.length;z++)if($[z].value===k.activeLabel){U=z;break}}var Q=Pe(Pe({},K),{},{x:K.left,y:K.top}),oe=Math.min(F,Q.x+Q.width),R=Math.min(L,Q.y+Q.height),M=$[U]&&$[U].value,Y=gR(b.state,b.props.data,U),X=$[U]?{x:B==="horizontal"?$[U].coordinate:oe,y:B==="horizontal"?R:$[U].coordinate}:Jge;b.setState(Pe(Pe({},k),{},{activeLabel:M,activeCoordinate:X,activePayload:Y,activeTooltipIndex:U}))}else b.setState(k)}),zt(b,"renderCursor",function(k){var j,B=b.state,E=B.isTooltipActive,I=B.activeCoordinate,T=B.activePayload,N=B.offset,F=B.activeTooltipIndex,L=B.tooltipAxisBandSize,U=b.getTooltipEventType(),H=(j=k.props.active)!==null&&j!==void 0?j:E,K=b.props.layout,$=k.key||"_recharts-cursor";return re.createElement(Sbt,{key:$,activeCoordinate:I,activePayload:T,activeTooltipIndex:F,chartName:n,element:k,isActive:H,layout:K,offset:N,tooltipAxisBandSize:L,tooltipEventType:U})}),zt(b,"renderPolarAxis",function(k,j,B){var E=Cl(k,"type.axisType"),I=Cl(b.state,"".concat(E,"Map")),T=k.type.defaultProps,N=T!==void 0?Pe(Pe({},T),k.props):k.props,F=I&&I[N["".concat(E,"Id")]];return C.cloneElement(k,Pe(Pe({},F),{},{className:Pn(E,F.className),key:k.key||"".concat(j,"-").concat(B),ticks:id(F,!0)}))}),zt(b,"renderPolarGrid",function(k){var j=k.props,B=j.radialLines,E=j.polarAngles,I=j.polarRadius,T=b.state,N=T.radiusAxisMap,F=T.angleAxisMap,L=jh(N),U=jh(F),H=U.cx,K=U.cy,$=U.innerRadius,z=U.outerRadius;return C.cloneElement(k,{polarAngles:Array.isArray(E)?E:id(U,!0).map(function(Q){return Q.coordinate}),polarRadius:Array.isArray(I)?I:id(L,!0).map(function(Q){return Q.coordinate}),cx:H,cy:K,innerRadius:$,outerRadius:z,key:k.key||"polar-grid",radialLines:B})}),zt(b,"renderLegend",function(){var k=b.state.formattedGraphicalItems,j=b.props,B=j.children,E=j.width,I=j.height,T=b.props.margin||{},N=E-(T.left||0)-(T.right||0),F=$me({children:B,formattedGraphicalItems:k,legendWidth:N,legendContent:u});if(!F)return null;var L=F.item,U=DX(F,kbt);return C.cloneElement(L,Pe(Pe({},U),{},{chartWidth:E,chartHeight:I,margin:T,onBBoxUpdate:b.handleLegendBBoxUpdate}))}),zt(b,"renderTooltip",function(){var k,j=b.props,B=j.children,E=j.accessibilityLayer,I=So(B,sl);if(!I)return null;var T=b.state,N=T.isTooltipActive,F=T.activeCoordinate,L=T.activePayload,U=T.activeLabel,H=T.offset,K=(k=I.props.active)!==null&&k!==void 0?k:N;return C.cloneElement(I,{viewBox:Pe(Pe({},H),{},{x:H.left,y:H.top}),active:K,label:U,payload:K?L:[],coordinate:F,accessibilityLayer:E})}),zt(b,"renderBrush",function(k){var j=b.props,B=j.margin,E=j.data,I=b.state,T=I.offset,N=I.dataStartIndex,F=I.dataEndIndex,L=I.updateId;return C.cloneElement(k,{key:k.key||"_recharts-brush",onChange:tk(b.handleBrushChange,k.props.onChange),data:E,x:Ze(k.props.x)?k.props.x:T.left,y:Ze(k.props.y)?k.props.y:T.top+T.height+T.brushBottom-(B.bottom||0),width:Ze(k.props.width)?k.props.width:T.width,startIndex:N,endIndex:F,updateId:"brush-".concat(L)})}),zt(b,"renderReferenceElement",function(k,j,B){if(!k)return null;var E=b,I=E.clipPathId,T=b.state,N=T.xAxisMap,F=T.yAxisMap,L=T.offset,U=k.type.defaultProps||{},H=k.props,K=H.xAxisId,$=K===void 0?U.xAxisId:K,z=H.yAxisId,Q=z===void 0?U.yAxisId:z;return C.cloneElement(k,{key:k.key||"".concat(j,"-").concat(B),xAxis:N[$],yAxis:F[Q],viewBox:{x:L.left,y:L.top,width:L.width,height:L.height},clipPathId:I})}),zt(b,"renderActivePoints",function(k){var j=k.item,B=k.activePoint,E=k.basePoint,I=k.childIndex,T=k.isRange,N=[],F=j.props.key,L=j.item.type.defaultProps!==void 0?Pe(Pe({},j.item.type.defaultProps),j.item.props):j.item.props,U=L.activeDot,H=L.dataKey,K=Pe(Pe({index:I,dataKey:H,cx:B.x,cy:B.y,r:4,fill:GQ(j.item),strokeWidth:2,stroke:"#fff",payload:B.payload,value:B.value},jn(U,!1)),OB(U));return N.push(y.renderActiveDot(U,K,"".concat(F,"-activePoint-").concat(I))),E?N.push(y.renderActiveDot(U,Pe(Pe({},K),{},{cx:E.x,cy:E.y}),"".concat(F,"-basePoint-").concat(I))):T&&N.push(null),N}),zt(b,"renderGraphicChild",function(k,j,B){var E=b.filterFormatItem(k,j,B);if(!E)return null;var I=b.getTooltipEventType(),T=b.state,N=T.isTooltipActive,F=T.tooltipAxis,L=T.activeTooltipIndex,U=T.activeLabel,H=b.props.children,K=So(H,sl),$=E.props,z=$.points,Q=$.isRange,oe=$.baseLine,R=E.item.type.defaultProps!==void 0?Pe(Pe({},E.item.type.defaultProps),E.item.props):E.item.props,M=R.activeDot,Y=R.hide,X=R.activeBar,q=R.activeShape,Z=!!(!Y&&N&&K&&(M||X||q)),de={};I!=="axis"&&K&&K.props.trigger==="click"?de={onClick:tk(b.handleItemMouseEnter,k.props.onClick)}:I!=="axis"&&(de={onMouseLeave:tk(b.handleItemMouseLeave,k.props.onMouseLeave),onMouseEnter:tk(b.handleItemMouseEnter,k.props.onMouseEnter)});var ue=C.cloneElement(k,Pe(Pe({},E.props),de));function ae($e){return typeof F.dataKey=="function"?F.dataKey($e.payload):null}if(Z)if(L>=0){var he,ie;if(F.dataKey&&!F.allowDuplicatedCategory){var Ce=typeof F.dataKey=="function"?ae:"payload.".concat(F.dataKey.toString());he=IB(z,Ce,U),ie=Q&&oe&&IB(oe,Ce,U)}else he=z==null?void 0:z[L],ie=Q&&oe&&oe[L];if(q||X){var Oe=k.props.activeIndex!==void 0?k.props.activeIndex:L;return[C.cloneElement(k,Pe(Pe(Pe({},E.props),de),{},{activeIndex:Oe})),null,null]}if(!Cn(he))return[ue].concat(Vv(b.renderActivePoints({item:E,activePoint:he,basePoint:ie,childIndex:L,isRange:Q})))}else{var te,je=(te=b.getItemByXY(b.state.activeCoordinate))!==null&&te!==void 0?te:{graphicalItem:ue},tt=je.graphicalItem,nt=tt.item,Te=nt===void 0?k:nt,ct=tt.childIndex,we=Pe(Pe(Pe({},E.props),de),{},{activeIndex:ct});return[C.cloneElement(Te,we),null,null]}return Q?[ue,null,null]:[ue,null]}),zt(b,"renderCustomized",function(k,j,B){return C.cloneElement(k,Pe(Pe({key:"recharts-customized-".concat(B)},b.props),b.state))}),zt(b,"renderMap",{CartesianGrid:{handler:sk,once:!0},ReferenceArea:{handler:b.renderReferenceElement},ReferenceLine:{handler:sk},ReferenceDot:{handler:b.renderReferenceElement},XAxis:{handler:sk},YAxis:{handler:sk},Brush:{handler:b.renderBrush,once:!0},Bar:{handler:b.renderGraphicChild},Line:{handler:b.renderGraphicChild},Area:{handler:b.renderGraphicChild},Radar:{handler:b.renderGraphicChild},RadialBar:{handler:b.renderGraphicChild},Scatter:{handler:b.renderGraphicChild},Pie:{handler:b.renderGraphicChild},Funnel:{handler:b.renderGraphicChild},Tooltip:{handler:b.renderCursor,once:!0},PolarGrid:{handler:b.renderPolarGrid,once:!0},PolarAngleAxis:{handler:b.renderPolarAxis},PolarRadiusAxis:{handler:b.renderPolarAxis},Customized:{handler:b.renderCustomized}}),b.clipPathId="".concat((x=v.id)!==null&&x!==void 0?x:G2("recharts"),"-clip"),b.throttleTriggeredAfterMouseMove=Qpe(b.triggeredAfterMouseMove,(w=v.throttleDelay)!==null&&w!==void 0?w:1e3/60),b.state={},b}return Lbt(y,g),Ibt(y,[{key:"componentDidMount",value:function(){var x,w;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(w=this.props.margin.top)!==null&&w!==void 0?w:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,w=x.children,b=x.data,k=x.height,j=x.layout,B=So(w,sl);if(B){var E=B.props.defaultIndex;if(!(typeof E!="number"||E<0||E>this.state.tooltipTicks.length-1)){var I=this.state.tooltipTicks[E]&&this.state.tooltipTicks[E].value,T=gR(this.state,b,E,I),N=this.state.tooltipTicks[E].coordinate,F=(this.state.offset.top+k)/2,L=j==="horizontal",U=L?{x:N,y:F}:{y:N,x:F},H=this.state.formattedGraphicalItems.find(function($){var z=$.item;return z.type.name==="Scatter"});H&&(U=Pe(Pe({},U),H.props.points[E].tooltipPosition),T=H.props.points[E].tooltipPayload);var K={activeTooltipIndex:E,isTooltipActive:!0,activeLabel:I,activePayload:T,activeCoordinate:U};this.setState(K),this.renderCursor(B),this.accessibilityManager.setIndex(E)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,w){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==w.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var b,k;this.accessibilityManager.setDetails({offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0}})}return null}},{key:"componentDidUpdate",value:function(x){GM([So(x.children,sl)],[So(this.props.children,sl)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=So(this.props.children,sl);if(x&&typeof x.props.shared=="boolean"){var w=x.props.shared?"axis":"item";return o.indexOf(w)>=0?w:s}return s}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var w=this.container,b=w.getBoundingClientRect(),k=fdt(b),j={chartX:Math.round(x.pageX-k.left),chartY:Math.round(x.pageY-k.top)},B=b.width/w.offsetWidth||1,E=this.inRange(j.chartX,j.chartY,B);if(!E)return null;var I=this.state,T=I.xAxisMap,N=I.yAxisMap,F=this.getTooltipEventType();if(F!=="axis"&&T&&N){var L=jh(T).scale,U=jh(N).scale,H=L&&L.invert?L.invert(j.chartX):null,K=U&&U.invert?U.invert(j.chartY):null;return Pe(Pe({},j),{},{xValue:H,yValue:K})}var $=HX(this.state,this.props.data,this.props.layout,E);return $?Pe(Pe({},j),$):null}},{key:"inRange",value:function(x,w){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,k=this.props.layout,j=x/b,B=w/b;if(k==="horizontal"||k==="vertical"){var E=this.state.offset,I=j>=E.left&&j<=E.left+E.width&&B>=E.top&&B<=E.top+E.height;return I?{x:j,y:B}:null}var T=this.state,N=T.angleAxisMap,F=T.radiusAxisMap;if(N&&F){var L=jh(N);return EY({x:j,y:B},L)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,w=this.getTooltipEventType(),b=So(x,sl),k={};b&&w==="axis"&&(b.props.trigger==="click"?k={onClick:this.handleClick}:k={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 j=OB(this.props,this.handleOuterEvent);return Pe(Pe({},j),k)}},{key:"addListener",value:function(){H4.on(Q4,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){H4.removeListener(Q4,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,w,b){for(var k=this.state.formattedGraphicalItems,j=0,B=k.length;j<B;j++){var E=k[j];if(E.item===x||E.props.key===x.key||w===ld(E.item.type)&&b===E.childIndex)return E}return null}},{key:"renderClipPath",value:function(){var x=this.clipPathId,w=this.state.offset,b=w.left,k=w.top,j=w.height,B=w.width;return re.createElement("defs",null,re.createElement("clipPath",{id:x},re.createElement("rect",{x:b,y:k,height:j,width:B})))}},{key:"getXScales",value:function(){var x=this.state.xAxisMap;return x?Object.entries(x).reduce(function(w,b){var k=RX(b,2),j=k[0],B=k[1];return Pe(Pe({},w),{},zt({},j,B.scale))},{}):null}},{key:"getYScales",value:function(){var x=this.state.yAxisMap;return x?Object.entries(x).reduce(function(w,b){var k=RX(b,2),j=k[0],B=k[1];return Pe(Pe({},w),{},zt({},j,B.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(x){var w;return(w=this.state.xAxisMap)===null||w===void 0||(w=w[x])===null||w===void 0?void 0:w.scale}},{key:"getYScaleByAxisId",value:function(x){var w;return(w=this.state.yAxisMap)===null||w===void 0||(w=w[x])===null||w===void 0?void 0:w.scale}},{key:"getItemByXY",value:function(x){var w=this.state,b=w.formattedGraphicalItems,k=w.activeItem;if(b&&b.length)for(var j=0,B=b.length;j<B;j++){var E=b[j],I=E.props,T=E.item,N=T.type.defaultProps!==void 0?Pe(Pe({},T.type.defaultProps),T.props):T.props,F=ld(T.type);if(F==="Bar"){var L=(I.data||[]).find(function($){return Ayt(x,$)});if(L)return{graphicalItem:E,payload:L}}else if(F==="RadialBar"){var U=(I.data||[]).find(function($){return EY(x,$)});if(U)return{graphicalItem:E,payload:U}}else if(rT(E,k)||iT(E,k)||V1(E,k)){var H=gvt({graphicalItem:E,activeTooltipItem:k,itemData:N.data}),K=N.activeIndex===void 0?H:N.activeIndex;return{graphicalItem:Pe(Pe({},E),{},{childIndex:K}),payload:V1(E,k)?N.data[H]:E.props.data[H]}}}return null}},{key:"render",value:function(){var x=this;if(!xW(this))return null;var w=this.props,b=w.children,k=w.className,j=w.width,B=w.height,E=w.style,I=w.compact,T=w.title,N=w.desc,F=DX(w,_bt),L=jn(F,!1);if(I)return re.createElement(xX,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},re.createElement(XM,cy({},L,{width:j,height:B,title:T,desc:N}),this.renderClipPath(),bW(b,this.renderMap)));if(this.props.accessibilityLayer){var U,H;L.tabIndex=(U=this.props.tabIndex)!==null&&U!==void 0?U:0,L.role=(H=this.props.role)!==null&&H!==void 0?H:"application",L.onKeyDown=function($){x.accessibilityManager.keyboardEvent($)},L.onFocus=function(){x.accessibilityManager.focus()}}var K=this.parseEventsOfWrapper();return re.createElement(xX,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},re.createElement("div",cy({className:Pn("recharts-wrapper",k),style:Pe({position:"relative",cursor:"default",width:j,height:B},E)},K,{ref:function(z){x.container=z}}),re.createElement(XM,cy({},L,{width:j,height:B,title:T,desc:N,style:$bt}),this.renderClipPath(),bW(b,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(C.Component);zt(p,"displayName",n),zt(p,"defaultProps",Pe({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},h)),zt(p,"getDerivedStateFromProps",function(g,y){var v=g.dataKey,x=g.data,w=g.children,b=g.width,k=g.height,j=g.layout,B=g.stackOffset,E=g.margin,I=y.dataStartIndex,T=y.dataEndIndex;if(y.updateId===void 0){var N=QX(g);return Pe(Pe(Pe({},N),{},{updateId:0},f(Pe(Pe({props:g},N),{},{updateId:0}),y)),{},{prevDataKey:v,prevData:x,prevWidth:b,prevHeight:k,prevLayout:j,prevStackOffset:B,prevMargin:E,prevChildren:w})}if(v!==y.prevDataKey||x!==y.prevData||b!==y.prevWidth||k!==y.prevHeight||j!==y.prevLayout||B!==y.prevStackOffset||!Iy(E,y.prevMargin)){var F=QX(g),L={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},U=Pe(Pe({},HX(y,x,j)),{},{updateId:y.updateId+1}),H=Pe(Pe(Pe({},F),L),U);return Pe(Pe(Pe({},H),f(Pe({props:g},H),y)),{},{prevDataKey:v,prevData:x,prevWidth:b,prevHeight:k,prevLayout:j,prevStackOffset:B,prevMargin:E,prevChildren:w})}if(!GM(w,y.prevChildren)){var K,$,z,Q,oe=So(w,Fv),R=oe&&(K=($=oe.props)===null||$===void 0?void 0:$.startIndex)!==null&&K!==void 0?K:I,M=oe&&(z=(Q=oe.props)===null||Q===void 0?void 0:Q.endIndex)!==null&&z!==void 0?z:T,Y=R!==I||M!==T,X=!Cn(x),q=X&&!Y?y.updateId:y.updateId+1;return Pe(Pe({updateId:q},f(Pe(Pe({props:g},y),{},{updateId:q,dataStartIndex:R,dataEndIndex:M}),y)),{},{prevChildren:w,dataStartIndex:R,dataEndIndex:M})}return null}),zt(p,"renderActiveDot",function(g,y,v){var x;return C.isValidElement(g)?x=C.cloneElement(g,y):gn(g)?x=g(y):x=re.createElement(XQ,y),re.createElement(gi,{className:"recharts-active-dot",key:v},x)});var m=C.forwardRef(function(y,v){return re.createElement(p,cy({},y,{ref:v}))});return m.displayName=p.displayName,m},tye=eye({chartName:"LineChart",GraphicalChild:T0,axisComponents:[{axisType:"xAxis",AxisComp:jm},{axisType:"yAxis",AxisComp:Bm}],formatAxisMap:yge}),Zbt=eye({chartName:"BarChart",GraphicalChild:_m,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:jm},{axisType:"yAxis",AxisComp:Bm}],formatAxisMap:yge});const zX={GPTBot:"#22c55e","ChatGPT-User":"#16a34a","OAI-SearchBot":"#15803d",ClaudeBot:"#f97316","Claude-Web":"#ea580c",PerplexityBot:"#3b82f6",Googlebot:"#ef4444","Google-Extended":"#dc2626",Bingbot:"#14b8a6",Bytespider:"#8b5cf6",CCBot:"#6b7280",Amazonbot:"#f59e0b",FacebookBot:"#2563eb","Meta-ExternalAgent":"#1d4ed8",AppleBot:"#a3a3a3",DuckDuckBot:"#f97316",YandexBot:"#ef4444","Cohere-AI":"#ec4899"},e1t=()=>{const[e,t]=C.useState([]),[n,r]=C.useState(!0),[i,s]=C.useState([]),[a,o]=C.useState(!0);C.useEffect(()=>{(async()=>{const k=new Date(Date.now()-2592e6).toISOString(),{data:j}=await Me.from("crawl_events").select("id, crawler_name, crawler_company, page_path, status_code, created_at").gte("created_at",k).order("created_at",{ascending:!1}).limit(1e3);t(j||[]),r(!1)})()},[]),C.useEffect(()=>{(async()=>{const[{data:k},{data:j}]=await Promise.all([Me.from("aeo_pages").select("slug").eq("status","published"),Me.from("crawl_events").select("page_path")]);if(k&&j){const B=new Set((j||[]).map(I=>I.page_path)),E=k.map(I=>`/${I.slug}`).filter(I=>!B.has(I));s(E)}o(!1)})()},[]);const c=Date.now(),u=c-7*864e5,d=c-14*864e5,h=C.useMemo(()=>e.filter(b=>new Date(b.created_at).getTime()>=u),[e,u]),A=C.useMemo(()=>e.filter(b=>{const k=new Date(b.created_at).getTime();return k>=d&&k<u}),[e,u,d]),f=C.useMemo(()=>new Set(h.map(b=>b.crawler_name)).size,[h]),p=C.useMemo(()=>{const b={};h.forEach(j=>{b[j.crawler_name]=(b[j.crawler_name]||0)+1});const k=Object.entries(b).sort((j,B)=>B[1]-j[1])[0];return k?{name:k[0],count:k[1]}:null},[h]),m=C.useMemo(()=>new Set(h.map(b=>b.page_path)).size,[h]),g=h.length>A.length?"up":h.length<A.length?"down":"flat",y=g==="up"?Dre:g==="down"?Rre:Ore,v=C.useMemo(()=>{const b={},k=new Set;return e.forEach(B=>{const E=B.created_at.substring(0,10);b[E]||(b[E]={}),b[E][B.crawler_name]=(b[E][B.crawler_name]||0)+1,k.add(B.crawler_name)}),{data:Object.entries(b).sort((B,E)=>B[0].localeCompare(E[0])).map(([B,E])=>({date:B.slice(5),...E})),crawlers:Array.from(k)}},[e]),x=C.useMemo(()=>{const b={};return h.forEach(k=>{b[k.crawler_name]||(b[k.crawler_name]={company:k.crawler_company,count:0,lastVisit:k.created_at,pageCounts:{}}),b[k.crawler_name].count++,b[k.crawler_name].pageCounts[k.page_path]=(b[k.crawler_name].pageCounts[k.page_path]||0)+1,k.created_at>b[k.crawler_name].lastVisit&&(b[k.crawler_name].lastVisit=k.created_at)}),Object.entries(b).map(([k,j])=>{var B;return{name:k,company:j.company,count:j.count,lastVisit:j.lastVisit,topPage:((B=Object.entries(j.pageCounts).sort((E,I)=>I[1]-E[1])[0])==null?void 0:B[0])||"-"}}).sort((k,j)=>j.count-k.count)},[h]),w=e.slice(0,50);return n?l.jsxs("div",{className:"space-y-4",children:[l.jsx(lt,{className:"h-32 w-full"}),l.jsx(lt,{className:"h-64 w-full"})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(Xt,{children:l.jsx(Jt,{className:"pt-6",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Visits (7d)"}),l.jsx("p",{className:"text-2xl font-bold",children:h.length})]}),l.jsx(y,{className:`w-5 h-5 ${g==="up"?"text-green-500":g==="down"?"text-red-500":"text-muted-foreground"}`})]})})}),l.jsx(Xt,{children:l.jsxs(Jt,{className:"pt-6",children:[l.jsx("div",{className:"flex items-center gap-2",children:l.jsx(Zk,{className:"w-5 h-5 text-muted-foreground"})}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Unique Crawlers"}),l.jsx("p",{className:"text-2xl font-bold",children:f})]})}),l.jsx(Xt,{children:l.jsxs(Jt,{className:"pt-6",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Most Active Crawler"}),l.jsx("p",{className:"text-2xl font-bold",children:(p==null?void 0:p.name)||"—"}),p&&l.jsxs("p",{className:"text-xs text-muted-foreground",children:[p.count," visits"]})]})}),l.jsx(Xt,{children:l.jsxs(Jt,{className:"pt-6",children:[l.jsx("div",{className:"flex items-center gap-2",children:l.jsx($p,{className:"w-5 h-5 text-muted-foreground"})}),l.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Pages Crawled"}),l.jsx("p",{className:"text-2xl font-bold",children:m})]})})]}),l.jsxs(Xt,{children:[l.jsx(wa,{children:l.jsx(ba,{className:"text-base",children:"Crawler Activity — Last 30 Days"})}),l.jsx(Jt,{children:v.data.length===0?l.jsx("p",{className:"text-sm text-muted-foreground py-8 text-center",children:"No crawler activity recorded yet."}):l.jsx(SQ,{width:"100%",height:300,children:l.jsxs(tye,{data:v.data,children:[l.jsx(uT,{strokeDasharray:"3 3",className:"stroke-border"}),l.jsx(jm,{dataKey:"date",className:"text-xs"}),l.jsx(Bm,{className:"text-xs"}),l.jsx(sl,{contentStyle:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--foreground))"}}),l.jsx(Tp,{}),v.crawlers.map(b=>l.jsx(T0,{type:"monotone",dataKey:b,stroke:zX[b]||"#888",strokeWidth:2,dot:!1},b))]})})})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsxs(Xt,{children:[l.jsx(wa,{children:l.jsx(ba,{className:"text-base",children:"Crawler Breakdown (7d)"})}),l.jsx(Jt,{children:x.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No crawler visits in the last 7 days."}):l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border text-muted-foreground",children:[l.jsx("th",{className:"text-left py-2 font-medium",children:"Crawler"}),l.jsx("th",{className:"text-left py-2 font-medium",children:"Company"}),l.jsx("th",{className:"text-right py-2 font-medium",children:"Visits"}),l.jsx("th",{className:"text-left py-2 font-medium",children:"Last Visit"}),l.jsx("th",{className:"text-left py-2 font-medium",children:"Top Page"})]})}),l.jsx("tbody",{children:x.map(b=>l.jsxs("tr",{className:"border-b border-border/50",children:[l.jsx("td",{className:"py-2 font-medium",children:b.name}),l.jsx("td",{className:"py-2 text-muted-foreground",children:b.company}),l.jsx("td",{className:"py-2 text-right",children:b.count}),l.jsx("td",{className:"py-2 text-muted-foreground",children:Py(new Date(b.lastVisit),{addSuffix:!0})}),l.jsx("td",{className:"py-2 text-xs text-muted-foreground truncate max-w-[150px]",children:b.topPage})]},b.name))})]})})})]}),l.jsxs(Xt,{children:[l.jsx(wa,{children:l.jsx(ba,{className:"text-base",children:"Pages Never Crawled"})}),l.jsx(Jt,{children:a?l.jsx(lt,{className:"h-20 w-full"}):i.length===0?l.jsxs("div",{className:"flex items-center gap-2 text-green-600",children:[l.jsx(cU,{className:"w-4 h-4"}),l.jsx("span",{className:"text-sm",children:"All AEO pages have been crawled by at least one AI bot."})]}):l.jsx("ul",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:i.map(b=>l.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[l.jsx(Vp,{className:"w-4 h-4 text-yellow-500 shrink-0"}),l.jsx("span",{className:"text-muted-foreground truncate",children:b})]},b))})})]})]}),l.jsxs(Xt,{children:[l.jsx(wa,{children:l.jsx(ba,{className:"text-base",children:"Recent Activity"})}),l.jsx(Jt,{children:w.length===0?l.jsx("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"No crawler activity recorded yet. Bot visits will appear here once detected."}):l.jsx("div",{className:"max-h-[400px] overflow-y-auto space-y-2",children:w.map(b=>l.jsxs("div",{className:"flex items-center gap-3 text-sm py-1.5 border-b border-border/30 last:border-0",children:[l.jsx("span",{className:"text-xs text-muted-foreground w-24 shrink-0",children:Py(new Date(b.created_at),{addSuffix:!0})}),l.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{backgroundColor:zX[b.crawler_name]||"#888"}}),l.jsx("span",{className:"font-medium w-32 shrink-0",children:b.crawler_name}),l.jsx("span",{className:"text-muted-foreground truncate flex-1",children:b.page_path}),l.jsx(qt,{variant:b.status_code===200?"default":"destructive",className:"text-xs shrink-0",children:b.status_code||200})]},b.id))})})]})]})},Ux=["perplexity","openai","gemini"],ak={perplexity:{label:"Perplexity",color:"#3b82f6",bgClass:"bg-blue-100 text-blue-800"},openai:{label:"ChatGPT",color:"#22c55e",bgClass:"bg-green-100 text-green-800"},gemini:{label:"Gemini",color:"#a855f7",bgClass:"bg-purple-100 text-purple-800"}},VX={buying:"bg-blue-100 text-blue-800",selling:"bg-green-100 text-green-800",neighborhoods:"bg-purple-100 text-purple-800","market-insights":"bg-orange-100 text-orange-800",guides:"bg-teal-100 text-teal-800",luxury:"bg-amber-100 text-amber-800",general:"bg-gray-100 text-gray-800"},t1t=["buying","selling","neighborhoods","market-insights","guides","luxury","general"],n1t=({siteDomain:e})=>{const[t,n]=C.useState([]),[r,i]=C.useState([]),[s,a]=C.useState(!0),[o,c]=C.useState(!1),[u,d]=C.useState({current:0,total:0}),[h,A]=C.useState(new Set),[f,p]=C.useState(new Set),[m,g]=C.useState("all"),[y,v]=C.useState("all"),[x,w]=C.useState("last-checked"),b="khmmwvmdbhaplcfcndjx",k="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",j=C.useCallback(async()=>{const q=new Date(Date.now()-2592e6).toISOString(),[{data:Z},{data:de}]=await Promise.all([Me.from("citation_checks").select("*").eq("site_domain",e).gte("checked_at",q).order("checked_at",{ascending:!1}).limit(1e3),Me.from("monitor_prompts").select("*").eq("site_domain",e).eq("is_active",!0).order("created_at",{ascending:!0})]);n(Z||[]),i(de||[]),a(!1)},[e]);C.useEffect(()=>{j()},[j]);const B=t.length,E=t.filter(q=>q.was_cited).length,I=B>0?Math.round(E/B*100):0,T=C.useMemo(()=>{const q=new Set(t.filter(Z=>Z.was_cited).map(Z=>Z.ai_platform));return Ux.map(Z=>({platform:Z,citing:q.has(Z)}))},[t]),N=C.useMemo(()=>{const q=t.filter(Z=>{const de=Z.competitor_mentions;return Array.isArray(de)&&de.length>0}).length;return B>0?Math.round(q/B*100):0},[t,B]),F=C.useMemo(()=>Ux.map(q=>{var ie;const Z=t.filter(Ce=>Ce.ai_platform===q),de=Z.filter(Ce=>Ce.was_cited).length,ue=Z.length>0?Math.round(de/Z.length*100):0,ae=Z[0],he=((ie=Z.find(Ce=>Ce.was_cited&&Ce.citation_url))==null?void 0:ie.citation_url)||null;return{platform:q,total:Z.length,cited:de,rate:ue,lastCheck:ae,lastCitedUrl:he,hasData:Z.length>0}}),[t]),L=C.useMemo(()=>r.map(q=>{const Z=t.filter(he=>he.prompt_text===q.prompt_text),de={};Ux.forEach(he=>{de[he]=Z.find(ie=>ie.ai_platform===he)||null});const ue=Z.length>0?Z[0].checked_at:null,ae=Ux.filter(he=>{var ie;return(ie=de[he])==null?void 0:ie.was_cited}).length;return{...q,byPlatform:de,lastChecked:ue,citedCount:ae}}),[r,t]),U=C.useMemo(()=>{let q=L;return m!=="all"&&(q=q.filter(Z=>Z.category===m)),y==="cited"&&(q=q.filter(Z=>Z.citedCount>0)),y==="not-cited"&&(q=q.filter(Z=>Z.citedCount===0)),x==="citation-rate"?q=[...q].sort((Z,de)=>de.citedCount-Z.citedCount):x==="category"?q=[...q].sort((Z,de)=>Z.category.localeCompare(de.category)):q=[...q].sort((Z,de)=>!Z.lastChecked&&!de.lastChecked?0:Z.lastChecked?de.lastChecked?new Date(de.lastChecked).getTime()-new Date(Z.lastChecked).getTime():-1:1),q},[L,m,y,x]),H=async q=>{c(!0),d({current:0,total:q.length});let Z=0;for(const ue of q){d({current:Z+1,total:q.length});try{await fetch(`https://${b}.supabase.co/functions/v1/check-citations`,{method:"POST",headers:{"Content-Type":"application/json",apikey:k},body:JSON.stringify({prompt_text:ue.prompt_text,site_domain:ue.site_domain,prompt_category:ue.category,prompt_id:ue.id})})}catch(ae){console.error("Check failed for prompt:",ue.prompt_text,ae)}Z++,Z<q.length&&await new Promise(ae=>setTimeout(ae,2e3))}c(!1),await j();const de=F.filter(ue=>ue.hasData||!0).length;De({title:`Checked ${Z} prompts across ${de} platforms`})},K=()=>H(r),$=()=>{const q=r.filter(Z=>h.has(Z.id));q.length>0&&H(q)},z=q=>{p(Z=>{const de=new Set(Z);return de.has(q)?de.delete(q):de.add(q),de})},Q=q=>{A(Z=>{const de=new Set(Z);return de.has(q)?de.delete(q):de.add(q),de})},oe=()=>{h.size===U.length?A(new Set):A(new Set(U.map(q=>q.id)))},R=t.length>0?t[0].checked_at:null,M=R?_Ge(new Date(R),7):null,Y=I>30?"text-green-600":I>=10?"text-yellow-600":"text-red-500",X=q=>q?q.was_cited&&q.citation_position!=null?l.jsxs("span",{className:"text-green-600 font-medium text-xs",children:["✅ Cited (#",q.citation_position,")"]}):q.was_cited||q.brand_mentioned?l.jsx("span",{className:"text-green-500 text-xs",children:"✅ Mentioned"}):l.jsx("span",{className:"text-muted-foreground text-xs",children:"❌ Not found"}):l.jsx("span",{className:"text-muted-foreground",children:"—"});return s?l.jsxs("div",{className:"space-y-4",children:[l.jsx(lt,{className:"h-32 w-full"}),l.jsx(lt,{className:"h-64 w-full"})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[l.jsx(Xt,{children:l.jsxs(Jt,{className:"pt-6",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Citation Rate (30d)"}),l.jsxs("p",{className:`text-3xl font-bold ${Y}`,children:[I,"%"]}),l.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[E," of ",B," checks cited"]})]})}),l.jsx(Xt,{children:l.jsxs(Jt,{className:"pt-6",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Platforms Citing You"}),l.jsx("div",{className:"flex gap-2 mt-2",children:T.map(({platform:q,citing:Z})=>l.jsx("span",{className:`inline-flex px-2 py-1 rounded-full text-xs font-medium ${Z?ak[q].bgClass:"bg-muted text-muted-foreground"}`,children:ak[q].label},q))})]})}),l.jsx(Xt,{children:l.jsxs(Jt,{className:"pt-6",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Checks Run"}),l.jsx("p",{className:"text-3xl font-bold",children:B})]})}),l.jsx(Xt,{children:l.jsxs(Jt,{className:"pt-6",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Competitors Cited Instead"}),l.jsxs("p",{className:`text-3xl font-bold ${N>20?"text-red-500":"text-muted-foreground"}`,children:[N,"%"]})]})})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:F.map(q=>{var Z;return l.jsxs(Xt,{children:[l.jsx(wa,{className:"pb-3",children:l.jsxs(ba,{className:"text-sm flex items-center justify-between",children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:`w-2 h-2 rounded-full ${q.hasData?"bg-green-500":"bg-muted-foreground"}`}),ak[q.platform].label]}),!q.hasData&&l.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"No data yet"})]})}),l.jsxs(Jt,{className:"space-y-3",children:[l.jsx("p",{className:`text-2xl font-bold ${q.rate>30?"text-green-600":q.rate>=10?"text-yellow-600":"text-muted-foreground"}`,children:q.hasData?`${q.rate}%`:"—"}),q.hasData&&l.jsx("div",{className:"w-full bg-muted rounded-full h-2",children:l.jsx("div",{className:"bg-green-500 h-2 rounded-full transition-all",style:{width:`${q.rate}%`}})}),l.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[l.jsxs("p",{children:["Last checked: ",(Z=q.lastCheck)!=null&&Z.checked_at?Py(new Date(q.lastCheck.checked_at),{addSuffix:!0}):"Never"]}),q.lastCitedUrl&&l.jsxs("p",{className:"truncate",children:["Last citation: ",l.jsx("a",{href:`https://${q.lastCitedUrl}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:q.lastCitedUrl})]})]})]})]},q.platform)})}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsxs(Fr,{value:m,onValueChange:g,children:[l.jsx(Br,{className:"w-[160px]",children:l.jsx(Mr,{placeholder:"Category"})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"all",children:"All Categories"}),t1t.map(q=>l.jsx(ft,{value:q,children:q},q))]})]}),l.jsxs(Fr,{value:y,onValueChange:v,children:[l.jsx(Br,{className:"w-[150px]",children:l.jsx(Mr,{})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"all",children:"Show All"}),l.jsx(ft,{value:"cited",children:"Cited Only"}),l.jsx(ft,{value:"not-cited",children:"Not Cited Only"})]})]}),l.jsxs(Fr,{value:x,onValueChange:w,children:[l.jsx(Br,{className:"w-[150px]",children:l.jsx(Mr,{})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"last-checked",children:"Last Checked"}),l.jsx(ft,{value:"citation-rate",children:"Citation Rate"}),l.jsx(ft,{value:"category",children:"Category"})]})]})]}),l.jsx(Xt,{children:l.jsx(Jt,{className:"pt-6",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border text-muted-foreground",children:[l.jsx("th",{className:"text-left py-2 w-8",children:l.jsx(no,{checked:h.size===U.length&&U.length>0,onCheckedChange:oe})}),l.jsx("th",{className:"text-left py-2 w-6"}),l.jsx("th",{className:"text-left py-2 font-medium",children:"Prompt"}),l.jsx("th",{className:"text-left py-2 font-medium w-28",children:"Category"}),l.jsx("th",{className:"text-center py-2 font-medium w-28",children:"Perplexity"}),l.jsx("th",{className:"text-center py-2 font-medium w-28",children:"ChatGPT"}),l.jsx("th",{className:"text-center py-2 font-medium w-28",children:"Gemini"}),l.jsx("th",{className:"text-left py-2 font-medium w-28",children:"Last Checked"})]})}),l.jsxs("tbody",{children:[U.map(q=>l.jsxs(l.Fragment,{children:[l.jsxs("tr",{className:"border-b border-border/50 hover:bg-muted/30 cursor-pointer",onClick:()=>z(q.id),children:[l.jsx("td",{className:"py-2.5",onClick:Z=>Z.stopPropagation(),children:l.jsx(no,{checked:h.has(q.id),onCheckedChange:()=>Q(q.id)})}),l.jsx("td",{className:"py-2.5",children:f.has(q.id)?l.jsx(hc,{className:"w-4 h-4 text-muted-foreground"}):l.jsx(fc,{className:"w-4 h-4 text-muted-foreground"})}),l.jsx("td",{className:"py-2.5",children:l.jsxs(BU,{children:[l.jsx(NU,{asChild:!0,children:l.jsx("span",{className:"block max-w-[300px] truncate",children:q.prompt_text})}),l.jsx(bE,{side:"top",className:"max-w-sm",children:l.jsx("p",{children:q.prompt_text})})]})}),l.jsx("td",{className:"py-2.5",children:l.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs font-medium ${VX[q.category]||VX.general}`,children:q.category})}),l.jsx("td",{className:"py-2.5 text-center",children:X(q.byPlatform.perplexity)}),l.jsx("td",{className:"py-2.5 text-center",children:X(q.byPlatform.openai)}),l.jsx("td",{className:"py-2.5 text-center",children:X(q.byPlatform.gemini)}),l.jsx("td",{className:"py-2.5 text-xs text-muted-foreground",children:q.lastChecked?Py(new Date(q.lastChecked),{addSuffix:!0}):"Never"})]},q.id),f.has(q.id)&&l.jsx("tr",{className:"bg-muted/20",children:l.jsx("td",{colSpan:8,className:"p-4",children:l.jsxs("div",{className:"space-y-3",children:[Ux.map(Z=>{const de=q.byPlatform[Z];return de?l.jsxs("div",{className:"text-xs space-y-1",children:[l.jsx("p",{className:"font-medium",children:ak[Z].label}),de.response_snippet&&l.jsx("p",{className:"text-muted-foreground bg-muted p-2 rounded text-xs leading-relaxed line-clamp-4",children:de.response_snippet}),de.citation_url&&l.jsxs("p",{children:["Citation: ",l.jsxs("a",{href:de.citation_url.startsWith("http")?de.citation_url:`https://${de.citation_url}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline inline-flex items-center gap-1",children:[de.citation_url," ",l.jsx(eo,{className:"w-3 h-3"})]})]}),Array.isArray(de.competitor_mentions)&&de.competitor_mentions.length>0&&l.jsxs("p",{className:"text-red-500",children:["Competitors mentioned: ",de.competitor_mentions.join(", ")]})]},Z):null}),l.jsxs(xe,{size:"sm",variant:"outline",disabled:o,onClick:Z=>{Z.stopPropagation(),H([q])},children:[l.jsx(R3,{className:"w-3 h-3 mr-1"})," Run This Prompt"]})]})})},`${q.id}-detail`)]})),U.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:8,className:"py-8 text-center text-muted-foreground",children:"No prompts match the current filters."})})]})]})})})}),l.jsx(Xt,{children:l.jsxs(Jt,{className:"pt-6 space-y-4",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsxs(xe,{onClick:K,disabled:o||r.length===0,children:[o?l.jsx(Ba,{className:"w-4 h-4 mr-2 animate-spin"}):l.jsx(R3,{className:"w-4 h-4 mr-2"}),o?`Checking prompt ${u.current} of ${u.total}...`:"Run All Checks Now"]}),l.jsxs(xe,{variant:"outline",onClick:$,disabled:o||h.size===0,children:["Run Selected (",h.size,")"]})]}),o&&l.jsx(Cv,{value:u.current/u.total*100,className:"h-2"}),l.jsxs("div",{className:"text-xs text-muted-foreground space-y-1",children:[l.jsxs("p",{children:["Last full run: ",R?Py(new Date(R),{addSuffix:!0}):"Never"]}),M&&l.jsxs("p",{children:["Next suggested run: ",M.toLocaleDateString()]}),l.jsx("p",{className:"text-muted-foreground/60",children:"Estimated cost: ~$0.01–0.03 per prompt across all platforms"})]})]})})]})},r1t=[{id:"buying",label:"Buying"},{id:"selling",label:"Selling"},{id:"neighborhoods",label:"Neighborhoods & Area Guides"},{id:"market-insights",label:"Market Reports & Trends"}],i1t=[{name:"Buyer Personas",items:[{id:"first-time-buyers",label:"First-Time Buyers",description:"First-time homebuyer guidance, programs, and local advice"},{id:"move-up-buyers",label:"Move-Up Buyers",description:"Current owners upgrading to a bigger or nicer home"},{id:"downsizers",label:"Downsizers / Empty Nesters",description:"Selling the family home, moving to something smaller"},{id:"relocation",label:"Relocation / Out-of-State",description:"People moving to the area from another city or state"},{id:"military-va",label:"Military / VA Buyers",description:"VA loans, base proximity, military-friendly agents"},{id:"investors",label:"Investors / Rental Properties",description:"Investment properties, cap rates, landlord guidance"},{id:"retirees",label:"Retirees",description:"Retirement communities, 55+, lifestyle transitions"},{id:"divorce-buyers",label:"Divorce Buyers",description:"Buying after a divorce, sensitive situations"},{id:"multi-generational",label:"Multi-Generational Buyers",description:"Homes for extended families, in-law suites"}]},{name:"Seller Personas",items:[{id:"fsbo-converts",label:"FSBO Converts",description:"For Sale By Owner sellers considering hiring an agent"},{id:"estate-probate",label:"Estate / Probate Sales",description:"Inherited property, estate settlement"},{id:"divorce-sellers",label:"Divorce Sellers",description:"Selling during or after a divorce"},{id:"landlords-exiting",label:"Landlords Exiting Rentals",description:"Selling investment/rental properties"},{id:"distressed-sellers",label:"Pre-Foreclosure / Distressed Sellers",description:"Short sales, financial distress situations"}]},{name:"Property Types",items:[{id:"luxury",label:"Luxury / High-End",description:"Premium properties, estates, high-end market"},{id:"waterfront",label:"Waterfront / Lakefront",description:"Waterfront homes, lake properties, coastal"},{id:"condos-townhomes",label:"Condos / Townhomes",description:"Condo and townhome market, HOA considerations"},{id:"new-construction",label:"New Construction",description:"New builds, builder relationships, custom homes"},{id:"historic-homes",label:"Historic / Older Homes",description:"Historic properties, renovation considerations"},{id:"land-lots",label:"Land / Lots",description:"Vacant land, building lots, acreage"},{id:"multi-family",label:"Multi-Family / Duplexes",description:"Duplexes, triplexes, small multi-family"},{id:"farms-rural",label:"Farms / Rural Property",description:"Agricultural, rural, hobby farms"},{id:"senior-living",label:"55+ Communities / Senior Living",description:"Age-restricted communities"}]},{name:"Local Knowledge",items:[{id:"school-districts",label:"School Districts",description:"School quality, district boundaries, family decisions"},{id:"commuter-guides",label:"Commuter Guides",description:"Commute times, transit access, highway proximity"}]},{name:"Specialty Topics",items:[{id:"financing",label:"FHA / VA / USDA Financing",description:"Government-backed loan programs and eligibility"},{id:"fixer-uppers",label:"Home Renovation / Fixer-Uppers",description:"Homes needing work, renovation potential"},{id:"second-homes",label:"Second Homes / Vacation Properties",description:"Vacation homes, short-term rental potential"}]}],KX=3,s1t=({selectedCategories:e,onCategoriesChange:t,onContinue:n})=>{const r=s=>{e.includes(s)?t(e.filter(a=>a!==s)):t([...e,s])},i=e.length>=KX;return l.jsxs("div",{className:"space-y-6 max-w-3xl mx-auto py-4",children:[l.jsxs("div",{className:"text-center space-y-2",children:[l.jsx("h2",{className:"text-lg font-semibold",children:"What do you specialize in?"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Select the niches you serve. The discovery engine will find high-intent questions in these categories. Buying, Selling, Neighborhoods, and Market Insights are always included."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Always Included"}),l.jsx("div",{className:"grid grid-cols-2 gap-2",children:r1t.map(s=>l.jsxs("div",{className:"flex items-center gap-2.5 rounded-md border bg-muted/40 px-3 py-2.5 opacity-80",children:[l.jsx(no,{checked:!0,disabled:!0,className:"opacity-60"}),l.jsx(Pre,{className:"w-3.5 h-3.5 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:s.label})]},s.id))})]}),i1t.map(s=>l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:s.name}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:s.items.map(a=>{const o=e.includes(a.id);return l.jsxs("button",{type:"button",onClick:()=>r(a.id),className:`flex items-start gap-2.5 rounded-md border px-3 py-2.5 text-left transition-colors hover:bg-muted/50 ${o?"border-primary bg-primary/5":"border-border"}`,children:[l.jsx(no,{checked:o,className:"mt-0.5 pointer-events-none"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("span",{className:"text-sm font-medium block",children:a.label}),l.jsx("span",{className:"text-xs text-muted-foreground block",children:a.description})]})]},a.id)})})]},s.name)),l.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[l.jsxs("p",{className:"text-sm text-muted-foreground",children:[l.jsxs(qt,{variant:i?"default":"secondary",className:"mr-2",children:[e.length," of ",KX," minimum"]}),"selected"]}),l.jsxs(xe,{onClick:n,disabled:!i,children:["Continue ",l.jsx(fc,{className:"w-4 h-4 ml-1"})]})]})]})},qX={buying:"bg-blue-100 text-blue-800",selling:"bg-green-100 text-green-800",neighborhoods:"bg-purple-100 text-purple-800","market-insights":"bg-orange-100 text-orange-800",guides:"bg-teal-100 text-teal-800",luxury:"bg-amber-100 text-amber-800",general:"bg-gray-100 text-gray-800"},a1t={perplexity:"bg-blue-500",openai:"bg-green-500",gemini:"bg-purple-500"},o1t=({open:e,onOpenChange:t,siteDomain:n,onImported:r})=>{const[i,s]=C.useState("categories"),[a,o]=C.useState(""),[c,u]=C.useState(""),[d,h]=C.useState([]),[A,f]=C.useState(null),[p,m]=C.useState(new Set),[g,y]=C.useState({}),[v,x]=C.useState(!0),[w,b]=C.useState("all"),[k,j]=C.useState("score"),[B,E]=C.useState(!1),[I,T]=C.useState(!1),[N,F]=C.useState(1),[L,U]=C.useState(""),[H,K]=C.useState(0),[$,z]=C.useState(0),[Q,oe]=C.useState([]),[R,M]=C.useState(0),Y="khmmwvmdbhaplcfcndjx",X="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q";C.useEffect(()=>{!e||!n||(async()=>{const{data:we}=await Me.from("monitored_sites").select("selected_categories").eq("domain",n).limit(1).single();we!=null&&we.selected_categories&&Array.isArray(we.selected_categories)&&we.selected_categories.length>0&&h(we.selected_categories)})()},[e,n]);const q=async()=>{await Me.from("monitored_sites").update({selected_categories:d}).eq("domain",n),s("input")},Z=async()=>{if(!(!a.trim()||!c.trim())){s("loading"),F(1),U(`Starting discovery for ${a.trim()}, ${c.trim()}...`),K(0),z(0),oe([]),M(0);try{const we=await fetch(`https://${Y}.supabase.co/functions/v1/discover-prompts`,{method:"POST",headers:{"Content-Type":"application/json",apikey:X},body:JSON.stringify({metro:a.trim(),state:c.trim(),categories:d})});if(!we.ok||!we.body){const ye=await we.text();throw new Error(ye||"Failed to start discovery")}const $e=we.body.getReader(),Ve=new TextDecoder;let $t="",yt=null;for(;;){const{done:ye,value:Be}=await $e.read();if(ye)break;$t+=Ve.decode(Be,{stream:!0});let Ge;for(;(Ge=$t.indexOf(`

`))!==-1;){const Ue=$t.slice(0,Ge).trim();if($t=$t.slice(Ge+2),!Ue.startsWith("data: "))continue;const Ye=Ue.slice(6).trim();if(Ye!=="[DONE]")try{const pe=JSON.parse(Ye);switch(pe.type){case"status":U(pe.message),pe.phase&&F(pe.phase),de(pe.message);break;case"progress":U(pe.message),K(pe.completed),z(pe.total),pe.phase&&F(pe.phase),de(pe.message);break;case"phase_complete":U(pe.message),pe.uniqueQuestions&&M(pe.uniqueQuestions),de(pe.message);break;case"error":throw new Error(pe.message);case"result":yt=pe;break}}catch(pe){if(pe.message&&!pe.message.includes("JSON"))throw pe}}}if(yt){f(yt);const ye=new Set;yt.questions.forEach(Be=>{Be.citability_score>=3&&ye.add(Be.normalized)}),m(ye),s("results")}else throw new Error("No results received from discovery")}catch(we){De({title:"Discovery failed",description:we.message,variant:"destructive"}),s("input")}}},de=we=>{oe($e=>[...$e,`[${new Date().toLocaleTimeString()}] ${we}`].slice(-30))},ue=C.useMemo(()=>{if(!A)return[];let we=[...A.questions];return v&&(we=we.filter($e=>$e.citability_score>=4)),w!=="all"&&(we=we.filter($e=>$e.category===w)),k==="score"?we.sort(($e,Ve)=>Ve.citability_score-$e.citability_score):k==="category"?we.sort(($e,Ve)=>$e.category.localeCompare(Ve.category)):k==="platforms"&&we.sort(($e,Ve)=>Ve.source_count-$e.source_count),we},[A,v,w,k]),ae=p.size,he=(A==null?void 0:A.questions.filter(we=>p.has(we.normalized)&&we.citability_score>=4).length)||0,ie=(A==null?void 0:A.questions.filter(we=>p.has(we.normalized)&&we.citability_score>=3&&we.citability_score<4).length)||0,Ce=we=>{m($e=>{const Ve=new Set($e);return Ve.has(we)?Ve.delete(we):Ve.add(we),Ve})},Oe=()=>{const we=new Set(p);ue.forEach($e=>we.add($e.normalized)),m(we)},te=()=>m(new Set),je=async()=>{if(!(!A||ae===0)){E(!0);try{const{data:we}=await Me.from("monitor_prompts").select("prompt_text").eq("site_domain",n),$e=new Set((we||[]).map(yt=>yt.prompt_text.toLowerCase().replace(/[?!.,]+$/,"").trim())),Ve=A.questions.filter(yt=>p.has(yt.normalized)).filter(yt=>!$e.has(yt.normalized)).map(yt=>({site_domain:n,prompt_text:g[yt.normalized]||yt.question,category:yt.category,citability_score:yt.citability_score})),$t=ae-Ve.length;if(Ve.length>0){const{error:yt}=await Me.from("monitor_prompts").insert(Ve);if(yt)throw yt}De({title:`Added ${Ve.length} new prompts to your prompt bank`,description:$t>0?`${$t} duplicates skipped`:void 0}),r(),t(!1),tt()}catch(we){De({title:"Import failed",description:we.message,variant:"destructive"})}finally{E(!1)}}},tt=()=>{s("categories"),f(null),m(new Set),y({}),oe([]),F(1),U(""),K(0),z(0),M(0)},nt=we=>{we||tt(),t(we)},Te=we=>{const $e=we/5*100,Ve=we>=4?"bg-green-500":we>=3?"bg-yellow-500":we>=2?"bg-orange-500":"bg-red-500",$t=we>=4?"High":we>=3?"Medium":we>=2?"Low":"Unlikely";return l.jsxs("div",{className:"flex items-center gap-2 min-w-[140px]",children:[l.jsx("div",{className:"flex-1 h-2 rounded-full bg-muted overflow-hidden",children:l.jsx("div",{className:`h-full rounded-full ${Ve}`,style:{width:`${$e}%`}})}),l.jsx("span",{className:"text-xs font-medium w-8 text-right",children:we.toFixed(1)}),l.jsx("span",{className:`text-[10px] font-medium px-1.5 py-0.5 rounded ${we>=4?"bg-green-100 text-green-800":we>=3?"bg-yellow-100 text-yellow-800":we>=2?"bg-orange-100 text-orange-800":"bg-red-100 text-red-800"}`,children:$t})]})},ct=$>0?Math.round(H/$*100):0;return l.jsx(No,{open:e,onOpenChange:nt,children:l.jsxs(Ka,{className:"max-w-6xl max-h-[90vh] flex flex-col p-0",children:[l.jsx(qa,{className:"px-6 pt-6 pb-4 border-b",children:l.jsxs(Wa,{className:"flex items-center gap-2",children:[l.jsx(Ts,{className:"w-5 h-5 text-primary"})," Prompt Discovery Engine"]})}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[i==="categories"&&l.jsx(s1t,{selectedCategories:d,onCategoriesChange:h,onContinue:q}),i==="input"&&l.jsxs("div",{className:"max-w-md mx-auto py-12 space-y-6",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium",children:"Metro Area"}),l.jsx(Xe,{placeholder:"e.g., Grand Rapids, Phoenix, Dallas-Fort Worth",value:a,onChange:we=>o(we.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium",children:"State"}),l.jsx(Xe,{placeholder:"e.g., MI, AZ, TX",value:c,onChange:we=>u(we.target.value),className:"mt-1"})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(xe,{variant:"outline",onClick:()=>s("categories"),children:"Back"}),l.jsxs(xe,{onClick:Z,disabled:!a.trim()||!c.trim(),className:"flex-1",children:[l.jsx(Ts,{className:"w-4 h-4 mr-2"})," Discover Questions"]})]})]}),l.jsxs("div",{className:"text-center space-y-2",children:[l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Querying ",4+d.length," prompt categories across AI platforms. Takes 2-4 minutes."]}),d.length>0&&l.jsx("div",{className:"flex flex-wrap justify-center gap-1",children:d.map(we=>l.jsx(qt,{variant:"secondary",className:"text-[10px]",children:we},we))})]})]}),i==="loading"&&l.jsxs("div",{className:"flex flex-col items-center justify-center py-10 space-y-6 max-w-2xl mx-auto",children:[l.jsx(Ba,{className:"w-10 h-10 animate-spin text-primary"}),l.jsxs("div",{className:"text-center space-y-2 w-full",children:[l.jsx("p",{className:"font-medium",children:L}),l.jsx("div",{className:"flex items-center justify-center gap-2",children:["perplexity","openai","gemini"].map(we=>l.jsx(qt,{variant:"secondary",className:"text-xs capitalize",children:we==="openai"?"ChatGPT":we.charAt(0).toUpperCase()+we.slice(1)},we))}),$>0&&l.jsxs("div",{className:"w-full space-y-1 pt-2",children:[l.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[l.jsxs("span",{children:["Phase ",N,": ",H,"/",$]}),l.jsxs("span",{children:[ct,"%"]})]}),l.jsx("div",{className:"w-full h-3 rounded-full bg-muted overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-500",style:{width:`${ct}%`}})})]}),R>0&&l.jsxs("p",{className:"text-sm text-muted-foreground pt-1",children:["✅ ",R," unique questions discovered — now scoring citability..."]})]}),l.jsxs("div",{className:"w-full border rounded-lg bg-muted/30 p-3 max-h-48 overflow-y-auto",children:[l.jsx("p",{className:"text-[10px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:"Live Activity Log"}),l.jsxs("div",{className:"space-y-0.5 font-mono text-[11px] text-muted-foreground",children:[Q.length===0&&l.jsx("p",{children:"Waiting for events..."}),Q.map((we,$e)=>l.jsx("p",{className:$e===Q.length-1?"text-foreground font-medium":"",children:we},$e))]})]})]}),i==="results"&&A&&l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("p",{className:"font-medium",children:["Total questions found: ",A.total_questions]}),l.jsxs("p",{className:"text-sm font-medium text-green-700",children:[A.high_citability_count," questions scored 4+ (high citability) — these are your priority targets"]})]}),l.jsxs("div",{className:"flex h-3 rounded-full overflow-hidden bg-muted",children:[A.high_citability_count>0&&l.jsx("div",{className:"bg-green-500 transition-all",style:{width:`${A.high_citability_count/A.total_questions*100}%`}}),A.medium_citability_count>0&&l.jsx("div",{className:"bg-yellow-500 transition-all",style:{width:`${A.medium_citability_count/A.total_questions*100}%`}}),A.low_citability_count>0&&l.jsx("div",{className:"bg-red-500 transition-all",style:{width:`${A.low_citability_count/A.total_questions*100}%`}})]}),l.jsxs("div",{className:"flex gap-4 text-xs text-muted-foreground",children:[l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-green-500"})," High (",A.high_citability_count,")"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-yellow-500"})," Medium (",A.medium_citability_count,")"]}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-red-500"})," Low (",A.low_citability_count,")"]})]}),l.jsx("p",{className:"text-[10px] text-muted-foreground",children:A.accuracy_note})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(pc,{checked:v,onCheckedChange:x}),l.jsx("span",{className:"text-sm font-medium",children:"High Citability Only"})]}),l.jsxs(Fr,{value:w,onValueChange:b,children:[l.jsx(Br,{className:"w-[160px]",children:l.jsx(Mr,{})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"all",children:"All Categories"}),["buying","selling","neighborhoods","market-insights","luxury","guides","general"].map(we=>l.jsx(ft,{value:we,children:we},we))]})]}),l.jsxs(Fr,{value:k,onValueChange:j,children:[l.jsx(Br,{className:"w-[160px]",children:l.jsx(Mr,{})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"score",children:"Citability Score"}),l.jsx(ft,{value:"category",children:"Category"}),l.jsx(ft,{value:"platforms",children:"Number of Platforms"})]})]}),l.jsxs("div",{className:"flex gap-2 ml-auto",children:[l.jsx(xe,{size:"sm",variant:"outline",onClick:Oe,children:"Select All Visible"}),l.jsx(xe,{size:"sm",variant:"outline",onClick:te,children:"Deselect All"})]})]}),l.jsx("div",{className:"border rounded-lg overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b bg-muted/50 text-muted-foreground",children:[l.jsx("th",{className:"w-10 p-2"}),l.jsx("th",{className:"text-left p-2 font-medium",children:"Question"}),l.jsx("th",{className:"text-left p-2 font-medium w-32",children:"Category"}),l.jsx("th",{className:"text-left p-2 font-medium w-44",children:"Citability"}),l.jsx("th",{className:"text-center p-2 font-medium w-24",children:"Platforms"})]})}),l.jsxs("tbody",{children:[ue.map(we=>l.jsxs("tr",{className:"border-b border-border/50 hover:bg-muted/30",children:[l.jsx("td",{className:"p-2 text-center",children:l.jsx(no,{checked:p.has(we.normalized),onCheckedChange:()=>Ce(we.normalized)})}),l.jsx("td",{className:"p-2",children:l.jsx("input",{className:"w-full bg-transparent border-none outline-none text-sm focus:ring-1 focus:ring-primary rounded px-1 py-0.5",value:g[we.normalized]??we.question,onChange:$e=>y(Ve=>({...Ve,[we.normalized]:$e.target.value}))})}),l.jsx("td",{className:"p-2",children:l.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs font-medium ${qX[we.category]||qX.general}`,children:we.category})}),l.jsx("td",{className:"p-2",children:Te(we.citability_score)}),l.jsx("td",{className:"p-2",children:l.jsx("div",{className:"flex items-center justify-center gap-1.5",children:we.sources.map($e=>l.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${a1t[$e]||"bg-gray-400"}`,title:$e},$e))})})]},we.normalized)),ue.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:5,className:"py-8 text-center text-muted-foreground",children:"No questions match the current filters."})})]})]})})]})]}),i==="results"&&l.jsxs("div",{className:"border-t bg-background px-6 py-4 flex items-center justify-between",children:[l.jsxs("p",{className:"text-sm text-muted-foreground",children:[ae," questions selected (",he," high, ",ie," medium)"]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs(xe,{variant:"outline",onClick:()=>T(!0),disabled:ae===0||B,children:[l.jsx($p,{className:"w-4 h-4 mr-2"})," Generate Blueprint from Selected"]}),l.jsxs(xe,{onClick:je,disabled:ae===0||B,children:[B?l.jsx(Ba,{className:"w-4 h-4 mr-2 animate-spin"}):l.jsx(Fo,{className:"w-4 h-4 mr-2"}),"Add Selected to Prompt Bank"]})]})]}),A&&l.jsx(xAe,{open:I,onOpenChange:T,siteDomain:n,questions:A.questions.filter(we=>p.has(we.normalized)),metro:A.metro||a,state:A.state||c,onImported:r})]})})},z4=["buying","selling","neighborhoods","market-insights","guides","luxury","general"],WX={buying:"bg-blue-100 text-blue-800",selling:"bg-green-100 text-green-800",neighborhoods:"bg-purple-100 text-purple-800","market-insights":"bg-orange-100 text-orange-800",guides:"bg-teal-100 text-teal-800",luxury:"bg-amber-100 text-amber-800",general:"bg-gray-100 text-gray-800"},l1t=({score:e})=>{if(e==null)return l.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const t=e/5*100,n=e>=4?"bg-green-500":e>=3?"bg-yellow-500":e>=2?"bg-orange-500":"bg-red-500",r=e>=4?"High":e>=3?"Medium":e>=2?"Low":"Unlikely",i=e>=4?"bg-green-100 text-green-800":e>=3?"bg-yellow-100 text-yellow-800":e>=2?"bg-orange-100 text-orange-800":"bg-red-100 text-red-800";return l.jsxs("div",{className:"flex items-center gap-1.5 min-w-[110px]",children:[l.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-muted overflow-hidden",children:l.jsx("div",{className:`h-full rounded-full ${n}`,style:{width:`${t}%`}})}),l.jsx("span",{className:"text-[10px] font-medium w-6 text-right",children:e.toFixed(1)}),l.jsx("span",{className:`text-[9px] font-medium px-1 py-0.5 rounded ${i}`,children:r})]})},c1t=()=>{const[e,t]=C.useState([]),[n,r]=C.useState(null),[i,s]=C.useState(!0),[a,o]=C.useState(""),[c,u]=C.useState("all"),[d,h]=C.useState(!1),[A,f]=C.useState(!1),[p,m]=C.useState(!1),[g,y]=C.useState(""),[v,x]=C.useState("general"),[w,b]=C.useState(""),[k,j]=C.useState("general"),[B,E]=C.useState(null),[I,T]=C.useState(""),[N,F]=C.useState(!1),[L,U]=C.useState(""),[H,K]=C.useState(""),[$,z]=C.useState(!1),[Q,oe]=C.useState(!1),[R,M]=C.useState(""),[Y,X]=C.useState(""),[q,Z]=C.useState("default"),[de,ue]=C.useState(!1),[ae,he]=C.useState(!1),[ie,Ce]=C.useState(!1),[Oe,te]=C.useState(""),[je,tt]=C.useState(""),nt="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",Te=async()=>{const[{data:pe},{data:bt}]=await Promise.all([Me.from("monitored_sites").select("*").limit(1).single(),Me.from("monitor_prompts").select("*").order("created_at",{ascending:!0})]);pe&&r({id:pe.id,domain:pe.domain,brand_keywords:pe.brand_keywords||[],competitor_domains:pe.competitor_domains||[]}),t(bt||[]),s(!1)};C.useEffect(()=>{Te()},[]);const ct=C.useMemo(()=>{let pe=e.filter(bt=>!(c!=="all"&&bt.category!==c||a&&!bt.prompt_text.toLowerCase().includes(a.toLowerCase())||de&&(bt.citability_score==null||bt.citability_score<4)));return q==="citability"&&(pe=[...pe].sort((bt,mt)=>(mt.citability_score??0)-(bt.citability_score??0))),pe},[e,c,a,q,de]),we=async()=>{if(!g.trim()||!n)return;const{error:pe}=await Me.from("monitor_prompts").insert({site_domain:n.domain,prompt_text:g.trim(),category:v});if(pe){De({title:"Failed to add prompt",variant:"destructive"});return}De({title:"Prompt added"}),y(""),h(!1),Te()},$e=async()=>{if(!w.trim()||!n)return;const pe=w.split(`
`).map(_t=>_t.trim()).filter(Boolean);if(pe.length===0)return;const bt=pe.map(_t=>({site_domain:n.domain,prompt_text:_t,category:k})),{error:mt}=await Me.from("monitor_prompts").insert(bt);if(mt){De({title:"Bulk add failed",variant:"destructive"});return}De({title:`${pe.length} prompts added`}),b(""),f(!1),Te()},Ve=async(pe,bt)=>{await Me.from("monitor_prompts").update({is_active:bt}).eq("id",pe),t(mt=>mt.map(_t=>_t.id===pe?{..._t,is_active:bt}:_t))},$t=async pe=>{confirm("Delete this prompt?")&&(await Me.from("monitor_prompts").delete().eq("id",pe),t(bt=>bt.filter(mt=>mt.id!==pe)),De({title:"Prompt deleted"}))},yt=async pe=>{await Me.from("monitor_prompts").update({prompt_text:I}).eq("id",pe),t(bt=>bt.map(mt=>mt.id===pe?{...mt,prompt_text:I}:mt)),E(null),De({title:"Prompt updated"})},ye=async()=>{if(!L.trim()||!n)return;const pe=[...n.brand_keywords,L.trim()];await Me.from("monitored_sites").update({brand_keywords:pe}).eq("id",n.id),r({...n,brand_keywords:pe}),U("")},Be=async pe=>{if(!n)return;const bt=n.brand_keywords.filter(mt=>mt!==pe);await Me.from("monitored_sites").update({brand_keywords:bt}).eq("id",n.id),r({...n,brand_keywords:bt})},Ge=async()=>{if(!H.trim()||!n)return;const pe=[...n.competitor_domains,H.trim()];await Me.from("monitored_sites").update({competitor_domains:pe}).eq("id",n.id),r({...n,competitor_domains:pe}),K("")},Ue=async pe=>{if(!n)return;const bt=n.competitor_domains.filter(mt=>mt!==pe);await Me.from("monitored_sites").update({competitor_domains:bt}).eq("id",n.id),r({...n,competitor_domains:bt})},Ye=async()=>{if(!(!R.trim()||!Y.trim()||!n)){z(!0),oe(!1);try{const pe=e.filter(Dt=>Dt.is_active);if(pe.length===0){De({title:"No active prompts to score"}),z(!1);return}const bt=pe.map(Dt=>Dt.prompt_text),mt=u1t(bt,R.trim(),Y.trim()),Rt=await d1t(mt,bt.length,"https://khmmwvmdbhaplcfcndjx.supabase.co",nt);for(let Dt=0;Dt<pe.length;Dt++){const Ft=Rt[Dt]??3;await Me.from("monitor_prompts").update({citability_score:Ft}).eq("id",pe[Dt].id)}const Wt=Rt.filter(Dt=>Dt>=4).length,vt=Rt.filter(Dt=>Dt>=3&&Dt<4).length;De({title:`Scored ${pe.length} prompts`,description:`${Wt} scored high, ${vt} scored medium.`}),Te()}catch(pe){De({title:"Scoring failed",description:pe.message,variant:"destructive"})}finally{z(!1)}}};return i?l.jsx(lt,{className:"h-64 w-full"}):l.jsxs("div",{className:"space-y-6",children:[l.jsx(Xw,{open:N,onOpenChange:F,children:l.jsxs(Xt,{children:[l.jsx(Jw,{className:"w-full",children:l.jsxs(wa,{className:"flex flex-row items-center justify-between cursor-pointer",children:[l.jsxs(ba,{className:"text-base flex items-center gap-2",children:[l.jsx(hU,{className:"w-4 h-4"})," Site Settings"]}),l.jsx(hc,{className:`w-4 h-4 transition-transform ${N?"rotate-180":""}`})]})}),l.jsx(Zw,{children:l.jsxs(Jt,{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Site Domain"}),l.jsx("p",{className:"text-sm font-mono mt-1",children:n==null?void 0:n.domain})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Brand Keywords"}),l.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:n==null?void 0:n.brand_keywords.map(pe=>l.jsxs(qt,{variant:"secondary",className:"gap-1",children:[pe,l.jsx("button",{onClick:()=>Be(pe),className:"ml-1 hover:text-destructive",children:l.jsx(ta,{className:"w-3 h-3"})})]},pe))}),l.jsxs("div",{className:"flex gap-2 mt-2",children:[l.jsx(Xe,{placeholder:"Add keyword...",value:L,onChange:pe=>U(pe.target.value),onKeyDown:pe=>pe.key==="Enter"&&ye(),className:"max-w-xs"}),l.jsx(xe,{size:"sm",variant:"outline",onClick:ye,children:"Add"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Competitor Domains"}),l.jsxs("div",{className:"flex flex-wrap gap-2 mt-2",children:[n==null?void 0:n.competitor_domains.map(pe=>l.jsxs(qt,{variant:"secondary",className:"gap-1",children:[pe,l.jsx("button",{onClick:()=>Ue(pe),className:"ml-1 hover:text-destructive",children:l.jsx(ta,{className:"w-3 h-3"})})]},pe)),(n==null?void 0:n.competitor_domains.length)===0&&l.jsx("span",{className:"text-sm text-muted-foreground",children:"None added yet"})]}),l.jsxs("div",{className:"flex gap-2 mt-2",children:[l.jsx(Xe,{placeholder:"Add competitor domain...",value:H,onChange:pe=>K(pe.target.value),onKeyDown:pe=>pe.key==="Enter"&&Ge(),className:"max-w-xs"}),l.jsx(xe,{size:"sm",variant:"outline",onClick:Ge,children:"Add"})]})]})]})})]})}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsxs("div",{className:"relative flex-1 min-w-[200px] max-w-sm",children:[l.jsx(hE,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),l.jsx(Xe,{placeholder:"Search prompts...",value:a,onChange:pe=>o(pe.target.value),className:"pl-9"})]}),l.jsxs(Fr,{value:c,onValueChange:u,children:[l.jsx(Br,{className:"w-[180px]",children:l.jsx(Mr,{placeholder:"Category"})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"all",children:"All Categories"}),z4.map(pe=>l.jsx(ft,{value:pe,children:pe},pe))]})]}),l.jsxs(Fr,{value:q,onValueChange:Z,children:[l.jsx(Br,{className:"w-[160px]",children:l.jsx(Mr,{})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"default",children:"Date Added"}),l.jsx(ft,{value:"citability",children:"Citability Score"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(pc,{checked:de,onCheckedChange:ue}),l.jsx("span",{className:"text-sm font-medium",children:"High Only"})]}),l.jsxs(xe,{size:"sm",onClick:()=>h(!0),children:[l.jsx(zp,{className:"w-4 h-4 mr-1"})," Add Prompt"]}),l.jsxs(xe,{size:"sm",variant:"outline",onClick:()=>f(!0),children:[l.jsx(R2e,{className:"w-4 h-4 mr-1"})," Bulk Add"]}),l.jsxs(xe,{size:"sm",variant:"default",onClick:()=>m(!0),className:"bg-primary",children:[l.jsx(Ts,{className:"w-4 h-4 mr-1"})," Discover Prompts"]}),l.jsxs(xe,{size:"sm",variant:"outline",onClick:()=>oe(!0),disabled:$,children:[$?l.jsx(Ba,{className:"w-4 h-4 mr-1 animate-spin"}):l.jsx(Xc,{className:"w-4 h-4 mr-1"}),"Re-score Prompts"]}),l.jsxs(xe,{size:"sm",variant:"outline",onClick:()=>Ce(!0),disabled:e.filter(pe=>pe.is_active).length===0,children:[l.jsx($p,{className:"w-4 h-4 mr-1"})," Generate Blueprint from Bank"]})]}),l.jsx(Xt,{children:l.jsx(Jt,{className:"pt-6",children:l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-border text-muted-foreground",children:[l.jsx("th",{className:"text-left py-2 font-medium",children:"Prompt Text"}),l.jsx("th",{className:"text-left py-2 font-medium w-32",children:"Category"}),l.jsx("th",{className:"text-left py-2 font-medium w-32",children:"Citability"}),l.jsx("th",{className:"text-center py-2 font-medium w-20",children:"Active"}),l.jsx("th",{className:"text-left py-2 font-medium w-28",children:"Last Checked"}),l.jsx("th",{className:"text-right py-2 font-medium w-24",children:"Actions"})]})}),l.jsxs("tbody",{children:[ct.map(pe=>l.jsxs("tr",{className:"border-b border-border/50",children:[l.jsx("td",{className:"py-2.5",children:B===pe.id?l.jsxs("div",{className:"flex gap-2",children:[l.jsx(Xe,{value:I,onChange:bt=>T(bt.target.value),className:"text-sm"}),l.jsx(xe,{size:"sm",onClick:()=>yt(pe.id),children:"Save"}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>E(null),children:"Cancel"})]}):l.jsx("span",{children:pe.prompt_text})}),l.jsx("td",{className:"py-2.5",children:l.jsx("span",{className:`inline-block px-2 py-0.5 rounded-full text-xs font-medium ${WX[pe.category]||WX.general}`,children:pe.category})}),l.jsx("td",{className:"py-2.5",children:l.jsx(l1t,{score:pe.citability_score})}),l.jsx("td",{className:"py-2.5 text-center",children:l.jsx(pc,{checked:pe.is_active??!0,onCheckedChange:bt=>Ve(pe.id,bt)})}),l.jsx("td",{className:"py-2.5 text-muted-foreground text-xs",children:pe.last_checked_at?Py(new Date(pe.last_checked_at),{addSuffix:!0}):"Never"}),l.jsx("td",{className:"py-2.5 text-right",children:l.jsxs("div",{className:"flex justify-end gap-1",children:[l.jsx(xe,{size:"icon",variant:"ghost",className:"h-7 w-7",onClick:()=>{E(pe.id),T(pe.prompt_text)},children:l.jsx(Fre,{className:"w-3.5 h-3.5"})}),l.jsx(xe,{size:"icon",variant:"ghost",className:"h-7 w-7 text-destructive",onClick:()=>$t(pe.id),children:l.jsx(jl,{className:"w-3.5 h-3.5"})})]})})]},pe.id)),ct.length===0&&l.jsx("tr",{children:l.jsx("td",{colSpan:6,className:"py-8 text-center text-muted-foreground",children:"No prompts found."})})]})]})})})}),l.jsx(No,{open:d,onOpenChange:h,children:l.jsxs(Ka,{children:[l.jsx(qa,{children:l.jsx(Wa,{children:"Add Prompt"})}),l.jsxs("div",{className:"space-y-4",children:[l.jsx(Vi,{placeholder:"Enter your prompt question...",value:g,onChange:pe=>y(pe.target.value),rows:3}),l.jsxs(Fr,{value:v,onValueChange:x,children:[l.jsx(Br,{children:l.jsx(Mr,{})}),l.jsx(Nr,{children:z4.map(pe=>l.jsx(ft,{value:pe,children:pe},pe))})]}),l.jsx(xe,{onClick:we,disabled:!g.trim(),className:"w-full",children:"Save Prompt"})]})]})}),l.jsx(No,{open:A,onOpenChange:f,children:l.jsxs(Ka,{children:[l.jsx(qa,{children:l.jsx(Wa,{children:"Bulk Add Prompts"})}),l.jsxs("div",{className:"space-y-4",children:[l.jsx(Vi,{placeholder:"Paste one prompt per line...",value:w,onChange:pe=>b(pe.target.value),rows:8}),l.jsxs(Fr,{value:k,onValueChange:j,children:[l.jsx(Br,{children:l.jsx(Mr,{})}),l.jsx(Nr,{children:z4.map(pe=>l.jsx(ft,{value:pe,children:pe},pe))})]}),l.jsxs(xe,{onClick:$e,disabled:!w.trim(),className:"w-full",children:["Add ",w.split(`
`).filter(pe=>pe.trim()).length," Prompts"]})]})]})}),l.jsx(No,{open:Q,onOpenChange:oe,children:l.jsxs(Ka,{children:[l.jsx(qa,{children:l.jsx(Wa,{children:"Re-score Prompts for Citability"})}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("p",{className:"text-sm text-muted-foreground",children:["This will score all ",e.filter(pe=>pe.is_active).length," active prompts for citability. Requires a metro area for context."]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium",children:"Metro Area"}),l.jsx(Xe,{placeholder:"e.g., Grand Rapids",value:R,onChange:pe=>M(pe.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium",children:"State"}),l.jsx(Xe,{placeholder:"e.g., MI",value:Y,onChange:pe=>X(pe.target.value),className:"mt-1"})]}),l.jsxs(xe,{onClick:Ye,disabled:!R.trim()||!Y.trim(),className:"w-full",children:["Score ",e.filter(pe=>pe.is_active).length," Prompts"]})]})]})}),n&&l.jsx(o1t,{open:p,onOpenChange:m,siteDomain:n.domain,onImported:Te}),l.jsx(No,{open:ie,onOpenChange:Ce,children:l.jsxs(Ka,{children:[l.jsx(qa,{children:l.jsx(Wa,{children:"Generate Blueprint from Prompt Bank"})}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("p",{className:"text-sm text-muted-foreground",children:["This will cluster and rewrite ",e.filter(pe=>pe.is_active).length," active prompts into a structured content blueprint. Enter the metro area for context."]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium",children:"Metro Area"}),l.jsx(Xe,{placeholder:"e.g., Grand Rapids",value:Oe,onChange:pe=>te(pe.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-sm font-medium",children:"State"}),l.jsx(Xe,{placeholder:"e.g., MI",value:je,onChange:pe=>tt(pe.target.value),className:"mt-1"})]}),l.jsxs(xe,{onClick:()=>{Ce(!1),he(!0)},disabled:!Oe.trim()||!je.trim(),className:"w-full",children:[l.jsx($p,{className:"w-4 h-4 mr-2"})," Generate Blueprint"]})]})]})}),n&&l.jsx(xAe,{open:ae,onOpenChange:he,siteDomain:n.domain,questions:e.filter(pe=>pe.is_active&&pe.citability_score!=null&&pe.citability_score>=4).map(pe=>({question:pe.prompt_text,category:pe.category,citability_score:pe.citability_score??4})),metro:Oe,state:je,onImported:Te})]})};function u1t(e,t,n){const r=e.map((i,s)=>`${s+1}. ${i}`).join(`
`);return`You are evaluating real estate questions for ${t}, ${n}. For each question below, rate on a scale of 1-5 how likely you would be to include a specific local real estate agent's name, cite an agent's website URL, or directly recommend contacting a local realtor in your response.

SCORING GUIDE:
5 = You would almost certainly name a specific agent or link to an agent's website
4 = You would very likely recommend a specific agent or cite agent content
3 = You might cite an agent's content if it was high quality and relevant
2 = You would mostly answer with general info but might mention an agent in passing
1 = You would answer entirely with general knowledge and would not cite a specific agent

For each question, respond with ONLY the number (1-5), one per line, in the same order. No explanations.

Questions:
${r}`}async function d1t(e,t,n,r){await fetch(`${n}/functions/v1/discover-prompts`,{method:"POST",headers:{"Content-Type":"application/json",apikey:r},body:JSON.stringify({score_only:!0,scoring_prompt:e,count:t})});const i=`${n}/functions/v1/generate-aeo-content`,s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",apikey:r},body:JSON.stringify({prompt:e,max_tokens:2e3})});if(!s.ok)throw new Error("Scoring request failed");const a=await s.json(),c=(a.content||a.text||"").trim().split(`
`).map(d=>d.trim()),u=[];for(const d of c){const h=d.match(/(\d)/);if(h){const A=parseInt(h[1]);A>=1&&A<=5&&u.push(A)}if(u.length>=t)break}for(;u.length<t;)u.push(3);return u}const h1t=()=>{const[e,t]=C.useState([]),[n,r]=C.useState("");return C.useEffect(()=>{(async()=>{const{data:s}=await Me.from("monitored_sites").select("id, domain, display_name").eq("is_active",!0).order("created_at",{ascending:!0});s&&s.length>0&&(t(s),r(s[0].domain))})()},[]),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-lg font-semibold",children:"AEO Monitor"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Track AI crawler activity and monitor your brand's visibility across AI platforms."})]}),e.length>1&&l.jsxs(Fr,{value:n,onValueChange:r,children:[l.jsx(Br,{className:"w-[220px]",children:l.jsx(Mr,{placeholder:"Select site"})}),l.jsx(Nr,{children:e.map(i=>l.jsx(ft,{value:i.domain,children:i.display_name},i.domain))})]})]}),n&&l.jsxs(ym,{defaultValue:"crawler-activity",children:[l.jsxs(Vf,{className:"bg-muted/50 p-1",children:[l.jsx(Hn,{value:"crawler-activity",className:"text-xs uppercase tracking-wider",children:"Crawler Activity"}),l.jsx(Hn,{value:"citation-tracker",className:"text-xs uppercase tracking-wider",children:"Citation Tracker"}),l.jsx(Hn,{value:"prompt-bank",className:"text-xs uppercase tracking-wider",children:"Prompt Bank"})]}),l.jsx(Qn,{value:"crawler-activity",className:"mt-6",children:l.jsx(e1t,{})}),l.jsx(Qn,{value:"citation-tracker",className:"mt-6",children:l.jsx(n1t,{siteDomain:n})}),l.jsx(Qn,{value:"prompt-bank",className:"mt-6",children:l.jsx(c1t,{})})]})]})},f1t=()=>{const{isAdmin:e,isLoading:t}=A0(),{tier:n,isAeo:r,setTier:i,isLoading:s}=ife(),{configMap:a}=Os(),o=El(),[c,u]=C.useState(!1),[d,h]=C.useState("index"),[A,f]=C.useState(""),[p,m]=C.useState(!1),[g,y]=C.useState(!1),[v,x]=C.useState(!1),[w,b]=C.useState(null),[k,j]=C.useState(!1),[B,E]=C.useState(!1),I="khmmwvmdbhaplcfcndjx",T="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",N=async()=>{x(!0),j(!0),b(null);try{const[H,K]=await Promise.all([fetch(`https://${I}.supabase.co/functions/v1/sync-site-content`,{headers:{apikey:T}}),fetch("/sitemap-aeo.xml").then(Q=>Q.ok?Q.text():"").catch(()=>"")]);if(!H.ok)throw new Error(await H.text());const $=await H.json(),z=a.site_base_url||"https://www.holdengr.com";K&&$.audit&&($.audit=$.audit.map(Q=>{const R=Q.path==="/"&&Q.htmlFile==="index.html"?K.includes(`<loc>${z}/</loc>`)||K.includes(`<loc>${z}</loc>`):K.includes(`<loc>${z}/${Q.htmlFile}</loc>`);return{...Q,sitemapAeo:R?"✅":"❌"}})),b($),De({title:"Site content synchronized successfully"})}catch(H){De({title:"Sync failed",description:H.message,variant:"destructive"}),j(!1)}finally{x(!1)}},F=async()=>{E(!0);try{const H=await fetch(`https://${I}.supabase.co/functions/v1/sitemap`,{headers:{apikey:T}});if(!H.ok)throw new Error(await H.text());De({title:"Sitemaps regenerated",description:"sitemap.xml has been rebuilt from the database."})}catch(H){De({title:"Sitemap rebuild failed",description:H.message,variant:"destructive"})}finally{E(!1)}},L=async H=>{h(H),m(!0),u(!0),f("");try{const $=await(await fetch(`https://${I}.supabase.co/functions/v1/generate-llms-txt?type=${H}&rebuild=true`,{headers:{apikey:T}})).text();f($)}catch(K){De({title:"Rebuild failed",description:K.message,variant:"destructive"}),u(!1)}finally{m(!1)}},U=()=>{navigator.clipboard.writeText(A),y(!0),setTimeout(()=>y(!1),2e3)};return C.useEffect(()=>{!t&&!e&&o("/auth")},[e,t,o]),t||s?l.jsx(ln,{children:l.jsxs("div",{className:"container-page section-padding",children:[l.jsx(lt,{className:"h-10 w-64 mb-8"}),l.jsx(lt,{className:"h-64 w-full"})]})}):e?l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Site Factory | Holden Richardson"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsxs("div",{className:"container-page py-12 md:py-20",children:[l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h1",{className:"heading-section mb-0",children:"Site Factory"}),l.jsx(qt,{variant:r?"default":"outline",className:"text-xs uppercase tracking-wider",children:n==="aeo"?"AEO":"Core"})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx("span",{className:`font-medium ${r?"text-muted-foreground":"text-foreground"}`,children:"Core"}),l.jsx(pc,{checked:r,onCheckedChange:H=>i(H?"aeo":"core")}),l.jsx("span",{className:`font-medium ${r?"text-foreground":"text-muted-foreground"}`,children:"AEO"})]}),l.jsxs(At,{to:"/",className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[l.jsx(pm,{className:"w-4 h-4"}),"Back to Site"]})]})]}),l.jsxs("div",{className:"mb-8 flex flex-wrap items-center gap-3",children:[l.jsxs(xe,{size:"sm",variant:"default",onClick:N,disabled:v,children:[l.jsx(K2e,{className:"w-3.5 h-3.5 mr-1.5"})," Full Site Sync & Audit"]}),l.jsxs(xe,{size:"sm",variant:"outline",onClick:F,disabled:B,children:[l.jsx(C2,{className:`w-3.5 h-3.5 mr-1.5 ${B?"animate-spin":""}`}),B?"Rebuilding...":"Regenerate Sitemaps"]}),l.jsxs(xe,{size:"sm",variant:"outline",onClick:()=>L("index"),disabled:p,children:[l.jsx(Xc,{className:"w-3.5 h-3.5 mr-1.5"})," Rebuild llms.txt"]}),l.jsxs(xe,{size:"sm",variant:"outline",onClick:()=>L("full"),disabled:p,children:[l.jsx(Xc,{className:"w-3.5 h-3.5 mr-1.5"})," Rebuild llms-full.txt"]})]}),l.jsx("div",{className:"mb-8",children:l.jsx(KYe,{})}),l.jsxs(ym,{defaultValue:"agent-config",className:"space-y-8",children:[l.jsxs(Vf,{className:"bg-muted/50 p-1",children:[l.jsx(Hn,{value:"agent-config",className:"text-xs uppercase tracking-wider",children:"Agent Config"}),l.jsx(Hn,{value:"blueprint",className:"text-xs uppercase tracking-wider",children:"Blueprint"}),l.jsx(Hn,{value:"media",className:"text-xs uppercase tracking-wider",children:"Media Library"}),r&&l.jsx(Hn,{value:"generator",className:"text-xs uppercase tracking-wider",children:"Page Generator"}),r&&l.jsx(Hn,{value:"cannibalization",className:"text-xs uppercase tracking-wider",children:"Cannibalization"}),l.jsx(Hn,{value:"monitor",className:"text-xs uppercase tracking-wider",children:"Monitor"}),l.jsx(Hn,{value:"backups",className:"text-xs uppercase tracking-wider",children:"Backups"}),l.jsx(Hn,{value:"crawlability",className:"text-xs uppercase tracking-wider",children:"Crawlability"}),l.jsx(Hn,{value:"readiness",className:"text-xs uppercase tracking-wider",children:"Readiness"})]}),l.jsx(Qn,{value:"agent-config",children:l.jsx(qqe,{})}),l.jsx(Qn,{value:"blueprint",children:l.jsx(aGe,{})}),l.jsx(Qn,{value:"media",children:l.jsx(gGe,{})}),r&&l.jsx(Qn,{value:"generator",children:l.jsx(lGe,{})}),r&&l.jsx(Qn,{value:"cannibalization",children:l.jsx(cGe,{})}),l.jsx(Qn,{value:"monitor",children:l.jsx(h1t,{})}),l.jsx(Qn,{value:"backups",children:l.jsx(uGe,{})}),l.jsx(Qn,{value:"crawlability",children:l.jsx(VYe,{})}),l.jsx(Qn,{value:"readiness",children:l.jsx(zYe,{})})]}),l.jsx(No,{open:c,onOpenChange:u,children:l.jsxs(Ka,{className:"max-w-3xl max-h-[80vh] overflow-y-auto",children:[l.jsx(qa,{children:l.jsxs(Wa,{children:[d==="full"?"llms-full.txt":"llms.txt"," — Generated Content"]})}),p?l.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"Generating..."}):l.jsxs(l.Fragment,{children:[l.jsxs(xe,{size:"sm",variant:"outline",onClick:U,className:"mb-2 w-fit",children:[g?l.jsx(Fo,{className:"w-3.5 h-3.5 mr-1.5"}):l.jsx(M3,{className:"w-3.5 h-3.5 mr-1.5"}),g?"Copied!":"Copy to Clipboard"]}),l.jsx("pre",{className:"text-xs bg-muted p-4 rounded overflow-auto max-h-[50vh] whitespace-pre-wrap",children:A})]})]})}),l.jsx(qYe,{open:k,onOpenChange:j,syncReport:w,setSyncReport:b,isSyncing:v})]})]}):null},A1t=nH,p1t=rH,nye=C.forwardRef(({className:e,...t},n)=>l.jsx(F2,{className:it("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));nye.displayName=F2.displayName;const m1t=w2("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),rye=C.forwardRef(({side:e="right",className:t,children:n,...r},i)=>l.jsxs(p1t,{children:[l.jsx(nye,{}),l.jsxs(M2,{ref:i,className:it(m1t({side:e}),t),...r,children:[n,l.jsxs(JE,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[l.jsx(ta,{className:"h-4 w-4 text-white"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));rye.displayName=M2.displayName;const iye=({className:e,...t})=>l.jsx("div",{className:it("flex flex-col space-y-2 text-center sm:text-left",e),...t});iye.displayName="SheetHeader";const sye=C.forwardRef(({className:e,...t},n)=>l.jsx(L2,{ref:n,className:it("text-lg font-semibold text-foreground",e),...t}));sye.displayName=L2.displayName;const aye=C.forwardRef(({className:e,...t},n)=>l.jsx(R2,{ref:n,className:it("text-sm text-muted-foreground",e),...t}));aye.displayName=R2.displayName;const g1t="khmmwvmdbhaplcfcndjx",GX="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q",y1t=`https://${g1t}.supabase.co/functions/v1`,o$="possible_list_session",YX="possible_list_lurker_prompt_dismissed",v1t=["Holland","Hudsonville","Zeeland","Byron Center","Grandville","Caledonia","Forest Hills (Cascade)","Forest Hills (Ada)","Rockford","Jenison","Allendale"],x1t=["Ranch","Colonial","Condo","Townhouse","Land","Multi-family","Other"],oye=[{value:"now",label:"Now / actively"},{value:"3mo",label:"Within 3 months"},{value:"6mo",label:"Within 6 months"},{value:"12mo",label:"Within a year"},{value:"right_offer",label:"If the right offer comes"}];function lye(){try{return localStorage.getItem(o$)}catch{return null}}function w1t(e){try{localStorage.setItem(o$,e)}catch{}}function b1t(){try{localStorage.removeItem(o$)}catch{}}async function P0(e,t={}){const n={"Content-Type":"application/json",apikey:GX,Authorization:`Bearer ${GX}`};if(t.auth){const s=lye();s&&(n["x-list-session-token"]=s)}const r=await fetch(`${y1t}${e}`,{method:t.method||(t.body?"POST":"GET"),headers:n,body:t.body?JSON.stringify(t.body):void 0}),i=await r.json().catch(()=>({}));if(!r.ok){const s=i&&i.error||`Request failed (${r.status})`;throw Object.assign(new Error(s),{status:r.status,data:i})}return i}async function C1t(e){return P0("/list-signup",{body:e})}async function S1t(e){const t=await P0("/list-redeem-invite",{body:e});return t.session_token&&w1t(t.session_token),t}async function cye(){if(!lye())return{valid:!1};try{return await P0("/list-session-info",{auth:!0,method:"POST",body:{}})}catch{return{valid:!1}}}async function k1t(){return P0("/list-dashboard-data",{auth:!0})}async function _1t(e){return P0("/list-submit-intent",{body:e,auth:!0})}async function j1t(e,t){return P0("/list-tell-holden",{body:{intent_id:e,message:t||void 0},auth:!0})}function B1t(e){var t;return e?((t=oye.find(n=>n.value===e))==null?void 0:t.label)??null:null}function N1t(){const e="ABCDEFGHJKMNPQRSTUVWXYZ23456789",t=()=>e[Math.floor(Math.random()*e.length)],n=()=>Array.from({length:3},t).join("");return`${n()}-${n()}-${n()}`}const uye="The Off-Market List is an informational tool tracking hypothetical, non-binding buyer and seller interest. It is not a listing service, MLS, or private listing network. No property on this list is subject to a listing agreement. Participation does not create an agency, brokerage, or buyer-representation relationship with Holden Richardson or 616 Realty LLC. All real estate transactions require separate written agreements and are subject to NAR Clear Cooperation Policy and MichRIC rules. Equal Housing Opportunity. Holden Richardson, REALTOR®, MI License #6501392389, 616 Realty LLC.",dye=`The no-push promise: you'll never get a "ready to convert?" email, a "your intent is going stale" reminder, or a sequence trying to move you off the list. The dashboard sits there. Holden writes you when there's a real reason. Otherwise, silence.`,Eo=Me,E1t=()=>{const{isAdmin:e,isLoading:t}=A0(),n=El();return C.useEffect(()=>{!t&&!e&&n("/auth")},[e,t,n]),t?l.jsx(ln,{children:l.jsxs("div",{className:"container-page section-padding",children:[l.jsx(lt,{className:"h-10 w-64 mb-8"}),l.jsx(lt,{className:"h-64 w-full"})]})}):e?l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Off-Market List Admin | Holden Richardson"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsxs("div",{className:"container-page py-12 md:py-20",children:[l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h1",{className:"heading-section mb-0",children:"Off-Market List"}),l.jsx(qt,{variant:"default",className:"text-xs uppercase tracking-wider",children:"Admin"})]}),l.jsxs(At,{to:"/",className:"flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground",children:[l.jsx(pm,{className:"w-4 h-4"})," Back to Site"]})]}),l.jsxs(ym,{defaultValue:"members",className:"space-y-8",children:[l.jsxs(Vf,{className:"bg-muted/50 p-1 flex-wrap h-auto",children:[l.jsx(Hn,{value:"members",className:"text-xs uppercase tracking-wider",children:"Members"}),l.jsx(Hn,{value:"invites",className:"text-xs uppercase tracking-wider",children:"Invites"}),l.jsx(Hn,{value:"intents",className:"text-xs uppercase tracking-wider",children:"Intents"}),l.jsx(Hn,{value:"queue",className:"text-xs uppercase tracking-wider",children:"Action Queue"}),l.jsx(Hn,{value:"digest",className:"text-xs uppercase tracking-wider",children:"Digest"}),l.jsx(Hn,{value:"audit",className:"text-xs uppercase tracking-wider",children:"Audit log"})]}),l.jsx(Qn,{value:"members",children:l.jsx(T1t,{})}),l.jsx(Qn,{value:"invites",children:l.jsx(P1t,{})}),l.jsx(Qn,{value:"intents",children:l.jsx(I1t,{})}),l.jsx(Qn,{value:"queue",children:l.jsx(F1t,{})}),l.jsx(Qn,{value:"digest",children:l.jsx(M1t,{})}),l.jsx(Qn,{value:"audit",children:l.jsx(L1t,{})})]})]})]}):null},T1t=()=>{const[e,t]=C.useState(null),[n,r]=C.useState("all"),[i,s]=C.useState(""),a=async()=>{t(null);let u=Eo.from("list_members").select("*").order("created_at",{ascending:!1});n!=="all"&&(u=u.eq("status",n));const{data:d,error:h}=await u;h&&De({title:"Failed to load members",description:h.message,variant:"destructive"}),t(d||[])};C.useEffect(()=>{a()},[n]);const o=C.useMemo(()=>{if(!e)return[];if(!i.trim())return e;const u=i.toLowerCase();return e.filter(d=>{var h;return((h=d.email)==null?void 0:h.toLowerCase().includes(u))||`${d.first_name||""} ${d.last_name||""}`.toLowerCase().includes(u)})},[e,i]),c=async(u,d)=>{const h={status:d};d==="approved"&&(h.approved_at=new Date().toISOString());const{error:A}=await Eo.from("list_members").update(h).eq("id",u);if(A){De({title:"Update failed",description:A.message,variant:"destructive"});return}await Eo.from("list_audit_log").insert({action:`member_set_${d}`,target_id:u,target_table:"list_members",payload:{}}),De({title:`Member set to ${d}`}),a()};return l.jsx(Xt,{children:l.jsxs(Jt,{className:"p-6 space-y-4",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsxs(Fr,{value:n,onValueChange:r,children:[l.jsx(Br,{className:"w-40",children:l.jsx(Mr,{})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"all",children:"All statuses"}),l.jsx(ft,{value:"pending",children:"Pending"}),l.jsx(ft,{value:"approved",children:"Approved"}),l.jsx(ft,{value:"paused",children:"Paused"}),l.jsx(ft,{value:"removed",children:"Removed"})]})]}),l.jsx(Xe,{placeholder:"Search email or name…",value:i,onChange:u=>s(u.target.value),className:"max-w-xs"}),l.jsxs("div",{className:"ml-auto text-sm text-muted-foreground",children:[o.length," member(s)"]})]}),e===null?l.jsx(lt,{className:"h-64 w-full"}):l.jsxs(qf,{children:[l.jsx(Wf,{children:l.jsxs(Ei,{children:[l.jsx(yn,{children:"Name / Email"}),l.jsx(yn,{children:"Status"}),l.jsx(yn,{children:"Source"}),l.jsx(yn,{children:"Last visit"}),l.jsx(yn,{className:"text-right",children:"Actions"})]})}),l.jsxs(Gf,{children:[o.map(u=>l.jsxs(Ei,{children:[l.jsxs(sn,{children:[l.jsx("div",{className:"font-medium",children:u.first_name||u.last_name?`${u.first_name||""} ${u.last_name||""}`.trim():"—"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:u.email})]}),l.jsx(sn,{children:l.jsx(qt,{variant:u.status==="approved"?"default":"outline",className:"text-[10px] uppercase",children:u.status})}),l.jsx(sn,{className:"text-xs text-muted-foreground",children:u.source}),l.jsx(sn,{className:"text-xs text-muted-foreground",children:u.last_dashboard_visit_at?new Date(u.last_dashboard_visit_at).toLocaleDateString():"—"}),l.jsxs(sn,{className:"text-right space-x-1",children:[u.status!=="approved"&&l.jsx(xe,{size:"sm",variant:"outline",onClick:()=>c(u.id,"approved"),children:"Approve"}),u.status!=="paused"&&u.status!=="removed"&&l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>c(u.id,"paused"),children:"Pause"}),u.status!=="removed"&&l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>c(u.id,"removed"),children:"Remove"})]})]},u.id)),o.length===0&&l.jsx(Ei,{children:l.jsx(sn,{colSpan:5,className:"text-center text-muted-foreground py-8",children:"No members yet."})})]})]})]})})},P1t=()=>{const[e,t]=C.useState(null),[n,r]=C.useState(""),[i,s]=C.useState(""),[a,o]=C.useState(""),[c,u]=C.useState(""),[d,h]=C.useState("30"),[A,f]=C.useState(!1),[p,m]=C.useState(null),[g,y]=C.useState(!1),v=async()=>{t(null);const{data:b,error:k}=await Eo.from("list_invites").select("*").order("created_at",{ascending:!1}).limit(200);k&&De({title:"Failed to load invites",description:k.message,variant:"destructive"}),t(b||[])};C.useEffect(()=>{v()},[]);const x=async()=>{f(!0);try{const b=N1t(),k=d==="never"?null:new Date(Date.now()+parseInt(d,10)*24*60*60*1e3).toISOString(),{error:j}=await Eo.from("list_invites").insert({code:b,invitee_name:n||null,invitee_personal_context:i||null,invitee_email:a||null,invitee_phone:c||null,expires_at:k});if(j)throw j;m(b),r(""),s(""),o(""),u(""),De({title:"Invite created",description:b}),v()}catch(b){De({title:"Couldn't create invite",description:b.message,variant:"destructive"})}finally{f(!1)}},w=b=>{navigator.clipboard.writeText(b),y(!0),setTimeout(()=>y(!1),1500)};return l.jsxs("div",{className:"space-y-6",children:[l.jsx(Xt,{children:l.jsxs(Jt,{className:"p-6 space-y-4",children:[l.jsx("h3",{className:"font-semibold",children:"Generate invite code"}),l.jsxs("div",{className:"grid sm:grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(ht,{children:"Invitee name"}),l.jsx(Xe,{value:n,onChange:b=>r(b.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(ht,{children:"Expires in"}),l.jsxs(Fr,{value:d,onValueChange:h,children:[l.jsx(Br,{className:"mt-1",children:l.jsx(Mr,{})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"7",children:"7 days"}),l.jsx(ft,{value:"30",children:"30 days"}),l.jsx(ft,{value:"90",children:"90 days"}),l.jsx(ft,{value:"never",children:"Never"})]})]})]}),l.jsxs("div",{children:[l.jsx(ht,{children:"Invitee email (optional pre-fill)"}),l.jsx(Xe,{value:a,onChange:b=>o(b.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(ht,{children:"Invitee phone (optional)"}),l.jsx(Xe,{value:c,onChange:b=>u(b.target.value),className:"mt-1"})]})]}),l.jsxs("div",{children:[l.jsx(ht,{children:"Internal context (why you invited them)"}),l.jsx(Vi,{rows:2,value:i,onChange:b=>s(b.target.value),className:"mt-1"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(xe,{onClick:x,disabled:A,children:A?"Generating…":"Generate code"}),p&&l.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[l.jsx("code",{className:"font-mono bg-muted px-2 py-1 rounded",children:p}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>w(p),children:g?l.jsx(Fo,{className:"w-4 h-4"}):l.jsx(M3,{className:"w-4 h-4"})})]})]})]})}),l.jsx(Xt,{children:l.jsx(Jt,{className:"p-6",children:e===null?l.jsx(lt,{className:"h-48 w-full"}):l.jsxs(qf,{children:[l.jsx(Wf,{children:l.jsxs(Ei,{children:[l.jsx(yn,{children:"Code"}),l.jsx(yn,{children:"Invitee"}),l.jsx(yn,{children:"Status"}),l.jsx(yn,{children:"Redeemed"}),l.jsx(yn,{children:"Expires"}),l.jsx(yn,{})]})}),l.jsxs(Gf,{children:[e.map(b=>l.jsxs(Ei,{children:[l.jsx(sn,{children:l.jsx("code",{className:"font-mono text-xs",children:b.code})}),l.jsxs(sn,{className:"text-sm",children:[b.invitee_name||"—",b.invitee_email&&l.jsx("div",{className:"text-xs text-muted-foreground",children:b.invitee_email})]}),l.jsx(sn,{children:l.jsx(qt,{variant:b.status==="unused"?"outline":"secondary",className:"text-[10px] uppercase",children:b.status})}),l.jsx(sn,{className:"text-xs text-muted-foreground",children:b.redeemed_at?new Date(b.redeemed_at).toLocaleDateString():"—"}),l.jsx(sn,{className:"text-xs text-muted-foreground",children:b.expires_at?new Date(b.expires_at).toLocaleDateString():"Never"}),l.jsx(sn,{children:l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>w(b.code),children:l.jsx(M3,{className:"w-3 h-3"})})})]},b.id)),e.length===0&&l.jsx(Ei,{children:l.jsx(sn,{colSpan:6,className:"text-center text-muted-foreground py-8",children:"No invites yet."})})]})]})})})]})},I1t=()=>{const[e,t]=C.useState(null),[n,r]=C.useState("pending_review"),[i,s]=C.useState(null),a=async()=>{t(null);let o=Eo.from("list_intents").select("*").order("created_at",{ascending:!1});n!=="all"&&(o=o.eq("status",n));const{data:c,error:u}=await o;u&&De({title:"Failed to load intents",description:u.message,variant:"destructive"}),t(c||[])};return C.useEffect(()=>{a()},[n]),l.jsxs(Xt,{children:[l.jsxs(Jt,{className:"p-6 space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(Fr,{value:n,onValueChange:r,children:[l.jsx(Br,{className:"w-48",children:l.jsx(Mr,{})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"all",children:"All"}),l.jsx(ft,{value:"draft",children:"Draft"}),l.jsx(ft,{value:"pending_review",children:"Pending review"}),l.jsx(ft,{value:"active",children:"Active"}),l.jsx(ft,{value:"paused",children:"Paused"}),l.jsx(ft,{value:"converted",children:"Converted"}),l.jsx(ft,{value:"expired",children:"Expired"})]})]}),l.jsxs("div",{className:"ml-auto text-sm text-muted-foreground",children:[(e==null?void 0:e.length)||0," intent(s)"]})]}),e===null?l.jsx(lt,{className:"h-64 w-full"}):l.jsxs(qf,{children:[l.jsx(Wf,{children:l.jsxs(Ei,{children:[l.jsx(yn,{children:"Type"}),l.jsx(yn,{children:"Title"}),l.jsx(yn,{children:"Towns"}),l.jsx(yn,{children:"Status"}),l.jsx(yn,{children:"Submitted"})]})}),l.jsxs(Gf,{children:[e.map(o=>l.jsxs(Ei,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>s(o),children:[l.jsx(sn,{children:l.jsx(qt,{variant:o.type==="buy"?"default":"secondary",className:"text-[10px] uppercase",children:o.type})}),l.jsx(sn,{className:"text-sm",children:o.title||l.jsx("em",{className:"text-muted-foreground",children:"untitled"})}),l.jsx(sn,{className:"text-xs text-muted-foreground",children:(o.towns||[]).join(", ")||"—"}),l.jsx(sn,{children:l.jsx(qt,{variant:"outline",className:"text-[10px] uppercase",children:o.status.replace(/_/g," ")})}),l.jsx(sn,{className:"text-xs text-muted-foreground",children:o.submitted_at?new Date(o.submitted_at).toLocaleDateString():"—"})]},o.id)),e.length===0&&l.jsx(Ei,{children:l.jsx(sn,{colSpan:5,className:"text-center text-muted-foreground py-8",children:"No intents in this view."})})]})]})]}),l.jsx(O1t,{intent:i,onClose:()=>s(null),onSaved:()=>{s(null),a()}})]})},O1t=({intent:e,onClose:t,onSaved:n})=>{const[r,i]=C.useState(""),[s,a]=C.useState(""),[o,c]=C.useState(""),[u,d]=C.useState(""),[h,A]=C.useState(!1);if(C.useEffect(()=>{e&&(i(e.title||""),a(e.must_haves||""),c(e.notable_features||""),d(e.public_summary||""))},[e==null?void 0:e.id]),!e)return null;const f=async p=>{A(!0);try{const m={title:r||null,must_haves:s||null,notable_features:o||null,public_summary:u||null,status:p};p==="active"&&!e.approved_at&&(m.approved_at=new Date().toISOString());const{error:g}=await Eo.from("list_intents").update(m).eq("id",e.id);if(g)throw g;if(await Eo.from("list_audit_log").insert({action:`intent_set_${p}`,target_id:e.id,target_table:"list_intents",payload:{}}),De({title:`Intent set to ${p}`}),p==="active")try{const{data:y,error:v}=await Me.functions.invoke("list-run-matches",{body:{intent_id:e.id}});if(v)throw v;const x=(y==null?void 0:y.inserted)??0;x>0?De({title:`Matching ran — ${x} new candidate${x===1?"":"s"}`,description:`Top score ${(y==null?void 0:y.top_score)??0}. See Action Queue.`}):De({title:"Matching ran — no new candidates",description:"No active counterparts overlap this intent yet."})}catch(y){console.error("Matching invoke failed",y),De({title:"Matching run failed",description:(y==null?void 0:y.message)??"See console.",variant:"destructive"})}n()}catch(m){De({title:"Save failed",description:m.message,variant:"destructive"})}finally{A(!1)}};return l.jsx(A1t,{open:!!e,onOpenChange:p=>!p&&t(),children:l.jsxs(rye,{className:"w-full sm:max-w-xl overflow-y-auto",children:[l.jsxs(iye,{children:[l.jsxs(sye,{children:[l.jsx(qt,{variant:e.type==="buy"?"default":"secondary",className:"mr-2 text-[10px] uppercase",children:e.type}),"Moderate intent"]}),l.jsx(aye,{children:"Edit the editorial fields and approve, pause, or expire. Holden's pass strips fair-housing landmines and tightens the narrative."})]}),l.jsxs("div",{className:"mt-6 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Status:"})," ",e.status]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Timeline:"})," ",e.timeline||"—"]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("span",{className:"text-muted-foreground",children:"Towns:"})," ",(e.towns||[]).join(", ")||"—"]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("span",{className:"text-muted-foreground",children:"Property types:"})," ",(e.property_types||[]).join(", ")||"—"]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Price:"})," ",e.price_min?`$${e.price_min.toLocaleString()}`:"?","–",e.price_max?`$${e.price_max.toLocaleString()}`:"?"]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground",children:"Beds/Baths:"})," ",e.beds_min||"?"," / ",e.baths_min||"?"]})]}),l.jsxs("div",{children:[l.jsx(ht,{children:"Title"}),l.jsx(Xe,{value:r,onChange:p=>i(p.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(ht,{children:"Must-haves (buyer)"}),l.jsx(Vi,{rows:3,value:s,onChange:p=>a(p.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(ht,{children:"Notable features (seller)"}),l.jsx(Vi,{rows:3,value:o,onChange:p=>c(p.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(ht,{children:"Public summary (Holden's editorial card text)"}),l.jsx(Vi,{rows:4,value:u,onChange:p=>d(p.target.value),className:"mt-1",placeholder:"The narrative that lands on the dashboard. Strip fair-housing landmines."})]}),e.notes&&l.jsxs("div",{className:"text-xs",children:[l.jsx("div",{className:"text-muted-foreground mb-1",children:"Member notes (internal):"}),l.jsx("div",{className:"bg-muted/50 rounded p-2",children:e.notes})]}),l.jsxs("div",{className:"flex flex-wrap gap-2 pt-4 border-t",children:[l.jsx(xe,{onClick:()=>f("active"),disabled:h,children:"Approve (active)"}),l.jsx(xe,{variant:"outline",onClick:()=>f("paused"),disabled:h,children:"Pause"}),l.jsx(xe,{variant:"outline",onClick:()=>f("converted"),disabled:h,children:"Convert"}),l.jsx(xe,{variant:"ghost",onClick:()=>f("expired"),disabled:h,children:"Expire"})]})]})]})})},F1t=()=>{const[e,t]=C.useState("all"),[n,r]=C.useState(null),[i,s]=C.useState(null),[a,o]=C.useState(!1),c=async()=>{r(null),s(null);const[f,p]=await Promise.all([Eo.from("list_interest_pings").select("*, intent:intent_id (id, title, type, towns, price_min, price_max), member:member_id (id, first_name, last_name, email)").order("created_at",{ascending:!1}),Eo.from("list_matches").select("*, buy:buy_intent_id (id, title, towns, price_min, price_max, member:member_id (first_name, last_name, email)), sell:sell_intent_id (id, title, towns, price_min, price_max, member:member_id (first_name, last_name, email))").neq("status","dismissed").order("match_score",{ascending:!1}).order("created_at",{ascending:!1})]);f.error&&De({title:"Failed to load pings",description:f.error.message,variant:"destructive"}),p.error&&De({title:"Failed to load matches",description:p.error.message,variant:"destructive"}),r(f.data||[]),s(p.data||[])};C.useEffect(()=>{c()},[]);const u=async(f,p)=>{const{error:m}=await Eo.from("list_interest_pings").update({status:p}).eq("id",f);if(m){De({title:"Update failed",description:m.message,variant:"destructive"});return}De({title:`Marked ${p}`}),c()},d=async(f,p)=>{const m={status:p};(p==="reviewed"||p==="intro_made"||p==="dismissed")&&(m.reviewed_at=new Date().toISOString());const{error:g}=await Eo.from("list_matches").update(m).eq("id",f);if(g){De({title:"Update failed",description:g.message,variant:"destructive"});return}De({title:`Match ${p.replace("_"," ")}`}),c()},h=async()=>{o(!0);try{const{data:f,error:p}=await Me.functions.invoke("list-run-matches",{body:{}});if(p)throw p;const m=(f==null?void 0:f.inserted)??0,g=(f==null?void 0:f.skipped_existing)??0,y=(f==null?void 0:f.top_score)??0;De({title:`Rescan complete — ${m} new`,description:`Skipped ${g} existing. Top score ${y}.`}),c()}catch(f){De({title:"Rescan failed",description:(f==null?void 0:f.message)??"See console",variant:"destructive"})}finally{o(!1)}},A=f=>f?`$${(f/1e3).toFixed(0)}k`:"?";return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[["all","pings","matches"].map(f=>l.jsx(xe,{size:"sm",variant:e===f?"default":"outline",onClick:()=>t(f),children:f==="all"?"All":f==="pings"?"Interest pings":"Auto matches"},f)),l.jsx("div",{className:"ml-auto",children:l.jsx(xe,{size:"sm",variant:"secondary",onClick:h,disabled:a,children:a?"Re-scanning…":"Re-scan all matches"})})]}),(e==="all"||e==="pings")&&l.jsx(Xt,{children:l.jsxs(Jt,{className:"p-6",children:[l.jsx("h3",{className:"font-semibold mb-4",children:"Interest pings"}),n===null?l.jsx(lt,{className:"h-32 w-full"}):n.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:"No pings yet."}):l.jsxs(qf,{children:[l.jsx(Wf,{children:l.jsxs(Ei,{children:[l.jsx(yn,{children:"From"}),l.jsx(yn,{children:"On intent"}),l.jsx(yn,{children:"Message"}),l.jsx(yn,{children:"Status"}),l.jsx(yn,{className:"text-right",children:"Actions"})]})}),l.jsx(Gf,{children:n.map(f=>{var p,m,g,y,v,x;return l.jsxs(Ei,{children:[l.jsxs(sn,{className:"text-sm",children:[((p=f.member)==null?void 0:p.first_name)||""," ",((m=f.member)==null?void 0:m.last_name)||"",l.jsx("div",{className:"text-xs text-muted-foreground",children:(g=f.member)==null?void 0:g.email})]}),l.jsxs(sn,{className:"text-sm",children:[((y=f.intent)==null?void 0:y.title)||"—",l.jsxs("div",{className:"text-xs text-muted-foreground",children:[(v=f.intent)==null?void 0:v.type," · ",(((x=f.intent)==null?void 0:x.towns)||[]).join(", ")]})]}),l.jsx(sn,{className:"text-xs max-w-xs",children:f.message||l.jsx("em",{className:"text-muted-foreground",children:"no message"})}),l.jsx(sn,{children:l.jsx(qt,{variant:"outline",className:"text-[10px] uppercase",children:f.status})}),l.jsxs(sn,{className:"text-right space-x-1",children:[l.jsx(xe,{size:"sm",variant:"outline",onClick:()=>u(f.id,"contacted"),children:"Contacted"}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>u(f.id,"converted"),children:"Converted"}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>u(f.id,"dismissed"),children:"Dismiss"})]})]},f.id)})})]})]})}),(e==="all"||e==="matches")&&l.jsx(Xt,{children:l.jsxs(Jt,{className:"p-6",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"font-semibold",children:"Auto matches"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Candidates only. No member is ever told until you make the intro."})]}),i===null?l.jsx(lt,{className:"h-32 w-full"}):i.length===0?l.jsx("p",{className:"text-sm text-muted-foreground",children:'No candidate matches yet. Approve more intents or hit "Re-scan all matches".'}):l.jsx("div",{className:"space-y-3",children:i.map(f=>{var g,y,v,x,w,b,k,j,B,E,I,T,N,F,L,U,H,K,$,z;const p=f.match_reasons||{},m=p.weak_match;return l.jsxs("div",{className:`rounded-lg border p-4 ${m?"opacity-60 border-dashed":""}`,children:[l.jsxs("div",{className:"flex items-start justify-between gap-4 mb-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(qt,{variant:m?"outline":"default",className:"text-[10px] uppercase",children:["Score ",f.match_score,m?" · weak":""]}),l.jsx(qt,{variant:"outline",className:"text-[10px] uppercase",children:f.status}),(p.warnings||[]).map((Q,oe)=>l.jsxs(qt,{variant:"outline",className:"text-[10px] normal-case font-normal",children:["⚠ ",Q]},oe))]}),l.jsxs("div",{className:"space-x-1",children:[l.jsx(xe,{size:"sm",variant:"outline",onClick:()=>d(f.id,"reviewed"),children:"Reviewed"}),l.jsx(xe,{size:"sm",onClick:()=>d(f.id,"intro_made"),children:"Intro made"}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>d(f.id,"dismissed"),children:"Dismiss"})]})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-4 text-sm",children:[l.jsxs("div",{className:"rounded border bg-muted/30 p-3",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:"Buyer"}),l.jsxs("div",{className:"font-medium",children:[(y=(g=f.buy)==null?void 0:g.member)==null?void 0:y.first_name," ",(x=(v=f.buy)==null?void 0:v.member)==null?void 0:x.last_name]}),l.jsx("div",{className:"text-xs text-muted-foreground",children:(b=(w=f.buy)==null?void 0:w.member)==null?void 0:b.email}),l.jsx("div",{className:"text-xs mt-2",children:((k=f.buy)==null?void 0:k.title)||l.jsx("em",{children:"untitled"})}),l.jsxs("div",{className:"text-xs text-muted-foreground",children:[(((j=f.buy)==null?void 0:j.towns)||[]).join(", ")," · ",A((B=f.buy)==null?void 0:B.price_min),"–",A((E=f.buy)==null?void 0:E.price_max)]})]}),l.jsxs("div",{className:"rounded border bg-muted/30 p-3",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-1",children:"Seller"}),l.jsxs("div",{className:"font-medium",children:[(T=(I=f.sell)==null?void 0:I.member)==null?void 0:T.first_name," ",(F=(N=f.sell)==null?void 0:N.member)==null?void 0:F.last_name]}),l.jsx("div",{className:"text-xs text-muted-foreground",children:(U=(L=f.sell)==null?void 0:L.member)==null?void 0:U.email}),l.jsx("div",{className:"text-xs mt-2",children:((H=f.sell)==null?void 0:H.title)||l.jsx("em",{children:"untitled"})}),l.jsxs("div",{className:"text-xs text-muted-foreground",children:[(((K=f.sell)==null?void 0:K.towns)||[]).join(", ")," · ",A(($=f.sell)==null?void 0:$.price_min),"–",A((z=f.sell)==null?void 0:z.price_max)]})]})]}),l.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5 text-[11px]",children:[(p.town_match||[]).length>0&&l.jsxs(qt,{variant:"secondary",className:"font-normal",children:["🏘 ",(p.town_match||[]).join(", ")]}),(p.shared_property_types||[]).length>0&&l.jsxs(qt,{variant:"secondary",className:"font-normal",children:["🏠 ",(p.shared_property_types||[]).join(", ")]}),p.price_fit&&l.jsxs(qt,{variant:"secondary",className:"font-normal",children:["💰 ",String(p.price_fit).replace("_"," ")]}),p.timeline_fit&&p.timeline_fit!=="unknown"&&l.jsxs(qt,{variant:"secondary",className:"font-normal",children:["⏱ ",String(p.timeline_fit).replace("_"," ")]})]})]},f.id)})})]})})]})},M1t=()=>l.jsx(Xt,{className:"border-dashed",children:l.jsxs(Jt,{className:"p-12 text-center text-muted-foreground space-y-2",children:[l.jsx("h3",{className:"font-semibold text-foreground",children:"Digest preview"}),l.jsx("p",{className:"text-sm max-w-md mx-auto",children:"Weekly digest sender (Resend + Twilio) is deferred. Once wired, the next scheduled payload will preview here before it ships Saturday morning."})]})}),L1t=()=>{const[e,t]=C.useState(null),[n,r]=C.useState(""),i=async()=>{t(null);let s=Eo.from("list_audit_log").select("*").order("created_at",{ascending:!1}).limit(500);n.trim()&&(s=s.ilike("action",`%${n.trim()}%`));const{data:a,error:o}=await s;o&&De({title:"Failed to load audit log",description:o.message,variant:"destructive"}),t(a||[])};return C.useEffect(()=>{i()},[n]),l.jsx(Xt,{children:l.jsxs(Jt,{className:"p-6 space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Xe,{placeholder:"Filter by action…",value:n,onChange:s=>r(s.target.value),className:"max-w-xs"}),l.jsxs("div",{className:"ml-auto text-sm text-muted-foreground",children:[(e==null?void 0:e.length)||0," entries"]})]}),e===null?l.jsx(lt,{className:"h-64 w-full"}):l.jsxs(qf,{children:[l.jsx(Wf,{children:l.jsxs(Ei,{children:[l.jsx(yn,{children:"When"}),l.jsx(yn,{children:"Action"}),l.jsx(yn,{children:"Target"}),l.jsx(yn,{children:"Payload"})]})}),l.jsxs(Gf,{children:[e.map(s=>l.jsxs(Ei,{children:[l.jsx(sn,{className:"text-xs whitespace-nowrap",children:new Date(s.created_at).toLocaleString()}),l.jsx(sn,{children:l.jsx("code",{className:"text-xs",children:s.action})}),l.jsxs(sn,{className:"text-xs",children:[s.target_table,s.target_id&&l.jsx("div",{className:"text-muted-foreground truncate max-w-[12rem]",children:s.target_id})]}),l.jsx(sn,{children:l.jsx("pre",{className:"text-[10px] max-w-xs overflow-x-auto bg-muted/50 p-2 rounded",children:JSON.stringify(s.payload,null,0)})})]},s.id)),e.length===0&&l.jsx(Ei,{children:l.jsx(sn,{colSpan:4,className:"text-center text-muted-foreground py-8",children:"No audit entries."})})]})]})]})})},R1t=[{to:"/admin/list",title:"Off-Market List",desc:"Members, invites, intents, redemptions, settings.",icon:M2e},{to:"/admin/aeo",title:"AEO",desc:"Pages, categories, monitor, blueprints, crawl health.",icon:Ts},{to:"/admin/blog",title:"Blog",desc:"Long-form posts, drafts, publishing.",icon:$p},{to:"/admin/profile",title:"Profile",desc:"Agent profile + site config.",icon:AE}];function D1t(){const e=El(),{user:t,isLoading:n,isAdmin:r,signOut:i}=A0();return C.useEffect(()=>{!n&&(!t||!r)&&e("/auth")},[t,r,n,e]),n||!t||!r?l.jsx(ln,{children:l.jsx("div",{className:"min-h-[60vh] flex items-center justify-center text-muted-foreground",children:"Loading…"})}):l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Admin | Holden Richardson"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsx("div",{className:"section-padding",children:l.jsxs("div",{className:"container-page max-w-5xl",children:[l.jsxs("div",{className:"flex items-start justify-between mb-10 gap-4 flex-wrap",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-2 text-sm font-semibold",children:"Admin"}),l.jsx("h1",{className:"heading-section text-4xl md:text-5xl",children:"Dashboard"}),l.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:["Signed in as ",t.email]})]}),l.jsxs(xe,{variant:"outline",onClick:async()=>{await i(),e("/")},children:[l.jsx(Ire,{className:"w-4 h-4 mr-2"})," Sign out"]})]}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:R1t.map(s=>l.jsx(At,{to:s.to,className:"group",children:l.jsxs(Xt,{className:"h-full transition-all hover:shadow-lg hover:border-accent/40",children:[l.jsxs(wa,{children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-md bg-accent/10 text-accent flex items-center justify-center",children:l.jsx(s.icon,{className:"w-5 h-5"})}),l.jsx(ba,{className:"text-xl group-hover:text-accent transition-colors",children:s.title})]}),l.jsx(kp,{className:"pt-2",children:s.desc})]}),l.jsx(Jt,{children:l.jsx("span",{className:"text-sm text-accent font-medium",children:"Open →"})})]})},s.to))})]})})]})}const U1t=({onSuccess:e})=>{const[t,n]=C.useState(""),[r,i]=C.useState(""),[s,a]=C.useState(""),[o,c]=C.useState(""),[u,d]=C.useState(""),[h,A]=C.useState(!1),[f,p]=C.useState(!0),[m,g]=C.useState(!1),[y,v]=C.useState(null),x=async w=>{if(w.preventDefault(),v(null),!s){v("Email required.");return}g(!0);try{const b=await C1t({email:s,phone:o||void 0,first_name:t||void 0,last_name:r||void 0,referral_text:u||void 0,sms_opt_in:h,email_opt_in:f});b.already_on_list?De({title:"You're already on the list",description:b.status==="approved"?"Approved. Use your invite code to sign in.":"Holden has your application — sit tight."}):De({title:"You're in the queue",description:"Holden will personally review within a day or two."}),e()}catch(b){v((b==null?void 0:b.message)||"Something went wrong.")}finally{g(!1)}};return l.jsxs("form",{onSubmit:x,className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(ht,{htmlFor:"fn",children:"First name"}),l.jsx(Xe,{id:"fn",value:t,onChange:w=>n(w.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(ht,{htmlFor:"ln",children:"Last name"}),l.jsx(Xe,{id:"ln",value:r,onChange:w=>i(w.target.value),className:"mt-1"})]})]}),l.jsxs("div",{children:[l.jsx(ht,{htmlFor:"em",children:"Email *"}),l.jsx(Xe,{id:"em",type:"email",required:!0,value:s,onChange:w=>a(w.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(ht,{htmlFor:"ph",children:"Phone (optional)"}),l.jsx(Xe,{id:"ph",type:"tel",value:o,onChange:w=>c(w.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(ht,{htmlFor:"ref",children:"Who referred you? (optional)"}),l.jsx(Vi,{id:"ref",rows:2,value:u,onChange:w=>d(w.target.value),className:"mt-1"})]}),l.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[l.jsx(no,{checked:f,onCheckedChange:w=>p(!!w),className:"mt-0.5"}),l.jsx("span",{children:"Email me about my list status and the weekly digest."})]}),l.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[l.jsx(no,{checked:h,onCheckedChange:w=>A(!!w),className:"mt-0.5"}),l.jsx("span",{children:"Text me when there's a real match. (Holden only — no automated nudges.)"})]}),y&&l.jsx("div",{className:"text-sm text-destructive",children:y}),l.jsx(xe,{type:"submit",disabled:m,className:"w-full",children:m?"Submitting…":"Join the queue"})]})},H1t=({onSuccess:e})=>{const[t,n]=C.useState(""),[r,i]=C.useState(""),[s,a]=C.useState(""),[o,c]=C.useState(""),[u,d]=C.useState(""),[h,A]=C.useState(!1),[f,p]=C.useState(!0),[m,g]=C.useState(!1),[y,v]=C.useState(null),x=async w=>{if(w.preventDefault(),v(null),!t||!r){v("Code and email required.");return}g(!0);try{await S1t({code:t.toUpperCase().replace(/\s+/g,""),email:r,first_name:s||void 0,last_name:o||void 0,phone:u||void 0,sms_opt_in:h,email_opt_in:f}),De({title:"You're in",description:"Welcome to the Off-Market List."}),e()}catch(b){v((b==null?void 0:b.message)||"That code isn't valid. Double-check it or DM Holden.")}finally{g(!1)}};return l.jsxs("form",{onSubmit:x,className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx(ht,{htmlFor:"code",children:"Invite code *"}),l.jsx(Xe,{id:"code",required:!0,value:t,onChange:w=>n(w.target.value.toUpperCase()),placeholder:"XXX-XXX-XXX",className:"mt-1 font-mono tracking-widest"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(ht,{htmlFor:"r-fn",children:"First name"}),l.jsx(Xe,{id:"r-fn",value:s,onChange:w=>a(w.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(ht,{htmlFor:"r-ln",children:"Last name"}),l.jsx(Xe,{id:"r-ln",value:o,onChange:w=>c(w.target.value),className:"mt-1"})]})]}),l.jsxs("div",{children:[l.jsx(ht,{htmlFor:"r-em",children:"Email *"}),l.jsx(Xe,{id:"r-em",type:"email",required:!0,value:r,onChange:w=>i(w.target.value),className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(ht,{htmlFor:"r-ph",children:"Phone (optional)"}),l.jsx(Xe,{id:"r-ph",type:"tel",value:u,onChange:w=>d(w.target.value),className:"mt-1"})]}),l.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[l.jsx(no,{checked:f,onCheckedChange:w=>p(!!w),className:"mt-0.5"}),l.jsx("span",{children:"Email me the weekly digest."})]}),l.jsxs("label",{className:"flex items-start gap-2 text-sm",children:[l.jsx(no,{checked:h,onCheckedChange:w=>A(!!w),className:"mt-0.5"}),l.jsx("span",{children:"Text me when there's a real match."})]}),y&&l.jsx("div",{className:"text-sm text-destructive",children:y}),l.jsx(xe,{type:"submit",disabled:m,className:"w-full",children:m?"Checking…":"Redeem code"})]})};var l$="Radio",[Q1t,hye]=Wi(l$),[$1t,z1t]=Q1t(l$),fye=C.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:s,disabled:a,value:o="on",onCheck:c,form:u,...d}=e,[h,A]=C.useState(null),f=Qt(t,g=>A(g)),p=C.useRef(!1),m=h?u||!!h.closest("form"):!0;return l.jsxs($1t,{scope:n,checked:i,disabled:a,children:[l.jsx(ut.button,{type:"button",role:"radio","aria-checked":i,"data-state":gye(i),"data-disabled":a?"":void 0,disabled:a,value:o,...d,ref:f,onClick:et(e.onClick,g=>{i||c==null||c(),m&&(p.current=g.isPropagationStopped(),p.current||g.stopPropagation())})}),m&&l.jsx(mye,{control:h,bubbles:!p.current,name:r,value:o,checked:i,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});fye.displayName=l$;var Aye="RadioIndicator",pye=C.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,s=z1t(Aye,n);return l.jsx(ia,{present:r||s.checked,children:l.jsx(ut.span,{"data-state":gye(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t})})});pye.displayName=Aye;var V1t="RadioBubbleInput",mye=C.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},s)=>{const a=C.useRef(null),o=Qt(a,s),c=D2(n),u=k2(t);return C.useEffect(()=>{const d=a.current;if(!d)return;const h=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==n&&f){const p=new Event("click",{bubbles:r});f.call(d,n),d.dispatchEvent(p)}},[c,n,r]),l.jsx(ut.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:o,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});mye.displayName=V1t;function gye(e){return e?"checked":"unchecked"}var K1t=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],hT="RadioGroup",[q1t,mPt]=Wi(hT,[DE,hye]),yye=DE(),vye=hye(),[W1t,G1t]=q1t(hT),xye=C.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:s,required:a=!1,disabled:o=!1,orientation:c,dir:u,loop:d=!0,onValueChange:h,...A}=e,f=yye(n),p=gm(u),[m,g]=ja({prop:s,defaultProp:i??null,onChange:h,caller:hT});return l.jsx(W1t,{scope:n,name:r,required:a,disabled:o,value:m,onValueChange:g,children:l.jsx(Eoe,{asChild:!0,...f,orientation:c,dir:p,loop:d,children:l.jsx(ut.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":o?"":void 0,dir:p,...A,ref:t})})})});xye.displayName=hT;var wye="RadioGroupItem",bye=C.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,s=G1t(wye,n),a=s.disabled||r,o=yye(n),c=vye(n),u=C.useRef(null),d=Qt(t,u),h=s.value===i.value,A=C.useRef(!1);return C.useEffect(()=>{const f=m=>{K1t.includes(m.key)&&(A.current=!0)},p=()=>A.current=!1;return document.addEventListener("keydown",f),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",f),document.removeEventListener("keyup",p)}},[]),l.jsx(Toe,{asChild:!0,...o,focusable:!a,active:h,children:l.jsx(fye,{disabled:a,required:s.required,checked:h,...c,...i,name:s.name,ref:d,onCheck:()=>s.onValueChange(i.value),onKeyDown:et(f=>{f.key==="Enter"&&f.preventDefault()}),onFocus:et(i.onFocus,()=>{var f;A.current&&((f=u.current)==null||f.click())})})})});bye.displayName=wye;var Y1t="RadioGroupIndicator",Cye=C.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=vye(n);return l.jsx(pye,{...i,...r,ref:t})});Cye.displayName=Y1t;var Sye=xye,kye=bye,X1t=Cye;const _ye=C.forwardRef(({className:e,...t},n)=>l.jsx(Sye,{className:it("grid gap-2",e),...t,ref:n}));_ye.displayName=Sye.displayName;const yR=C.forwardRef(({className:e,...t},n)=>l.jsx(kye,{ref:n,className:it("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:l.jsx(X1t,{className:"flex items-center justify-center",children:l.jsx(uU,{className:"h-2.5 w-2.5 fill-current text-current"})})}));yR.displayName=kye.displayName;const jye=({onSuccess:e,onCancel:t})=>{const[n,r]=C.useState("buy"),[i,s]=C.useState(""),[a,o]=C.useState([]),[c,u]=C.useState(""),[d,h]=C.useState([]),[A,f]=C.useState(""),[p,m]=C.useState(""),[g,y]=C.useState(""),[v,x]=C.useState(""),[w,b]=C.useState(""),[k,j]=C.useState(""),[B,E]=C.useState(""),[I,T]=C.useState(""),[N,F]=C.useState(!1),[L,U]=C.useState(null),H=z=>o(Q=>Q.includes(z)?Q.filter(oe=>oe!==z):[...Q,z]),K=z=>h(Q=>Q.includes(z)?Q.filter(oe=>oe!==z):[...Q,z]),$=async z=>{z.preventDefault(),U(null);const Q=[...a];if(c.trim()&&Q.push(c.trim()),Q.length===0){U("Pick at least one town.");return}if(d.length===0){U("Pick at least one property type.");return}const oe=R=>{const M=parseInt(R.replace(/[^0-9]/g,""),10);return Number.isFinite(M)?M:null};F(!0);try{await _1t({type:n,title:i.trim()||void 0,towns:Q,property_types:d,price_min:oe(A),price_max:oe(p),beds_min:g?parseInt(g,10):null,baths_min:v?parseFloat(v):null,timeline:w||null,must_haves:k.trim()||void 0,notable_features:B.trim()||void 0,notes:I.trim()||void 0}),De({title:"Intent submitted",description:"Holden reviews each one personally — you'll see it on your dashboard once approved."}),e==null||e()}catch(R){U((R==null?void 0:R.message)||"Something went wrong.")}finally{F(!1)}};return l.jsxs("form",{onSubmit:$,className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx(ht,{className:"mb-2 block",children:"I'm here to…"}),l.jsxs(_ye,{value:n,onValueChange:z=>r(z),className:"flex gap-6",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(yR,{value:"buy",id:"t-buy"}),l.jsx(ht,{htmlFor:"t-buy",className:"font-normal cursor-pointer",children:"Buy"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(yR,{value:"sell",id:"t-sell"}),l.jsx(ht,{htmlFor:"t-sell",className:"font-normal cursor-pointer",children:"Sell"})]})]})]}),l.jsxs("div",{children:[l.jsx(ht,{htmlFor:"title",children:"Short label (optional)"}),l.jsx(Xe,{id:"title",value:i,onChange:z=>s(z.target.value),placeholder:'e.g. "Townhouse in GR ~$400k"',className:"mt-1"})]}),l.jsxs("div",{children:[l.jsx(ht,{className:"mb-2 block",children:"Towns"}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:v1t.map(z=>l.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[l.jsx(no,{checked:a.includes(z),onCheckedChange:()=>H(z)}),l.jsx("span",{children:z})]},z))}),l.jsx(Xe,{value:c,onChange:z=>u(z.target.value),placeholder:"Other town(s) — comma separated",className:"mt-2"})]}),l.jsxs("div",{children:[l.jsx(ht,{className:"mb-2 block",children:"Property type"}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:x1t.map(z=>l.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[l.jsx(no,{checked:d.includes(z),onCheckedChange:()=>K(z)}),l.jsx("span",{children:z})]},z))})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(ht,{htmlFor:"pmin",children:"Price min"}),l.jsx(Xe,{id:"pmin",value:A,onChange:z=>f(z.target.value),placeholder:"$300,000",className:"mt-1",inputMode:"numeric"})]}),l.jsxs("div",{children:[l.jsx(ht,{htmlFor:"pmax",children:"Price max"}),l.jsx(Xe,{id:"pmax",value:p,onChange:z=>m(z.target.value),placeholder:"$450,000",className:"mt-1",inputMode:"numeric"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx(ht,{children:"Beds (min)"}),l.jsxs(Fr,{value:g,onValueChange:y,children:[l.jsx(Br,{className:"mt-1",children:l.jsx(Mr,{placeholder:"Any"})}),l.jsx(Nr,{children:["1","2","3","4","5"].map(z=>l.jsxs(ft,{value:z,children:[z,"+"]},z))})]})]}),l.jsxs("div",{children:[l.jsx(ht,{children:"Baths (min)"}),l.jsxs(Fr,{value:v,onValueChange:x,children:[l.jsx(Br,{className:"mt-1",children:l.jsx(Mr,{placeholder:"Any"})}),l.jsx(Nr,{children:["1","1.5","2","2.5","3"].map(z=>l.jsxs(ft,{value:z,children:[z,"+"]},z))})]})]})]}),l.jsxs("div",{children:[l.jsx(ht,{children:"Timeline"}),l.jsxs(Fr,{value:w,onValueChange:z=>b(z),children:[l.jsx(Br,{className:"mt-1",children:l.jsx(Mr,{placeholder:"Pick one"})}),l.jsx(Nr,{children:oye.map(z=>l.jsx(ft,{value:z.value,children:z.label},z.value))})]})]}),l.jsxs("div",{children:[l.jsx(ht,{htmlFor:"must",children:n==="sell"?"Notable features":"Must-haves"}),l.jsx(Vi,{id:"must",rows:3,className:"mt-1",value:n==="sell"?B:k,onChange:z=>n==="sell"?E(z.target.value):j(z.target.value),placeholder:n==="sell"?"Anything that makes this place stand out (lot, build year, recent updates, view, etc.)":"Garage, main-floor primary, walkout basement, etc."})]}),l.jsxs("div",{children:[l.jsx(ht,{htmlFor:"notes",children:"Notes (Holden may keep these private or use a vetted version)"}),l.jsx(Vi,{id:"notes",rows:3,className:"mt-1",value:I,onChange:z=>T(z.target.value),placeholder:"Anything else Holden should know."})]}),L&&l.jsx("div",{className:"text-sm text-destructive bg-destructive/10 border border-destructive/30 rounded-md p-3",children:L}),l.jsxs("div",{className:"flex gap-3 pt-2",children:[l.jsx(xe,{type:"submit",disabled:N,children:N?"Submitting…":"Submit intent"}),t&&l.jsx(xe,{type:"button",variant:"outline",onClick:t,disabled:N,children:"Cancel"})]})]})},J1t=e=>{const t=new Date(e),n=Math.floor((Date.now()-t.getTime())/(1e3*60*60*24));return n<1?"today":n<7?`${n}d ago`:n<30?`${Math.floor(n/7)}w ago`:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})},Z1t=e=>new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"}),e2t=({card:e})=>{var d,h;const[t,n]=C.useState(!1),[r,i]=C.useState(""),[s,a]=C.useState(e.pinged),[o,c]=C.useState(!1),u=async()=>{c(!0);try{await j1t(e.id,r.trim()||void 0),a(!0),n(!1),De({title:"Holden notified",description:"He'll text you when there's an update."})}catch(A){De({title:"Couldn't send",description:(A==null?void 0:A.message)||"Try again in a moment.",variant:"destructive"})}finally{c(!1)}};return l.jsx(Xt,{className:"overflow-hidden",children:l.jsxs(Jt,{className:"p-5 space-y-3",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"font-mono text-sm font-medium",children:e.codename}),l.jsx(qt,{variant:e.type==="buy"?"default":"secondary",className:"text-[10px] uppercase",children:e.type==="buy"?"Buyer":"Seller"})]}),e.price_band&&l.jsx("div",{className:"text-lg font-semibold mt-0.5",children:e.price_band})]}),l.jsxs("div",{className:"text-xs text-muted-foreground text-right shrink-0",children:["added ",J1t(e.created_at)]})]}),e.public_summary&&l.jsx("p",{className:"text-sm text-foreground/90 leading-relaxed",children:e.public_summary}),l.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5 text-xs text-muted-foreground",children:[((d=e.towns)==null?void 0:d.length)>0&&l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(ov,{className:"w-3 h-3"})," ",e.towns.join(", ")]}),e.beds_min!=null&&l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(A2e,{className:"w-3 h-3"})," ",e.beds_min,"+"]}),e.baths_min!=null&&l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(lU,{className:"w-3 h-3"})," ",e.baths_min,"+"]}),e.sqft_band&&l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(z2e,{className:"w-3 h-3"})," ",e.sqft_band]}),e.timeline&&l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(w2e,{className:"w-3 h-3"})," ",B1t(e.timeline)]})]}),((h=e.property_types)==null?void 0:h.length)>0&&l.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.property_types.map(A=>l.jsx(qt,{variant:"outline",className:"text-[10px] font-normal",children:A},A))}),e.reviewed_at&&l.jsxs("div",{className:"text-[11px] text-muted-foreground italic",children:["Reviewed by Holden: ",Z1t(e.reviewed_at)]}),l.jsx("div",{className:"pt-2 border-t border-border/60",children:s?l.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[l.jsx(Fo,{className:"w-4 h-4 text-primary"}),"Holden notified"]}):t?l.jsxs("div",{className:"space-y-2",children:[l.jsx(Vi,{placeholder:"Optional: anything Holden should know? (one line)",rows:2,value:r,onChange:A=>i(A.target.value)}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(xe,{size:"sm",onClick:u,disabled:o,children:o?"Sending…":"Send"}),l.jsx(xe,{size:"sm",variant:"ghost",onClick:()=>n(!1),disabled:o,children:"Cancel"})]})]}):l.jsx(xe,{size:"sm",variant:"outline",onClick:()=>n(!0),children:"Tell Holden I'm interested"})})]})})},t2t=[{rate:"3.5%",label:"Matched on the list",summary:"When a buyer and seller already on the Off-Market List come together and Holden represents both sides, total commission is 3.5% — split between the two parties. No MLS, no marketing spend, just a clean match.",conditions:["Both buyer and seller are approved Off-Market List members","Holden represents both sides under written dual-agency disclosure","Split between parties as agreed in writing","Disclosed per MichRIC and Michigan agency rules"]},{rate:"4%",label:"MLS listing",summary:"If you'd rather list on the open market instead of waiting for a match, Holden lists your home for 4% total — 2% to Holden, 2% offered as buyer-agent compensation. Full marketing, photography, and contract-to-close, at well below the traditional 6%.",conditions:["2% to Holden as listing agent","2% offered as buyer-agent compensation","Full MLS exposure, professional photo/video, syndicated marketing","Available to Off-Market List members electing to go to market"]},{rate:"1%",label:"On-list buyer rebate",summary:"If you're an on-list buyer and you decide not to wait for an off-market match — and instead buy a home on the MLS with Holden — you get 1% of the purchase price back as a credit toward your closing costs.",conditions:["Buyer is an approved Off-Market List member","Purchase is an MLS-listed home with Holden as buyer's agent","Applied as a credit toward closing costs at closing, subject to lender approval","Stacks with whatever buyer-agent compensation the listing side offers"]}],Bye=()=>l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Member Benefits"}),l.jsx("p",{className:"text-muted-foreground max-w-2xl",children:"The benefit is structural, not promotional. If a transaction happens because two people on the list lined up, the commission is lower — because the work is lower. That's it. No tiers, no points, no expiring perks."})]}),l.jsx("div",{className:"grid md:grid-cols-3 gap-4",children:t2t.map(e=>l.jsx(Xt,{className:"flex flex-col",children:l.jsxs(Jt,{className:"p-6 flex-1 flex flex-col",children:[l.jsxs("div",{className:"flex items-baseline gap-2 mb-1",children:[l.jsx("span",{className:"text-4xl font-bold",children:e.rate}),l.jsx("span",{className:"text-sm text-muted-foreground",children:"total commission"})]}),l.jsx(qt,{variant:"outline",className:"self-start mb-3 text-xs",children:e.label}),l.jsx("p",{className:"text-sm text-foreground/90 mb-4",children:e.summary}),l.jsxs("div",{className:"mt-auto",children:[l.jsx("div",{className:"text-xs uppercase tracking-wider text-muted-foreground mb-2",children:"Conditions"}),l.jsx("ul",{className:"space-y-1.5 text-xs text-muted-foreground",children:e.conditions.map(t=>l.jsxs("li",{className:"flex gap-2",children:[l.jsx("span",{className:"text-primary",children:"·"}),l.jsx("span",{children:t})]},t))})]})]})},e.rate))}),l.jsx("div",{className:"text-xs text-muted-foreground max-w-2xl",children:"Voice pass on this copy is pending. Numbers, conditions, and structure are locked."})]}),n2t=()=>l.jsx("div",{className:"border-t border-border/60 pt-6 mt-12 text-xs text-muted-foreground leading-relaxed max-w-3xl",children:uye}),r2t=()=>{const[e,t]=Yie(),[n,r]=C.useState("loading"),[i,s]=C.useState(null),[a,o]=C.useState(!1),[c,u]=C.useState(!1),d=async()=>{const f=await cye();if(!f.valid){s(null),r("logged_out");return}s(f.member),r(f.member.status==="approved"?"approved":"pending")};C.useEffect(()=>{d()},[]);const h=()=>{u(!1),d()},A=()=>{b1t(),s(null),r("logged_out")};return l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"The Off-Market List | Holden Richardson"}),l.jsx("meta",{name:"description",content:"A small, vetted list of buyers and sellers in West Michigan exploring off-market moves before anything hits the MLS."}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsxs("div",{className:"container-page py-12 md:py-16",children:[n==="loading"&&l.jsxs("div",{className:"space-y-4 max-w-3xl",children:[l.jsx(lt,{className:"h-12 w-64"}),l.jsx(lt,{className:"h-64 w-full"})]}),n==="logged_out"&&l.jsx(i2t,{openSignup:()=>o(!0),openRedeem:()=>u(!0)}),n==="pending"&&i&&l.jsx(s2t,{member:i,onSignout:A}),n==="approved"&&i&&l.jsx(a2t,{member:i,onSignout:A,initialTab:e.get("tab")||void 0,setTab:f=>t({tab:f})}),l.jsx(n2t,{})]}),l.jsx(No,{open:a,onOpenChange:o,children:l.jsxs(Ka,{className:"max-w-md",children:[l.jsxs(qa,{children:[l.jsx(Wa,{children:"Apply to join the Off-Market List"}),l.jsx(Ij,{children:"Holden personally reviews each application. You'll hear within a day or two."})]}),l.jsx(U1t,{onSuccess:()=>o(!1)})]})}),l.jsx(No,{open:c,onOpenChange:u,children:l.jsxs(Ka,{className:"max-w-md",children:[l.jsxs(qa,{children:[l.jsx(Wa,{children:"Redeem your invite code"}),l.jsx(Ij,{children:"Holden DM'd or texted you a 9-character code. Drop it in."})]}),l.jsx(H1t,{onSuccess:h})]})})]})},i2t=({openSignup:e,openRedeem:t})=>l.jsxs("div",{className:"space-y-12 max-w-4xl",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx(qt,{variant:"outline",className:"text-xs uppercase tracking-wider",children:"Off-Market · West Michigan"}),l.jsx("h1",{className:"text-4xl md:text-5xl font-bold tracking-tight",children:"The Off-Market List"}),l.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl leading-relaxed",children:"A small, vetted group of West Michigan buyers and sellers exploring off-market moves before anything hits the MLS. It's an intent tracker, not a listing service. When two sides line up, Holden makes the introduction."})]}),l.jsx(Xt,{className:"bg-muted/40 border-primary/30",children:l.jsxs(Jt,{className:"p-6",children:[l.jsx("div",{className:"text-xs uppercase tracking-wider text-primary mb-2",children:"The no-push promise"}),l.jsx("p",{className:"text-sm leading-relaxed",children:dye})]})}),l.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[l.jsx(Xt,{className:"hover:border-primary/50 transition-colors",children:l.jsxs(Jt,{className:"p-6 space-y-3",children:[l.jsx("h3",{className:"font-semibold text-lg",children:"New here?"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Apply to join. Holden personally reviews each one — usually within a day or two."}),l.jsx(xe,{onClick:e,className:"w-full",children:"Sign up to join"})]})}),l.jsx(Xt,{className:"hover:border-primary/50 transition-colors",children:l.jsxs(Jt,{className:"p-6 space-y-3",children:[l.jsx("h3",{className:"font-semibold text-lg",children:"Have a code?"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"If Holden sent you a 9-character invite code, drop it in to skip the queue."}),l.jsx(xe,{onClick:t,variant:"outline",className:"w-full",children:"I have a code"})]})})]}),l.jsx(Xt,{className:"border-dashed",children:l.jsxs(Jt,{className:"p-8 text-center text-muted-foreground",children:[l.jsx("div",{className:"text-xs uppercase tracking-wider mb-2",children:"Demo"}),l.jsx("div",{className:"aspect-video bg-muted/50 rounded-md flex items-center justify-center",children:"Loom walkthrough coming soon"})]})})]}),s2t=({member:e,onSignout:t})=>l.jsxs("div",{className:"max-w-2xl space-y-6",children:[l.jsx(qt,{variant:"outline",className:"text-xs uppercase tracking-wider",children:"In review"}),l.jsxs("h1",{className:"text-3xl md:text-4xl font-bold tracking-tight",children:["You're in the queue",e.first_name?`, ${e.first_name}`:"","."]}),l.jsx("p",{className:"text-lg text-muted-foreground leading-relaxed",children:"Holden personally reviews each application. You'll hear within a day or two — usually a quick text or email with an invite code."}),l.jsx(Xt,{className:"bg-muted/40",children:l.jsxs(Jt,{className:"p-6 text-sm space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[l.jsx(Pre,{className:"w-4 h-4"}),"The dashboard is locked until you're approved."]}),l.jsx("p",{className:"text-muted-foreground",children:"No automated reminders, no nurture sequence, no follow-up cadence. Just a real reply from Holden when he gets to your application."})]})}),l.jsx(xe,{variant:"ghost",size:"sm",onClick:t,className:"text-muted-foreground",children:"Sign out"})]}),a2t=({member:e,onSignout:t,initialTab:n,setTab:r})=>{const[i,s]=C.useState(null),[a,o]=C.useState(!0),[c,u]=C.useState(!1),[d,h]=C.useState(()=>typeof window<"u"&&!!localStorage.getItem(YX)),[A,f]=C.useState(n||"buyers"),p=async()=>{o(!0);try{const y=await k1t();s(y)}finally{o(!1)}};C.useEffect(()=>{p()},[]);const m=()=>{localStorage.setItem(YX,"1"),h(!0)},g=y=>{f(y),r(y)};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-end justify-between flex-wrap gap-3",children:[l.jsxs("div",{children:[l.jsx(qt,{variant:"default",className:"text-xs uppercase tracking-wider mb-2",children:"Approved"}),l.jsxs("h1",{className:"text-3xl md:text-4xl font-bold tracking-tight",children:["The Off-Market List",e.first_name?` — ${e.first_name}`:""]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(xe,{onClick:()=>u(!0),children:"Add intent"}),l.jsx(xe,{variant:"ghost",size:"sm",onClick:t,className:"text-muted-foreground",children:"Sign out"})]})]}),e.tier==="lurker"&&!d&&l.jsx(Xt,{className:"bg-primary/5 border-primary/40",children:l.jsxs(Jt,{className:"p-4 flex items-start gap-3",children:[l.jsxs("div",{className:"flex-1 text-sm",children:[l.jsx("span",{className:"font-medium",children:"Add what you're looking for"})," and we'll alert you when it shows up. Takes 90 seconds."]}),l.jsx(xe,{size:"sm",onClick:()=>u(!0),children:"Add intent"}),l.jsx("button",{onClick:m,className:"text-muted-foreground hover:text-foreground p-1",children:l.jsx(ta,{className:"w-4 h-4"})})]})}),l.jsxs(ym,{value:A,onValueChange:g,children:[l.jsxs(Vf,{className:"bg-muted/50",children:[l.jsx(Hn,{value:"buyers",className:"text-xs uppercase tracking-wider",children:"Buyers"}),l.jsx(Hn,{value:"sellers",className:"text-xs uppercase tracking-wider",children:"Sellers"}),l.jsx(Hn,{value:"my",className:"text-xs uppercase tracking-wider",children:"My Intents"}),l.jsx(Hn,{value:"benefits",className:"text-xs uppercase tracking-wider",children:"Member Benefits"})]}),l.jsx(Qn,{value:"buyers",children:l.jsx(XX,{loading:a,cards:(i==null?void 0:i.buy_intents)||[],kind:"buy"})}),l.jsx(Qn,{value:"sellers",children:l.jsx(XX,{loading:a,cards:(i==null?void 0:i.sell_intents)||[],kind:"sell"})}),l.jsx(Qn,{value:"my",children:l.jsx(o2t,{loading:a,intents:(i==null?void 0:i.my_intents)||[],onAdd:()=>u(!0)})}),l.jsx(Qn,{value:"benefits",children:l.jsx(Bye,{})})]}),l.jsx(Xt,{className:"bg-muted/30 border-dashed mt-8",children:l.jsxs(Jt,{className:"p-4 text-xs text-muted-foreground",children:[l.jsx("span",{className:"uppercase tracking-wider text-primary mr-2",children:"No-push promise"}),dye]})}),l.jsx(No,{open:c,onOpenChange:u,children:l.jsxs(Ka,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[l.jsxs(qa,{children:[l.jsx(Wa,{children:"Add an intent"}),l.jsx(Ij,{children:"What would you do, if the right thing showed up? Holden reviews each one before it lands on the dashboard."})]}),l.jsx(jye,{onSuccess:()=>{u(!1),p(),g("my")},onCancel:()=>u(!1)})]})})]})},XX=({loading:e,cards:t,kind:n})=>{const[r,i]=C.useState("all"),[s,a]=C.useState("all"),[o,c]=C.useState("all"),[u,d]=C.useState(""),[h,A]=C.useState("newest"),f=C.useMemo(()=>{const g=new Set;return t.forEach(y=>{var v;return(v=y.towns)==null?void 0:v.forEach(x=>g.add(x))}),Array.from(g).sort()},[t]),p=C.useMemo(()=>{const g=new Set;return t.forEach(y=>{var v;return(v=y.property_types)==null?void 0:v.forEach(x=>g.add(x))}),Array.from(g).sort()},[t]),m=C.useMemo(()=>{let g=[...t];r!=="all"&&(g=g.filter(v=>{var x;return(x=v.towns)==null?void 0:x.includes(r)})),s!=="all"&&(g=g.filter(v=>{var x;return(x=v.property_types)==null?void 0:x.includes(s)})),o!=="all"&&(g=g.filter(v=>v.timeline===o));const y=parseInt(u.replace(/[^0-9]/g,""),10);return Number.isFinite(y)&&(g=g.filter(v=>{if(!v.price_band)return!0;const x=v.price_band.match(/\$?([\d.]+)([kKmM])/);return x?parseFloat(x[1])*(x[2].toLowerCase()==="m"?1e6:1e3)<=y:!0})),h==="newest"&&g.sort((v,x)=>new Date(x.created_at).getTime()-new Date(v.created_at).getTime()),g},[t,r,s,o,u,h]);return e?l.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-4 mt-6",children:Array.from({length:6}).map((g,y)=>l.jsx(lt,{className:"h-64 w-full"},y))}):l.jsxs("div",{className:"space-y-4 mt-6",children:[l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsxs(Fr,{value:r,onValueChange:i,children:[l.jsx(Br,{className:"w-auto min-w-[140px]",children:l.jsx(Mr,{placeholder:"Town"})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"all",children:"All towns"}),f.map(g=>l.jsx(ft,{value:g,children:g},g))]})]}),l.jsxs(Fr,{value:s,onValueChange:a,children:[l.jsx(Br,{className:"w-auto min-w-[140px]",children:l.jsx(Mr,{placeholder:"Type"})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"all",children:"All types"}),p.map(g=>l.jsx(ft,{value:g,children:g},g))]})]}),l.jsxs(Fr,{value:o,onValueChange:c,children:[l.jsx(Br,{className:"w-auto min-w-[140px]",children:l.jsx(Mr,{placeholder:"Timeline"})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"all",children:"Any timeline"}),l.jsx(ft,{value:"now",children:"Now"}),l.jsx(ft,{value:"3mo",children:"≤3 months"}),l.jsx(ft,{value:"6mo",children:"≤6 months"}),l.jsx(ft,{value:"12mo",children:"≤12 months"}),l.jsx(ft,{value:"right_offer",children:"Right offer"})]})]}),l.jsx(Xe,{placeholder:"Max price",value:u,onChange:g=>d(g.target.value),className:"w-32",inputMode:"numeric"}),l.jsx("div",{className:"ml-auto",children:l.jsxs(Fr,{value:h,onValueChange:g=>A(g),children:[l.jsx(Br,{className:"w-auto min-w-[140px]",children:l.jsx(Mr,{})}),l.jsxs(Nr,{children:[l.jsx(ft,{value:"newest",children:"Newest first"}),l.jsx(ft,{value:"price_asc",children:"Price ↑ (soon)"}),l.jsx(ft,{value:"price_desc",children:"Price ↓ (soon)"})]})]})})]}),m.length===0?l.jsx(Xt,{className:"border-dashed",children:l.jsxs(Jt,{className:"p-12 text-center text-muted-foreground",children:["No ",n==="buy"?"buyer":"seller"," intents match those filters yet."]})}):l.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-4",children:m.map(g=>l.jsx(e2t,{card:g},g.id))})]})},o2t=({loading:e,intents:t,onAdd:n})=>e?l.jsx(lt,{className:"h-48 w-full mt-6"}):t.length===0?l.jsx(Xt,{className:"mt-6 border-dashed",children:l.jsxs(Jt,{className:"p-12 text-center space-y-3",children:[l.jsx("p",{className:"text-muted-foreground",children:"You haven't added any intents yet."}),l.jsx(xe,{onClick:n,children:"Add your first intent"})]})}):l.jsx("div",{className:"space-y-3 mt-6",children:t.map(r=>{var i;return l.jsx(Xt,{children:l.jsxs(Jt,{className:"p-5 flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[l.jsx(qt,{variant:r.type==="buy"?"default":"secondary",className:"text-[10px] uppercase",children:r.type}),l.jsx(qt,{variant:"outline",className:"text-[10px] uppercase",children:r.status.replace(/_/g," ")})]}),r.title&&l.jsx("div",{className:"font-medium",children:r.title}),l.jsxs("div",{className:"text-sm text-muted-foreground mt-1",children:[((i=r.towns)==null?void 0:i.join(", "))||"—",(r.price_min||r.price_max)&&l.jsxs(l.Fragment,{children:[" · ",r.price_min?`$${r.price_min.toLocaleString()}`:"?","–",r.price_max?`$${r.price_max.toLocaleString()}`:"?"]}),r.timeline&&l.jsxs(l.Fragment,{children:[" · ",r.timeline]})]})]}),l.jsx(xe,{size:"sm",variant:"outline",disabled:!0,title:"Pause/edit coming soon",children:"Pause"})]})},r.id)})}),l2t=()=>l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Member Benefits — The Off-Market List | Holden Richardson"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsxs("div",{className:"container-page py-12 md:py-16",children:[l.jsxs(At,{to:"/list",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground mb-6",children:[l.jsx(pm,{className:"w-4 h-4"})," Back to The Off-Market List"]}),l.jsx(Bye,{}),l.jsx("div",{className:"border-t border-border/60 pt-6 mt-12 text-xs text-muted-foreground leading-relaxed max-w-3xl",children:uye})]})]}),c2t=()=>{const e=El(),[t,n]=C.useState(null);return C.useEffect(()=>{(async()=>{const r=await cye();if(!r.valid||r.member.status!=="approved"){e("/list",{replace:!0});return}n(!0)})()},[e]),l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Add Intent — The Off-Market List | Holden Richardson"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsxs("div",{className:"container-page py-12 md:py-16 max-w-2xl",children:[l.jsx("h1",{className:"text-3xl md:text-4xl font-bold tracking-tight mb-2",children:"Add an intent"}),l.jsx("p",{className:"text-muted-foreground mb-8",children:"What would you do, if the right thing showed up? Holden reviews each one before it lands on the dashboard."}),t===null?l.jsx(lt,{className:"h-96 w-full"}):l.jsx(Xt,{children:l.jsx(Jt,{className:"p-6",children:l.jsx(jye,{onSuccess:()=>e("/list?tab=my"),onCancel:()=>e("/list")})})})]})]})};var Nye=["PageUp","PageDown"],Eye=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Tye={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},I0="Slider",[vR,u2t,d2t]=y2(I0),[Pye,gPt]=Wi(I0,[d2t]),[h2t,fT]=Pye(I0),Iye=C.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:s=1,orientation:a="horizontal",disabled:o=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:d,onValueChange:h=()=>{},onValueCommit:A=()=>{},inverted:f=!1,form:p,...m}=e,g=C.useRef(new Set),y=C.useRef(0),x=a==="horizontal"?f2t:A2t,[w=[],b]=ja({prop:d,defaultProp:u,onChange:T=>{var F;(F=[...g.current][y.current])==null||F.focus(),h(T)}}),k=C.useRef(w);function j(T){const N=v2t(w,T);I(T,N)}function B(T){I(T,y.current)}function E(){const T=k.current[y.current];w[y.current]!==T&&A(w)}function I(T,N,{commit:F}={commit:!1}){const L=C2t(s),U=S2t(Math.round((T-r)/s)*s+r,L),H=p1(U,[r,i]);b((K=[])=>{const $=g2t(K,H,N);if(b2t($,c*s)){y.current=$.indexOf(H);const z=String($)!==String(K);return z&&F&&A($),z?$:K}else return K})}return l.jsx(h2t,{scope:e.__scopeSlider,name:n,disabled:o,min:r,max:i,valueIndexToChangeRef:y,thumbs:g.current,values:w,orientation:a,form:p,children:l.jsx(vR.Provider,{scope:e.__scopeSlider,children:l.jsx(vR.Slot,{scope:e.__scopeSlider,children:l.jsx(x,{"aria-disabled":o,"data-disabled":o?"":void 0,...m,ref:t,onPointerDown:et(m.onPointerDown,()=>{o||(k.current=w)}),min:r,max:i,inverted:f,onSlideStart:o?void 0:j,onSlideMove:o?void 0:B,onSlideEnd:o?void 0:E,onHomeKeyDown:()=>!o&&I(r,0,{commit:!0}),onEndKeyDown:()=>!o&&I(i,w.length-1,{commit:!0}),onStepKeyDown:({event:T,direction:N})=>{if(!o){const U=Nye.includes(T.key)||T.shiftKey&&Eye.includes(T.key)?10:1,H=y.current,K=w[H],$=s*U*N;I(K+$,H,{commit:!0})}}})})})})});Iye.displayName=I0;var[Oye,Fye]=Pye(I0,{startEdge:"left",endEdge:"right",size:"width",direction:1}),f2t=C.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:s,onSlideStart:a,onSlideMove:o,onSlideEnd:c,onStepKeyDown:u,...d}=e,[h,A]=C.useState(null),f=Qt(t,x=>A(x)),p=C.useRef(void 0),m=gm(i),g=m==="ltr",y=g&&!s||!g&&s;function v(x){const w=p.current||h.getBoundingClientRect(),b=[0,w.width],j=c$(b,y?[n,r]:[r,n]);return p.current=w,j(x-w.left)}return l.jsx(Oye,{scope:e.__scopeSlider,startEdge:y?"left":"right",endEdge:y?"right":"left",direction:y?1:-1,size:"width",children:l.jsx(Mye,{dir:m,"data-orientation":"horizontal",...d,ref:f,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const w=v(x.clientX);a==null||a(w)},onSlideMove:x=>{const w=v(x.clientX);o==null||o(w)},onSlideEnd:()=>{p.current=void 0,c==null||c()},onStepKeyDown:x=>{const b=Tye[y?"from-left":"from-right"].includes(x.key);u==null||u({event:x,direction:b?-1:1})}})})}),A2t=C.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:s,onSlideMove:a,onSlideEnd:o,onStepKeyDown:c,...u}=e,d=C.useRef(null),h=Qt(t,d),A=C.useRef(void 0),f=!i;function p(m){const g=A.current||d.current.getBoundingClientRect(),y=[0,g.height],x=c$(y,f?[r,n]:[n,r]);return A.current=g,x(m-g.top)}return l.jsx(Oye,{scope:e.__scopeSlider,startEdge:f?"bottom":"top",endEdge:f?"top":"bottom",size:"height",direction:f?1:-1,children:l.jsx(Mye,{"data-orientation":"vertical",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:m=>{const g=p(m.clientY);s==null||s(g)},onSlideMove:m=>{const g=p(m.clientY);a==null||a(g)},onSlideEnd:()=>{A.current=void 0,o==null||o()},onStepKeyDown:m=>{const y=Tye[f?"from-bottom":"from-top"].includes(m.key);c==null||c({event:m,direction:y?-1:1})}})})}),Mye=C.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:a,onEndKeyDown:o,onStepKeyDown:c,...u}=e,d=fT(I0,n);return l.jsx(ut.span,{...u,ref:t,onKeyDown:et(e.onKeyDown,h=>{h.key==="Home"?(a(h),h.preventDefault()):h.key==="End"?(o(h),h.preventDefault()):Nye.concat(Eye).includes(h.key)&&(c(h),h.preventDefault())}),onPointerDown:et(e.onPointerDown,h=>{const A=h.target;A.setPointerCapture(h.pointerId),h.preventDefault(),d.thumbs.has(A)?A.focus():r(h)}),onPointerMove:et(e.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&i(h)}),onPointerUp:et(e.onPointerUp,h=>{const A=h.target;A.hasPointerCapture(h.pointerId)&&(A.releasePointerCapture(h.pointerId),s(h))})})}),Lye="SliderTrack",Rye=C.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=fT(Lye,n);return l.jsx(ut.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});Rye.displayName=Lye;var xR="SliderRange",Dye=C.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=fT(xR,n),s=Fye(xR,n),a=C.useRef(null),o=Qt(t,a),c=i.values.length,u=i.values.map(A=>Qye(A,i.min,i.max)),d=c>1?Math.min(...u):0,h=100-Math.max(...u);return l.jsx(ut.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:o,style:{...e.style,[s.startEdge]:d+"%",[s.endEdge]:h+"%"}})});Dye.displayName=xR;var wR="SliderThumb",Uye=C.forwardRef((e,t)=>{const n=u2t(e.__scopeSlider),[r,i]=C.useState(null),s=Qt(t,o=>i(o)),a=C.useMemo(()=>r?n().findIndex(o=>o.ref.current===r):-1,[n,r]);return l.jsx(p2t,{...e,ref:s,index:a})}),p2t=C.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...s}=e,a=fT(wR,n),o=Fye(wR,n),[c,u]=C.useState(null),d=Qt(t,v=>u(v)),h=c?a.form||!!c.closest("form"):!0,A=k2(c),f=a.values[r],p=f===void 0?0:Qye(f,a.min,a.max),m=y2t(r,a.values.length),g=A==null?void 0:A[o.size],y=g?x2t(g,p,o.direction):0;return C.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),l.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${p}% + ${y}px)`},children:[l.jsx(vR.ItemSlot,{scope:e.__scopeSlider,children:l.jsx(ut.span,{role:"slider","aria-label":e["aria-label"]||m,"aria-valuemin":a.min,"aria-valuenow":f,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...s,ref:d,style:f===void 0?{display:"none"}:e.style,onFocus:et(e.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),h&&l.jsx(Hye,{name:i??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:f},r)]})});Uye.displayName=wR;var m2t="RadioBubbleInput",Hye=C.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=C.useRef(null),s=Qt(i,r),a=D2(t);return C.useEffect(()=>{const o=i.current;if(!o)return;const c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&d){const h=new Event("input",{bubbles:!0});d.call(o,t),o.dispatchEvent(h)}},[a,t]),l.jsx(ut.input,{style:{display:"none"},...n,ref:s,defaultValue:t})});Hye.displayName=m2t;function g2t(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,s)=>i-s)}function Qye(e,t,n){const s=100/(n-t)*(e-t);return p1(s,[0,100])}function y2t(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function v2t(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),r=Math.min(...n);return n.indexOf(r)}function x2t(e,t,n){const r=e/2,s=c$([0,50],[0,r]);return(r-s(t)*n)*n}function w2t(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function b2t(e,t){if(t>0){const n=w2t(e);return Math.min(...n)>=t}return!0}function c$(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function C2t(e){return(String(e).split(".")[1]||"").length}function S2t(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var $ye=Iye,k2t=Rye,_2t=Dye,j2t=Uye;const bR=C.forwardRef(({className:e,...t},n)=>l.jsxs($ye,{ref:n,className:it("relative flex w-full touch-none select-none items-center",e),...t,children:[l.jsx(k2t,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:l.jsx(_2t,{className:"absolute h-full bg-primary"})}),l.jsx(j2t,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));bR.displayName=$ye.displayName;const vg=e=>e.toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}),JX=()=>{const{configMap:e}=Os(),t=e.booking_url||p6e,n=e.agent_phone||oM,r=`sms:${(n||A6e).replace(/[^+\d]/g,"")}`,[i,s]=C.useState(4e5),[a,o]=C.useState(45e4),c=C.useMemo(()=>i*.01,[i]),u=C.useMemo(()=>a*.02,[a]),d=C.useMemo(()=>a*.01,[a]),h=C.useMemo(()=>a*.03,[a]);return l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"1% Listing & 1% Buyer Rebate Program | Holden Richardson"}),l.jsx("meta",{name:"description",content:"Full-service representation in Grand Rapids for a 1% listing fee or a 1% buyer rebate toward closing costs. Same marketing, negotiation, and contract-to-close support — just more efficient."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/savings-program"}),l.jsx("meta",{property:"og:title",content:"1% Listing & 1% Buyer Rebate | Holden Richardson"}),l.jsx("meta",{property:"og:description",content:"Full-service real estate at 1% — for buyers and sellers in Grand Rapids."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/savings-program"}),l.jsx("meta",{property:"og:type",content:"website"})]}),l.jsx("section",{className:"bg-secondary pt-24 md:pt-28 pb-6 md:pb-8",children:l.jsx("div",{className:"container-page",children:l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-2 text-xs font-semibold",children:"Save More. Get More."}),l.jsx("h1",{className:"font-serif text-2xl md:text-3xl font-light text-foreground max-w-3xl",children:"1% Listing Fee. 1% Buyer Rebate. Full Service — Always."})]})})}),l.jsx("section",{className:"pt-6 pb-16 md:pt-8 md:pb-20 bg-background",children:l.jsxs("div",{className:"container-page",children:[l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[l.jsx(_e,{children:l.jsxs("div",{className:"border border-border bg-secondary p-8 md:p-10 h-full flex flex-col",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[l.jsx(X2e,{className:"w-5 h-5 text-accent"}),l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest text-xs font-semibold",children:"For Buyers"})]}),l.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-3",children:"Get 1% Back at Closing"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-8",children:"When you buy a home with Holden, you receive 1% of the purchase price back as a credit toward your closing costs."}),l.jsxs("div",{className:"mb-8",children:[l.jsxs("div",{className:"flex justify-between items-baseline mb-3",children:[l.jsx("label",{className:"text-caption text-muted-foreground",children:"Purchase Price"}),l.jsx("span",{className:"font-serif text-2xl text-foreground",children:vg(i)})]}),l.jsx(bR,{value:[i],onValueChange:A=>s(A[0]),min:1e5,max:2e6,step:1e4,className:"my-4"}),l.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[l.jsx("span",{children:"$100k"}),l.jsx("span",{children:"$2M"})]})]}),l.jsxs("div",{className:"mt-auto bg-foreground text-background p-6",children:[l.jsx("p",{className:"text-caption text-background/60 uppercase tracking-widest text-xs mb-2",children:"Your Rebate Toward Closing"}),l.jsx("p",{className:"font-serif text-4xl md:text-5xl font-light text-accent",children:vg(c)})]})]})}),l.jsx(_e,{delay:.1,children:l.jsxs("div",{className:"border border-border bg-secondary p-8 md:p-10 h-full flex flex-col",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[l.jsx(Rre,{className:"w-5 h-5 text-accent"}),l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest text-xs font-semibold",children:"For Sellers"})]}),l.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-3",children:"List for 1% Instead of 3%"}),l.jsx("p",{className:"text-sm text-muted-foreground mb-8",children:"Pay a 1% listing fee instead of the traditional 3%. Keep more equity in your pocket — without cutting corners on service."}),l.jsxs("div",{className:"mb-8",children:[l.jsxs("div",{className:"flex justify-between items-baseline mb-3",children:[l.jsx("label",{className:"text-caption text-muted-foreground",children:"Sale Price"}),l.jsx("span",{className:"font-serif text-2xl text-foreground",children:vg(a)})]}),l.jsx(bR,{value:[a],onValueChange:A=>o(A[0]),min:1e5,max:2e6,step:1e4,className:"my-4"}),l.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[l.jsx("span",{children:"$100k"}),l.jsx("span",{children:"$2M"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3 mb-4 text-sm",children:[l.jsxs("div",{className:"border border-border p-4 bg-background",children:[l.jsx("p",{className:"text-caption text-muted-foreground text-xs mb-1",children:"Traditional 3%"}),l.jsx("p",{className:"font-serif text-xl text-muted-foreground line-through",children:vg(h)})]}),l.jsxs("div",{className:"border border-accent p-4 bg-background",children:[l.jsx("p",{className:"text-caption text-accent text-xs mb-1",children:"Holden's 1%"}),l.jsx("p",{className:"font-serif text-xl text-foreground",children:vg(d)})]})]}),l.jsxs("div",{className:"mt-auto bg-foreground text-background p-6",children:[l.jsx("p",{className:"text-caption text-background/60 uppercase tracking-widest text-xs mb-2",children:"You Save"}),l.jsx("p",{className:"font-serif text-4xl md:text-5xl font-light text-accent",children:vg(u)})]})]})})]}),l.jsx("p",{className:"text-xs text-muted-foreground text-center mt-6 max-w-2xl mx-auto",children:"Estimates only. Buyer rebate is applied as a credit toward closing costs at closing, subject to lender approval. Seller savings shown vs. a traditional 3% listing fee; buyer-side compensation is separate and negotiable per transaction."})]})}),l.jsx("section",{className:"py-16 md:py-20 bg-secondary",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsxs("div",{className:"max-w-3xl mb-10",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3 text-xs font-semibold",children:"Don't Confuse This With Discount"}),l.jsx("h2",{className:"font-serif text-3xl md:text-4xl font-light text-foreground mb-4",children:"This Is Full Service. Period."}),l.jsx("p",{className:"text-base text-muted-foreground",children:'You get every single thing a 3% agent provides — professional photography, full MLS exposure, syndicated marketing, hard negotiation, and complete contract-to-close management. Nothing is stripped out. Nothing is "self-serve." You get me, and you get the full operation behind me.'})]})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-10 gap-y-4",children:["Professional photography & video","Full MLS listing & syndication","Targeted digital marketing & social","Pricing strategy backed by live data","Aggressive negotiation on your behalf","Full contract-to-close coordination","Inspection & appraisal management","Showings, open houses, and feedback loops","Vendor network: lenders, inspectors, attorneys","Direct cell access to me — not a team assistant"].map(A=>l.jsxs("div",{className:"flex items-start gap-3 py-2 border-b border-border/50",children:[l.jsx(Fo,{className:"w-4 h-4 text-accent shrink-0 mt-1"}),l.jsx("span",{className:"text-sm text-foreground",children:A})]},A))})]})}),l.jsx("section",{className:"py-16 md:py-20 bg-background",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsxs("div",{className:"max-w-3xl mx-auto text-center mb-12",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3 text-xs font-semibold",children:"How We Do It"}),l.jsx("h2",{className:"font-serif text-3xl md:text-4xl font-light text-foreground mb-4",children:"Built Lean, Run Tight, Powered by Tools."}),l.jsx("p",{className:"text-base text-muted-foreground",children:"Most agencies carry overhead that gets baked into your fee. We don't. Our operation is built around modern tools, automation, and a tight system that lets me deliver top-tier service without the bloated cost structure."})]})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 max-w-5xl mx-auto",children:[{title:"Efficient Systems",body:"Automated marketing, transaction management, and CRM tools handle the busywork — so my time goes to negotiating, advising, and showing up for you."},{title:"No Bloated Overhead",body:"No assistant teams to fund, no franchise fees padding the bill. The savings get passed straight back to you."},{title:"Same Local Expertise",body:"11+ years and 150+ homes sold in West Michigan. The market knowledge doesn't get discounted — only the fee does."}].map(A=>l.jsxs("div",{className:"border border-border p-6 bg-secondary",children:[l.jsx("h3",{className:"font-serif text-xl mb-2 text-foreground",children:A.title}),l.jsx("p",{className:"text-sm text-muted-foreground",children:A.body})]},A.title))})]})}),l.jsx("section",{className:"py-16 md:py-20 bg-foreground text-background",children:l.jsx("div",{className:"container-page",children:l.jsxs(_e,{variant:"lift",children:[l.jsxs("div",{className:"text-center max-w-2xl mx-auto mb-10",children:[l.jsx("p",{className:"text-caption text-background/60 uppercase tracking-widest mb-3 text-xs",children:"Ready to Run the Numbers?"}),l.jsx("h2",{className:"font-serif text-3xl md:text-4xl font-light mb-4",children:"Let's Talk About Your Move."}),l.jsx("p",{className:"text-base text-background/70",children:"Book a quick call or send a message. No pressure — just a clear breakdown of what this would look like for your specific situation."})]}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 max-w-3xl mx-auto",children:[l.jsx("a",{href:`tel:${n}`,children:l.jsxs(xe,{size:"lg",className:"w-full bg-background text-foreground hover:bg-background/90 rounded-none font-semibold h-14 text-base",children:[l.jsx(lf,{className:"w-5 h-5 mr-2"}),"Call"]})}),l.jsx("a",{href:r,children:l.jsxs(xe,{size:"lg",className:"w-full bg-background text-foreground hover:bg-background/90 rounded-none font-semibold h-14 text-base",children:[l.jsx(ad,{className:"w-5 h-5 mr-2"}),"Text"]})}),l.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:l.jsxs(xe,{size:"lg",className:"w-full bg-accent text-accent-foreground hover:bg-accent hover:opacity-90 rounded-none font-semibold h-14 text-base",children:[l.jsx(Oo,{className:"w-5 h-5 mr-2"}),"Book a Meeting"]})})]}),l.jsx("div",{className:"text-center mt-8",children:l.jsx(At,{to:"/contact",className:"text-sm text-background/70 hover:text-background underline underline-offset-4",children:"Or send a message via the contact form →"})})]})})})]})},B2t=()=>{const e=El(),{toast:t}=Qf(),[n,r]=C.useState(!1),[i,s]=C.useState(""),[a,o]=C.useState(""),[c,u]=C.useState(!1),[d,h]=C.useState(!1),[A,f]=C.useState(!0);C.useEffect(()=>{const{data:{subscription:m}}=Me.auth.onAuthStateChange(g=>{g==="PASSWORD_RECOVERY"&&(r(!0),f(!1))});return Me.auth.getSession().then(({data:{session:g}})=>{g&&r(!0),f(!1)}),()=>m.unsubscribe()},[]);const p=async m=>{if(m.preventDefault(),i!==a){t({variant:"destructive",title:"Passwords don't match",description:"Please make sure your passwords match."});return}if(i.length<6){t({variant:"destructive",title:"Password too short",description:"Password must be at least 6 characters."});return}u(!0);const{error:g}=await Me.auth.updateUser({password:i});g?t({variant:"destructive",title:"Failed to reset password",description:g.message}):(h(!0),t({title:"Password updated!",description:"Your password has been changed. Redirecting…"}),setTimeout(()=>e("/auth"),2e3)),u(!1)};return A?l.jsx(ln,{children:l.jsx("div",{className:"min-h-[60vh] flex items-center justify-center",children:l.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Verifying reset link…"})})}):l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Reset Password | Holden Richardson — Grand Rapids Real Estate"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsx("div",{className:"section-padding",children:l.jsx("div",{className:"container-page max-w-md",children:l.jsxs(Xt,{className:"border-border",children:[l.jsxs(wa,{className:"text-center",children:[l.jsx(ba,{className:"heading-card",children:"Reset Password"}),l.jsx(kp,{children:n?"Enter your new password below.":"This link is invalid or has expired."})]}),l.jsx(Jt,{children:d?l.jsx("div",{className:"text-center space-y-4",children:l.jsx("p",{className:"text-muted-foreground",children:"Password updated successfully! Redirecting to sign in…"})}):n?l.jsxs("form",{onSubmit:p,className:"space-y-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"new-password",children:"New Password"}),l.jsx(Xe,{id:"new-password",type:"password",placeholder:"••••••••",value:i,onChange:m=>s(m.target.value),required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ht,{htmlFor:"confirm-password",children:"Confirm Password"}),l.jsx(Xe,{id:"confirm-password",type:"password",placeholder:"••••••••",value:a,onChange:m=>o(m.target.value),required:!0})]}),l.jsx(xe,{type:"submit",className:"w-full",disabled:c,children:c?"Updating…":"Set New Password"})]}):l.jsxs("div",{className:"text-center space-y-4",children:[l.jsx("p",{className:"text-muted-foreground",children:"The password reset link is invalid or has expired. Please request a new one."}),l.jsx(At,{to:"/auth",children:l.jsx(xe,{variant:"outline",children:"Back to Sign In"})})]})})]})})})]})},N2t=()=>l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Privacy Policy | Holden Richardson"}),l.jsx("meta",{name:"description",content:"Privacy policy for HoldenGR.com — how we collect, use, and protect your personal information."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/privacy-policy"}),l.jsx("meta",{property:"og:title",content:"Privacy Policy | Holden Richardson"}),l.jsx("meta",{property:"og:description",content:"Privacy policy for HoldenGR.com — how we collect, use, and protect your personal information."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/privacy-policy"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary"}),l.jsx("meta",{name:"twitter:title",content:"Privacy Policy | Holden Richardson"}),l.jsx("meta",{name:"twitter:description",content:"Privacy policy for HoldenGR.com."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx("section",{className:"py-14 md:py-20 bg-secondary -mt-20 pt-32 md:pt-36",children:l.jsx("div",{className:"container-page",children:l.jsxs(_e,{variant:"blur",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Legal"}),l.jsx("h1",{className:"font-serif text-3xl md:text-5xl font-light mb-3",children:"Privacy Policy"}),l.jsx("div",{className:"w-16 h-[2px] bg-accent mb-4"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Last updated: ",new Date().toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})]})]})})}),l.jsx("section",{className:"py-14 md:py-20 bg-background",children:l.jsx("div",{className:"container-page max-w-3xl mx-auto prose prose-neutral prose-headings:font-serif prose-headings:font-light",children:l.jsxs(_e,{children:[l.jsx("h2",{children:"Information We Collect"}),l.jsx("p",{children:"When you use our website, we may collect the following personal information:"}),l.jsxs("ul",{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Contact Information:"})," Name, email address, phone number, and any message you provide through our contact form."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Usage Data:"})," Information about how you access and use our website, including your IP address, browser type, pages visited, and time spent on the site."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Cookies:"})," We use cookies and similar technologies to improve your experience and analyze site traffic."]})]}),l.jsx("h2",{children:"How We Use Your Information"}),l.jsx("p",{children:"We use the information we collect to:"}),l.jsxs("ul",{children:[l.jsx("li",{children:"Respond to your inquiries and provide real estate services"}),l.jsx("li",{children:"Send you relevant property information and market updates (only with your consent)"}),l.jsx("li",{children:"Improve our website and user experience"}),l.jsx("li",{children:"Comply with legal obligations"})]}),l.jsx("h2",{children:"Information Sharing"}),l.jsx("p",{children:"We do not sell, trade, or rent your personal information to third parties. We may share your information with:"}),l.jsxs("ul",{children:[l.jsxs("li",{children:[l.jsx("strong",{children:"616 Realty LLC:"})," Our brokerage, as necessary to facilitate real estate transactions"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Service Providers:"})," Third-party services that help us operate our website and CRM systems"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Legal Requirements:"})," When required by law or to protect our rights"]})]}),l.jsx("h2",{children:"Data Security"}),l.jsx("p",{children:"We implement reasonable security measures to protect your personal information. However, no method of transmission over the internet is 100% secure, and we cannot guarantee absolute security."}),l.jsx("h2",{children:"Your Rights"}),l.jsx("p",{children:"You have the right to:"}),l.jsxs("ul",{children:[l.jsx("li",{children:"Request access to the personal information we hold about you"}),l.jsx("li",{children:"Request correction or deletion of your personal information"}),l.jsx("li",{children:"Opt out of marketing communications at any time"})]}),l.jsx("h2",{children:"Contact Us"}),l.jsx("p",{children:"If you have questions about this privacy policy, please contact us at:"}),l.jsxs("p",{children:["Holden Richardson — 616 Realty LLC",l.jsx("br",{}),"1171 Plainfield Ave NE, Grand Rapids, MI 49503",l.jsx("br",{}),l.jsx("a",{href:"mailto:holden@holdengr.com",children:"holden@holdengr.com"}),l.jsx("br",{}),"(616) 403-6393"]})]})})})]}),E2t=()=>l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Terms of Service | Holden Richardson"}),l.jsx("meta",{name:"description",content:"Terms of service for HoldenGR.com — conditions governing the use of this website."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/terms-of-service"}),l.jsx("meta",{property:"og:title",content:"Terms of Service | Holden Richardson"}),l.jsx("meta",{property:"og:description",content:"Terms of service for HoldenGR.com — conditions governing the use of this website."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/terms-of-service"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary"}),l.jsx("meta",{name:"twitter:title",content:"Terms of Service | Holden Richardson"}),l.jsx("meta",{name:"twitter:description",content:"Terms of service for HoldenGR.com."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx("section",{className:"py-14 md:py-20 bg-secondary -mt-20 pt-32 md:pt-36",children:l.jsx("div",{className:"container-page",children:l.jsxs(_e,{variant:"blur",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Legal"}),l.jsx("h1",{className:"font-serif text-3xl md:text-5xl font-light mb-3",children:"Terms of Service"}),l.jsx("div",{className:"w-16 h-[2px] bg-accent mb-4"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Last updated: ",new Date().toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})]})]})})}),l.jsx("section",{className:"py-14 md:py-20 bg-background",children:l.jsx("div",{className:"container-page max-w-3xl mx-auto prose prose-neutral prose-headings:font-serif prose-headings:font-light",children:l.jsxs(_e,{children:[l.jsx("h2",{children:"Agreement to Terms"}),l.jsx("p",{children:'By accessing and using HoldenGR.com ("the Website"), you agree to be bound by these Terms of Service. If you do not agree to these terms, please do not use the Website.'}),l.jsx("h2",{children:"Use of Website"}),l.jsx("p",{children:"This Website is operated by Holden Richardson, a licensed real estate agent with 616 Realty LLC (License #6501392389). The Website is intended to provide general information about real estate services in the Grand Rapids, Michigan area."}),l.jsx("p",{children:"You agree to use the Website only for lawful purposes and in a manner that does not infringe upon the rights of others."}),l.jsx("h2",{children:"Property Listings & Information"}),l.jsx("p",{children:"Property listing information displayed on this Website is sourced from various third-party providers, including Multiple Listing Services (MLS). While we strive for accuracy:"}),l.jsxs("ul",{children:[l.jsx("li",{children:"Listings may not reflect real-time availability, pricing, or property conditions"}),l.jsx("li",{children:"All information should be independently verified before making any decisions"}),l.jsx("li",{children:"Photos and descriptions may not represent current property conditions"}),l.jsx("li",{children:"We are not responsible for errors or omissions in listing data"})]}),l.jsx("h2",{children:"No Professional Advice"}),l.jsx("p",{children:"The content on this Website is for informational purposes only and does not constitute professional real estate, legal, financial, or tax advice. Always consult with appropriate professionals before making real estate decisions."}),l.jsx("h2",{children:"Intellectual Property"}),l.jsx("p",{children:"All content on this Website, including text, images, logos, and design elements, is the property of Holden Richardson and 616 Realty LLC or their respective owners and is protected by copyright and trademark laws."}),l.jsx("h2",{children:"Limitation of Liability"}),l.jsx("p",{children:"To the fullest extent permitted by law, Holden Richardson and 616 Realty LLC shall not be liable for any direct, indirect, incidental, or consequential damages arising from your use of or inability to use this Website."}),l.jsx("h2",{children:"Governing Law"}),l.jsx("p",{children:"These terms are governed by the laws of the State of Michigan. Any disputes shall be resolved in the courts of Kent County, Michigan."}),l.jsx("h2",{children:"Changes to Terms"}),l.jsx("p",{children:"We reserve the right to modify these terms at any time. Continued use of the Website after changes constitutes acceptance of the updated terms."}),l.jsx("h2",{children:"Contact"}),l.jsxs("p",{children:["Holden Richardson — 616 Realty LLC",l.jsx("br",{}),"1171 Plainfield Ave NE, Grand Rapids, MI 49503",l.jsx("br",{}),l.jsx("a",{href:"mailto:holden@holdengr.com",children:"holden@holdengr.com"}),l.jsx("br",{}),"(616) 403-6393"]})]})})})]}),T2t=()=>l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Accessibility | Holden Richardson"}),l.jsx("meta",{name:"description",content:"Accessibility statement for HoldenGR.com — our commitment to digital accessibility."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/accessibility"}),l.jsx("meta",{property:"og:title",content:"Accessibility | Holden Richardson"}),l.jsx("meta",{property:"og:description",content:"Accessibility statement for HoldenGR.com — our commitment to digital accessibility."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/accessibility"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary"}),l.jsx("meta",{name:"twitter:title",content:"Accessibility | Holden Richardson"}),l.jsx("meta",{name:"twitter:description",content:"Accessibility statement for HoldenGR.com."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx("section",{className:"py-14 md:py-20 bg-secondary -mt-20 pt-32 md:pt-36",children:l.jsx("div",{className:"container-page",children:l.jsxs(_e,{variant:"blur",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Legal"}),l.jsx("h1",{className:"font-serif text-3xl md:text-5xl font-light mb-3",children:"Accessibility"}),l.jsx("div",{className:"w-16 h-[2px] bg-accent mb-4"})]})})}),l.jsx("section",{className:"py-14 md:py-20 bg-background",children:l.jsx("div",{className:"container-page max-w-3xl mx-auto prose prose-neutral prose-headings:font-serif prose-headings:font-light",children:l.jsxs(_e,{children:[l.jsx("h2",{children:"Our Commitment"}),l.jsx("p",{children:"Holden Richardson and 616 Realty LLC are committed to ensuring digital accessibility for people with disabilities. We continually improve the user experience for everyone and apply the relevant accessibility standards."}),l.jsx("h2",{children:"Standards"}),l.jsx("p",{children:"We aim to conform to the Web Content Accessibility Guidelines (WCAG) 2.1 at the AA level. These guidelines explain how to make web content more accessible to people with a wide range of disabilities, including:"}),l.jsxs("ul",{children:[l.jsx("li",{children:"Visual impairments (blindness, low vision, color blindness)"}),l.jsx("li",{children:"Hearing impairments"}),l.jsx("li",{children:"Motor impairments"}),l.jsx("li",{children:"Cognitive disabilities"})]}),l.jsx("h2",{children:"Measures Taken"}),l.jsx("p",{children:"We have taken the following measures to ensure accessibility:"}),l.jsxs("ul",{children:[l.jsx("li",{children:"Semantic HTML structure throughout the website"}),l.jsx("li",{children:"Descriptive alt text for all meaningful images"}),l.jsx("li",{children:"Sufficient color contrast ratios for text and interactive elements"}),l.jsx("li",{children:"Keyboard navigation support"}),l.jsx("li",{children:"Responsive design that works across devices and screen sizes"}),l.jsx("li",{children:"Clear and consistent navigation"}),l.jsx("li",{children:"Form labels and error messages for all input fields"})]}),l.jsx("h2",{children:"Known Limitations"}),l.jsx("p",{children:"While we strive for full accessibility, some third-party content (such as embedded property listing tools, video players, or map widgets) may not be fully accessible. We are actively working with our vendors to improve these areas."}),l.jsx("h2",{children:"Feedback"}),l.jsx("p",{children:"We welcome your feedback on the accessibility of this website. If you encounter any barriers or have suggestions for improvement, please contact us:"}),l.jsxs("p",{children:["Holden Richardson — 616 Realty LLC",l.jsx("br",{}),l.jsx("a",{href:"mailto:holden@holdengr.com",children:"holden@holdengr.com"}),l.jsx("br",{}),"(616) 403-6393"]}),l.jsx("p",{children:"We will make reasonable efforts to address any accessibility concerns and respond within 5 business days."}),l.jsx("h2",{children:"Fair Housing"}),l.jsx("p",{children:"In accordance with the Fair Housing Act, we do not discriminate on the basis of race, color, religion, sex, handicap, familial status, or national origin. We are committed to providing equal housing opportunities for all."})]})})})]}),P2t=()=>{const e=ro();return C.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Page Not Found | Holden Richardson — Grand Rapids Real Estate"}),l.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),l.jsx("section",{className:"section-padding bg-background min-h-[60vh] flex items-center",children:l.jsxs("div",{className:"container-page text-center",children:[l.jsx("h1",{className:"text-8xl md:text-9xl font-serif text-gold mb-6",children:"404"}),l.jsx("h2",{className:"heading-section mb-4",children:"Page Not Found"}),l.jsx("p",{className:"text-body text-muted-foreground mb-10 max-w-md mx-auto",children:"The page you're looking for doesn't exist or has been moved."}),l.jsx(At,{to:"/",className:"btn-outline-primary",children:"Return Home"})]})})]})},I2t=e=>/<(p|div|h[1-6]|ul|ol|blockquote|table|section|article)\b/i.test(e)?e:e.split(/\n{2,}/).map(t=>t.trim()).filter(Boolean).map(t=>`<p>${t.replace(/\n/g,"<br />")}</p>`).join(`
`),b_=()=>{var de,ue,ae,he;const e=mm(),t=ro(),n=!e.category&&t.pathname.startsWith("/news/"),r=n?"about":e.category,i=n?"news":e.subcategory,a=e.slug||"",{data:o,isLoading:c}=Gqe(r||"",a,i),{data:u}=Yqe(o==null?void 0:o.id),d=C.useMemo(()=>{if(!o)return"";const Ce=(Array.isArray(o.faq_json)?o.faq_json:[]).map(Oe=>`${(Oe==null?void 0:Oe.question)||""} ${(Oe==null?void 0:Oe.answer)||""}`).join(" ");return`${o.h1||""} ${o.title||""} ${o.intro_text||""} ${Ce}`},[o]),{data:h}=Jqe(o==null?void 0:o.category_id,o==null?void 0:o.id,d,5),{configMap:A}=Os(),{data:f}=f0(),p=C.useMemo(()=>!f||!(o!=null&&o.cover_image_id)?null:f.find(ie=>ie.id===o.cover_image_id)||null,[f,o==null?void 0:o.cover_image_id]),m=A.agent_phone,g=A.agent_email,y=A.booking_url,v=A.agent_name,x=((de=A.site_base_url)==null?void 0:de.replace(/\/$/,""))||"",w=n?"News":r==="about"?"About":r==null?void 0:r.replace(/-/g," "),b=n?"/news":`/${r}`,k=n?null:i?`/${r}/${i}`:null,j=n?`/news/${a}`:i?`/${r}/${i}/${a}`:`/${r}/${a}`,B=x?`${x}${j}`:"",E=ie=>x?`${x}${ie}`:ie;if(c)return l.jsx(ln,{children:l.jsxs("div",{className:"container-page section-padding",children:[l.jsx(lt,{className:"h-12 w-3/4 mb-6"}),l.jsx(lt,{className:"h-6 w-full mb-4"}),l.jsx(lt,{className:"h-64 w-full"})]})});if(!o)return l.jsx(ln,{children:l.jsxs("div",{className:"container-page section-padding text-center",children:[l.jsx("h1",{className:"heading-section mb-4",children:"Page Not Found"}),l.jsx("p",{className:"text-body text-muted-foreground",children:"The page you're looking for doesn't exist."})]})});const I=((ue=o.category)==null?void 0:ue.slug)==="news",T=o.press_links,N=[A.about_website,A.about_google_business,A.about_facebook,A.about_instagram,A.about_linkedin,A.about_youtube,A.about_x,A.about_tiktok,A.about_zillow,A.about_realtor].filter(Boolean),F=(ae=o.faq_json)!=null&&ae.length?{"@context":"https://schema.org","@type":"FAQPage",...B&&{mainEntityOfPage:{"@type":"WebPage","@id":B}},about:{"@id":"https://www.holdengr.com/#agent"},mainEntity:o.faq_json.map(ie=>({"@type":"Question",name:ie.question,acceptedAnswer:{"@type":"Answer",text:ie.answer}}))}:null,L=I?{"@context":"https://schema.org","@type":"NewsArticle",headline:o.h1,description:o.meta_description||o.intro_text||o.title,...B&&{mainEntityOfPage:{"@type":"WebPage","@id":B},url:B},...o.published_at&&{datePublished:o.published_at},...o.updated_at&&{dateModified:o.updated_at},author:{"@type":"Person",name:v||"Holden Richardson",url:"https://www.holdengr.com/about",...m&&{telephone:m},...g&&{email:g}},...p&&{image:[vc(p.file_path)]},publisher:{"@id":"https://www.holdengr.com/#agent"},inLanguage:"en-US"}:null,U=!I&&v?{"@context":"https://schema.org","@type":"RealEstateAgent","@id":"https://www.holdengr.com/#agent",name:v,...A.agent_brokerage&&{worksFor:{"@type":"RealEstateOrganization",name:A.agent_brokerage}},...A.agent_market&&{areaServed:A.agent_market},...m&&{telephone:m},...g&&{email:g},...N.length>0&&{sameAs:N}}:null,H=[{"@type":"ListItem",position:1,name:"Home",item:x?`${x}/`:"https://www.holdengr.com/"},{"@type":"ListItem",position:2,name:w||"",item:E(b)}];i&&!n?(H.push({"@type":"ListItem",position:3,name:i.replace(/-/g," "),item:E(k)}),H.push({"@type":"ListItem",position:4,name:o.title,item:B||E(j)})):H.push({"@type":"ListItem",position:3,name:o.title,item:B||E(j)});const K={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:H},$=o.video_url,z=o.video_transcript,oe=(o.video_orientation||"horizontal")==="vertical",R=$==null?void 0:$.match(/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|shorts\/|watch\?v=|watch\?.+&v=))([^&?\s]+)/),M=R==null?void 0:R[1],Y=$&&M?{"@context":"https://schema.org","@type":"VideoObject",name:o.h1,description:o.meta_description||o.subheadline||o.title,thumbnailUrl:`https://i.ytimg.com/vi/${M}/hqdefault.jpg`,embedUrl:`https://www.youtube.com/embed/${M}`,contentUrl:`https://www.youtube.com/watch?v=${M}`,...o.published_at&&{uploadDate:o.published_at},publisher:{"@id":"https://www.holdengr.com/#agent"},inLanguage:"en-US",isAccessibleForFree:!0,...z&&{transcript:z}}:null,X=o.subheadline,q=p?vc(p.file_path):null,Z=o.schema_markup&&typeof o.schema_markup=="object"?o.schema_markup:null;return l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsx("title",{children:o.meta_title||o.title}),l.jsx("meta",{name:"description",content:o.meta_description||o.intro_text||o.subheadline||""}),l.jsx("meta",{property:"og:title",content:o.meta_title||o.title}),l.jsx("meta",{property:"og:description",content:o.meta_description||o.intro_text||o.subheadline||""}),l.jsx("meta",{property:"og:type",content:"article"}),l.jsx("meta",{property:"og:image",content:q||"https://www.holdengr.com/og-image-1200x630.png"}),B&&l.jsx("meta",{property:"og:url",content:B}),B&&l.jsx("link",{rel:"canonical",href:B}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:o.meta_title||o.title}),l.jsx("meta",{name:"twitter:description",content:o.meta_description||o.intro_text||o.subheadline||""}),l.jsx("meta",{name:"twitter:image",content:q||"https://www.holdengr.com/og-image-1200x630.png"}),Z&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify(Z)}),F&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify(F)}),L&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify(L)}),U&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify(U)}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify(K)}),Y&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify(Y)})]}),l.jsxs("section",{className:"relative text-background py-20 md:py-28 -mt-20 pt-32 md:pt-40 overflow-hidden min-h-[50vh] flex items-end",children:[q?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${q})`}}),l.jsx("div",{className:"absolute inset-0 bg-black/40"})]}):l.jsx("div",{className:"absolute inset-0 bg-black"}),l.jsxs("div",{className:"container-page relative z-10 w-full",children:[l.jsx(_e,{variant:"blur",children:l.jsxs("nav",{className:"text-sm text-background/50 mb-6 uppercase tracking-wider",children:[l.jsx(At,{to:"/",className:"text-accent/70 hover:text-accent transition-colors",children:"Home"}),l.jsx("span",{className:"mx-2",children:"/"}),l.jsx(At,{to:b,className:"text-accent/70 hover:text-accent transition-colors capitalize",children:w}),i&&!n&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"mx-2",children:"/"}),l.jsx(At,{to:k,className:"text-accent/70 hover:text-accent transition-colors capitalize",children:i.replace(/-/g," ")})]}),l.jsx("span",{className:"mx-2",children:"/"}),l.jsx("span",{className:"text-background/80",children:o.title})]})}),l.jsxs(_e,{delay:.1,children:[l.jsx("h1",{className:"text-3xl md:text-5xl lg:text-6xl font-semibold tracking-tight leading-tight mb-4 max-w-4xl",children:o.h1}),l.jsx("div",{className:"w-16 h-[2px] bg-accent mt-4 mb-6"})]}),X&&l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-lg md:text-xl text-background/65 max-w-3xl",children:X})})]})]}),l.jsx("section",{className:"py-16 md:py-24 bg-background",children:l.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[o.intro_text&&l.jsx(_e,{children:l.jsx("p",{className:"text-body text-foreground/75 text-lg leading-relaxed max-w-3xl mx-auto text-left",children:o.intro_text})}),I&&o.body_content&&l.jsx(_e,{children:l.jsxs("div",{className:"mt-10 md:mt-14",children:[T&&(T.national||T.local||T.source)&&l.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-8 p-4 border border-border bg-secondary/40",children:[l.jsx("span",{className:"text-xs uppercase tracking-wider text-muted-foreground font-medium",children:"As seen in:"}),T.national&&l.jsxs("a",{href:T.national,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-accent hover:text-accent/80 transition-colors font-medium",children:[l.jsx(eo,{className:"w-3.5 h-3.5"})," National"]}),T.local&&l.jsxs("a",{href:T.local,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-accent hover:text-accent/80 transition-colors font-medium",children:[l.jsx(eo,{className:"w-3.5 h-3.5"})," Local"]}),T.source&&l.jsxs("a",{href:T.source,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm text-accent hover:text-accent/80 transition-colors font-medium",children:[l.jsx(eo,{className:"w-3.5 h-3.5"})," Source"]})]}),l.jsx("div",{className:"prose prose-sm md:prose-base max-w-none prose-headings:font-semibold prose-headings:tracking-tight prose-a:text-accent",dangerouslySetInnerHTML:{__html:I2t(o.body_content)}})]})}),o.intro_text&&o.faq_json&&o.faq_json.length>0&&l.jsxs("div",{className:"flex items-center justify-center my-10 md:my-14",children:[l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"}),l.jsx("div",{className:"w-2 h-2 rotate-45 border border-accent/50 mx-4"}),l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"})]}),o.faq_json&&o.faq_json.length>0&&l.jsxs(l.Fragment,{children:[l.jsx(_e,{children:l.jsxs("div",{className:"text-center mb-10",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Common Questions"}),l.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight text-foreground",children:"What You Need to Know"})]})}),l.jsx(_e,{delay:.1,children:l.jsx(Gp,{type:"single",collapsible:!0,className:"space-y-4",children:o.faq_json.map((ie,Ce)=>l.jsxs(Ef,{value:`faq-${Ce}`,className:"border border-border px-6 md:px-8 transition-colors duration-200 bg-card hover:border-accent/40",children:[l.jsx(Tf,{className:"text-left text-sm md:text-base font-medium hover:no-underline py-4 text-foreground/85 hover:text-foreground",children:ie.question}),l.jsx(Pf,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1",children:ie.answer})]},Ce))})})]})]})}),o.faq_json&&o.faq_json.length>0&&$&&M&&l.jsxs("div",{className:"flex items-center justify-center py-2 bg-background",children:[l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"}),l.jsx("div",{className:"w-2 h-2 rotate-45 border border-accent/50 mx-4"}),l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"})]}),$&&M&&l.jsx("section",{className:"py-16 md:py-24 bg-secondary/15",children:l.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Watch"}),l.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-6",children:"Video Overview"})]}),l.jsx(_e,{delay:.1,children:l.jsx("div",{className:`relative overflow-hidden mx-auto ${oe?"max-w-sm aspect-[9/16]":"w-full aspect-video"}`,children:l.jsx("iframe",{src:`https://www.youtube.com/embed/${M}`,title:o.h1,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"absolute inset-0 w-full h-full border border-border",loading:"lazy"})})}),z&&l.jsx(Gp,{type:"single",collapsible:!0,className:"mt-6",children:l.jsxs(Ef,{value:"transcript",className:"border border-border px-6 md:px-8 transition-colors duration-200 bg-card hover:border-accent/40",children:[l.jsx(Tf,{className:"text-left text-sm font-medium hover:no-underline py-4 text-foreground/75 hover:text-foreground",children:"View Video Transcript"}),l.jsx(Pf,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1 whitespace-pre-line",children:z})]})})]})}),h&&h.length>0&&l.jsx("section",{className:"py-12 md:py-16 bg-background",children:l.jsxs("div",{className:"container-page",children:[l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Related Topics"}),l.jsxs("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-2",children:["Most Relevant ",w," Questions"]}),l.jsx("div",{className:"w-12 h-px bg-accent mb-8"})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:h.map((ie,Ce)=>l.jsx(_e,{delay:Ce*.06,children:l.jsxs(At,{to:i?`/${r}/${i}/${ie.slug}`:`/${r}/${ie.slug}`,className:"group flex items-center gap-4 px-5 py-4 border border-border bg-card hover:border-accent/50 hover:bg-secondary/40 transition-colors duration-200",children:[l.jsx("div",{className:"w-1 h-8 bg-accent shrink-0"}),l.jsx("div",{className:"flex-1 min-w-0",children:l.jsx("h3",{className:"text-sm md:text-base font-medium group-hover:text-accent transition-colors leading-snug",children:ie.h1||ie.title})}),l.jsx(Va,{size:16,className:"shrink-0 text-accent/60 group-hover:text-accent transition-all group-hover:translate-x-1"})]})},ie.id))}),l.jsx(_e,{children:l.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-x-6 gap-y-3 text-sm",children:[l.jsxs(At,{to:"/faq",className:"inline-flex items-center gap-2 text-accent hover:text-accent/80 transition-colors uppercase tracking-wider text-caption font-medium",children:["Browse all questions ",l.jsx(Va,{size:14})]}),l.jsxs(At,{to:b,className:"inline-flex items-center gap-2 text-foreground/60 hover:text-foreground transition-colors uppercase tracking-wider text-caption font-medium",children:["All ",w," topics ",l.jsx(Va,{size:14})]})]})})]})}),u&&u.length>0&&l.jsx("section",{className:"py-16 md:py-24 bg-secondary/15",children:l.jsxs("div",{className:"container-page",children:[l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Sub-Topics"}),l.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-2",children:"Explore More Topics"}),l.jsx("div",{className:"w-12 h-px bg-accent mb-12"})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:u.map((ie,Ce)=>l.jsx(_e,{delay:Ce*.08,variant:"lift",children:l.jsxs(At,{to:`/${r}/${ie.slug}`,className:"group block p-8 border border-border bg-card hover:border-accent/50 hover:bg-secondary/40 transition-colors duration-200",children:[l.jsx("h3",{className:"text-lg font-semibold tracking-tight mb-2 group-hover:text-accent transition-colors",children:ie.title}),ie.intro_text&&l.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mb-4",children:ie.intro_text}),l.jsxs("span",{className:"inline-flex items-center gap-2 text-caption text-foreground/60 group-hover:text-accent transition-colors uppercase tracking-wider",children:["Read More ",l.jsx(Va,{size:14,className:"transition-transform group-hover:translate-x-1"})]})]})},ie.id))})]})}),l.jsx("section",{className:"py-20 md:py-28 bg-foreground text-background",children:l.jsx("div",{className:"container-page text-center",children:l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-gold uppercase tracking-widest mb-3 font-semibold",children:"Let's Connect"}),l.jsx("h2",{className:"text-2xl md:text-4xl font-semibold tracking-tight mb-3",children:"Reach Out Your Way"}),l.jsx("p",{className:"text-background/80 max-w-lg mx-auto font-medium mb-10",children:v?`${v} is here to help — pick whichever works best for you.`:"We're here to help — pick whichever works best for you."}),l.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[y&&l.jsx("a",{href:y,target:"_blank",rel:"noopener noreferrer",children:l.jsxs(xe,{size:"lg",className:"bg-background text-foreground hover:bg-background/90 rounded-none transition-colors font-semibold",children:[l.jsx(Oo,{className:"w-4 h-4 mr-2"}),"Book Virtual Meeting With Holden"]})}),g&&l.jsx("a",{href:`mailto:${g}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(e_,{className:"w-4 h-4 mr-2"}),"Email"]})}),m&&l.jsx("a",{href:`tel:${m}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(lf,{className:"w-4 h-4 mr-2"}),"Call"]})}),l.jsx(At,{to:"/contact",children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(ad,{className:"w-4 h-4 mr-2"}),"Send a Message"]})})]})]})})}),l.jsx("noscript",{children:l.jsxs("div",{style:{padding:"2rem"},children:[l.jsx("h1",{children:o.h1}),o.intro_text&&l.jsx("p",{children:o.intro_text}),(he=o.faq_json)==null?void 0:he.map((ie,Ce)=>l.jsxs("div",{children:[l.jsx("h3",{children:ie.question}),l.jsx("p",{children:ie.answer})]},Ce))]})})]})},O2t={car:y2e,trees:q2e,building:g2e,heart:Ere,users:G2e,school:j2e,pin:ov},u$=({stats:e})=>{if(!e||e.length===0)return null;const t=e.length,n=t<=3?t:Math.ceil(t/2),r=t<=6?t:Math.ceil(t/2),i=`nbs-${C.useId().replace(/:/g,"")}`;return l.jsxs("section",{className:"relative py-10 md:py-14 overflow-hidden",children:[l.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-foreground via-foreground/95 to-foreground"}),l.jsx("div",{className:"absolute inset-0 backdrop-blur-sm"}),l.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-accent/30 to-transparent"}),l.jsx("style",{children:`
        #${i} { grid-template-columns: repeat(${n}, minmax(0, 1fr)); }
        @media (min-width: 768px) {
          #${i} { grid-template-columns: repeat(${r}, minmax(0, 1fr)); }
        }
      `}),l.jsx("div",{className:"relative container-page",children:l.jsx("div",{id:i,className:"grid gap-6 md:gap-8",children:e.map((s,a)=>{const o=s.icon&&O2t[s.icon]||ov;return l.jsx(_e,{delay:a*.08,children:l.jsxs("div",{className:"text-center group",children:[l.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-xl bg-background/10 backdrop-blur-md border border-background/20 shadow-lg shadow-black/10 mb-3 group-hover:bg-background/15 group-hover:scale-105 transition-all duration-300",children:l.jsx(o,{className:"w-5 h-5 text-accent"})}),l.jsx("p",{className:"text-lg md:text-xl font-semibold text-background",children:s.value}),l.jsx("p",{className:"text-xs text-background/50 uppercase tracking-widest mt-1",children:s.label})]})},a)})})}),l.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-background/10 to-transparent"})]})},F2t=({category:e,subcategories:t,faqs:n})=>{const{data:r}=f0(),i=(r||[]).filter(a=>a.media_type==="stock_photo"),s=e.stats_json||[];return l.jsxs(l.Fragment,{children:[e.intro_text&&l.jsx("section",{className:"py-16 md:py-20 bg-background",children:l.jsx("div",{className:"container-page max-w-4xl",children:l.jsx(_e,{children:l.jsx("p",{className:"text-body text-foreground/75 text-lg leading-relaxed text-left",children:e.intro_text.split(`

`)[0]})})})}),l.jsx(u$,{stats:s}),l.jsx("section",{className:"py-12 md:py-20 bg-secondary/20",children:l.jsxs("div",{className:"container-page",children:[l.jsx(_e,{children:l.jsxs("div",{className:"text-center mb-12",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Explore Communities"}),l.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light",children:"Grand Rapids Area Neighborhoods"}),l.jsx("div",{className:"w-12 h-px bg-accent mx-auto mt-4"})]})}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 lg:gap-8",children:t.map((a,o)=>{const c=a.cover_image_id?i.find(h=>h.id===a.cover_image_id):null,u=c?vc(c.file_path):null,d=a.stats_json||[];return l.jsx(_e,{delay:o*.06,variant:"lift",children:l.jsxs(At,{to:`/neighborhoods/${a.slug}`,className:"group block bg-card border border-border/40 rounded-lg overflow-hidden shadow-sm hover:shadow-lg transition-all duration-300 hover:border-accent/40",children:[l.jsxs("div",{className:"relative aspect-[16/9] overflow-hidden",children:[u?l.jsx("img",{src:u,alt:`${a.name} neighborhood`,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",loading:"lazy"}):l.jsx("div",{className:"w-full h-full bg-gradient-to-br from-secondary/60 to-secondary/30 flex items-center justify-center",children:l.jsx("span",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Add cover image"})}),l.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-5",children:l.jsxs("h3",{className:"font-serif text-xl md:text-2xl text-white font-light flex items-center gap-2",children:[a.icon&&l.jsx("span",{children:a.icon}),a.name]})})]}),l.jsxs("div",{className:"p-5 md:p-6",children:[a.description&&l.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mb-4 line-clamp-3",children:a.description}),d.length>0&&l.jsx("div",{className:"flex flex-wrap gap-3 mb-4",children:d.slice(0,3).map((h,A)=>l.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 bg-secondary/60 border border-border/60 text-xs text-foreground/70",children:[l.jsx("span",{className:"font-medium",children:h.value}),l.jsx("span",{className:"text-muted-foreground",children:"·"}),l.jsx("span",{children:h.label})]},A))}),l.jsxs("span",{className:"inline-flex items-center gap-2 text-caption text-accent uppercase tracking-wider font-medium group-hover:gap-3 transition-all",children:["Explore ",a.name,l.jsx(Va,{size:14,className:"transition-transform group-hover:translate-x-1"})]})]})]})},a.id)})})]})}),n.length>0&&l.jsx("section",{className:"py-16 md:py-24 bg-background",children:l.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[l.jsx(_e,{children:l.jsx("div",{className:"text-center mb-12",children:l.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-3 text-foreground",children:e.faq_title||"Common Questions About Grand Rapids Neighborhoods"})})}),l.jsx(_e,{delay:.1,children:l.jsx(Gp,{type:"single",collapsible:!0,className:"space-y-4",children:n.map((a,o)=>l.jsxs(Ef,{value:`faq-${o}`,className:"border border-border/60 px-6 md:px-8 transition-all duration-300 bg-background shadow-md shadow-foreground/[0.06] hover:shadow-lg hover:shadow-foreground/[0.08]",children:[l.jsx(Tf,{className:"text-left text-sm md:text-base font-medium hover:no-underline py-4 text-foreground/85 hover:text-foreground",children:a.question}),l.jsx(Pf,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1",children:a.answer})]},o))})})]})})]})};function M2t(e){var r;const t=((r=e.split(/[.!?]/)[0])==null?void 0:r.trim())||"",n=t.split(/\s+/);return n.length<=8?t:n.slice(0,6).join(" ")+"…"}const L2t=({category:e,parentCategory:t,pages:n,faqs:r})=>{var h;const i=e.stats_json||[],s=((h=e.intro_text)==null?void 0:h.split(`

`).filter(Boolean))||[],a=e.section_headings||[],{data:o}=f0(),c=(o||[]).filter(A=>A.media_type==="stock_photo"),u=e.content_image_ids||[],d=c.filter(A=>{var f,p;return((f=A.tags)==null?void 0:f.includes(e.slug))||((p=A.tags)==null?void 0:p.includes("content"))});return l.jsxs(l.Fragment,{children:[l.jsx(u$,{stats:i}),s.length>0&&l.jsx("div",{className:"bg-background",children:s.map((A,f)=>{const p=f%2===1,m=u[f],y=(m?c.find(x=>x.id===m):null)||d[f],v=y?vc(y.file_path):null;return l.jsx("section",{className:`py-16 md:py-24 ${f%2===0?"bg-background":"bg-secondary/20"}`,children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:`grid grid-cols-1 lg:grid-cols-2 gap-10 lg:gap-16 items-center ${p?"lg:[direction:rtl]":""}`,children:[l.jsxs(_e,{className:p?"lg:[direction:ltr]":"",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:e.name}),l.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-4 leading-snug",children:a[f]||M2t(A)}),l.jsx("div",{className:"w-10 h-px bg-accent mb-6"}),l.jsx("p",{className:"text-body text-foreground/75 leading-relaxed text-lg",children:A})]}),l.jsx(_e,{delay:.15,className:p?"lg:[direction:ltr]":"",children:v?l.jsx("div",{className:"aspect-[4/3] overflow-hidden",children:l.jsx("img",{src:v,alt:(y==null?void 0:y.alt_text)||`${e.name} — section ${f+1}`,className:"w-full h-full object-cover",loading:"lazy"})}):l.jsx("div",{className:"aspect-[4/3] bg-gradient-to-br from-secondary/60 to-secondary/30 border border-border/40 flex items-center justify-center",children:l.jsxs("div",{className:"text-center px-8",children:[l.jsx("div",{className:"w-12 h-12 mx-auto mb-3 border border-accent/30 flex items-center justify-center",children:l.jsx("span",{className:"text-accent text-lg font-serif",children:f+1})}),l.jsx("span",{className:"text-xs text-muted-foreground tracking-wider uppercase",children:"Upload image via Media Library"})]})})})]})})},f)})}),r.length>0&&l.jsx("section",{className:"py-16 md:py-24 bg-background",children:l.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[l.jsx(_e,{children:l.jsx("div",{className:"text-center mb-12",children:l.jsx("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-3 text-foreground",children:e.faq_title||`Common Questions About ${e.name}`})})}),l.jsx(_e,{delay:.1,children:l.jsx(Gp,{type:"single",collapsible:!0,className:"space-y-4",children:r.map((A,f)=>l.jsxs(Ef,{value:`faq-${f}`,className:"border border-border/60 px-6 md:px-8 transition-all duration-300 bg-background shadow-md shadow-foreground/[0.06] hover:shadow-lg hover:shadow-foreground/[0.08]",children:[l.jsx(Tf,{className:"text-left text-sm md:text-base font-medium hover:no-underline py-4 text-foreground/85 hover:text-foreground",children:A.question}),l.jsx(Pf,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1",children:A.answer})]},f))})})]})}),n&&n.length>0&&l.jsx("section",{className:"py-12 md:py-16 bg-secondary/20",children:l.jsxs("div",{className:"container-page",children:[l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Dive Deeper"}),l.jsxs("h2",{className:"font-serif text-2xl md:text-3xl font-light mb-2",children:["Explore ",e.name," Topics"]}),l.jsx("div",{className:"w-12 h-px bg-accent mb-8"})]}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:n.map((A,f)=>l.jsx(_e,{delay:f*.06,children:l.jsxs(At,{to:`/neighborhoods/${e.slug}/${A.slug}`,className:"group flex items-center gap-4 px-5 py-4 border-l-4 border-l-accent bg-accent/[0.07] hover:bg-accent/[0.13] border border-accent/20 hover:border-accent/40 transition-all duration-300 rounded-r-lg shadow-sm hover:shadow-md",children:[l.jsx("div",{className:"flex-1 min-w-0",children:l.jsx("h3",{className:"font-serif text-sm md:text-base group-hover:text-accent transition-colors leading-snug",children:A.h1||A.title})}),l.jsx(Va,{size:16,className:"shrink-0 text-accent/60 group-hover:text-accent transition-all group-hover:translate-x-1"})]})},A.id))})]})})]})};function ZX(e){var r;const t=((r=e.split(/[.!?]/)[0])==null?void 0:r.trim())||"",n=t.split(/\s+/);return n.length<=8?t:n.slice(0,6).join(" ")+"…"}function R2t(e){try{const t=new URL(e);if(t.hostname.includes("youtu.be"))return`https://www.youtube.com/embed${t.pathname}`;const n=t.searchParams.get("v");if(n)return`https://www.youtube.com/embed/${n}`;const r=t.pathname.match(/\/shorts\/([^/?&]+)/);if(r)return`https://www.youtube.com/embed/${r[1]}`}catch{}return null}function D2t(e){try{const t=new URL(e);if(t.hostname.includes("youtu.be"))return t.pathname.replace(/^\//,"").split("/")[0]||null;const n=t.searchParams.get("v");if(n)return n;const r=t.pathname.match(/\/shorts\/([^/?&]+)/);if(r)return r[1];const i=t.pathname.match(/\/embed\/([^/?&]+)/);if(i)return i[1]}catch{}return null}const zye=({subcategorySlug:e,categoryOverride:t}={})=>{var Y;const n=mm(),r=t||n.category;if(r==="about"&&!e)return l.jsx(SE,{to:"/about",replace:!0});const{configMap:i}=Os(),s=i.agent_name,a=i.agent_email,o=i.agent_phone,c=i.booking_url,{data:u,isLoading:d}=eA(),h=u==null?void 0:u.find(X=>X.slug===r&&!X.parent_id),A=e?u==null?void 0:u.find(X=>X.slug===e&&X.parent_id===(h==null?void 0:h.id)):h,{data:f}=Wqe(e||A==null?void 0:A.id),{data:p,isLoading:m}=gr({queryKey:["category-parents",A==null?void 0:A.id],enabled:!!A,queryFn:async()=>{const{data:X,error:q}=await Me.from("aeo_pages").select("id, title, slug, h1, subheadline, intro_text, is_parent, display_order").eq("category_id",A.id).eq("status","published").order("display_order");if(q)throw q;return X}}),{data:g}=f0(),y=(g||[]).filter(X=>X.media_type==="stock_photo"),v=(A==null?void 0:A.cover_image_id)||null,x=(A==null?void 0:A.content_image_ids)||[],w=v?y.find(X=>X.id===v):null,b=y.filter(X=>{var q,Z;return((q=X.tags)==null?void 0:q.includes(r||""))||((Z=X.tags)==null?void 0:Z.includes("featured"))}),k=b.filter(X=>{var q;return(q=X.tags)==null?void 0:q.includes("cover")}),j=y.filter(X=>{var q;return(q=X.tags)==null?void 0:q.includes("cover")}),B=b.filter(X=>{var q;return(q=X.tags)==null?void 0:q.includes("content")}),E=y.filter(X=>{var q;return(q=X.tags)==null?void 0:q.includes("content")});if(!A&&!m&&!d)return l.jsx(ln,{children:l.jsxs("div",{className:"container-page section-padding text-center",children:[l.jsx("h1",{className:"heading-section mb-4",children:"Category Not Found"}),l.jsx("p",{className:"text-body text-muted-foreground",children:"This page doesn't exist yet."})]})});const I=(A==null?void 0:A.name)||(r==null?void 0:r.replace(/-/g," "))||"",T=(A==null?void 0:A.faq_json)||[],N=((Y=A==null?void 0:A.intro_text)==null?void 0:Y.split(`

`).filter(Boolean))||[],F=(A==null?void 0:A.section_headings)||[],L=A!=null&&A.video_url?R2t(A.video_url):null,U=A!=null&&A.video_url?D2t(A.video_url):null,H=`https://www.holdengr.com/${r}${e?`/${e}`:""}`,K=T.length>0?{"@context":"https://schema.org","@type":"FAQPage",mainEntityOfPage:{"@type":"WebPage","@id":H},about:{"@id":"https://www.holdengr.com/#agent"},mainEntity:T.map(X=>({"@type":"Question",name:X.question,acceptedAnswer:{"@type":"Answer",text:X.answer}}))}:null,$=A!=null&&A.video_url&&L?{"@context":"https://schema.org","@type":"VideoObject",name:A.video_headline||`${I} Video`,description:A.description||`Video about ${I} — Grand Rapids real estate.`,thumbnailUrl:U?`https://i.ytimg.com/vi/${U}/hqdefault.jpg`:"https://www.holdengr.com/og-image-1200x630.png",embedUrl:L,...U&&{contentUrl:`https://www.youtube.com/watch?v=${U}`},uploadDate:A.created_at,publisher:{"@id":"https://www.holdengr.com/#agent"},inLanguage:"en-US",isAccessibleForFree:!0,...A.video_transcript?{transcript:A.video_transcript}:{}}:null,Q=r?{buyers:{name:"How to buy a home in Grand Rapids, Michigan",totalTime:"P60D",tool:["Pre-approval letter","Buyer's agent","Home inspector"],supply:["Down payment funds","Earnest money (typically 1–2% of purchase price)","Closing cost reserves"]},sellers:{name:"How to sell a home in Grand Rapids, Michigan",totalTime:"P90D",tool:["Comparative market analysis (CMA)","Listing agent","Professional photographer"],supply:["Staging budget","Pre-listing inspection (optional)","Closing-cost reserves for prorations and concessions"]}}[r]:void 0,oe=!e&&Q&&F.length>0&&F.length===N.length?{"@context":"https://schema.org","@type":"HowTo",name:Q.name,description:(A==null?void 0:A.description)||Q.name,totalTime:Q.totalTime,...Q.tool&&{tool:Q.tool.map(X=>({"@type":"HowToTool",name:X}))},...Q.supply&&{supply:Q.supply.map(X=>({"@type":"HowToSupply",name:X}))},step:N.map((X,q)=>({"@type":"HowToStep",position:q+1,name:F[q]||ZX(X),text:X,url:`${H}#step-${q+1}`})),about:{"@id":"https://www.holdengr.com/#agent"},mainEntityOfPage:{"@type":"WebPage","@id":H}}:null,R=[{"@type":"ListItem",position:1,name:"Home",item:"https://www.holdengr.com/"},{"@type":"ListItem",position:2,name:(h==null?void 0:h.name)||I,item:`https://www.holdengr.com/${r}`}];e&&A&&R.push({"@type":"ListItem",position:3,name:A.name,item:H});const M={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:R};return l.jsxs(ln,{children:[l.jsxs(Ln,{children:[l.jsxs("title",{children:[I," | Grand Rapids Area Real Estate"]}),l.jsx("meta",{name:"description",content:(A==null?void 0:A.description)||`${I} — Expert real estate guidance for the Grand Rapids area.`}),l.jsx("link",{rel:"canonical",href:H}),l.jsx("meta",{property:"og:title",content:`${I} | Grand Rapids Area Real Estate`}),l.jsx("meta",{property:"og:description",content:(A==null?void 0:A.description)||`${I} — Expert real estate guidance for the Grand Rapids area.`}),l.jsx("meta",{property:"og:url",content:H}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:`${I} | Grand Rapids Area Real Estate`}),l.jsx("meta",{name:"twitter:description",content:(A==null?void 0:A.description)||`${I} — Expert real estate guidance.`}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("script",{type:"application/ld+json",children:JSON.stringify(M)}),K&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify(K)}),$&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify($)}),oe&&l.jsx("script",{type:"application/ld+json",children:JSON.stringify(oe)})]}),(()=>{const X=w||k[0]||j[0],q=X?vc(X.file_path):null;return l.jsxs("section",{className:"relative text-background py-20 md:py-28 -mt-20 pt-32 md:pt-40 overflow-hidden min-h-[50vh] flex items-end",children:[q?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url(${q})`}}),l.jsx("div",{className:`absolute inset-0 ${r==="buyers"?"bg-black/55":"bg-black/40"}`})]}):l.jsx("div",{className:"absolute inset-0 bg-black"}),l.jsxs("div",{className:"container-page relative z-10 w-full",children:[l.jsx(_e,{children:l.jsx("p",{className:"text-caption text-background/50 mb-4 uppercase tracking-widest",children:"Grand Rapids Area Real Estate"})}),l.jsxs(_e,{delay:.1,children:[l.jsx("h1",{className:"font-sans text-4xl md:text-5xl lg:text-6xl font-semibold leading-tight mb-4 max-w-4xl capitalize",children:I}),l.jsx("div",{className:"w-16 h-[2px] bg-accent mt-4 mb-6"})]}),(A==null?void 0:A.description)&&l.jsx(_e,{delay:.2,children:l.jsx("p",{className:"text-lg md:text-xl text-background/65 max-w-3xl",children:A.description})}),!q&&l.jsxs("div",{className:"mt-6 inline-flex items-center gap-2 px-4 py-2 border border-background/20 rounded text-xs text-background/40 uppercase tracking-wider",children:[l.jsx("span",{children:"📷"}),' Tag an image "hero" + "',r,'" in Media Library for cover photo']})]})]})})(),!(r==="neighborhoods"&&!e)&&l.jsx(u$,{stats:(A==null?void 0:A.stats_json)||[]}),r==="neighborhoods"&&!e&&A&&f&&f.length>0?l.jsxs(l.Fragment,{children:[l.jsx(F2t,{category:A,subcategories:f,faqs:T}),l.jsx("section",{className:"py-20 md:py-28 bg-foreground text-background",children:l.jsx("div",{className:"container-page text-center",children:l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-gold uppercase tracking-widest mb-3 font-semibold",children:"Let's Connect"}),l.jsx("h2",{className:"text-2xl md:text-4xl font-semibold tracking-tight mb-3",children:"Reach Out Your Way"}),l.jsx("p",{className:"text-background/80 max-w-lg mx-auto font-medium mb-10",children:s?`${s} is here to help — pick whichever works best for you.`:"We're here to help — pick whichever works best for you."}),l.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[c&&l.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",children:l.jsxs(xe,{size:"lg",className:"bg-background text-foreground hover:bg-background/90 rounded-none transition-colors font-semibold",children:[l.jsx(Oo,{className:"w-4 h-4 mr-2"}),"Book Virtual Meeting With Holden"]})}),a&&l.jsx("a",{href:`mailto:${a}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(e_,{className:"w-4 h-4 mr-2"}),"Email"]})}),o&&l.jsx("a",{href:`tel:${o}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(lf,{className:"w-4 h-4 mr-2"}),"Call"]})}),l.jsx(At,{to:"/contact",children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(ad,{className:"w-4 h-4 mr-2"}),"Send a Message"]})})]})]})})})]}):r==="neighborhoods"&&e&&A&&h?l.jsxs(l.Fragment,{children:[l.jsx(L2t,{category:A,parentCategory:h,pages:p||[],faqs:T}),l.jsx("section",{className:"py-20 md:py-28 bg-foreground text-background",children:l.jsx("div",{className:"container-page text-center",children:l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-gold uppercase tracking-widest mb-3 font-semibold",children:"Let's Connect"}),l.jsx("h2",{className:"text-2xl md:text-4xl font-semibold tracking-tight mb-3",children:"Reach Out Your Way"}),l.jsx("p",{className:"text-background/80 max-w-lg mx-auto font-medium mb-10",children:s?`${s} is here to help — pick whichever works best for you.`:"We're here to help — pick whichever works best for you."}),l.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[c&&l.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",children:l.jsxs(xe,{size:"lg",className:"bg-background text-foreground hover:bg-background/90 rounded-none transition-colors font-semibold",children:[l.jsx(Oo,{className:"w-4 h-4 mr-2"}),"Book Virtual Meeting With Holden"]})}),a&&l.jsx("a",{href:`mailto:${a}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(e_,{className:"w-4 h-4 mr-2"}),"Email"]})}),o&&l.jsx("a",{href:`tel:${o}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(lf,{className:"w-4 h-4 mr-2"}),"Call"]})}),l.jsx(At,{to:"/contact",children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(ad,{className:"w-4 h-4 mr-2"}),"Send a Message"]})})]})]})})})]}):e==="news"&&A?l.jsx(ice,{categoryId:A.id,parentCategorySlug:r||"about"}):l.jsxs(l.Fragment,{children:[N.length>0&&l.jsx("div",{className:N.length>0?"bg-background":"",children:N.map((X,q)=>{const Z=q%2===1,de=x[q],ae=(de?y.find(Ce=>Ce.id===de):null)||B[q]||E[q],he=ae?vc(ae.file_path):null,ie=oe?`step-${q+1}`:void 0;return l.jsx("section",{id:ie,className:`py-16 md:py-24 ${q%2===0?"bg-background":"bg-secondary/20"} scroll-mt-24`,children:l.jsx("div",{className:"container-page",children:l.jsxs("div",{className:`grid grid-cols-1 lg:grid-cols-2 gap-10 lg:gap-16 items-center ${Z?"lg:[direction:rtl]":""}`,children:[l.jsxs(_e,{className:Z?"lg:[direction:ltr]":"",children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:oe?`Step ${q+1} of ${N.length}`:I}),l.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-4 leading-snug",children:F[q]||ZX(X)}),l.jsx("div",{className:"w-10 h-px bg-accent mb-6"}),l.jsx("p",{className:"text-body text-foreground/75 leading-relaxed text-lg",children:X})]}),l.jsx(_e,{delay:.15,className:Z?"lg:[direction:ltr]":"",children:he?l.jsx("div",{className:"aspect-[4/3] overflow-hidden",children:l.jsx("img",{src:he,alt:(ae==null?void 0:ae.alt_text)||`${I} — section ${q+1}`,className:"w-full h-full object-cover",loading:"lazy"})}):l.jsx("div",{className:"aspect-[4/3] bg-gradient-to-br from-secondary/60 to-secondary/30 border border-border/40 flex items-center justify-center",children:l.jsxs("div",{className:"text-center px-8",children:[l.jsx("div",{className:"w-12 h-12 mx-auto mb-3 border border-accent/30 flex items-center justify-center",children:l.jsx("span",{className:"text-accent text-lg font-semibold",children:q+1})}),l.jsx("span",{className:"text-xs text-muted-foreground tracking-wider uppercase",children:"Upload image via Media Library"})]})})})]})})},q)})}),T.length>0&&l.jsx("section",{className:"py-16 md:py-24 bg-background",children:l.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[l.jsx(_e,{children:l.jsxs("div",{className:"text-center mb-12",children:[l.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-3 text-foreground",children:(A==null?void 0:A.faq_title)||`Common Questions About ${I}`}),(A==null?void 0:A.description)&&l.jsx("p",{className:"text-sm text-muted-foreground max-w-2xl mx-auto",children:A.description})]})}),l.jsx(_e,{delay:.1,children:l.jsx(Gp,{type:"single",collapsible:!0,className:"space-y-4",children:T.map((X,q)=>l.jsxs(Ef,{value:`faq-${q}`,className:"border border-border px-6 md:px-8 transition-colors duration-200 bg-card hover:border-accent/40",children:[l.jsx(Tf,{className:"text-left text-sm md:text-base font-medium hover:no-underline py-4 text-foreground/85 hover:text-foreground",children:X.question}),l.jsx(Pf,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1",children:X.answer})]},q))})})]})}),T.length>0&&L&&l.jsxs("div",{className:"flex items-center justify-center py-2 bg-background",children:[l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"}),l.jsx("div",{className:"w-2 h-2 rotate-45 border border-accent/50 mx-4"}),l.jsx("div",{className:"h-px bg-border flex-1 max-w-16"})]}),L&&l.jsx("section",{className:"py-16 md:py-24 bg-secondary/20",children:l.jsxs("div",{className:"container-page max-w-4xl mx-auto",children:[l.jsxs(_e,{children:[(A==null?void 0:A.video_headline)&&l.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-8 text-center",children:A.video_headline}),l.jsx("div",{className:`mx-auto ${(A==null?void 0:A.video_orientation)==="vertical"?"max-w-sm":"max-w-4xl"}`,children:l.jsx("div",{className:`relative overflow-hidden ${(A==null?void 0:A.video_orientation)==="vertical"?"aspect-[9/16]":"aspect-video"}`,children:l.jsx("iframe",{src:L,title:(A==null?void 0:A.video_headline)||`${I} Video`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"absolute inset-0 w-full h-full",loading:"lazy"})})})]}),(A==null?void 0:A.video_transcript)&&l.jsx(_e,{delay:.1,children:l.jsx("div",{className:"mt-8 max-w-3xl mx-auto",children:l.jsx(Gp,{type:"single",collapsible:!0,children:l.jsxs(Ef,{value:"transcript",className:"border border-border px-6 md:px-8 transition-colors duration-200 bg-card hover:border-accent/40",children:[l.jsx(Tf,{className:"text-left text-sm font-medium hover:no-underline py-4 text-foreground/75 hover:text-foreground",children:"View Video Transcript"}),l.jsx(Pf,{className:"text-sm text-muted-foreground leading-relaxed pb-5 px-1 whitespace-pre-line",children:A.video_transcript})]})})})})]})}),l.jsx("section",{className:"py-12 md:py-16 bg-background",children:l.jsxs("div",{className:"container-page",children:[l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-accent uppercase tracking-widest mb-3",children:"Dive Deeper"}),l.jsxs("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-2",children:["Explore ",I," Topics"]}),l.jsx("div",{className:"w-12 h-px bg-accent mb-8"})]}),m?l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(X=>l.jsx(lt,{className:"h-24 w-full"},X))}):p&&p.length>0||f&&f.length>0?l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[!e&&(f==null?void 0:f.map((X,q)=>l.jsx(_e,{delay:q*.06,children:l.jsxs(At,{to:`/${r}/${X.slug}`,className:"group flex items-center gap-4 px-5 py-4 border border-border bg-card hover:border-accent/50 hover:bg-secondary/40 transition-colors duration-200",children:[l.jsx("div",{className:"w-1 h-8 bg-accent shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("h3",{className:"text-sm md:text-base font-medium group-hover:text-accent transition-colors leading-snug",children:[X.icon&&l.jsx("span",{className:"mr-1",children:X.icon}),X.name]}),X.description&&l.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-1",children:X.description})]}),l.jsx(Va,{size:16,className:"shrink-0 text-accent/60 group-hover:text-accent transition-all group-hover:translate-x-1"})]})},X.id))),p==null?void 0:p.map((X,q)=>{const Z=e?`/${r}/${e}`:`/${r}`;return l.jsx(_e,{delay:((f==null?void 0:f.length)||0+q)*.06,children:l.jsxs(At,{to:`${Z}/${X.slug}`,className:"group flex items-center gap-4 px-5 py-4 border border-border bg-card hover:border-accent/50 hover:bg-secondary/40 transition-colors duration-200",children:[l.jsx("div",{className:"w-1 h-8 bg-accent shrink-0"}),l.jsx("div",{className:"flex-1 min-w-0",children:l.jsx("h3",{className:"text-sm md:text-base font-medium group-hover:text-accent transition-colors leading-snug",children:X.h1||X.title})}),l.jsx(Va,{size:16,className:"shrink-0 text-accent/60 group-hover:text-accent transition-all group-hover:translate-x-1"})]})},X.id)})]}):l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-muted-foreground",children:"Content for this category is coming soon."})})]})}),l.jsx("section",{className:"py-20 md:py-28 bg-foreground text-background",children:l.jsx("div",{className:"container-page text-center",children:l.jsxs(_e,{children:[l.jsx("p",{className:"text-caption text-gold uppercase tracking-widest mb-3 font-semibold",children:"Let's Connect"}),l.jsx("h2",{className:"text-2xl md:text-4xl font-semibold tracking-tight mb-3",children:"Reach Out Your Way"}),l.jsx("p",{className:"text-background/80 max-w-lg mx-auto font-medium mb-10",children:s?`${s} is here to help — pick whichever works best for you.`:"We're here to help — pick whichever works best for you."}),l.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[c&&l.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",children:l.jsxs(xe,{size:"lg",className:"bg-background text-foreground hover:bg-background/90 rounded-none transition-colors font-semibold",children:[l.jsx(Oo,{className:"w-4 h-4 mr-2"}),"Book Virtual Meeting With Holden"]})}),a&&l.jsx("a",{href:`mailto:${a}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(e_,{className:"w-4 h-4 mr-2"}),"Email"]})}),o&&l.jsx("a",{href:`tel:${o}`,children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(lf,{className:"w-4 h-4 mr-2"}),"Call"]})}),l.jsx(At,{to:"/contact",children:l.jsxs(xe,{size:"lg",variant:"outline",className:"border-background/40 text-background bg-transparent hover:bg-background hover:text-foreground rounded-none transition-colors font-semibold",children:[l.jsx(ad,{className:"w-4 h-4 mr-2"}),"Send a Message"]})})]})]})})})]})]})},U2t=()=>{const{category:e,slug:t}=mm(),{data:n,isLoading:r}=gr({queryKey:["aeo-resolve",e,t],enabled:!!e&&!!t,queryFn:async()=>{const{data:i}=await Me.from("aeo_categories").select("id").eq("slug",e).is("parent_id",null).maybeSingle();if(!i)return{type:"page"};const{data:s}=await Me.from("aeo_categories").select("id, slug").eq("slug",t).eq("parent_id",i.id).eq("enabled",!0).maybeSingle();return s?{type:"subcategory",subcategoryId:s.id}:{type:"page"}},staleTime:1e3*60*5});return r?l.jsx(ln,{children:l.jsxs("div",{className:"container-page section-padding",children:[l.jsx(lt,{className:"h-12 w-3/4 mb-6"}),l.jsx(lt,{className:"h-64 w-full"})]})}):(n==null?void 0:n.type)==="subcategory"?l.jsx(zye,{subcategorySlug:t}):l.jsx(b_,{})};function H2t({value:e,label:t,lens:n}){const r=Math.max(0,Math.min(100,e)),i=r>=75?"hsl(0 70% 55%)":r>=50?"hsl(35 80% 55%)":r>=25?"hsl(85 50% 50%)":"hsl(195 60% 50%)";return l.jsxs("div",{className:"bg-card border border-border p-6",children:[l.jsxs("div",{className:"flex items-baseline justify-between mb-4",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:n==="seller"?"Seller Market Heat":"Buyer Difficulty"}),l.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground/70",children:"0–100"})]}),l.jsxs("div",{className:"flex items-end gap-4",children:[l.jsx("div",{className:"text-5xl font-bold text-foreground tabular-nums",style:{color:i},children:r}),l.jsx("div",{className:"text-sm text-foreground/80 pb-2",children:t})]}),l.jsx("div",{className:"mt-4 h-2 bg-muted rounded-none overflow-hidden",children:l.jsx("div",{className:"h-full transition-all duration-700",style:{width:`${r}%`,background:i}})}),l.jsxs("div",{className:"flex justify-between text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60 mt-2",children:[l.jsx("span",{children:"Cold"}),l.jsx("span",{children:"Balanced"}),l.jsx("span",{children:"Hot"})]})]})}function Q2t(e){return e>=20?0:e>=15?.3:e>=10?.41:e>=5?.62:1}function $2t(e){const t=e.homePrice*(e.downPaymentPct/100),n=Math.max(0,e.homePrice-t),r=e.ratePct/100/12,i=e.termYears*12,s=r===0?n/i:n*(r*Math.pow(1+r,i))/(Math.pow(1+r,i)-1),a=e.homePrice*(e.propertyTaxRatePct/100)/12,o=e.annualInsurance/12,c=Q2t(e.downPaymentPct),u=n*(c/100)/12,d=e.monthlyHoa??0;return{loanAmount:n,downPayment:t,monthlyPI:s,monthlyTax:a,monthlyInsurance:o,monthlyPmi:u,monthlyHoa:d,monthlyTotal:s+a+o+u+d,pmiRatePct:c}}const O0=e=>e.toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}),eJ=e=>e.toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2}),ih=({label:e,value:t,sub:n})=>l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsx("div",{className:"text-[9px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-2",children:e}),l.jsx("div",{className:"text-2xl font-bold text-foreground tabular-nums",children:t}),n&&l.jsx("div",{className:"text-[11px] text-muted-foreground mt-1",children:n})]});function z2t({snapshot:e,lens:t}){return e.yoy_pct>=0,l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:"Market Snapshot"}),l.jsx("span",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60",children:"AI-researched · Not MLS-verified"})]}),l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:[l.jsx(ih,{label:"Median Sale Price",value:O0(e.median_sale_price),sub:`${e.yoy_pct>=0?"+":""}${e.yoy_pct.toFixed(1)}% YoY`}),l.jsx(ih,{label:"Homes Sold (30d)",value:String(e.homes_sold_30d)}),l.jsx(ih,{label:"Median Days on Market",value:`${e.median_dom}d`}),l.jsx(ih,{label:"List-to-Sale Ratio",value:`${e.list_to_sale_pct.toFixed(1)}%`}),l.jsx(ih,{label:"Active Inventory",value:String(e.active_inventory),sub:e.months_supply?`${e.months_supply.toFixed(1)} mo supply`:void 0}),t==="buyer"&&e.pct_above_ask!==void 0&&l.jsx(ih,{label:"Selling Above Ask",value:`${e.pct_above_ask.toFixed(0)}%`}),t==="buyer"&&e.new_listings_7d!==void 0&&l.jsx(ih,{label:"New Listings (7d)",value:String(e.new_listings_7d)}),t==="buyer"&&e.price_reduced_7d!==void 0&&l.jsx(ih,{label:"Price Reduced (7d)",value:String(e.price_reduced_7d)})]})]})}function V2t({data:e}){return l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsx("div",{className:"flex items-center justify-between mb-4",children:l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:"Median Sale Price · 24-Month Trend"})}),l.jsx("div",{style:{width:"100%",height:260},children:l.jsx(SQ,{children:l.jsxs(tye,{data:e,margin:{top:10,right:12,left:12,bottom:0},children:[l.jsx(uT,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),l.jsx(jm,{dataKey:"month",tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"}}),l.jsx(Bm,{tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"},tickFormatter:t=>`$${(t/1e3).toFixed(0)}k`,width:60}),l.jsx(sl,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))"},formatter:t=>O0(t)}),l.jsx(T0,{type:"monotone",dataKey:"value",stroke:"hsl(var(--primary))",strokeWidth:2,dot:{r:2}})]})})})]})}function K2t({data:e}){return l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-4",children:"Homes Sold per Month · 12-Month"}),l.jsx("div",{style:{width:"100%",height:220},children:l.jsx(SQ,{children:l.jsxs(Zbt,{data:e,margin:{top:10,right:12,left:0,bottom:0},children:[l.jsx(uT,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),l.jsx(jm,{dataKey:"month",tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"}}),l.jsx(Bm,{tick:{fontSize:10,fill:"hsl(var(--muted-foreground))"},width:40}),l.jsx(sl,{contentStyle:{background:"hsl(var(--card))",border:"1px solid hsl(var(--border))"}}),l.jsx(_m,{dataKey:"value",fill:"hsl(var(--primary))"})]})})})]})}function q2t({percentile:e,comps:t,zip:n}){return l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsxs("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-4",children:["Metro Score · How ",n," Ranks"]}),l.jsxs("div",{className:"mb-5",children:[l.jsxs("div",{className:"flex items-baseline gap-3 mb-2",children:[l.jsx("span",{className:"text-4xl font-bold tabular-nums",children:Math.round(e)}),l.jsx("span",{className:"text-sm text-muted-foreground",children:"percentile vs. GR metro"})]}),l.jsx("div",{className:"h-2 bg-muted",children:l.jsx("div",{className:"h-full bg-primary",style:{width:`${Math.max(2,Math.min(100,e))}%`}})})]}),t.length>0&&l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] uppercase tracking-[0.25em] text-muted-foreground/70 mb-2",children:"Nearby Comps"}),l.jsx("ul",{className:"space-y-1.5",children:t.map(r=>l.jsxs("li",{className:"flex items-center justify-between text-sm",children:[l.jsxs("span",{className:"text-foreground/80",children:[r.zip," · ",r.label]}),l.jsx("span",{className:"tabular-nums text-foreground",children:O0(r.median_price)})]},r.zip))})]})]})}function W2t(){const[e,t]=C.useState(null),[n,r]=C.useState(!0);return C.useEffect(()=>{let i=!0;return(async()=>{try{const{data:s}=await Me.from("market_pulse_rates").select("rates, source, fetched_at").order("fetched_at",{ascending:!1}).limit(1).maybeSingle();if(!s||Date.now()-new Date(s.fetched_at).getTime()>1e3*60*60*12){await Me.functions.invoke("market-pulse-rates",{body:{}});const{data:o}=await Me.from("market_pulse_rates").select("rates, source, fetched_at").order("fetched_at",{ascending:!1}).limit(1).maybeSingle();i&&o&&t({rates:o.rates,source:o.source,fetched_at:o.fetched_at})}else i&&t({rates:s.rates,source:s.source,fetched_at:s.fetched_at})}catch(s){console.error("RatesModule load error",s)}finally{i&&r(!1)}})(),()=>{i=!1}},[]),l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:"Today's Mortgage Rates"}),e&&l.jsxs("span",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60",children:[e.source," · ",new Date(e.fetched_at).toLocaleDateString()]})]}),n||!e?l.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading rates…"}):l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-3",children:[l.jsx(Hx,{label:"30-Yr Fixed",v:e.rates.thirty_year_fixed}),l.jsx(Hx,{label:"15-Yr Fixed",v:e.rates.fifteen_year_fixed}),e.rates.seven_one_arm!==void 0&&l.jsx(Hx,{label:"7/1 ARM",v:e.rates.seven_one_arm}),e.rates.fha_thirty!==void 0&&l.jsx(Hx,{label:"FHA 30",v:e.rates.fha_thirty}),e.rates.va_thirty!==void 0&&l.jsx(Hx,{label:"VA 30",v:e.rates.va_thirty})]}),l.jsx("p",{className:"text-[10px] text-muted-foreground/60 mt-3",children:"National averages. Your actual rate depends on credit, down payment, and lender."})]})}const Hx=({label:e,v:t})=>l.jsxs("div",{className:"border border-border p-3",children:[l.jsx("div",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground mb-1",children:e}),l.jsxs("div",{className:"text-xl font-bold tabular-nums",children:[t.toFixed(3),"%"]})]});function Vye(e){if(e<=0)return 0;if(e<=1e5)return 400+e/1e3*5.75;const t=e-1e5;return 400+100*5.75+t/1e3*3.5}function G2t(e){const t=e.salePrice*(e.listingCommissionPct/100),n=e.salePrice*(e.buyerAgentCommissionPct/100),r=e.salePrice*.0075,i=e.salePrice*.0011,s=e.titleInsuranceOverride??Vye(e.salePrice),a=t+n+r+i+s+e.settlementFee+e.recordingFee+e.proratedTax+e.sellerConcessions+e.mortgagePayoff;return{salePrice:e.salePrice,listingCommission:t,buyerAgentCommission:n,stateTransferTax:r,countyTransferTax:i,titleInsurance:s,settlementFee:e.settlementFee,recordingFee:e.recordingFee,proratedTax:e.proratedTax,sellerConcessions:e.sellerConcessions,mortgagePayoff:e.mortgagePayoff,totalCosts:a,estimatedNet:e.salePrice-a}}const Ru=e=>e===""||e==="-"?0:Number(e)||0;function Y2t({defaultPrice:e}){const[t,n]=C.useState(String(e||35e4)),[r,i]=C.useState("180000"),[s,a]=C.useState("3"),[o,c]=C.useState("3"),[u,d]=C.useState("0"),[h,A]=C.useState("1500"),[f,p]=C.useState("400"),[m,g]=C.useState("75"),[y,v]=C.useState(""),x=C.useMemo(()=>G2t({salePrice:Ru(t),mortgagePayoff:Ru(r),listingCommissionPct:Ru(s),buyerAgentCommissionPct:Ru(o),sellerConcessions:Ru(u),proratedTax:Ru(h),settlementFee:Ru(f),recordingFee:Ru(m),titleInsuranceOverride:y?Number(y):void 0}),[t,r,s,o,u,h,f,m,y]);return l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsxs("div",{className:"flex items-baseline justify-between mb-4",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:"Michigan Seller Net Sheet"}),l.jsx("span",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60",children:"Estimate"})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx(sh,{label:"Sale Price",value:t,setValue:n,prefix:"$"}),l.jsx(sh,{label:"Mortgage Payoff",value:r,setValue:i,prefix:"$"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsx(sh,{label:"Listing Comm. %",value:s,setValue:a,step:.25}),l.jsx(sh,{label:"Buyer Agent %",value:o,setValue:c,step:.25})]}),l.jsx(sh,{label:"Seller Concessions",value:u,setValue:d,prefix:"$"}),l.jsx(sh,{label:"Prorated Property Tax",value:h,setValue:A,prefix:"$"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsx(sh,{label:"Settlement Fee",value:f,setValue:p,prefix:"$"}),l.jsx(sh,{label:"Recording Fee",value:m,setValue:g,prefix:"$"})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground block mb-1",children:["Title Insurance Override ",l.jsxs("span",{className:"text-muted-foreground/50",children:["(default ",O0(Vye(Ru(t))),")"]})]}),l.jsx("input",{type:"number",value:y,onChange:w=>v(w.target.value),placeholder:"optional",className:"w-full bg-background border border-border px-3 py-2 text-sm"})]})]}),l.jsxs("div",{className:"bg-muted/40 border border-border p-4 space-y-2 text-sm",children:[l.jsx(Xo,{label:"Sale Price",v:x.salePrice,bold:!0}),l.jsx(tJ,{}),l.jsx(Xo,{label:`Listing Commission (${s}%)`,v:-x.listingCommission}),l.jsx(Xo,{label:`Buyer Agent (${o}%)`,v:-x.buyerAgentCommission}),l.jsx(Xo,{label:"MI State Transfer Tax (0.75%)",v:-x.stateTransferTax}),l.jsx(Xo,{label:"Kent County Transfer Tax (0.11%)",v:-x.countyTransferTax}),l.jsx(Xo,{label:"Title Insurance (owner's)",v:-x.titleInsurance}),l.jsx(Xo,{label:"Settlement Fee",v:-x.settlementFee}),l.jsx(Xo,{label:"Recording / Deed Prep",v:-x.recordingFee}),l.jsx(Xo,{label:"Prorated Property Tax",v:-x.proratedTax}),x.sellerConcessions>0&&l.jsx(Xo,{label:"Seller Concessions",v:-x.sellerConcessions}),l.jsx(Xo,{label:"Mortgage Payoff",v:-x.mortgagePayoff}),l.jsx(tJ,{}),l.jsx(Xo,{label:"Estimated Net Proceeds",v:x.estimatedNet,bold:!0,highlight:!0}),l.jsx("p",{className:"text-[10px] text-muted-foreground/70 mt-3 leading-relaxed",children:"Estimate only — confirm exact figures with your title company. Transfer taxes shown are MI State + Kent County. Other counties may differ."})]})]})]})}const sh=({label:e,value:t,setValue:n,prefix:r,step:i})=>l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground block mb-1",children:e}),l.jsxs("div",{className:"relative",children:[r&&l.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:r}),l.jsx("input",{type:"text",inputMode:"decimal",step:i??1,value:t,onChange:s=>{const a=s.target.value;(a===""||/^-?\d*\.?\d*$/.test(a))&&n(a)},onBlur:s=>{(s.target.value===""||s.target.value==="-"||s.target.value===".")&&n("0")},className:`w-full bg-background border border-border py-2 text-sm ${r?"pl-7 pr-3":"px-3"}`})]})]}),Xo=({label:e,v:t,bold:n,highlight:r})=>l.jsxs("div",{className:`flex items-center justify-between ${n?"font-bold":""} ${r?"text-lg pt-1":""}`,children:[l.jsx("span",{className:r?"text-foreground":"text-foreground/80",children:e}),l.jsx("span",{className:`tabular-nums ${t<0?"text-foreground/70":"text-foreground"}`,children:O0(t)})]}),tJ=()=>l.jsx("div",{className:"h-px bg-border my-1"}),xg=e=>e===""||e==="-"||e==="."?0:Number(e)||0;function X2t({defaultPrice:e}){const[t,n]=C.useState(String(e||325e3)),[r,i]=C.useState("10"),[s,a]=C.useState("6.875"),[o,c]=C.useState(30),[u,d]=C.useState("1.45"),[h,A]=C.useState("1400"),[f,p]=C.useState("0");C.useEffect(()=>{(async()=>{var x;const{data:y}=await Me.from("market_pulse_rates").select("rates").order("fetched_at",{ascending:!1}).limit(1).maybeSingle(),v=(x=y==null?void 0:y.rates)==null?void 0:x.thirty_year_fixed;typeof v=="number"&&a(String(v))})()},[]);const m=C.useMemo(()=>$2t({homePrice:xg(t),downPaymentPct:xg(r),ratePct:xg(s),termYears:o,propertyTaxRatePct:xg(u),annualInsurance:xg(h),monthlyHoa:xg(f)}),[t,r,s,o,u,h,f]),g=[{key:"P&I",v:m.monthlyPI,color:"hsl(var(--primary))"},{key:"Tax",v:m.monthlyTax,color:"hsl(35 80% 55%)"},{key:"Insurance",v:m.monthlyInsurance,color:"hsl(195 60% 50%)"},{key:"PMI",v:m.monthlyPmi,color:"hsl(0 70% 55%)"},{key:"HOA",v:m.monthlyHoa,color:"hsl(85 50% 50%)"}].filter(y=>y.v>0);return l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsxs("div",{className:"flex items-baseline justify-between mb-4",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium",children:"PITI + PMI Mortgage Calculator"}),l.jsx("span",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60",children:"Estimate"})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx(wg,{label:"Home Price",v:t,set:n,prefix:"$"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsx(wg,{label:"Down Payment %",v:r,set:i,step:.5}),l.jsx(wg,{label:"Rate %",v:s,set:a,step:.125})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground block mb-1",children:"Term"}),l.jsxs("select",{value:o,onChange:y=>c(Number(y.target.value)),className:"w-full bg-background border border-border px-3 py-2 text-sm",children:[l.jsx("option",{value:30,children:"30 years"}),l.jsx("option",{value:15,children:"15 years"})]})]}),l.jsx(wg,{label:"Property Tax %",v:u,set:d,step:.05})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsx(wg,{label:"Annual Insurance",v:h,set:A,prefix:"$"}),l.jsx(wg,{label:"Monthly HOA",v:f,set:p,prefix:"$"})]}),m.pmiRatePct>0&&l.jsxs("p",{className:"text-[11px] text-muted-foreground bg-muted/40 border border-border p-2",children:["Down payment under 20% — PMI applied at ",l.jsxs("strong",{children:[m.pmiRatePct.toFixed(2),"%/yr"]}),"."]})]}),l.jsxs("div",{className:"bg-muted/40 border border-border p-4",children:[l.jsx("div",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground mb-2",children:"Estimated Monthly Payment"}),l.jsx("div",{className:"text-4xl font-bold tabular-nums mb-4",children:eJ(m.monthlyTotal)}),l.jsxs("div",{className:"space-y-1.5 text-sm mb-4",children:[l.jsx(TA,{label:"Principal & Interest",v:m.monthlyPI}),l.jsx(TA,{label:"Property Tax",v:m.monthlyTax}),l.jsx(TA,{label:"Insurance",v:m.monthlyInsurance}),m.monthlyPmi>0&&l.jsx(TA,{label:"PMI",v:m.monthlyPmi}),m.monthlyHoa>0&&l.jsx(TA,{label:"HOA",v:m.monthlyHoa})]}),l.jsx("div",{className:"flex h-3 overflow-hidden border border-border",children:g.map(y=>l.jsx("div",{title:`${y.key}: ${eJ(y.v)}`,style:{width:`${y.v/m.monthlyTotal*100}%`,background:y.color}},y.key))}),l.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-1 mt-2 text-[10px] uppercase tracking-[0.15em]",children:g.map(y=>l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"w-2 h-2",style:{background:y.color}}),l.jsx("span",{className:"text-muted-foreground",children:y.key})]},y.key))}),l.jsxs("div",{className:"mt-4 pt-3 border-t border-border text-sm space-y-1",children:[l.jsx(TA,{label:"Down Payment",v:m.downPayment}),l.jsx(TA,{label:"Loan Amount",v:m.loanAmount})]})]})]})]})}const wg=({label:e,v:t,set:n,prefix:r,step:i})=>l.jsxs("div",{children:[l.jsx("label",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground block mb-1",children:e}),l.jsxs("div",{className:"relative",children:[r&&l.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-sm text-muted-foreground",children:r}),l.jsx("input",{type:"text",inputMode:"decimal",step:i??1,value:t,onChange:s=>{const a=s.target.value;(a===""||/^-?\d*\.?\d*$/.test(a))&&n(a)},onBlur:s=>{(s.target.value===""||s.target.value==="-"||s.target.value===".")&&n("0")},className:`w-full bg-background border border-border py-2 text-sm ${r?"pl-7 pr-3":"px-3"}`})]})]}),TA=({label:e,v:t})=>l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-foreground/80",children:e}),l.jsx("span",{className:"tabular-nums",children:O0(t)})]});function J2t({md:e,area:t}){return l.jsxs("div",{className:"bg-card border border-border p-6",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[l.jsx("img",{src:roe,alt:"Holden Richardson",className:"w-12 h-12 rounded-full object-cover object-top border border-border"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground",children:"Holden's Take"}),l.jsxs("div",{className:"text-sm font-medium",children:["On ",t]})]})]}),l.jsx("div",{className:"prose prose-sm max-w-none prose-p:text-foreground/85 prose-p:leading-relaxed prose-headings:text-foreground prose-strong:text-foreground",children:l.jsx(q6,{children:e})})]})}const Z2t=[{t:"Pre-Listing Walkthrough",d:"I walk your home, identify quick-win prep items, and recommend pricing strategy backed by live comps."},{t:"Strategic Pricing",d:"We price to attract showings in the first 10 days — that's where the strongest offers come from."},{t:"Marketing Launch",d:"Pro photos, video, social campaigns, and syndication to all major portals + my buyer database."},{t:"Negotiation",d:"I negotiate offer terms, inspection requests, and appraisal gaps to protect your bottom line."},{t:"Smooth Close",d:"I coordinate title, lender, inspectors, and movers so your closing day is the easy day."}],eCt=[{t:"Search Strategy Session",d:"We map your must-haves, deal-breakers, neighborhoods, and budget — and align on timeline."},{t:"Lender Connect",d:"I introduce you to 2–3 vetted local lenders so you get a competitive pre-approval, not just any pre-approval."},{t:"Showings + Off-Market",d:"I tour properties with you and tap my agent network for off-market opportunities."},{t:"Offer + Negotiation",d:"I structure offers that win without overpaying — escalation, concessions, and inspection terms tuned to the market."},{t:"Inspection → Close",d:"I manage inspections, repair negotiations, and the closing timeline so nothing slips."}];function tCt({lens:e}){const t=e==="seller"?Z2t:eCt,{configMap:n}=Os(),r=n.booking_url;return l.jsxs("div",{className:"bg-card border border-border p-6",children:[l.jsxs("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-1",children:["My Plan to ",e==="seller"?"Sell Your Home":"Help You Buy"]}),l.jsxs("p",{className:"text-sm text-foreground/80 mb-5",children:["Here's how I work with ",e==="seller"?"sellers":"buyers"," — start to close."]}),l.jsx("ol",{className:"space-y-4",children:t.map((i,s)=>l.jsxs("li",{className:"flex gap-3",children:[l.jsx("div",{className:"shrink-0 w-7 h-7 border border-border flex items-center justify-center text-xs font-bold text-foreground",children:s+1}),l.jsxs("div",{children:[l.jsxs("div",{className:"text-sm font-semibold flex items-center gap-2",children:[l.jsx(e0,{size:14,className:"text-foreground/70"})," ",i.t]}),l.jsx("p",{className:"text-sm text-foreground/75 mt-0.5",children:i.d})]})]},i.t))}),l.jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[r&&l.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center px-5 py-3 bg-primary text-primary-foreground text-[11px] uppercase tracking-[0.2em] font-medium hover:bg-primary/90",children:e==="seller"?"Book a Listing Consult":"Start with a Buyer Strategy Call"}),l.jsx("a",{href:"sms:6164036393",className:"inline-flex items-center justify-center px-5 py-3 border border-border text-foreground text-[11px] uppercase tracking-[0.2em] font-medium hover:bg-muted",children:"Text Holden"})]})]})}function nCt(){const{configMap:e}=Os(),t=e.booking_url;return l.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-40 bg-primary text-primary-foreground border-t border-primary-foreground/10 shadow-2xl",children:l.jsxs("div",{className:"container-page py-3 flex items-center justify-between gap-3",children:[l.jsx("div",{className:"hidden md:block text-[11px] uppercase tracking-[0.2em] text-primary-foreground/80",children:"Questions about this report?"}),l.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[l.jsxs("a",{href:"sms:6164036393",className:"inline-flex items-center gap-2 px-3 md:px-4 py-2 border border-primary-foreground/30 text-primary-foreground text-[10px] md:text-[11px] uppercase tracking-[0.2em] font-medium hover:bg-primary-foreground/10",children:[l.jsx(aj,{size:14})," Text"]}),l.jsxs("a",{href:"tel:+16164036393",className:"inline-flex items-center gap-2 px-3 md:px-4 py-2 border border-primary-foreground/30 text-primary-foreground text-[10px] md:text-[11px] uppercase tracking-[0.2em] font-medium hover:bg-primary-foreground/10",children:[l.jsx(lf,{size:14})," Call"]}),t&&l.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-3 md:px-4 py-2 bg-gold text-primary text-[10px] md:text-[11px] uppercase tracking-[0.2em] font-medium hover:opacity-90",children:[l.jsx(Oo,{size:14})," Book"]})]})]})})}const rCt="modulepreload",iCt=function(e){return"/"+e},nJ={},C_=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),o=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));i=Promise.allSettled(n.map(c=>{if(c=iCt(c),c in nJ)return;nJ[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":rCt,u||(h.as="script"),h.crossOrigin="",h.href=c,o&&h.setAttribute("nonce",o),document.head.appendChild(h),u)return new Promise((A,f)=>{h.addEventListener("load",A),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(a){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a}return i.then(a=>{for(const o of a||[])o.status==="rejected"&&s(o.reason);return t().catch(s)})};function Gn(e){"@babel/helpers - typeof";return Gn=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},Gn(e)}var xc=Uint8Array,To=Uint16Array,d$=Int32Array,h$=new xc([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]),f$=new xc([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]),rJ=new xc([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Kye=function(e,t){for(var n=new To(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new d$(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return{b:n,r:i}},qye=Kye(h$,2),sCt=qye.b,CR=qye.r;sCt[28]=258,CR[258]=28;var aCt=Kye(f$,0),iJ=aCt.r,SR=new To(32768);for(var kr=0;kr<32768;++kr){var ah=(kr&43690)>>1|(kr&21845)<<1;ah=(ah&52428)>>2|(ah&13107)<<2,ah=(ah&61680)>>4|(ah&3855)<<4,SR[kr]=((ah&65280)>>8|(ah&255)<<8)>>1}var sb=function(e,t,n){for(var r=e.length,i=0,s=new To(t);i<r;++i)e[i]&&++s[e[i]-1];var a=new To(t);for(i=1;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;var o;if(n){o=new To(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],d=t-e[i],h=a[e[i]-1]++<<d,A=h|(1<<d)-1;h<=A;++h)o[SR[h]>>c]=u}else for(o=new To(r),i=0;i<r;++i)e[i]&&(o[i]=SR[a[e[i]-1]++]>>15-e[i]);return o},cm=new xc(288);for(var kr=0;kr<144;++kr)cm[kr]=8;for(var kr=144;kr<256;++kr)cm[kr]=9;for(var kr=256;kr<280;++kr)cm[kr]=7;for(var kr=280;kr<288;++kr)cm[kr]=8;var PN=new xc(32);for(var kr=0;kr<32;++kr)PN[kr]=5;var oCt=sb(cm,9,0),lCt=sb(PN,5,0),Wye=function(e){return(e+7)/8|0},cCt=function(e,t,n){return(n==null||n>e.length)&&(n=e.length),new xc(e.subarray(t,n))},Du=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Qx=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},V4=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return{t:Yye,l:0};if(i==1){var a=new xc(n[0].s+1);return a[n[0].s]=1,{t:a,l:1}}n.sort(function(b,k){return b.f-k.f}),n.push({s:-1,f:25001});var o=n[0],c=n[1],u=0,d=1,h=2;for(n[0]={s:-1,f:o.f+c.f,l:o,r:c};d!=i-1;)o=n[n[u].f<n[h].f?u++:h++],c=n[u!=d&&n[u].f<n[h].f?u++:h++],n[d++]={s:-1,f:o.f+c.f,l:o,r:c};for(var A=s[0].s,r=1;r<i;++r)s[r].s>A&&(A=s[r].s);var f=new To(A+1),p=kR(n[d-1],f,0);if(p>t){var r=0,m=0,g=p-t,y=1<<g;for(s.sort(function(k,j){return f[j.s]-f[k.s]||k.f-j.f});r<i;++r){var v=s[r].s;if(f[v]>t)m+=y-(1<<p-f[v]),f[v]=t;else break}for(m>>=g;m>0;){var x=s[r].s;f[x]<t?m-=1<<t-f[x]++-1:++r}for(;r>=0&&m;--r){var w=s[r].s;f[w]==t&&(--f[w],++m)}p=t}return{t:new xc(f),l:p}},kR=function(e,t,n){return e.s==-1?Math.max(kR(e.l,t,n+1),kR(e.r,t,n+1)):t[e.s]=n},sJ=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new To(++t),r=0,i=e[0],s=1,a=function(c){n[r++]=c},o=1;o<=t;++o)if(e[o]==i&&o!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)a(32754);s>2&&(a(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(a(i),--s;s>6;s-=6)a(8304);s>2&&(a(s-3<<5|8208),s=0)}for(;s--;)a(i);s=1,i=e[o]}return{c:n.subarray(0,r),n:t}},$x=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Gye=function(e,t,n){var r=n.length,i=Wye(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var s=0;s<r;++s)e[i+s+4]=n[s];return(i+4+r)*8},aJ=function(e,t,n,r,i,s,a,o,c,u,d){Du(t,d++,n),++i[256];for(var h=V4(i,15),A=h.t,f=h.l,p=V4(s,15),m=p.t,g=p.l,y=sJ(A),v=y.c,x=y.n,w=sJ(m),b=w.c,k=w.n,j=new To(19),B=0;B<v.length;++B)++j[v[B]&31];for(var B=0;B<b.length;++B)++j[b[B]&31];for(var E=V4(j,7),I=E.t,T=E.l,N=19;N>4&&!I[rJ[N-1]];--N);var F=u+5<<3,L=$x(i,cm)+$x(s,PN)+a,U=$x(i,A)+$x(s,m)+a+14+3*N+$x(j,I)+2*j[16]+3*j[17]+7*j[18];if(c>=0&&F<=L&&F<=U)return Gye(t,d,e.subarray(c,c+u));var H,K,$,z;if(Du(t,d,1+(U<L)),d+=2,U<L){H=sb(A,f,0),K=A,$=sb(m,g,0),z=m;var Q=sb(I,T,0);Du(t,d,x-257),Du(t,d+5,k-1),Du(t,d+10,N-4),d+=14;for(var B=0;B<N;++B)Du(t,d+3*B,I[rJ[B]]);d+=3*N;for(var oe=[v,b],R=0;R<2;++R)for(var M=oe[R],B=0;B<M.length;++B){var Y=M[B]&31;Du(t,d,Q[Y]),d+=I[Y],Y>15&&(Du(t,d,M[B]>>5&127),d+=M[B]>>12)}}else H=oCt,K=cm,$=lCt,z=PN;for(var B=0;B<o;++B){var X=r[B];if(X>255){var Y=X>>18&31;Qx(t,d,H[Y+257]),d+=K[Y+257],Y>7&&(Du(t,d,X>>23&31),d+=h$[Y]);var q=X&31;Qx(t,d,$[q]),d+=z[q],q>3&&(Qx(t,d,X>>5&8191),d+=f$[q])}else Qx(t,d,H[X]),d+=K[X]}return Qx(t,d,H[256]),d+K[256]},uCt=new d$([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Yye=new xc(0),dCt=function(e,t,n,r,i,s){var a=s.z||e.length,o=new xc(r+a+5*(1+Math.ceil(a/7e3))+i),c=o.subarray(r,o.length-i),u=s.l,d=(s.r||0)&7;if(t){d&&(c[0]=s.r>>3);for(var h=uCt[t-1],A=h>>13,f=h&8191,p=(1<<n)-1,m=s.p||new To(32768),g=s.h||new To(p+1),y=Math.ceil(n/3),v=2*y,x=function(Oe){return(e[Oe]^e[Oe+1]<<y^e[Oe+2]<<v)&p},w=new d$(25e3),b=new To(288),k=new To(32),j=0,B=0,E=s.i||0,I=0,T=s.w||0,N=0;E+2<a;++E){var F=x(E),L=E&32767,U=g[F];if(m[L]=U,g[F]=L,T<=E){var H=a-E;if((j>7e3||I>24576)&&(H>423||!u)){d=aJ(e,c,0,w,b,k,B,I,N,E-N,d),I=j=B=0,N=E;for(var K=0;K<286;++K)b[K]=0;for(var K=0;K<30;++K)k[K]=0}var $=2,z=0,Q=f,oe=L-U&32767;if(H>2&&F==x(E-oe))for(var R=Math.min(A,H)-1,M=Math.min(32767,E),Y=Math.min(258,H);oe<=M&&--Q&&L!=U;){if(e[E+$]==e[E+$-oe]){for(var X=0;X<Y&&e[E+X]==e[E+X-oe];++X);if(X>$){if($=X,z=oe,X>R)break;for(var q=Math.min(oe,X-2),Z=0,K=0;K<q;++K){var de=E-oe+K&32767,ue=m[de],ae=de-ue&32767;ae>Z&&(Z=ae,U=de)}}}L=U,U=m[L],oe+=L-U&32767}if(z){w[I++]=268435456|CR[$]<<18|iJ[z];var he=CR[$]&31,ie=iJ[z]&31;B+=h$[he]+f$[ie],++b[257+he],++k[ie],T=E+$,++j}else w[I++]=e[E],++b[e[E]]}}for(E=Math.max(E,T);E<a;++E)w[I++]=e[E],++b[e[E]];d=aJ(e,c,u,w,b,k,B,I,N,E-N,d),u||(s.r=d&7|c[d/8|0]<<3,d-=7,s.h=g,s.p=m,s.i=E,s.w=T)}else{for(var E=s.w||0;E<a+u;E+=65535){var Ce=E+65535;Ce>=a&&(c[d/8|0]=u,Ce=a),d=Gye(c,d+1,e.subarray(E,Ce))}s.i=a}return cCt(o,0,r+Wye(d)+i)},Xye=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,s=n.length|0,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=r+=n[a];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}e=r,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},hCt=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var s=t.dictionary.subarray(-32768),a=new xc(s.length+e.length);a.set(s),a.set(e,s.length),e=a,i.w=s.length}return dCt(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)},Jye=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},fCt=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=Xye();i.p(t.dictionary),Jye(e,2,i.d())}};function _R(e,t){t||(t={});var n=Xye();n.p(e);var r=hCt(e,t,t.dictionary?6:2,4);return fCt(r,t),Jye(r,r.length-4,n.d()),r}var ACt=typeof TextDecoder<"u"&&new TextDecoder,pCt=0;try{ACt.decode(Yye,{stream:!0}),pCt=1}catch{}function mCt(e){if(Array.isArray(e))return e}function gCt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,a,o=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(c=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(d){u=!0,i=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}function oJ(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yCt(e,t){if(e){if(typeof e=="string")return oJ(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?oJ(e,t):void 0}}function vCt(){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 lJ(e,t){return mCt(e)||gCt(e,t)||yCt(e,t)||vCt()}function cJ(e,t="utf8"){return new TextDecoder(t).decode(e)}const xCt=new TextEncoder;function wCt(e){return xCt.encode(e)}const bCt=1024*8,CCt=(()=>{const e=new Uint8Array(4),t=new Uint32Array(e.buffer);return!((t[0]=1)&e[0])})(),K4={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 A${constructor(t=bCt,n={}){vn(this,"buffer");vn(this,"byteLength");vn(this,"byteOffset");vn(this,"length");vn(this,"offset");vn(this,"lastWrittenByte");vn(this,"littleEndian");vn(this,"_data");vn(this,"_mark");vn(this,"_marks");let r=!1;typeof t=="number"?t=new ArrayBuffer(t):(r=!0,this.lastWrittenByte=t.byteLength);const i=n.offset?n.offset>>>0:0,s=t.byteLength-i;let a=i;(ArrayBuffer.isView(t)||t instanceof A$)&&(t.byteLength!==t.buffer.byteLength&&(a=t.byteOffset+i),t=t.buffer),r?this.lastWrittenByte=s:this.lastWrittenByte=0,this.buffer=t,this.length=s,this.byteLength=s,this.byteOffset=a,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,a,s),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 r=(this.offset+t)*2,i=new Uint8Array(r);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=r,this.byteLength=r,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,n){const r=K4[n].BYTES_PER_ELEMENT*t,i=this.byteOffset+this.offset,s=this.buffer.slice(i,i+r);if(this.littleEndian===CCt&&n!=="uint8"&&n!=="int8"){const o=new Uint8Array(this.buffer.slice(i,i+r));o.reverse();const c=new K4[n](o.buffer);return this.offset+=r,c.reverse(),c}const a=new K4[n](s);return this.offset+=r,a}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 n="";for(let r=0;r<t;r++)n+=this.readChar();return n}readUtf8(t=1){return cJ(this.readBytes(t))}decodeText(t=1,n="utf8"){return cJ(this.readBytes(t),n)}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 n=0;n<t.length;n++)this._data.setUint8(this.offset++,t[n]);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 n=0;n<t.length;n++)this.writeUint8(t.charCodeAt(n));return this}writeUtf8(t){return this.writeBytes(wCt(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)}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const SCt=4,uJ=0,dJ=1,kCt=2;function F0(e){let t=e.length;for(;--t>=0;)e[t]=0}const _Ct=0,Zye=1,jCt=2,BCt=3,NCt=258,p$=29,nC=256,J1=nC+1+p$,My=30,m$=19,eve=2*J1+1,lp=15,q4=16,ECt=7,g$=256,tve=16,nve=17,rve=18,jR=new Uint8Array([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]),S_=new Uint8Array([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]),TCt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ive=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),PCt=512,Gu=new Array((J1+2)*2);F0(Gu);const ab=new Array(My*2);F0(ab);const Z1=new Array(PCt);F0(Z1);const e2=new Array(NCt-BCt+1);F0(e2);const y$=new Array(p$);F0(y$);const IN=new Array(My);F0(IN);function W4(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let sve,ave,ove;function G4(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const lve=e=>e<256?Z1[e]:Z1[256+(e>>>7)],t2=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},Ya=(e,t,n)=>{e.bi_valid>q4-n?(e.bi_buf|=t<<e.bi_valid&65535,t2(e,e.bi_buf),e.bi_buf=t>>q4-e.bi_valid,e.bi_valid+=n-q4):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Yc=(e,t,n)=>{Ya(e,n[t*2],n[t*2+1])},cve=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},ICt=e=>{e.bi_valid===16?(t2(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},OCt=(e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,s=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,d,h,A,f,p,m=0;for(A=0;A<=lp;A++)e.bl_count[A]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;u<eve;u++)d=e.heap[u],A=n[n[d*2+1]*2+1]+1,A>c&&(A=c,m++),n[d*2+1]=A,!(d>r)&&(e.bl_count[A]++,f=0,d>=o&&(f=a[d-o]),p=n[d*2],e.opt_len+=p*(A+f),s&&(e.static_len+=p*(i[d*2+1]+f)));if(m!==0){do{for(A=c-1;e.bl_count[A]===0;)A--;e.bl_count[A]--,e.bl_count[A+1]+=2,e.bl_count[c]--,m-=2}while(m>0);for(A=c;A!==0;A--)for(d=e.bl_count[A];d!==0;)h=e.heap[--u],!(h>r)&&(n[h*2+1]!==A&&(e.opt_len+=(A-n[h*2+1])*n[h*2],n[h*2+1]=A),d--)}},uve=(e,t,n)=>{const r=new Array(lp+1);let i=0,s,a;for(s=1;s<=lp;s++)i=i+n[s-1]<<1,r[s]=i;for(a=0;a<=t;a++){let o=e[a*2+1];o!==0&&(e[a*2]=cve(r[o]++,o))}},FCt=()=>{let e,t,n,r,i;const s=new Array(lp+1);for(n=0,r=0;r<p$-1;r++)for(y$[r]=n,e=0;e<1<<jR[r];e++)e2[n++]=r;for(e2[n-1]=r,i=0,r=0;r<16;r++)for(IN[r]=i,e=0;e<1<<S_[r];e++)Z1[i++]=r;for(i>>=7;r<My;r++)for(IN[r]=i<<7,e=0;e<1<<S_[r]-7;e++)Z1[256+i++]=r;for(t=0;t<=lp;t++)s[t]=0;for(e=0;e<=143;)Gu[e*2+1]=8,e++,s[8]++;for(;e<=255;)Gu[e*2+1]=9,e++,s[9]++;for(;e<=279;)Gu[e*2+1]=7,e++,s[7]++;for(;e<=287;)Gu[e*2+1]=8,e++,s[8]++;for(uve(Gu,J1+1,s),e=0;e<My;e++)ab[e*2+1]=5,ab[e*2]=cve(e,5);sve=new W4(Gu,jR,nC+1,J1,lp),ave=new W4(ab,S_,0,My,lp),ove=new W4(new Array(0),TCt,0,m$,ECt)},dve=e=>{let t;for(t=0;t<J1;t++)e.dyn_ltree[t*2]=0;for(t=0;t<My;t++)e.dyn_dtree[t*2]=0;for(t=0;t<m$;t++)e.bl_tree[t*2]=0;e.dyn_ltree[g$*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},hve=e=>{e.bi_valid>8?t2(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},hJ=(e,t,n,r)=>{const i=t*2,s=n*2;return e[i]<e[s]||e[i]===e[s]&&r[t]<=r[n]},Y4=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&hJ(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!hJ(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},fJ=(e,t,n)=>{let r,i,s=0,a,o;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+s++]&255,r+=(e.pending_buf[e.sym_buf+s++]&255)<<8,i=e.pending_buf[e.sym_buf+s++],r===0?Yc(e,i,t):(a=e2[i],Yc(e,a+nC+1,t),o=jR[a],o!==0&&(i-=y$[a],Ya(e,i,o)),r--,a=lve(r),Yc(e,a,n),o=S_[a],o!==0&&(r-=IN[a],Ya(e,r,o)));while(s<e.sym_next);Yc(e,g$,t)},BR=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,s=t.stat_desc.elems;let a,o,c=-1,u;for(e.heap_len=0,e.heap_max=eve,a=0;a<s;a++)n[a*2]!==0?(e.heap[++e.heap_len]=c=a,e.depth[a]=0):n[a*2+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=c<2?++c:0,n[u*2]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=r[u*2+1]);for(t.max_code=c,a=e.heap_len>>1;a>=1;a--)Y4(e,n,a);u=s;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Y4(e,n,1),o=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=o,n[u*2]=n[a*2]+n[o*2],e.depth[u]=(e.depth[a]>=e.depth[o]?e.depth[a]:e.depth[o])+1,n[a*2+1]=n[o*2+1]=u,e.heap[1]=u++,Y4(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],OCt(e,t),uve(n,c,e.bl_count)},AJ=(e,t,n)=>{let r,i=-1,s,a=t[0*2+1],o=0,c=7,u=4;for(a===0&&(c=138,u=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)s=a,a=t[(r+1)*2+1],!(++o<c&&s===a)&&(o<u?e.bl_tree[s*2]+=o:s!==0?(s!==i&&e.bl_tree[s*2]++,e.bl_tree[tve*2]++):o<=10?e.bl_tree[nve*2]++:e.bl_tree[rve*2]++,o=0,i=s,a===0?(c=138,u=3):s===a?(c=6,u=3):(c=7,u=4))},pJ=(e,t,n)=>{let r,i=-1,s,a=t[0*2+1],o=0,c=7,u=4;for(a===0&&(c=138,u=3),r=0;r<=n;r++)if(s=a,a=t[(r+1)*2+1],!(++o<c&&s===a)){if(o<u)do Yc(e,s,e.bl_tree);while(--o!==0);else s!==0?(s!==i&&(Yc(e,s,e.bl_tree),o--),Yc(e,tve,e.bl_tree),Ya(e,o-3,2)):o<=10?(Yc(e,nve,e.bl_tree),Ya(e,o-3,3)):(Yc(e,rve,e.bl_tree),Ya(e,o-11,7));o=0,i=s,a===0?(c=138,u=3):s===a?(c=6,u=3):(c=7,u=4)}},MCt=e=>{let t;for(AJ(e,e.dyn_ltree,e.l_desc.max_code),AJ(e,e.dyn_dtree,e.d_desc.max_code),BR(e,e.bl_desc),t=m$-1;t>=3&&e.bl_tree[ive[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},LCt=(e,t,n,r)=>{let i;for(Ya(e,t-257,5),Ya(e,n-1,5),Ya(e,r-4,4),i=0;i<r;i++)Ya(e,e.bl_tree[ive[i]*2+1],3);pJ(e,e.dyn_ltree,t-1),pJ(e,e.dyn_dtree,n-1)},RCt=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return uJ;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return dJ;for(n=32;n<nC;n++)if(e.dyn_ltree[n*2]!==0)return dJ;return uJ};let mJ=!1;const DCt=e=>{mJ||(FCt(),mJ=!0),e.l_desc=new G4(e.dyn_ltree,sve),e.d_desc=new G4(e.dyn_dtree,ave),e.bl_desc=new G4(e.bl_tree,ove),e.bi_buf=0,e.bi_valid=0,dve(e)},fve=(e,t,n,r)=>{Ya(e,(_Ct<<1)+(r?1:0),3),hve(e),t2(e,n),t2(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},UCt=e=>{Ya(e,Zye<<1,3),Yc(e,g$,Gu),ICt(e)},HCt=(e,t,n,r)=>{let i,s,a=0;e.level>0?(e.strm.data_type===kCt&&(e.strm.data_type=RCt(e)),BR(e,e.l_desc),BR(e,e.d_desc),a=MCt(e),i=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=i&&(i=s)):i=s=n+5,n+4<=i&&t!==-1?fve(e,t,n,r):e.strategy===SCt||s===i?(Ya(e,(Zye<<1)+(r?1:0),3),fJ(e,Gu,ab)):(Ya(e,(jCt<<1)+(r?1:0),3),LCt(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),fJ(e,e.dyn_ltree,e.dyn_dtree)),dve(e),r&&hve(e)},QCt=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(e2[n]+nC+1)*2]++,e.dyn_dtree[lve(t)*2]++),e.sym_next===e.sym_end);var $Ct=DCt,zCt=fve,VCt=HCt,KCt=QCt,qCt=UCt,WCt={_tr_init:$Ct,_tr_stored_block:zCt,_tr_flush_block:VCt,_tr_tally:KCt,_tr_align:qCt};const GCt=(e,t,n,r)=>{let i=e&65535|0,s=e>>>16&65535|0,a=0;for(;n!==0;){a=n>2e3?2e3:n,n-=a;do i=i+t[r++]|0,s=s+i|0;while(--a);i%=65521,s%=65521}return i|s<<16|0};var n2=GCt;const YCt=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},XCt=new Uint32Array(YCt()),JCt=(e,t,n,r)=>{const i=XCt,s=r+n;e^=-1;for(let a=r;a<s;a++)e=e>>>8^i[(e^t[a])&255];return e^-1};var es=JCt,Kv={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"},rC={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:ZCt,_tr_stored_block:NR,_tr_flush_block:eSt,_tr_tally:vf,_tr_align:tSt}=WCt,{Z_NO_FLUSH:xf,Z_PARTIAL_FLUSH:nSt,Z_FULL_FLUSH:rSt,Z_FINISH:dl,Z_BLOCK:gJ,Z_OK:bs,Z_STREAM_END:yJ,Z_STREAM_ERROR:lu,Z_DATA_ERROR:iSt,Z_BUF_ERROR:X4,Z_DEFAULT_COMPRESSION:sSt,Z_FILTERED:aSt,Z_HUFFMAN_ONLY:ok,Z_RLE:oSt,Z_FIXED:lSt,Z_DEFAULT_STRATEGY:cSt,Z_UNKNOWN:uSt,Z_DEFLATED:AT}=rC,dSt=9,hSt=15,fSt=8,ASt=29,pSt=256,ER=pSt+1+ASt,mSt=30,gSt=19,ySt=2*ER+1,vSt=15,_n=3,Wh=258,cu=Wh+_n+1,xSt=32,qv=42,v$=57,TR=69,PR=73,IR=91,OR=103,cp=113,dw=666,ka=1,M0=2,um=3,L0=4,wSt=3,up=(e,t)=>(e.msg=Kv[t],t),vJ=e=>e*2-(e>4?9:0),Bh=e=>{let t=e.length;for(;--t>=0;)e[t]=0},bSt=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)};let CSt=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,wf=CSt;const bo=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},Po=(e,t)=>{eSt(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,bo(e.strm)},Dn=(e,t)=>{e.pending_buf[e.pending++]=t},zx=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},FR=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=n2(e.adler,t,i,n):e.state.wrap===2&&(e.adler=es(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},Ave=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,s,a=e.prev_length,o=e.nice_match;const c=e.strstart>e.w_size-cu?e.strstart-(e.w_size-cu):0,u=e.window,d=e.w_mask,h=e.prev,A=e.strstart+Wh;let f=u[r+a-1],p=u[r+a];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do if(i=t,!(u[i+a]!==p||u[i+a-1]!==f||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&r<A);if(s=Wh-(A-r),r=A-Wh,s>a){if(e.match_start=t,a=s,s>=o)break;f=u[r+a-1],p=u[r+a]}}while((t=h[t&d])>c&&--n!==0);return a<=e.lookahead?a:e.lookahead},Wv=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-cu)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),bSt(e),r+=t),e.strm.avail_in===0)break;if(n=FR(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=_n)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=wf(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=wf(e,e.ins_h,e.window[i+_n-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<_n)););}while(e.lookahead<cu&&e.strm.avail_in!==0)},pve=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,s,a=0,o=e.strm.avail_in;do{if(r=65535,s=e.bi_valid+42>>3,e.strm.avail_out<s||(s=e.strm.avail_out-s,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>s&&(r=s),r<n&&(r===0&&t!==dl||t===xf||r!==i+e.strm.avail_in)))break;a=t===dl&&r===i+e.strm.avail_in?1:0,NR(e,0,0,a),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,bo(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(FR(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(a===0);return o-=e.strm.avail_in,o&&(o>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=o&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-o,e.strm.next_in),e.strstart),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?L0:t!==xf&&t!==dl&&e.strm.avail_in===0&&e.strstart===e.block_start?M0:(s=e.window_size-e.strstart,e.strm.avail_in>s&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,s+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),s>e.strm.avail_in&&(s=e.strm.avail_in),s&&(FR(e.strm,e.window,e.strstart,s),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.high_water<e.strstart&&(e.high_water=e.strstart),s=e.bi_valid+42>>3,s=e.pending_buf_size-s>65535?65535:e.pending_buf_size-s,n=s>e.w_size?e.w_size:s,i=e.strstart-e.block_start,(i>=n||(i||t===dl)&&t!==xf&&e.strm.avail_in===0&&i<=s)&&(r=i>s?s:i,a=t===dl&&e.strm.avail_in===0&&r===i?1:0,NR(e,e.block_start,r,a),e.block_start+=r,bo(e.strm)),a?um:ka)},J4=(e,t)=>{let n,r;for(;;){if(e.lookahead<cu){if(Wv(e),e.lookahead<cu&&t===xf)return ka;if(e.lookahead===0)break}if(n=0,e.lookahead>=_n&&(e.ins_h=wf(e,e.ins_h,e.window[e.strstart+_n-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-cu&&(e.match_length=Ave(e,n)),e.match_length>=_n)if(r=vf(e,e.strstart-e.match_start,e.match_length-_n),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=_n){e.match_length--;do e.strstart++,e.ins_h=wf(e,e.ins_h,e.window[e.strstart+_n-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=wf(e,e.ins_h,e.window[e.strstart+1]);else r=vf(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Po(e,!1),e.strm.avail_out===0))return ka}return e.insert=e.strstart<_n-1?e.strstart:_n-1,t===dl?(Po(e,!0),e.strm.avail_out===0?um:L0):e.sym_next&&(Po(e,!1),e.strm.avail_out===0)?ka:M0},bg=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<cu){if(Wv(e),e.lookahead<cu&&t===xf)return ka;if(e.lookahead===0)break}if(n=0,e.lookahead>=_n&&(e.ins_h=wf(e,e.ins_h,e.window[e.strstart+_n-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=_n-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-cu&&(e.match_length=Ave(e,n),e.match_length<=5&&(e.strategy===aSt||e.match_length===_n&&e.strstart-e.match_start>4096)&&(e.match_length=_n-1)),e.prev_length>=_n&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-_n,r=vf(e,e.strstart-1-e.prev_match,e.prev_length-_n),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=wf(e,e.ins_h,e.window[e.strstart+_n-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=_n-1,e.strstart++,r&&(Po(e,!1),e.strm.avail_out===0))return ka}else if(e.match_available){if(r=vf(e,0,e.window[e.strstart-1]),r&&Po(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return ka}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=vf(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<_n-1?e.strstart:_n-1,t===dl?(Po(e,!0),e.strm.avail_out===0?um:L0):e.sym_next&&(Po(e,!1),e.strm.avail_out===0)?ka:M0},SSt=(e,t)=>{let n,r,i,s;const a=e.window;for(;;){if(e.lookahead<=Wh){if(Wv(e),e.lookahead<=Wh&&t===xf)return ka;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=_n&&e.strstart>0&&(i=e.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){s=e.strstart+Wh;do;while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<s);e.match_length=Wh-(s-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=_n?(n=vf(e,1,e.match_length-_n),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=vf(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Po(e,!1),e.strm.avail_out===0))return ka}return e.insert=0,t===dl?(Po(e,!0),e.strm.avail_out===0?um:L0):e.sym_next&&(Po(e,!1),e.strm.avail_out===0)?ka:M0},kSt=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Wv(e),e.lookahead===0)){if(t===xf)return ka;break}if(e.match_length=0,n=vf(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Po(e,!1),e.strm.avail_out===0))return ka}return e.insert=0,t===dl?(Po(e,!0),e.strm.avail_out===0?um:L0):e.sym_next&&(Po(e,!1),e.strm.avail_out===0)?ka:M0};function Rc(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const hw=[new Rc(0,0,0,0,pve),new Rc(4,4,8,4,J4),new Rc(4,5,16,8,J4),new Rc(4,6,32,32,J4),new Rc(4,4,16,16,bg),new Rc(8,16,32,32,bg),new Rc(8,16,128,128,bg),new Rc(8,32,128,256,bg),new Rc(32,128,258,1024,bg),new Rc(32,258,258,4096,bg)],_St=e=>{e.window_size=2*e.w_size,Bh(e.head),e.max_lazy_match=hw[e.level].max_lazy,e.good_match=hw[e.level].good_length,e.nice_match=hw[e.level].nice_length,e.max_chain_length=hw[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=_n-1,e.match_available=0,e.ins_h=0};function jSt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=AT,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(ySt*2),this.dyn_dtree=new Uint16Array((2*mSt+1)*2),this.bl_tree=new Uint16Array((2*gSt+1)*2),Bh(this.dyn_ltree),Bh(this.dyn_dtree),Bh(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(vSt+1),this.heap=new Uint16Array(2*ER+1),Bh(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*ER+1),Bh(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const iC=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==qv&&t.status!==v$&&t.status!==TR&&t.status!==PR&&t.status!==IR&&t.status!==OR&&t.status!==cp&&t.status!==dw?1:0},mve=e=>{if(iC(e))return up(e,lu);e.total_in=e.total_out=0,e.data_type=uSt;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?v$:t.wrap?qv:cp,e.adler=t.wrap===2?0:1,t.last_flush=-2,ZCt(t),bs},gve=e=>{const t=mve(e);return t===bs&&_St(e.state),t},BSt=(e,t)=>iC(e)||e.state.wrap!==2?lu:(e.state.gzhead=t,bs),yve=(e,t,n,r,i,s)=>{if(!e)return lu;let a=1;if(t===sSt&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>dSt||n!==AT||r<8||r>15||t<0||t>9||s<0||s>lSt||r===8&&a!==1)return up(e,lu);r===8&&(r=9);const o=new jSt;return e.state=o,o.strm=e,o.status=qv,o.wrap=a,o.gzhead=null,o.w_bits=r,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+_n-1)/_n),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=(o.lit_bufsize-1)*3,o.level=t,o.strategy=s,o.method=n,gve(e)},NSt=(e,t)=>yve(e,t,AT,hSt,fSt,cSt),ESt=(e,t)=>{if(iC(e)||t>gJ||t<0)return e?up(e,lu):lu;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===dw&&t!==dl)return up(e,e.avail_out===0?X4:lu);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(bo(e),e.avail_out===0)return n.last_flush=-1,bs}else if(e.avail_in===0&&vJ(t)<=vJ(r)&&t!==dl)return up(e,X4);if(n.status===dw&&e.avail_in!==0)return up(e,X4);if(n.status===qv&&n.wrap===0&&(n.status=cp),n.status===qv){let i=AT+(n.w_bits-8<<4)<<8,s=-1;if(n.strategy>=ok||n.level<2?s=0:n.level<6?s=1:n.level===6?s=2:s=3,i|=s<<6,n.strstart!==0&&(i|=xSt),i+=31-i%31,zx(n,i),n.strstart!==0&&(zx(n,e.adler>>>16),zx(n,e.adler&65535)),e.adler=1,n.status=cp,bo(e),n.pending!==0)return n.last_flush=-1,bs}if(n.status===v$){if(e.adler=0,Dn(n,31),Dn(n,139),Dn(n,8),n.gzhead)Dn(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Dn(n,n.gzhead.time&255),Dn(n,n.gzhead.time>>8&255),Dn(n,n.gzhead.time>>16&255),Dn(n,n.gzhead.time>>24&255),Dn(n,n.level===9?2:n.strategy>=ok||n.level<2?4:0),Dn(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Dn(n,n.gzhead.extra.length&255),Dn(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=es(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=TR;else if(Dn(n,0),Dn(n,0),Dn(n,0),Dn(n,0),Dn(n,0),Dn(n,n.level===9?2:n.strategy>=ok||n.level<2?4:0),Dn(n,wSt),n.status=cp,bo(e),n.pending!==0)return n.last_flush=-1,bs}if(n.status===TR){if(n.gzhead.extra){let i=n.pending,s=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+s>n.pending_buf_size;){let o=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=es(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=o,bo(e),n.pending!==0)return n.last_flush=-1,bs;i=0,s-=o}let a=new Uint8Array(n.gzhead.extra);n.pending_buf.set(a.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending+=s,n.gzhead.hcrc&&n.pending>i&&(e.adler=es(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=PR}if(n.status===PR){if(n.gzhead.name){let i=n.pending,s;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=es(e.adler,n.pending_buf,n.pending-i,i)),bo(e),n.pending!==0)return n.last_flush=-1,bs;i=0}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,Dn(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=es(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=IR}if(n.status===IR){if(n.gzhead.comment){let i=n.pending,s;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=es(e.adler,n.pending_buf,n.pending-i,i)),bo(e),n.pending!==0)return n.last_flush=-1,bs;i=0}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,Dn(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=es(e.adler,n.pending_buf,n.pending-i,i))}n.status=OR}if(n.status===OR){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(bo(e),n.pending!==0))return n.last_flush=-1,bs;Dn(n,e.adler&255),Dn(n,e.adler>>8&255),e.adler=0}if(n.status=cp,bo(e),n.pending!==0)return n.last_flush=-1,bs}if(e.avail_in!==0||n.lookahead!==0||t!==xf&&n.status!==dw){let i=n.level===0?pve(n,t):n.strategy===ok?kSt(n,t):n.strategy===oSt?SSt(n,t):hw[n.level].func(n,t);if((i===um||i===L0)&&(n.status=dw),i===ka||i===um)return e.avail_out===0&&(n.last_flush=-1),bs;if(i===M0&&(t===nSt?tSt(n):t!==gJ&&(NR(n,0,0,!1),t===rSt&&(Bh(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),bo(e),e.avail_out===0))return n.last_flush=-1,bs}return t!==dl?bs:n.wrap<=0?yJ:(n.wrap===2?(Dn(n,e.adler&255),Dn(n,e.adler>>8&255),Dn(n,e.adler>>16&255),Dn(n,e.adler>>24&255),Dn(n,e.total_in&255),Dn(n,e.total_in>>8&255),Dn(n,e.total_in>>16&255),Dn(n,e.total_in>>24&255)):(zx(n,e.adler>>>16),zx(n,e.adler&65535)),bo(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?bs:yJ)},TSt=e=>{if(iC(e))return lu;const t=e.state.status;return e.state=null,t===cp?up(e,iSt):bs},PSt=(e,t)=>{let n=t.length;if(iC(e))return lu;const r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==qv||r.lookahead)return lu;if(i===1&&(e.adler=n2(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Bh(r.head),r.strstart=0,r.block_start=0,r.insert=0);let c=new Uint8Array(r.w_size);c.set(t.subarray(n-r.w_size,n),0),t=c,n=r.w_size}const s=e.avail_in,a=e.next_in,o=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Wv(r);r.lookahead>=_n;){let c=r.strstart,u=r.lookahead-(_n-1);do r.ins_h=wf(r,r.ins_h,r.window[c+_n-1]),r.prev[c&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=c,c++;while(--u);r.strstart=c,r.lookahead=_n-1,Wv(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=_n-1,r.match_available=0,e.next_in=a,e.input=o,e.avail_in=s,r.wrap=i,bs};var ISt=NSt,OSt=yve,FSt=gve,MSt=mve,LSt=BSt,RSt=ESt,DSt=TSt,USt=PSt,HSt="pako deflate (from Nodeca project)",ob={deflateInit:ISt,deflateInit2:OSt,deflateReset:FSt,deflateResetKeep:MSt,deflateSetHeader:LSt,deflate:RSt,deflateEnd:DSt,deflateSetDictionary:USt,deflateInfo:HSt};const QSt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var $St=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)QSt(n,r)&&(e[r]=n[r])}}return e},zSt=e=>{let t=0;for(let r=0,i=e.length;r<i;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,i=0,s=e.length;r<s;r++){let a=e[r];n.set(a,i),i+=a.length}return n},pT={assign:$St,flattenChunks:zSt};let vve=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{vve=!1}const r2=new Uint8Array(256);for(let e=0;e<256;e++)r2[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;r2[254]=r2[254]=1;var VSt=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,s,a=e.length,o=0;for(i=0;i<a;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<a&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),o+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(o),s=0,i=0;s<o;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<a&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[s++]=n:n<2048?(t[s++]=192|n>>>6,t[s++]=128|n&63):n<65536?(t[s++]=224|n>>>12,t[s++]=128|n>>>6&63,t[s++]=128|n&63):(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63,t[s++]=128|n>>>6&63,t[s++]=128|n&63);return t};const KSt=(e,t)=>{if(t<65534&&e.subarray&&vve)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var qSt=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,i;const s=new Array(n*2);for(i=0,r=0;r<n;){let a=e[r++];if(a<128){s[i++]=a;continue}let o=r2[a];if(o>4){s[i++]=65533,r+=o-1;continue}for(a&=o===2?31:o===3?15:7;o>1&&r<n;)a=a<<6|e[r++]&63,o--;if(o>1){s[i++]=65533;continue}a<65536?s[i++]=a:(a-=65536,s[i++]=55296|a>>10&1023,s[i++]=56320|a&1023)}return KSt(s,i)},WSt=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+r2[e[n]]>t?n:t},i2={string2buf:VSt,buf2string:qSt,utf8border:WSt};function GSt(){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 xve=GSt;const wve=Object.prototype.toString,{Z_NO_FLUSH:YSt,Z_SYNC_FLUSH:XSt,Z_FULL_FLUSH:JSt,Z_FINISH:ZSt,Z_OK:ON,Z_STREAM_END:ekt,Z_DEFAULT_COMPRESSION:tkt,Z_DEFAULT_STRATEGY:nkt,Z_DEFLATED:rkt}=rC;function x$(e){this.options=pT.assign({level:tkt,method:rkt,chunkSize:16384,windowBits:15,memLevel:8,strategy:nkt},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new xve,this.strm.avail_out=0;let n=ob.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==ON)throw new Error(Kv[n]);if(t.header&&ob.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=i2.string2buf(t.dictionary):wve.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=ob.deflateSetDictionary(this.strm,r),n!==ON)throw new Error(Kv[n]);this._dict_set=!0}}x$.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,s;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?ZSt:YSt,typeof e=="string"?n.input=i2.string2buf(e):wve.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(s===XSt||s===JSt)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=ob.deflate(n,s),i===ekt)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=ob.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===ON;if(n.avail_out===0){this.onData(n.output);continue}if(s>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};x$.prototype.onData=function(e){this.chunks.push(e)};x$.prototype.onEnd=function(e){e===ON&&(this.result=pT.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const lk=16209,ikt=16191;var skt=function(t,n){let r,i,s,a,o,c,u,d,h,A,f,p,m,g,y,v,x,w,b,k,j,B,E,I;const T=t.state;r=t.next_in,E=t.input,i=r+(t.avail_in-5),s=t.next_out,I=t.output,a=s-(n-t.avail_out),o=s+(t.avail_out-257),c=T.dmax,u=T.wsize,d=T.whave,h=T.wnext,A=T.window,f=T.hold,p=T.bits,m=T.lencode,g=T.distcode,y=(1<<T.lenbits)-1,v=(1<<T.distbits)-1;e:do{p<15&&(f+=E[r++]<<p,p+=8,f+=E[r++]<<p,p+=8),x=m[f&y];t:for(;;){if(w=x>>>24,f>>>=w,p-=w,w=x>>>16&255,w===0)I[s++]=x&65535;else if(w&16){b=x&65535,w&=15,w&&(p<w&&(f+=E[r++]<<p,p+=8),b+=f&(1<<w)-1,f>>>=w,p-=w),p<15&&(f+=E[r++]<<p,p+=8,f+=E[r++]<<p,p+=8),x=g[f&v];n:for(;;){if(w=x>>>24,f>>>=w,p-=w,w=x>>>16&255,w&16){if(k=x&65535,w&=15,p<w&&(f+=E[r++]<<p,p+=8,p<w&&(f+=E[r++]<<p,p+=8)),k+=f&(1<<w)-1,k>c){t.msg="invalid distance too far back",T.mode=lk;break e}if(f>>>=w,p-=w,w=s-a,k>w){if(w=k-w,w>d&&T.sane){t.msg="invalid distance too far back",T.mode=lk;break e}if(j=0,B=A,h===0){if(j+=u-w,w<b){b-=w;do I[s++]=A[j++];while(--w);j=s-k,B=I}}else if(h<w){if(j+=u+h-w,w-=h,w<b){b-=w;do I[s++]=A[j++];while(--w);if(j=0,h<b){w=h,b-=w;do I[s++]=A[j++];while(--w);j=s-k,B=I}}}else if(j+=h-w,w<b){b-=w;do I[s++]=A[j++];while(--w);j=s-k,B=I}for(;b>2;)I[s++]=B[j++],I[s++]=B[j++],I[s++]=B[j++],b-=3;b&&(I[s++]=B[j++],b>1&&(I[s++]=B[j++]))}else{j=s-k;do I[s++]=I[j++],I[s++]=I[j++],I[s++]=I[j++],b-=3;while(b>2);b&&(I[s++]=I[j++],b>1&&(I[s++]=I[j++]))}}else if(w&64){t.msg="invalid distance code",T.mode=lk;break e}else{x=g[(x&65535)+(f&(1<<w)-1)];continue n}break}}else if(w&64)if(w&32){T.mode=ikt;break e}else{t.msg="invalid literal/length code",T.mode=lk;break e}else{x=m[(x&65535)+(f&(1<<w)-1)];continue t}break}}while(r<i&&s<o);b=p>>3,r-=b,p-=b<<3,f&=(1<<p)-1,t.next_in=r,t.next_out=s,t.avail_in=r<i?5+(i-r):5-(r-i),t.avail_out=s<o?257+(o-s):257-(s-o),T.hold=f,T.bits=p};const Cg=15,xJ=852,wJ=592,bJ=0,Z4=1,CJ=2,akt=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]),okt=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]),lkt=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]),ckt=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]),ukt=(e,t,n,r,i,s,a,o)=>{const c=o.bits;let u=0,d=0,h=0,A=0,f=0,p=0,m=0,g=0,y=0,v=0,x,w,b,k,j,B=null,E;const I=new Uint16Array(Cg+1),T=new Uint16Array(Cg+1);let N=null,F,L,U;for(u=0;u<=Cg;u++)I[u]=0;for(d=0;d<r;d++)I[t[n+d]]++;for(f=c,A=Cg;A>=1&&I[A]===0;A--);if(f>A&&(f=A),A===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,o.bits=1,0;for(h=1;h<A&&I[h]===0;h++);for(f<h&&(f=h),g=1,u=1;u<=Cg;u++)if(g<<=1,g-=I[u],g<0)return-1;if(g>0&&(e===bJ||A!==1))return-1;for(T[1]=0,u=1;u<Cg;u++)T[u+1]=T[u]+I[u];for(d=0;d<r;d++)t[n+d]!==0&&(a[T[t[n+d]]++]=d);if(e===bJ?(B=N=a,E=20):e===Z4?(B=akt,N=okt,E=257):(B=lkt,N=ckt,E=0),v=0,d=0,u=h,j=s,p=f,m=0,b=-1,y=1<<f,k=y-1,e===Z4&&y>xJ||e===CJ&&y>wJ)return 1;for(;;){F=u-m,a[d]+1<E?(L=0,U=a[d]):a[d]>=E?(L=N[a[d]-E],U=B[a[d]-E]):(L=96,U=0),x=1<<u-m,w=1<<p,h=w;do w-=x,i[j+(v>>m)+w]=F<<24|L<<16|U|0;while(w!==0);for(x=1<<u-1;v&x;)x>>=1;if(x!==0?(v&=x-1,v+=x):v=0,d++,--I[u]===0){if(u===A)break;u=t[n+a[d]]}if(u>f&&(v&k)!==b){for(m===0&&(m=f),j+=h,p=u-m,g=1<<p;p+m<A&&(g-=I[p+m],!(g<=0));)p++,g<<=1;if(y+=1<<p,e===Z4&&y>xJ||e===CJ&&y>wJ)return 1;b=v&k,i[b]=f<<24|p<<16|j-s|0}}return v!==0&&(i[j+v]=u-m<<24|64<<16|0),o.bits=f,0};var lb=ukt;const dkt=0,bve=1,Cve=2,{Z_FINISH:SJ,Z_BLOCK:hkt,Z_TREES:ck,Z_OK:dm,Z_STREAM_END:fkt,Z_NEED_DICT:Akt,Z_STREAM_ERROR:Nl,Z_DATA_ERROR:Sve,Z_MEM_ERROR:kve,Z_BUF_ERROR:pkt,Z_DEFLATED:kJ}=rC,mT=16180,_J=16181,jJ=16182,BJ=16183,NJ=16184,EJ=16185,TJ=16186,PJ=16187,IJ=16188,OJ=16189,FN=16190,Uu=16191,eO=16192,FJ=16193,tO=16194,MJ=16195,LJ=16196,RJ=16197,DJ=16198,uk=16199,dk=16200,UJ=16201,HJ=16202,QJ=16203,$J=16204,zJ=16205,nO=16206,VJ=16207,KJ=16208,Tr=16209,_ve=16210,jve=16211,mkt=852,gkt=592,ykt=15,vkt=ykt,qJ=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function xkt(){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 Nm=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<mT||t.mode>jve?1:0},Bve=e=>{if(Nm(e))return Nl;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=mT,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(mkt),t.distcode=t.distdyn=new Int32Array(gkt),t.sane=1,t.back=-1,dm},Nve=e=>{if(Nm(e))return Nl;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Bve(e)},Eve=(e,t)=>{let n;if(Nm(e))return Nl;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Nl:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,Nve(e))},Tve=(e,t)=>{if(!e)return Nl;const n=new xkt;e.state=n,n.strm=e,n.window=null,n.mode=mT;const r=Eve(e,t);return r!==dm&&(e.state=null),r},wkt=e=>Tve(e,vkt);let WJ=!0,rO,iO;const bkt=e=>{if(WJ){rO=new Int32Array(512),iO=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(lb(bve,e.lens,0,288,rO,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;lb(Cve,e.lens,0,32,iO,0,e.work,{bits:5}),WJ=!1}e.lencode=rO,e.lenbits=9,e.distcode=iO,e.distbits=5},Pve=(e,t,n,r)=>{let i;const s=e.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),r>=s.wsize?(s.window.set(t.subarray(n-s.wsize,n),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),s.window.set(t.subarray(n-r,n-r+i),s.wnext),r-=i,r?(s.window.set(t.subarray(n-r,n),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0},Ckt=(e,t)=>{let n,r,i,s,a,o,c,u,d,h,A,f,p,m,g=0,y,v,x,w,b,k,j,B;const E=new Uint8Array(4);let I,T;const N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Nm(e)||!e.output||!e.input&&e.avail_in!==0)return Nl;n=e.state,n.mode===Uu&&(n.mode=eO),a=e.next_out,i=e.output,c=e.avail_out,s=e.next_in,r=e.input,o=e.avail_in,u=n.hold,d=n.bits,h=o,A=c,B=dm;e:for(;;)switch(n.mode){case mT:if(n.wrap===0){n.mode=eO;break}for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.wrap&2&&u===35615){n.wbits===0&&(n.wbits=15),n.check=0,E[0]=u&255,E[1]=u>>>8&255,n.check=es(n.check,E,2,0),u=0,d=0,n.mode=_J;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=Tr;break}if((u&15)!==kJ){e.msg="unknown compression method",n.mode=Tr;break}if(u>>>=4,d-=4,j=(u&15)+8,n.wbits===0&&(n.wbits=j),j>15||j>n.wbits){e.msg="invalid window size",n.mode=Tr;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=u&512?OJ:Uu,u=0,d=0;break;case _J:for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.flags=u,(n.flags&255)!==kJ){e.msg="unknown compression method",n.mode=Tr;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Tr;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&n.wrap&4&&(E[0]=u&255,E[1]=u>>>8&255,n.check=es(n.check,E,2,0)),u=0,d=0,n.mode=jJ;case jJ:for(;d<32;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.head&&(n.head.time=u),n.flags&512&&n.wrap&4&&(E[0]=u&255,E[1]=u>>>8&255,E[2]=u>>>16&255,E[3]=u>>>24&255,n.check=es(n.check,E,4,0)),u=0,d=0,n.mode=BJ;case BJ:for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&n.wrap&4&&(E[0]=u&255,E[1]=u>>>8&255,n.check=es(n.check,E,2,0)),u=0,d=0,n.mode=NJ;case NJ:if(n.flags&1024){for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&n.wrap&4&&(E[0]=u&255,E[1]=u>>>8&255,n.check=es(n.check,E,2,0)),u=0,d=0}else n.head&&(n.head.extra=null);n.mode=EJ;case EJ:if(n.flags&1024&&(f=n.length,f>o&&(f=o),f&&(n.head&&(j=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(s,s+f),j)),n.flags&512&&n.wrap&4&&(n.check=es(n.check,r,f,s)),o-=f,s+=f,n.length-=f),n.length))break e;n.length=0,n.mode=TJ;case TJ:if(n.flags&2048){if(o===0)break e;f=0;do j=r[s+f++],n.head&&j&&n.length<65536&&(n.head.name+=String.fromCharCode(j));while(j&&f<o);if(n.flags&512&&n.wrap&4&&(n.check=es(n.check,r,f,s)),o-=f,s+=f,j)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=PJ;case PJ:if(n.flags&4096){if(o===0)break e;f=0;do j=r[s+f++],n.head&&j&&n.length<65536&&(n.head.comment+=String.fromCharCode(j));while(j&&f<o);if(n.flags&512&&n.wrap&4&&(n.check=es(n.check,r,f,s)),o-=f,s+=f,j)break e}else n.head&&(n.head.comment=null);n.mode=IJ;case IJ:if(n.flags&512){for(;d<16;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.wrap&4&&u!==(n.check&65535)){e.msg="header crc mismatch",n.mode=Tr;break}u=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Uu;break;case OJ:for(;d<32;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}e.adler=n.check=qJ(u),u=0,d=0,n.mode=FN;case FN:if(n.havedict===0)return e.next_out=a,e.avail_out=c,e.next_in=s,e.avail_in=o,n.hold=u,n.bits=d,Akt;e.adler=n.check=1,n.mode=Uu;case Uu:if(t===hkt||t===ck)break e;case eO:if(n.last){u>>>=d&7,d-=d&7,n.mode=nO;break}for(;d<3;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}switch(n.last=u&1,u>>>=1,d-=1,u&3){case 0:n.mode=FJ;break;case 1:if(bkt(n),n.mode=uk,t===ck){u>>>=2,d-=2;break e}break;case 2:n.mode=LJ;break;case 3:e.msg="invalid block type",n.mode=Tr}u>>>=2,d-=2;break;case FJ:for(u>>>=d&7,d-=d&7;d<32;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Tr;break}if(n.length=u&65535,u=0,d=0,n.mode=tO,t===ck)break e;case tO:n.mode=MJ;case MJ:if(f=n.length,f){if(f>o&&(f=o),f>c&&(f=c),f===0)break e;i.set(r.subarray(s,s+f),a),o-=f,s+=f,c-=f,a+=f,n.length-=f;break}n.mode=Uu;break;case LJ:for(;d<14;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.nlen=(u&31)+257,u>>>=5,d-=5,n.ndist=(u&31)+1,u>>>=5,d-=5,n.ncode=(u&15)+4,u>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Tr;break}n.have=0,n.mode=RJ;case RJ:for(;n.have<n.ncode;){for(;d<3;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.lens[N[n.have++]]=u&7,u>>>=3,d-=3}for(;n.have<19;)n.lens[N[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,I={bits:n.lenbits},B=lb(dkt,n.lens,0,19,n.lencode,0,n.work,I),n.lenbits=I.bits,B){e.msg="invalid code lengths set",n.mode=Tr;break}n.have=0,n.mode=DJ;case DJ:for(;n.have<n.nlen+n.ndist;){for(;g=n.lencode[u&(1<<n.lenbits)-1],y=g>>>24,v=g>>>16&255,x=g&65535,!(y<=d);){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(x<16)u>>>=y,d-=y,n.lens[n.have++]=x;else{if(x===16){for(T=y+2;d<T;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(u>>>=y,d-=y,n.have===0){e.msg="invalid bit length repeat",n.mode=Tr;break}j=n.lens[n.have-1],f=3+(u&3),u>>>=2,d-=2}else if(x===17){for(T=y+3;d<T;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}u>>>=y,d-=y,j=0,f=3+(u&7),u>>>=3,d-=3}else{for(T=y+7;d<T;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}u>>>=y,d-=y,j=0,f=11+(u&127),u>>>=7,d-=7}if(n.have+f>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Tr;break}for(;f--;)n.lens[n.have++]=j}}if(n.mode===Tr)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Tr;break}if(n.lenbits=9,I={bits:n.lenbits},B=lb(bve,n.lens,0,n.nlen,n.lencode,0,n.work,I),n.lenbits=I.bits,B){e.msg="invalid literal/lengths set",n.mode=Tr;break}if(n.distbits=6,n.distcode=n.distdyn,I={bits:n.distbits},B=lb(Cve,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,I),n.distbits=I.bits,B){e.msg="invalid distances set",n.mode=Tr;break}if(n.mode=uk,t===ck)break e;case uk:n.mode=dk;case dk:if(o>=6&&c>=258){e.next_out=a,e.avail_out=c,e.next_in=s,e.avail_in=o,n.hold=u,n.bits=d,skt(e,A),a=e.next_out,i=e.output,c=e.avail_out,s=e.next_in,r=e.input,o=e.avail_in,u=n.hold,d=n.bits,n.mode===Uu&&(n.back=-1);break}for(n.back=0;g=n.lencode[u&(1<<n.lenbits)-1],y=g>>>24,v=g>>>16&255,x=g&65535,!(y<=d);){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(v&&!(v&240)){for(w=y,b=v,k=x;g=n.lencode[k+((u&(1<<w+b)-1)>>w)],y=g>>>24,v=g>>>16&255,x=g&65535,!(w+y<=d);){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}u>>>=w,d-=w,n.back+=w}if(u>>>=y,d-=y,n.back+=y,n.length=x,v===0){n.mode=zJ;break}if(v&32){n.back=-1,n.mode=Uu;break}if(v&64){e.msg="invalid literal/length code",n.mode=Tr;break}n.extra=v&15,n.mode=UJ;case UJ:if(n.extra){for(T=n.extra;d<T;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=HJ;case HJ:for(;g=n.distcode[u&(1<<n.distbits)-1],y=g>>>24,v=g>>>16&255,x=g&65535,!(y<=d);){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(!(v&240)){for(w=y,b=v,k=x;g=n.distcode[k+((u&(1<<w+b)-1)>>w)],y=g>>>24,v=g>>>16&255,x=g&65535,!(w+y<=d);){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}u>>>=w,d-=w,n.back+=w}if(u>>>=y,d-=y,n.back+=y,v&64){e.msg="invalid distance code",n.mode=Tr;break}n.offset=x,n.extra=v&15,n.mode=QJ;case QJ:if(n.extra){for(T=n.extra;d<T;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Tr;break}n.mode=$J;case $J:if(c===0)break e;if(f=A-c,n.offset>f){if(f=n.offset-f,f>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Tr;break}f>n.wnext?(f-=n.wnext,p=n.wsize-f):p=n.wnext-f,f>n.length&&(f=n.length),m=n.window}else m=i,p=a-n.offset,f=n.length;f>c&&(f=c),c-=f,n.length-=f;do i[a++]=m[p++];while(--f);n.length===0&&(n.mode=dk);break;case zJ:if(c===0)break e;i[a++]=n.length,c--,n.mode=dk;break;case nO:if(n.wrap){for(;d<32;){if(o===0)break e;o--,u|=r[s++]<<d,d+=8}if(A-=c,e.total_out+=A,n.total+=A,n.wrap&4&&A&&(e.adler=n.check=n.flags?es(n.check,i,A,a-A):n2(n.check,i,A,a-A)),A=c,n.wrap&4&&(n.flags?u:qJ(u))!==n.check){e.msg="incorrect data check",n.mode=Tr;break}u=0,d=0}n.mode=VJ;case VJ:if(n.wrap&&n.flags){for(;d<32;){if(o===0)break e;o--,u+=r[s++]<<d,d+=8}if(n.wrap&4&&u!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=Tr;break}u=0,d=0}n.mode=KJ;case KJ:B=fkt;break e;case Tr:B=Sve;break e;case _ve:return kve;case jve:default:return Nl}return e.next_out=a,e.avail_out=c,e.next_in=s,e.avail_in=o,n.hold=u,n.bits=d,(n.wsize||A!==e.avail_out&&n.mode<Tr&&(n.mode<nO||t!==SJ))&&Pve(e,e.output,e.next_out,A-e.avail_out),h-=e.avail_in,A-=e.avail_out,e.total_in+=h,e.total_out+=A,n.total+=A,n.wrap&4&&A&&(e.adler=n.check=n.flags?es(n.check,i,A,e.next_out-A):n2(n.check,i,A,e.next_out-A)),e.data_type=n.bits+(n.last?64:0)+(n.mode===Uu?128:0)+(n.mode===uk||n.mode===tO?256:0),(h===0&&A===0||t===SJ)&&B===dm&&(B=pkt),B},Skt=e=>{if(Nm(e))return Nl;let t=e.state;return t.window&&(t.window=null),e.state=null,dm},kkt=(e,t)=>{if(Nm(e))return Nl;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,dm):Nl},_kt=(e,t)=>{const n=t.length;let r,i,s;return Nm(e)||(r=e.state,r.wrap!==0&&r.mode!==FN)?Nl:r.mode===FN&&(i=1,i=n2(i,t,n,0),i!==r.check)?Sve:(s=Pve(e,t,n,n),s?(r.mode=_ve,kve):(r.havedict=1,dm))};var jkt=Nve,Bkt=Eve,Nkt=Bve,Ekt=wkt,Tkt=Tve,Pkt=Ckt,Ikt=Skt,Okt=kkt,Fkt=_kt,Mkt="pako inflate (from Nodeca project)",Yu={inflateReset:jkt,inflateReset2:Bkt,inflateResetKeep:Nkt,inflateInit:Ekt,inflateInit2:Tkt,inflate:Pkt,inflateEnd:Ikt,inflateGetHeader:Okt,inflateSetDictionary:Fkt,inflateInfo:Mkt};function Lkt(){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 Rkt=Lkt;const Ive=Object.prototype.toString,{Z_NO_FLUSH:Dkt,Z_FINISH:Ukt,Z_OK:s2,Z_STREAM_END:sO,Z_NEED_DICT:aO,Z_STREAM_ERROR:Hkt,Z_DATA_ERROR:GJ,Z_MEM_ERROR:Qkt}=rC;function sC(e){this.options=pT.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||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new xve,this.strm.avail_out=0;let n=Yu.inflateInit2(this.strm,t.windowBits);if(n!==s2)throw new Error(Kv[n]);if(this.header=new Rkt,Yu.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=i2.string2buf(t.dictionary):Ive.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Yu.inflateSetDictionary(this.strm,t.dictionary),n!==s2)))throw new Error(Kv[n])}sC.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let s,a,o;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?Ukt:Dkt,Ive.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),s=Yu.inflate(n,a),s===aO&&i&&(s=Yu.inflateSetDictionary(n,i),s===s2?s=Yu.inflate(n,a):s===GJ&&(s=aO));n.avail_in>0&&s===sO&&n.state.wrap>0&&e[n.next_in]!==0;)Yu.inflateReset(n),s=Yu.inflate(n,a);switch(s){case Hkt:case GJ:case aO:case Qkt:return this.onEnd(s),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(n.avail_out===0||s===sO))if(this.options.to==="string"){let c=i2.utf8border(n.output,n.next_out),u=n.next_out-c,d=i2.buf2string(n.output,c);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(c,c+u),0),this.onData(d)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(s===s2&&o===0)){if(s===sO)return s=Yu.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};sC.prototype.onData=function(e){this.chunks.push(e)};sC.prototype.onEnd=function(e){e===s2&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=pT.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function w$(e,t){const n=new sC(t);if(n.push(e),n.err)throw n.msg||Kv[n.err];return n.result}function $kt(e,t){return t=t||{},t.raw=!0,w$(e,t)}var zkt=sC,Vkt=w$,Kkt=$kt,qkt=w$,Wkt=rC,Gkt={Inflate:zkt,inflate:Vkt,inflateRaw:Kkt,ungzip:qkt,constants:Wkt};const{Inflate:Ykt,inflate:Xkt,inflateRaw:yPt,ungzip:vPt}=Gkt;var YJ=Ykt,Jkt=Xkt;const Ove=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=3988292384^t>>>1:t=t>>>1;Ove[e]=t}const XJ=4294967295;function Zkt(e,t,n){let r=e;for(let i=0;i<n;i++)r=Ove[(r^t[i])&255]^r>>>8;return r}function e_t(e,t){return(Zkt(XJ,e,t)^XJ)>>>0}function JJ(e,t,n){const r=e.readUint32(),i=e_t(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(i!==r)throw new Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${i}`)}function Fve(e,t,n){for(let r=0;r<n;r++)t[r]=e[r]}function Mve(e,t,n,r){let i=0;for(;i<r;i++)t[i]=e[i];for(;i<n;i++)t[i]=e[i]+t[i-r]&255}function Lve(e,t,n,r){let i=0;if(n.length===0)for(;i<r;i++)t[i]=e[i];else for(;i<r;i++)t[i]=e[i]+n[i]&255}function Rve(e,t,n,r,i){let s=0;if(n.length===0){for(;s<i;s++)t[s]=e[s];for(;s<r;s++)t[s]=e[s]+(t[s-i]>>1)&255}else{for(;s<i;s++)t[s]=e[s]+(n[s]>>1)&255;for(;s<r;s++)t[s]=e[s]+(t[s-i]+n[s]>>1)&255}}function Dve(e,t,n,r,i){let s=0;if(n.length===0){for(;s<i;s++)t[s]=e[s];for(;s<r;s++)t[s]=e[s]+t[s-i]&255}else{for(;s<i;s++)t[s]=e[s]+n[s]&255;for(;s<r;s++)t[s]=e[s]+t_t(t[s-i],n[s],n[s-i])&255}}function t_t(e,t,n){const r=e+t-n,i=Math.abs(r-e),s=Math.abs(r-t),a=Math.abs(r-n);return i<=s&&i<=a?e:s<=a?t:n}function n_t(e,t,n,r,i,s){switch(e){case 0:Fve(t,n,i);break;case 1:Mve(t,n,i,s);break;case 2:Lve(t,n,r,i);break;case 3:Rve(t,n,r,i,s);break;case 4:Dve(t,n,r,i,s);break;default:throw new Error(`Unsupported filter: ${e}`)}}const r_t=new Uint16Array([255]),i_t=new Uint8Array(r_t.buffer),s_t=i_t[0]===255;function a_t(e){const{data:t,width:n,height:r,channels:i,depth:s}=e,a=[{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}],o=Math.ceil(s/8)*i,c=new Uint8Array(r*n*o);let u=0;for(let d=0;d<7;d++){const h=a[d],A=Math.ceil((n-h.x)/h.xStep),f=Math.ceil((r-h.y)/h.yStep);if(A<=0||f<=0)continue;const p=A*o,m=new Uint8Array(p);for(let g=0;g<f;g++){const y=t[u++],v=t.subarray(u,u+p);u+=p;const x=new Uint8Array(p);n_t(y,v,x,m,p,o),m.set(x);for(let w=0;w<A;w++){const b=h.x+w*h.xStep,k=h.y+g*h.yStep;if(!(b>=n||k>=r))for(let j=0;j<o;j++)c[(k*n+b)*o+j]=x[w*o+j]}}}if(s===16){const d=new Uint16Array(c.buffer);if(s_t)for(let h=0;h<d.length;h++)d[h]=o_t(d[h]);return d}else return c}function o_t(e){return(e&255)<<8|e>>8&255}const l_t=new Uint16Array([255]),c_t=new Uint8Array(l_t.buffer),u_t=c_t[0]===255,d_t=new Uint8Array(0);function ZJ(e){const{data:t,width:n,height:r,channels:i,depth:s}=e,a=Math.ceil(s/8)*i,o=Math.ceil(s/8*i*n),c=new Uint8Array(r*o);let u=d_t,d=0,h,A;for(let f=0;f<r;f++){switch(h=t.subarray(d+1,d+1+o),A=c.subarray(f*o,(f+1)*o),t[d]){case 0:Fve(h,A,o);break;case 1:Mve(h,A,o,a);break;case 2:Lve(h,A,u,o);break;case 3:Rve(h,A,u,o,a);break;case 4:Dve(h,A,u,o,a);break;default:throw new Error(`Unsupported filter: ${t[d]}`)}u=A,d+=o+1}if(s===16){const f=new Uint16Array(c.buffer);if(u_t)for(let p=0;p<f.length;p++)f[p]=h_t(f[p]);return f}else return c}function h_t(e){return(e&255)<<8|e>>8&255}const k_=Uint8Array.of(137,80,78,71,13,10,26,10);function eZ(e){if(!f_t(e.readBytes(k_.length)))throw new Error("wrong PNG signature")}function f_t(e){if(e.length<k_.length)return!1;for(let t=0;t<k_.length;t++)if(e[t]!==k_[t])return!1;return!0}const A_t="tEXt",p_t=0,Uve=new TextDecoder("latin1");function m_t(e){if(y_t(e),e.length===0||e.length>79)throw new Error("keyword length must be between 1 and 79")}const g_t=/^[\u0000-\u00FF]*$/;function y_t(e){if(!g_t.test(e))throw new Error("invalid latin1 text")}function v_t(e,t,n){const r=Hve(t);e[r]=x_t(t,n-r.length-1)}function Hve(e){for(e.mark();e.readByte()!==p_t;);const t=e.offset;e.reset();const n=Uve.decode(e.readBytes(t-e.offset-1));return e.skip(1),m_t(n),n}function x_t(e,t){return Uve.decode(e.readBytes(t))}const mo={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},oO={UNKNOWN:-1,DEFLATE:0},tZ={UNKNOWN:-1,ADAPTIVE:0},lO={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},hk={NONE:0,BACKGROUND:1,PREVIOUS:2},cO={SOURCE:0,OVER:1};class w_t extends A${constructor(n,r={}){super(n);vn(this,"_checkCrc");vn(this,"_inflator");vn(this,"_png");vn(this,"_apng");vn(this,"_end");vn(this,"_hasPalette");vn(this,"_palette");vn(this,"_hasTransparency");vn(this,"_transparency");vn(this,"_compressionMethod");vn(this,"_filterMethod");vn(this,"_interlaceMethod");vn(this,"_colorType");vn(this,"_isAnimated");vn(this,"_numberOfFrames");vn(this,"_numberOfPlays");vn(this,"_frames");vn(this,"_writingDataChunks");const{checkCrc:i=!1}=r;this._checkCrc=i,this._inflator=new YJ,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=oO.UNKNOWN,this._filterMethod=tZ.UNKNOWN,this._interlaceMethod=lO.UNKNOWN,this._colorType=mo.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(eZ(this);!this._end;){const n=this.readUint32(),r=this.readChars(4);this.decodeChunk(n,r)}return this.decodeImage(),this._png}decodeApng(){for(eZ(this);!this._end;){const n=this.readUint32(),r=this.readChars(4);this.decodeApngChunk(n,r)}return this.decodeApngImage(),this._apng}decodeChunk(n,r){const i=this.offset;switch(r){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(n);break;case"IDAT":this.decodeIDAT(n);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(n);break;case"iCCP":this.decodeiCCP(n);break;case A_t:v_t(this._png.text,this,n);break;case"pHYs":this.decodepHYs();break;default:this.skip(n);break}if(this.offset-i!==n)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?JJ(this,n+4,r):this.skip(4)}decodeApngChunk(n,r){const i=this.offset;switch(r!=="fdAT"&&r!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),r){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(n);break;default:this.decodeChunk(n,r),this.offset=i+n;break}if(this.offset-i!==n)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?JJ(this,n+4,r):this.skip(4)}decodeIHDR(){const n=this._png;n.width=this.readUint32(),n.height=this.readUint32(),n.depth=b_t(this.readUint8());const r=this.readUint8();this._colorType=r;let i;switch(r){case mo.GREYSCALE:i=1;break;case mo.TRUECOLOUR:i=3;break;case mo.INDEXED_COLOUR:i=1;break;case mo.GREYSCALE_ALPHA:i=2;break;case mo.TRUECOLOUR_ALPHA:i=4;break;case mo.UNKNOWN:default:throw new Error(`Unknown color type: ${r}`)}if(this._png.channels=i,this._compressionMethod=this.readUint8(),this._compressionMethod!==oO.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 n={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(n)}decodePLTE(n){if(n%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${n}`);const r=n/3;this._hasPalette=!0;const i=[];this._palette=i;for(let s=0;s<r;s++)i.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(n){this._writingDataChunks=!0;const r=n,i=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,i,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(n)}decodeFDAT(n){this._writingDataChunks=!0;let r=n,i=this.offset+this.byteOffset;if(i+=4,r-=4,this._inflator.push(new Uint8Array(this.buffer,i,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(n)}decodetRNS(n){switch(this._colorType){case mo.GREYSCALE:case mo.TRUECOLOUR:{if(n%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${n}`);if(n/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${n/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(n/2);for(let r=0;r<n/2;r++)this._transparency[r]=this.readUint16();break}case mo.INDEXED_COLOUR:{if(n>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${n} vs ${this._palette.length})`);let r=0;for(;r<n;r++){const i=this.readByte();this._palette[r].push(i)}for(;r<this._palette.length;r++)this._palette[r].push(255);break}case mo.UNKNOWN:case mo.GREYSCALE_ALPHA:case mo.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(n){const r=Hve(this),i=this.readUint8();if(i!==oO.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${i}`);const s=this.readBytes(n-r.length-2);this._png.iccEmbeddedProfile={name:r,profile:Jkt(s)}}decodepHYs(){const n=this.readUint32(),r=this.readUint32(),i=this.readByte();this._png.resolution={x:n,y:r,unit:i}}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 n=0;n<this._numberOfFrames;n++){const r={sequenceNumber:this._frames[n].sequenceNumber,delayNumber:this._frames[n].delayNumber,delayDenominator:this._frames[n].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)},i=this._frames.at(n);if(i){if(i.data=ZJ({data:i.data,width:i.width,height:i.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),n===0||i.xOffset===0&&i.yOffset===0&&i.width===this._png.width&&i.height===this._png.height)r.data=i.data;else{const s=this._apng.frames.at(n-1);this.disposeFrame(i,s,r),this.addFrameDataToCanvas(r,i)}this._apng.frames.push(r)}}return this._apng}disposeFrame(n,r,i){switch(n.disposeOp){case hk.NONE:break;case hk.BACKGROUND:for(let s=0;s<this._png.height;s++)for(let a=0;a<this._png.width;a++){const o=(s*n.width+a)*this._png.channels;for(let c=0;c<this._png.channels;c++)i.data[o+c]=0}break;case hk.PREVIOUS:i.data.set(r.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(n,r){const i=1<<this._png.depth,s=(a,o)=>{const c=((a+r.yOffset)*this._png.width+r.xOffset+o)*this._png.channels,u=(a*r.width+o)*this._png.channels;return{index:c,frameIndex:u}};switch(r.blendOp){case cO.SOURCE:for(let a=0;a<r.height;a++)for(let o=0;o<r.width;o++){const{index:c,frameIndex:u}=s(a,o);for(let d=0;d<this._png.channels;d++)n.data[c+d]=r.data[u+d]}break;case cO.OVER:for(let a=0;a<r.height;a++)for(let o=0;o<r.width;o++){const{index:c,frameIndex:u}=s(a,o);for(let d=0;d<this._png.channels;d++){const h=r.data[u+this._png.channels-1]/i,A=d%(this._png.channels-1)===0?1:r.data[u+d],f=Math.floor(h*A+(1-h)*n.data[c+d]);n.data[c+d]+=f}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){var r;if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const n=this._isAnimated?((r=this._frames)==null?void 0:r.at(0)).data:this._inflator.result;if(this._filterMethod!==tZ.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===lO.NO_INTERLACE)this._png.data=ZJ({data:n,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===lO.ADAM7)this._png.data=a_t({data:n,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 n=this._inflator.result,r=this._frames.at(-1);r?r.data=n:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:hk.NONE,blendOp:cO.SOURCE,data:n}),this._inflator=new YJ,this._writingDataChunks=!1}}function b_t(e){if(e!==1&&e!==2&&e!==4&&e!==8&&e!==16)throw new Error(`invalid bit depth: ${e}`);return e}var nZ;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.METRE=1]="METRE"})(nZ||(nZ={}));function C_t(e,t){return new w_t(e,t).decode()}var Yt=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function uO(){Yt.console&&typeof Yt.console.log=="function"&&Yt.console.log.apply(Yt.console,arguments)}var ir={log:uO,warn:function(e){Yt.console&&(typeof Yt.console.warn=="function"?Yt.console.warn.apply(Yt.console,arguments):uO.call(null,arguments))},error:function(e){Yt.console&&(typeof Yt.console.error=="function"?Yt.console.error.apply(Yt.console,arguments):uO(e))}};function dO(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){HA(r.response,t,n)},r.onerror=function(){ir.error("could not download file")},r.send()}function rZ(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function fk(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 HA=Yt.saveAs||((typeof window>"u"?"undefined":Gn(window))!=="object"||window!==Yt?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,t,n){var r=Yt.URL||Yt.webkitURL,i=document.createElement("a");t=t||e.name||"download",i.download=t,i.rel="noopener",typeof e=="string"?(i.href=e,i.origin!==location.origin?rZ(i.href)?dO(e,t,n):fk(i,i.target="_blank"):fk(i)):(i.href=r.createObjectURL(e),setTimeout(function(){r.revokeObjectURL(i.href)},4e4),setTimeout(function(){fk(i)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,n){if(t=t||e.name||"download",typeof e=="string")if(rZ(e))dO(e,t,n);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout(function(){fk(r)})}else navigator.msSaveOrOpenBlob(function(i,s){return s===void 0?s={autoBom:!1}:Gn(s)!=="object"&&(ir.warn("Deprecated: Expected third argument to be a object"),s={autoBom:!s}),s.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(i.type)?new Blob(["\uFEFF",i],{type:i.type}):i}(e,n),t)}:function(e,t,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),typeof e=="string")return dO(e,t,n);var i=e.type==="application/octet-stream",s=/constructor/i.test(Yt.HTMLElement)||Yt.safari,a=/CriOS\/[\d]+/.test(navigator.userAgent);if((a||i&&s)&&(typeof FileReader>"u"?"undefined":Gn(FileReader))==="object"){var o=new FileReader;o.onloadend=function(){var d=o.result;d=a?d:d.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=d:location=d,r=null},o.readAsDataURL(e)}else{var c=Yt.URL||Yt.webkitURL,u=c.createObjectURL(e);r?r.location=u:location.href=u,r=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 Qve(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 n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(o){return[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(o){return[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(o){return[parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,s=n[r].process,a=i.exec(e);a&&(t=s(a),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 o=this.r.toString(16),c=this.g.toString(16),u=this.b.toString(16);return o.length==1&&(o="0"+o),c.length==1&&(c="0"+c),u.length==1&&(u="0"+u),"#"+o+c+u}}var __=Yt.atob.bind(Yt),iZ=Yt.btoa.bind(Yt);/**
 * @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 hO(e,t){var n=e[0],r=e[1],i=e[2],s=e[3];n=Hs(n,r,i,s,t[0],7,-680876936),s=Hs(s,n,r,i,t[1],12,-389564586),i=Hs(i,s,n,r,t[2],17,606105819),r=Hs(r,i,s,n,t[3],22,-1044525330),n=Hs(n,r,i,s,t[4],7,-176418897),s=Hs(s,n,r,i,t[5],12,1200080426),i=Hs(i,s,n,r,t[6],17,-1473231341),r=Hs(r,i,s,n,t[7],22,-45705983),n=Hs(n,r,i,s,t[8],7,1770035416),s=Hs(s,n,r,i,t[9],12,-1958414417),i=Hs(i,s,n,r,t[10],17,-42063),r=Hs(r,i,s,n,t[11],22,-1990404162),n=Hs(n,r,i,s,t[12],7,1804603682),s=Hs(s,n,r,i,t[13],12,-40341101),i=Hs(i,s,n,r,t[14],17,-1502002290),n=Qs(n,r=Hs(r,i,s,n,t[15],22,1236535329),i,s,t[1],5,-165796510),s=Qs(s,n,r,i,t[6],9,-1069501632),i=Qs(i,s,n,r,t[11],14,643717713),r=Qs(r,i,s,n,t[0],20,-373897302),n=Qs(n,r,i,s,t[5],5,-701558691),s=Qs(s,n,r,i,t[10],9,38016083),i=Qs(i,s,n,r,t[15],14,-660478335),r=Qs(r,i,s,n,t[4],20,-405537848),n=Qs(n,r,i,s,t[9],5,568446438),s=Qs(s,n,r,i,t[14],9,-1019803690),i=Qs(i,s,n,r,t[3],14,-187363961),r=Qs(r,i,s,n,t[8],20,1163531501),n=Qs(n,r,i,s,t[13],5,-1444681467),s=Qs(s,n,r,i,t[2],9,-51403784),i=Qs(i,s,n,r,t[7],14,1735328473),n=$s(n,r=Qs(r,i,s,n,t[12],20,-1926607734),i,s,t[5],4,-378558),s=$s(s,n,r,i,t[8],11,-2022574463),i=$s(i,s,n,r,t[11],16,1839030562),r=$s(r,i,s,n,t[14],23,-35309556),n=$s(n,r,i,s,t[1],4,-1530992060),s=$s(s,n,r,i,t[4],11,1272893353),i=$s(i,s,n,r,t[7],16,-155497632),r=$s(r,i,s,n,t[10],23,-1094730640),n=$s(n,r,i,s,t[13],4,681279174),s=$s(s,n,r,i,t[0],11,-358537222),i=$s(i,s,n,r,t[3],16,-722521979),r=$s(r,i,s,n,t[6],23,76029189),n=$s(n,r,i,s,t[9],4,-640364487),s=$s(s,n,r,i,t[12],11,-421815835),i=$s(i,s,n,r,t[15],16,530742520),n=zs(n,r=$s(r,i,s,n,t[2],23,-995338651),i,s,t[0],6,-198630844),s=zs(s,n,r,i,t[7],10,1126891415),i=zs(i,s,n,r,t[14],15,-1416354905),r=zs(r,i,s,n,t[5],21,-57434055),n=zs(n,r,i,s,t[12],6,1700485571),s=zs(s,n,r,i,t[3],10,-1894986606),i=zs(i,s,n,r,t[10],15,-1051523),r=zs(r,i,s,n,t[1],21,-2054922799),n=zs(n,r,i,s,t[8],6,1873313359),s=zs(s,n,r,i,t[15],10,-30611744),i=zs(i,s,n,r,t[6],15,-1560198380),r=zs(r,i,s,n,t[13],21,1309151649),n=zs(n,r,i,s,t[4],6,-145523070),s=zs(s,n,r,i,t[11],10,-1120210379),i=zs(i,s,n,r,t[2],15,718787259),r=zs(r,i,s,n,t[9],21,-343485551),e[0]=Gh(n,e[0]),e[1]=Gh(r,e[1]),e[2]=Gh(i,e[2]),e[3]=Gh(s,e[3])}function gT(e,t,n,r,i,s){return t=Gh(Gh(t,e),Gh(r,s)),Gh(t<<i|t>>>32-i,n)}function Hs(e,t,n,r,i,s,a){return gT(t&n|~t&r,e,t,i,s,a)}function Qs(e,t,n,r,i,s,a){return gT(t&r|n&~r,e,t,i,s,a)}function $s(e,t,n,r,i,s,a){return gT(t^n^r,e,t,i,s,a)}function zs(e,t,n,r,i,s,a){return gT(n^(t|~r),e,t,i,s,a)}function $ve(e){var t,n=e.length,r=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)hO(r,S_t(e.substring(t-64,t)));e=e.substring(t-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)i[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(hO(r,i),t=0;t<16;t++)i[t]=0;return i[14]=8*n,hO(r,i),r}function S_t(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}var sZ="0123456789abcdef".split("");function k_t(e){for(var t="",n=0;n<4;n++)t+=sZ[e>>8*n+4&15]+sZ[e>>8*n&15];return t}function __t(e){return String.fromCharCode(255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function MR(e){return $ve(e).map(__t).join("")}var j_t=function(e){for(var t=0;t<e.length;t++)e[t]=k_t(e[t]);return e.join("")}($ve("hello"))!="5d41402abc4b2a76b9719d911017c592";function Gh(e,t){if(j_t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}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 LR(e,t){var n,r,i,s;if(e!==n){for(var a=(i=e,s=1+(256/e.length|0),new Array(s+1).join(i)),o=[],c=0;c<256;c++)o[c]=c;var u=0;for(c=0;c<256;c++){var d=o[c];u=(u+d+a.charCodeAt(c))%256,o[c]=o[u],o[u]=d}n=e,r=o}else o=r;var h=t.length,A=0,f=0,p="";for(c=0;c<h;c++)f=(f+(d=o[A=(A+1)%256]))%256,o[A]=o[f],o[f]=d,a=o[(o[A]+o[f])%256],p+=String.fromCharCode(t.charCodeAt(c)^a);return p}/**
 * @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 aZ={print:4,modify:8,copy:16,"annot-forms":32};function Dg(e,t,n,r){this.v=1,this.r=2;var i=192;e.forEach(function(o){if(aZ.perm!==void 0)throw new Error("Invalid permission: "+o);i+=aZ[o]}),this.padding="(¿N^NuŠAd\0NVÿú\b..\0¶Ðh>€/\f©þdSiz";var s=(t+this.padding).substr(0,32),a=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(s,a),this.P=-(1+(255^i)),this.encryptionKey=MR(s+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=LR(this.encryptionKey,this.padding)}function Ug(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",n=e.length,r=0;r<n;r++){var i=e.charCodeAt(r);t+=i<33||i===35||i===37||i===40||i===41||i===47||i===60||i===62||i===91||i===93||i===123||i===125||i>126?"#"+("0"+i.toString(16)).slice(-2):e[r]}return t}function oZ(e){if(Gn(e)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(n,r,i){if(i=i||!1,typeof n!="string"||typeof r!="function"||typeof i!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(n)||(t[n]={});var s=Math.random().toString(35);return t[n][s]=[r,!!i],s},this.unsubscribe=function(n){for(var r in t)if(t[r][n])return delete t[r][n],Object.keys(t[r]).length===0&&delete t[r],!0;return!1},this.publish=function(n){if(t.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),i=[];for(var s in t[n]){var a=t[n][s];try{a[0].apply(e,r)}catch(o){Yt.console&&ir.error("jsPDF PubSub Error",o.message,o)}a[1]&&i.push(s)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function MN(e){if(!(this instanceof MN))return new MN(e);var t="opacity,stroke-opacity".split(",");for(var n in e)e.hasOwnProperty(n)&&t.indexOf(n)>=0&&(this[n]=e[n]);this.id="",this.objectNumber=-1}function zve(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function KA(e,t,n,r,i){if(!(this instanceof KA))return new KA(e,t,n,r,i);this.type=e==="axial"?2:3,this.coords=t,this.colors=n,zve.call(this,r,i)}function uy(e,t,n,r,i){if(!(this instanceof uy))return new uy(e,t,n,r,i);this.boundingBox=e,this.xStep=t,this.yStep=n,this.stream="",this.cloneIndex=0,zve.call(this,r,i)}function It(e){var t,n=typeof arguments[0]=="string"?arguments[0]:"p",r=arguments[1],i=arguments[2],s=arguments[3],a=[],o=1,c=16,u="S",d=null;Gn(e=e||{})==="object"&&(n=e.orientation,r=e.unit||r,i=e.format||i,s=e.compress||e.compressPdf||s,(d=e.encryption||null)!==null&&(d.userPassword=d.userPassword||"",d.ownerPassword=d.ownerPassword||"",d.userPermissions=d.userPermissions||[]),o=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"),a=e.filters||(s===!0?["FlateEncode"]:a),r=r||"mm",n=(""+(n||"P")).toLowerCase();var h=e.putOnlyUsedFonts||!1,A={},f={internal:{},__private__:{}};f.__private__.PubSub=oZ;var p="1.3",m=f.__private__.getPdfVersion=function(){return p};f.__private__.setPdfVersion=function(P){p=P};var g={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]};f.__private__.getPageFormats=function(){return g};var y=f.__private__.getPageFormat=function(P){return g[P]};i=i||"a4";var v="compat",x="advanced",w=v;function b(){this.saveGraphicsState(),te(new St(Ye,0,0,-Ye,0,hA()*Ye).toString()+" cm"),this.setFontSize(this.getFontSize()/Ye),u="n",w=x}function k(){this.restoreGraphicsState(),u="S",w=v}var j=f.__private__.combineFontStyleAndFontWeight=function(P,V){if(P=="bold"&&V=="normal"||P=="bold"&&V==400||P=="normal"&&V=="italic"||P=="bold"&&V=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return V&&(P=V==400||V==="normal"?P==="italic"?"italic":"normal":V!=700&&V!=="bold"||P!=="normal"?(V==700?"bold":V)+""+P:"bold"),P};f.advancedAPI=function(P){var V=w===v;return V&&b.call(this),typeof P!="function"||(P(this),V&&k.call(this)),this},f.compatAPI=function(P){var V=w===x;return V&&k.call(this),typeof P!="function"||(P(this),V&&b.call(this)),this},f.isAdvancedAPI=function(){return w===x};var B,E=function(P){if(w!==x)throw new Error(P+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},I=f.roundToPrecision=f.__private__.roundToPrecision=function(P,V){var se=t||V;if(isNaN(P)||isNaN(se))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return P.toFixed(se).replace(/0+$/,"")};B=f.hpf=f.__private__.hpf=typeof c=="number"?function(P){if(isNaN(P))throw new Error("Invalid argument passed to jsPDF.hpf");return I(P,c)}:c==="smart"?function(P){if(isNaN(P))throw new Error("Invalid argument passed to jsPDF.hpf");return I(P,P>-1&&P<1?16:5)}:function(P){if(isNaN(P))throw new Error("Invalid argument passed to jsPDF.hpf");return I(P,16)};var T=f.f2=f.__private__.f2=function(P){if(isNaN(P))throw new Error("Invalid argument passed to jsPDF.f2");return I(P,2)},N=f.__private__.f3=function(P){if(isNaN(P))throw new Error("Invalid argument passed to jsPDF.f3");return I(P,3)},F=f.scale=f.__private__.scale=function(P){if(isNaN(P))throw new Error("Invalid argument passed to jsPDF.scale");return w===v?P*Ye:w===x?P:void 0},L=function(P){return F(function(V){return w===v?hA()-V:w===x?V:void 0}(P))};f.__private__.setPrecision=f.setPrecision=function(P){typeof parseInt(P,10)=="number"&&(t=parseInt(P,10))};var U,H="00000000000000000000000000000000",K=f.__private__.getFileId=function(){return H},$=f.__private__.setFileId=function(P){return H=P!==void 0&&/^[a-fA-F0-9]{32}$/.test(P)?P.toUpperCase():H.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),d!==null&&(fs=new Dg(d.userPermissions,d.userPassword,d.ownerPassword,H)),H};f.setFileId=function(P){return $(P),this},f.getFileId=function(){return K()};var z=f.__private__.convertDateToPDFDate=function(P){var V=P.getTimezoneOffset(),se=V<0?"+":"-",fe=Math.floor(Math.abs(V/60)),ve=Math.abs(V%60),Ne=[se,Y(fe),"'",Y(ve),"'"].join("");return["D:",P.getFullYear(),Y(P.getMonth()+1),Y(P.getDate()),Y(P.getHours()),Y(P.getMinutes()),Y(P.getSeconds()),Ne].join("")},Q=f.__private__.convertPDFDateToDate=function(P){var V=parseInt(P.substr(2,4),10),se=parseInt(P.substr(6,2),10)-1,fe=parseInt(P.substr(8,2),10),ve=parseInt(P.substr(10,2),10),Ne=parseInt(P.substr(12,2),10),Le=parseInt(P.substr(14,2),10);return new Date(V,se,fe,ve,Ne,Le,0)},oe=f.__private__.setCreationDate=function(P){var V;if(P===void 0&&(P=new Date),P instanceof Date)V=z(P);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(P))throw new Error("Invalid argument passed to jsPDF.setCreationDate");V=P}return U=V},R=f.__private__.getCreationDate=function(P){var V=U;return P==="jsDate"&&(V=Q(U)),V};f.setCreationDate=function(P){return oe(P),this},f.getCreationDate=function(P){return R(P)};var M,Y=f.__private__.padd2=function(P){return("0"+parseInt(P)).slice(-2)},X=f.__private__.padd2Hex=function(P){return("00"+(P=P.toString())).substr(P.length)},q=0,Z=[],de=[],ue=0,ae=[],he=[],ie=!1,Ce=de;f.__private__.setCustomOutputDestination=function(P){ie=!0,Ce=P};var Oe=function(P){ie||(Ce=P)};f.__private__.resetCustomOutputDestination=function(){ie=!1,Ce=de};var te=f.__private__.out=function(P){return P=P.toString(),ue+=P.length+1,Ce.push(P),Ce},je=f.__private__.write=function(P){return te(arguments.length===1?P.toString():Array.prototype.join.call(arguments," "))},tt=f.__private__.getArrayBuffer=function(P){for(var V=P.length,se=new ArrayBuffer(V),fe=new Uint8Array(se);V--;)fe[V]=P.charCodeAt(V);return se},nt=[["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]];f.__private__.getStandardFonts=function(){return nt};var Te=e.fontSize||16;f.__private__.setFontSize=f.setFontSize=function(P){return Te=w===x?P/Ye:P,this};var ct,we=f.__private__.getFontSize=f.getFontSize=function(){return w===v?Te:Te*Ye},$e=e.R2L||!1;f.__private__.setR2L=f.setR2L=function(P){return $e=P,this},f.__private__.getR2L=f.getR2L=function(){return $e};var Ve,$t=f.__private__.setZoomMode=function(P){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(P))ct=P;else if(isNaN(P)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(P)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+P+'" is not recognized.');ct=P}else ct=parseInt(P,10)};f.__private__.getZoomMode=function(){return ct};var yt,ye=f.__private__.setPageMode=function(P){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(P)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+P+'" is not recognized.');Ve=P};f.__private__.getPageMode=function(){return Ve};var Be=f.__private__.setLayoutMode=function(P){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(P)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+P+'" is not recognized.');yt=P};f.__private__.getLayoutMode=function(){return yt},f.__private__.setDisplayMode=f.setDisplayMode=function(P,V,se){return $t(P),Be(V),ye(se),this};var Ge={title:"",subject:"",author:"",keywords:"",creator:""};f.__private__.getDocumentProperty=function(P){if(Object.keys(Ge).indexOf(P)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return Ge[P]},f.__private__.getDocumentProperties=function(){return Ge},f.__private__.setDocumentProperties=f.setProperties=f.setDocumentProperties=function(P){for(var V in Ge)Ge.hasOwnProperty(V)&&P[V]&&(Ge[V]=P[V]);return this},f.__private__.setDocumentProperty=function(P,V){if(Object.keys(Ge).indexOf(P)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return Ge[P]=V};var Ue,Ye,pe,bt,mt,_t={},Rt={},Wt=[],vt={},Dt={},Ft={},Zt={},lr=null,cn=0,Et=[],Mn=new oZ(f),Ht=e.hotfixes||[],en={},Bn={},Wr=[],St=function P(V,se,fe,ve,Ne,Le){if(!(this instanceof P))return new P(V,se,fe,ve,Ne,Le);isNaN(V)&&(V=1),isNaN(se)&&(se=0),isNaN(fe)&&(fe=0),isNaN(ve)&&(ve=1),isNaN(Ne)&&(Ne=0),isNaN(Le)&&(Le=0),this._matrix=[V,se,fe,ve,Ne,Le]};Object.defineProperty(St.prototype,"sx",{get:function(){return this._matrix[0]},set:function(P){this._matrix[0]=P}}),Object.defineProperty(St.prototype,"shy",{get:function(){return this._matrix[1]},set:function(P){this._matrix[1]=P}}),Object.defineProperty(St.prototype,"shx",{get:function(){return this._matrix[2]},set:function(P){this._matrix[2]=P}}),Object.defineProperty(St.prototype,"sy",{get:function(){return this._matrix[3]},set:function(P){this._matrix[3]=P}}),Object.defineProperty(St.prototype,"tx",{get:function(){return this._matrix[4]},set:function(P){this._matrix[4]=P}}),Object.defineProperty(St.prototype,"ty",{get:function(){return this._matrix[5]},set:function(P){this._matrix[5]=P}}),Object.defineProperty(St.prototype,"a",{get:function(){return this._matrix[0]},set:function(P){this._matrix[0]=P}}),Object.defineProperty(St.prototype,"b",{get:function(){return this._matrix[1]},set:function(P){this._matrix[1]=P}}),Object.defineProperty(St.prototype,"c",{get:function(){return this._matrix[2]},set:function(P){this._matrix[2]=P}}),Object.defineProperty(St.prototype,"d",{get:function(){return this._matrix[3]},set:function(P){this._matrix[3]=P}}),Object.defineProperty(St.prototype,"e",{get:function(){return this._matrix[4]},set:function(P){this._matrix[4]=P}}),Object.defineProperty(St.prototype,"f",{get:function(){return this._matrix[5]},set:function(P){this._matrix[5]=P}}),Object.defineProperty(St.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(St.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(St.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(St.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),St.prototype.join=function(P){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(B).join(P)},St.prototype.multiply=function(P){var V=P.sx*this.sx+P.shy*this.shx,se=P.sx*this.shy+P.shy*this.sy,fe=P.shx*this.sx+P.sy*this.shx,ve=P.shx*this.shy+P.sy*this.sy,Ne=P.tx*this.sx+P.ty*this.shx+this.tx,Le=P.tx*this.shy+P.ty*this.sy+this.ty;return new St(V,se,fe,ve,Ne,Le)},St.prototype.decompose=function(){var P=this.sx,V=this.shy,se=this.shx,fe=this.sy,ve=this.tx,Ne=this.ty,Le=Math.sqrt(P*P+V*V),kt=(P/=Le)*se+(V/=Le)*fe;se-=P*kt,fe-=V*kt;var Ct=Math.sqrt(se*se+fe*fe);return kt/=Ct,P*(fe/=Ct)<V*(se/=Ct)&&(P=-P,V=-V,kt=-kt,Le=-Le),{scale:new St(Le,0,0,Ct,0,0),translate:new St(1,0,0,1,ve,Ne),rotate:new St(P,V,-V,P,0,0),skew:new St(1,0,kt,1,0,0)}},St.prototype.toString=function(P){return this.join(" ")},St.prototype.inversed=function(){var P=this.sx,V=this.shy,se=this.shx,fe=this.sy,ve=this.tx,Ne=this.ty,Le=1/(P*fe-V*se),kt=fe*Le,Ct=-V*Le,tn=-se*Le,an=P*Le;return new St(kt,Ct,tn,an,-kt*ve-tn*Ne,-Ct*ve-an*Ne)},St.prototype.applyToPoint=function(P){var V=P.x*this.sx+P.y*this.shx+this.tx,se=P.x*this.shy+P.y*this.sy+this.ty;return new dA(V,se)},St.prototype.applyToRectangle=function(P){var V=this.applyToPoint(P),se=this.applyToPoint(new dA(P.x+P.w,P.y+P.h));return new q0(V.x,V.y,se.x-V.x,se.y-V.y)},St.prototype.clone=function(){var P=this.sx,V=this.shy,se=this.shx,fe=this.sy,ve=this.tx,Ne=this.ty;return new St(P,V,se,fe,ve,Ne)},f.Matrix=St;var Xi=f.matrixMult=function(P,V){return V.multiply(P)},ds=new St(1,0,0,1,0,0);f.unitMatrix=f.identityMatrix=ds;var Er=function(P,V){if(!Dt[P]){var se=(V instanceof KA?"Sh":"P")+(Object.keys(vt).length+1).toString(10);V.id=se,Dt[P]=se,vt[se]=V,Mn.publish("addPattern",V)}};f.ShadingPattern=KA,f.TilingPattern=uy,f.addShadingPattern=function(P,V){return E("addShadingPattern()"),Er(P,V),this},f.beginTilingPattern=function(P){E("beginTilingPattern()"),W0(P.boundingBox[0],P.boundingBox[1],P.boundingBox[2]-P.boundingBox[0],P.boundingBox[3]-P.boundingBox[1],P.matrix)},f.endTilingPattern=function(P,V){E("endTilingPattern()"),V.stream=he[M].join(`
`),Er(P,V),Mn.publish("endTilingPattern",V),Wr.pop().restore()};var ai,Gr=f.__private__.newObject=function(){var P=Ji();return hs(P,!0),P},Ji=f.__private__.newObjectDeferred=function(){return q++,Z[q]=function(){return ue},q},hs=function(P,V){return V=typeof V=="boolean"&&V,Z[P]=ue,V&&te(P+" 0 obj"),P},oA=f.__private__.newAdditionalObject=function(){var P={objId:Ji(),content:""};return ae.push(P),P},Md=Ji(),Ol=Ji(),Bc=f.__private__.decodeColorString=function(P){var V=P.split(" ");if(V.length!==2||V[1]!=="g"&&V[1]!=="G")V.length!==5||V[4]!=="k"&&V[4]!=="K"||(V=[(1-V[0])*(1-V[3]),(1-V[1])*(1-V[3]),(1-V[2])*(1-V[3]),"r"]);else{var se=parseFloat(V[0]);V=[se,se,se,"r"]}for(var fe="#",ve=0;ve<3;ve++)fe+=("0"+Math.floor(255*parseFloat(V[ve])).toString(16)).slice(-2);return fe},Fl=f.__private__.encodeColorString=function(P){var V;typeof P=="string"&&(P={ch1:P});var se=P.ch1,fe=P.ch2,ve=P.ch3,Ne=P.ch4,Le=P.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof se=="string"&&se.charAt(0)!=="#"){var kt=new Qve(se);if(kt.ok)se=kt.toHex();else if(!/^\d*\.?\d*$/.test(se))throw new Error('Invalid color "'+se+'" passed to jsPDF.encodeColorString.')}if(typeof se=="string"&&/^#[0-9A-Fa-f]{3}$/.test(se)&&(se="#"+se[1]+se[1]+se[2]+se[2]+se[3]+se[3]),typeof se=="string"&&/^#[0-9A-Fa-f]{6}$/.test(se)){var Ct=parseInt(se.substr(1),16);se=Ct>>16&255,fe=Ct>>8&255,ve=255&Ct}if(fe===void 0||Ne===void 0&&se===fe&&fe===ve)V=typeof se=="string"?se+" "+Le[0]:P.precision===2?T(se/255)+" "+Le[0]:N(se/255)+" "+Le[0];else if(Ne===void 0||Gn(Ne)==="object"){if(Ne&&!isNaN(Ne.a)&&Ne.a===0)return["1.","1.","1.",Le[1]].join(" ");V=typeof se=="string"?[se,fe,ve,Le[1]].join(" "):P.precision===2?[T(se/255),T(fe/255),T(ve/255),Le[1]].join(" "):[N(se/255),N(fe/255),N(ve/255),Le[1]].join(" ")}else V=typeof se=="string"?[se,fe,ve,Ne,Le[2]].join(" "):P.precision===2?[T(se),T(fe),T(ve),T(Ne),Le[2]].join(" "):[N(se),N(fe),N(ve),N(Ne),Le[2]].join(" ");return V},Ml=f.__private__.getFilters=function(){return a},Qo=f.__private__.putStream=function(P){var V=(P=P||{}).data||"",se=P.filters||Ml(),fe=P.alreadyAppliedFilters||[],ve=P.addLength1||!1,Ne=V.length,Le=P.objectId,kt=function(yr){return yr};if(d!==null&&Le===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");d!==null&&(kt=fs.encryptor(Le,0));var Ct={};se===!0&&(se=["FlateEncode"]);var tn=P.additionalKeyValues||[],an=(Ct=It.API.processDataByFilters!==void 0?It.API.processDataByFilters(V,se):{data:V,reverseChain:[]}).reverseChain+(Array.isArray(fe)?fe.join(" "):fe.toString());if(Ct.data.length!==0&&(tn.push({key:"Length",value:Ct.data.length}),ve===!0&&tn.push({key:"Length1",value:Ne})),an.length!=0)if(an.split("/").length-1==1)tn.push({key:"Filter",value:an});else{tn.push({key:"Filter",value:"["+an+"]"});for(var Nn=0;Nn<tn.length;Nn+=1)if(tn[Nn].key==="DecodeParms"){for(var wi=[],nr=0;nr<Ct.reverseChain.split("/").length-1;nr+=1)wi.push("null");wi.push(tn[Nn].value),tn[Nn].value="["+wi.join(" ")+"]"}}te("<<");for(var Jn=0;Jn<tn.length;Jn++)te("/"+tn[Jn].key+" "+tn[Jn].value);te(">>"),Ct.data.length!==0&&(te("stream"),te(kt(Ct.data)),te("endstream"))},lA=f.__private__.putPage=function(P){var V=P.number,se=P.data,fe=P.objId,ve=P.contentsObjId;hs(fe,!0),te("<</Type /Page"),te("/Parent "+P.rootDictionaryObjId+" 0 R"),te("/Resources "+P.resourceDictionaryObjId+" 0 R"),te("/MediaBox ["+parseFloat(B(P.mediaBox.bottomLeftX))+" "+parseFloat(B(P.mediaBox.bottomLeftY))+" "+B(P.mediaBox.topRightX)+" "+B(P.mediaBox.topRightY)+"]"),P.cropBox!==null&&te("/CropBox ["+B(P.cropBox.bottomLeftX)+" "+B(P.cropBox.bottomLeftY)+" "+B(P.cropBox.topRightX)+" "+B(P.cropBox.topRightY)+"]"),P.bleedBox!==null&&te("/BleedBox ["+B(P.bleedBox.bottomLeftX)+" "+B(P.bleedBox.bottomLeftY)+" "+B(P.bleedBox.topRightX)+" "+B(P.bleedBox.topRightY)+"]"),P.trimBox!==null&&te("/TrimBox ["+B(P.trimBox.bottomLeftX)+" "+B(P.trimBox.bottomLeftY)+" "+B(P.trimBox.topRightX)+" "+B(P.trimBox.topRightY)+"]"),P.artBox!==null&&te("/ArtBox ["+B(P.artBox.bottomLeftX)+" "+B(P.artBox.bottomLeftY)+" "+B(P.artBox.topRightX)+" "+B(P.artBox.topRightY)+"]"),typeof P.userUnit=="number"&&P.userUnit!==1&&te("/UserUnit "+P.userUnit),Mn.publish("putPage",{objId:fe,pageContext:Et[V],pageNumber:V,page:se}),te("/Contents "+ve+" 0 R"),te(">>"),te("endobj");var Ne=se.join(`
`);return w===x&&(Ne+=`
Q`),hs(ve,!0),Qo({data:Ne,filters:Ml(),objectId:ve}),te("endobj"),fe},Nc=f.__private__.putPages=function(){var P,V,se=[];for(P=1;P<=cn;P++)Et[P].objId=Ji(),Et[P].contentsObjId=Ji();for(P=1;P<=cn;P++)se.push(lA({number:P,data:he[P],objId:Et[P].objId,contentsObjId:Et[P].contentsObjId,mediaBox:Et[P].mediaBox,cropBox:Et[P].cropBox,bleedBox:Et[P].bleedBox,trimBox:Et[P].trimBox,artBox:Et[P].artBox,userUnit:Et[P].userUnit,rootDictionaryObjId:Md,resourceDictionaryObjId:Ol}));hs(Md,!0),te("<</Type /Pages");var fe="/Kids [";for(V=0;V<cn;V++)fe+=se[V]+" 0 R ";te(fe+"]"),te("/Count "+cn),te(">>"),te("endobj"),Mn.publish("postPutPages")},cA=function(P){Mn.publish("putFont",{font:P,out:te,newObject:Gr,putStream:Qo}),P.isAlreadyPutted!==!0&&(P.objectNumber=Gr(),te("<<"),te("/Type /Font"),te("/BaseFont /"+Ug(P.postScriptName)),te("/Subtype /Type1"),typeof P.encoding=="string"&&te("/Encoding /"+P.encoding),te("/FirstChar 32"),te("/LastChar 255"),te(">>"),te("endobj"))},Tm=function(P){P.objectNumber=Gr();var V=[];V.push({key:"Type",value:"/XObject"}),V.push({key:"Subtype",value:"/Form"}),V.push({key:"BBox",value:"["+[B(P.x),B(P.y),B(P.x+P.width),B(P.y+P.height)].join(" ")+"]"}),V.push({key:"Matrix",value:"["+P.matrix.toString()+"]"});var se=P.pages[1].join(`
`);Qo({data:se,additionalKeyValues:V,objectId:P.objectNumber}),te("endobj")},Pm=function(P,V){V||(V=21);var se=Gr(),fe=function(Le,kt){var Ct,tn=[],an=1/(kt-1);for(Ct=0;Ct<1;Ct+=an)tn.push(Ct);if(tn.push(1),Le[0].offset!=0){var Nn={offset:0,color:Le[0].color};Le.unshift(Nn)}if(Le[Le.length-1].offset!=1){var wi={offset:1,color:Le[Le.length-1].color};Le.push(wi)}for(var nr="",Jn=0,yr=0;yr<tn.length;yr++){for(Ct=tn[yr];Ct>Le[Jn+1].offset;)Jn++;var Rr=Le[Jn].offset,Dr=(Ct-Rr)/(Le[Jn+1].offset-Rr),Fs=Le[Jn].color,ju=Le[Jn+1].color;nr+=X(Math.round((1-Dr)*Fs[0]+Dr*ju[0]).toString(16))+X(Math.round((1-Dr)*Fs[1]+Dr*ju[1]).toString(16))+X(Math.round((1-Dr)*Fs[2]+Dr*ju[2]).toString(16))}return nr.trim()}(P.colors,V),ve=[];ve.push({key:"FunctionType",value:"0"}),ve.push({key:"Domain",value:"[0.0 1.0]"}),ve.push({key:"Size",value:"["+V+"]"}),ve.push({key:"BitsPerSample",value:"8"}),ve.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ve.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Qo({data:fe,additionalKeyValues:ve,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:se}),te("endobj"),P.objectNumber=Gr(),te("<< /ShadingType "+P.type),te("/ColorSpace /DeviceRGB");var Ne="/Coords ["+B(parseFloat(P.coords[0]))+" "+B(parseFloat(P.coords[1]))+" ";P.type===2?Ne+=B(parseFloat(P.coords[2]))+" "+B(parseFloat(P.coords[3])):Ne+=B(parseFloat(P.coords[2]))+" "+B(parseFloat(P.coords[3]))+" "+B(parseFloat(P.coords[4]))+" "+B(parseFloat(P.coords[5])),te(Ne+="]"),P.matrix&&te("/Matrix ["+P.matrix.toString()+"]"),te("/Function "+se+" 0 R"),te("/Extend [true true]"),te(">>"),te("endobj")},Im=function(P,V){var se=Ji(),fe=Gr();V.push({resourcesOid:se,objectOid:fe}),P.objectNumber=fe;var ve=[];ve.push({key:"Type",value:"/Pattern"}),ve.push({key:"PatternType",value:"1"}),ve.push({key:"PaintType",value:"1"}),ve.push({key:"TilingType",value:"1"}),ve.push({key:"BBox",value:"["+P.boundingBox.map(B).join(" ")+"]"}),ve.push({key:"XStep",value:B(P.xStep)}),ve.push({key:"YStep",value:B(P.yStep)}),ve.push({key:"Resources",value:se+" 0 R"}),P.matrix&&ve.push({key:"Matrix",value:"["+P.matrix.toString()+"]"}),Qo({data:P.stream,additionalKeyValues:ve,objectId:P.objectNumber}),te("endobj")},BT=function(P){for(var V in P.objectNumber=Gr(),te("<<"),P)switch(V){case"opacity":te("/ca "+T(P[V]));break;case"stroke-opacity":te("/CA "+T(P[V]))}te(">>"),te("endobj")},D0=function(P){hs(P.resourcesOid,!0),te("<<"),te("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var V in te("/Font <<"),_t)_t.hasOwnProperty(V)&&(h===!1||h===!0&&A.hasOwnProperty(V))&&te("/"+V+" "+_t[V].objectNumber+" 0 R");te(">>")}(),function(){if(Object.keys(vt).length>0){for(var V in te("/Shading <<"),vt)vt.hasOwnProperty(V)&&vt[V]instanceof KA&&vt[V].objectNumber>=0&&te("/"+V+" "+vt[V].objectNumber+" 0 R");Mn.publish("putShadingPatternDict"),te(">>")}}(),function(V){if(Object.keys(vt).length>0){for(var se in te("/Pattern <<"),vt)vt.hasOwnProperty(se)&&vt[se]instanceof f.TilingPattern&&vt[se].objectNumber>=0&&vt[se].objectNumber<V&&te("/"+se+" "+vt[se].objectNumber+" 0 R");Mn.publish("putTilingPatternDict"),te(">>")}}(P.objectOid),function(){if(Object.keys(Ft).length>0){var V;for(V in te("/ExtGState <<"),Ft)Ft.hasOwnProperty(V)&&Ft[V].objectNumber>=0&&te("/"+V+" "+Ft[V].objectNumber+" 0 R");Mn.publish("putGStateDict"),te(">>")}}(),function(){for(var V in te("/XObject <<"),en)en.hasOwnProperty(V)&&en[V].objectNumber>=0&&te("/"+V+" "+en[V].objectNumber+" 0 R");Mn.publish("putXobjectDict"),te(">>")}(),te(">>"),te("endobj")},lC=function(P){Rt[P.fontName]=Rt[P.fontName]||{},Rt[P.fontName][P.fontStyle]=P.id},cC=function(P,V,se,fe,ve){var Ne={id:"F"+(Object.keys(_t).length+1).toString(10),postScriptName:P,fontName:V,fontStyle:se,encoding:fe,isStandardFont:ve||!1,metadata:{}};return Mn.publish("addFont",{font:Ne,instance:this}),_t[Ne.id]=Ne,lC(Ne),Ne.id},$o=f.__private__.pdfEscape=f.pdfEscape=function(P,V){return function(se,fe){var ve,Ne,Le,kt,Ct,tn,an,Nn,wi;if(Le=(fe=fe||{}).sourceEncoding||"Unicode",Ct=fe.outputEncoding,(fe.autoencode||Ct)&&_t[Ue].metadata&&_t[Ue].metadata[Le]&&_t[Ue].metadata[Le].encoding&&(kt=_t[Ue].metadata[Le].encoding,!Ct&&_t[Ue].encoding&&(Ct=_t[Ue].encoding),!Ct&&kt.codePages&&(Ct=kt.codePages[0]),typeof Ct=="string"&&(Ct=kt[Ct]),Ct)){for(an=!1,tn=[],ve=0,Ne=se.length;ve<Ne;ve++)(Nn=Ct[se.charCodeAt(ve)])?tn.push(String.fromCharCode(Nn)):tn.push(se[ve]),tn[ve].charCodeAt(0)>>8&&(an=!0);se=tn.join("")}for(ve=se.length;an===void 0&&ve!==0;)se.charCodeAt(ve-1)>>8&&(an=!0),ve--;if(!an)return se;for(tn=fe.noBOM?[]:[254,255],ve=0,Ne=se.length;ve<Ne;ve++){if((wi=(Nn=se.charCodeAt(ve))>>8)>>8)throw new Error("Character at position "+ve+" of string '"+se+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");tn.push(wi),tn.push(Nn-(wi<<8))}return String.fromCharCode.apply(void 0,tn)}(P,V).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},U0=f.__private__.beginPage=function(P){he[++cn]=[],Et[cn]={objId:0,contentsObjId:0,userUnit:Number(o),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(P[0]),topRightY:Number(P[1])}},dC(cn),Oe(he[M])},uC=function(P,V){var se,fe,ve;switch(n=V||n,typeof P=="string"&&(se=y(P.toLowerCase()),Array.isArray(se)&&(fe=se[0],ve=se[1])),Array.isArray(P)&&(fe=P[0]*Ye,ve=P[1]*Ye),isNaN(fe)&&(fe=i[0],ve=i[1]),(fe>14400||ve>14400)&&(ir.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),fe=Math.min(14400,fe),ve=Math.min(14400,ve)),i=[fe,ve],n.substr(0,1)){case"l":ve>fe&&(i=[ve,fe]);break;case"p":fe>ve&&(i=[ve,fe])}U0(i),RT(Gt),te(Dm),V0!==0&&te(V0+" J"),Dd!==0&&te(Dd+" j"),Mn.publish("addPage",{pageNumber:cn})},H0=function(P){P>0&&P<=cn&&(he.splice(P,1),Et.splice(P,1),cn--,M>cn&&(M=cn),this.setPage(M))},dC=function(P){P>0&&P<=cn&&(M=P)},hC=f.__private__.getNumberOfPages=f.getNumberOfPages=function(){return he.length-1},fC=function(P,V,se){var fe,ve=void 0;return se=se||{},P=P!==void 0?P:_t[Ue].fontName,V=V!==void 0?V:_t[Ue].fontStyle,fe=P.toLowerCase(),Rt[fe]!==void 0&&Rt[fe][V]!==void 0?ve=Rt[fe][V]:Rt[P]!==void 0&&Rt[P][V]!==void 0?ve=Rt[P][V]:se.disableWarning===!1&&ir.warn("Unable to look up font label for font '"+P+"', '"+V+"'. Refer to getFontList() for available fonts."),ve||se.noFallback||(ve=Rt.times[V])==null&&(ve=Rt.times.normal),ve},Ec=f.__private__.putInfo=function(){var P=Gr(),V=function(fe){return fe};for(var se in d!==null&&(V=fs.encryptor(P,0)),te("<<"),te("/Producer ("+$o(V("jsPDF "+It.version))+")"),Ge)Ge.hasOwnProperty(se)&&Ge[se]&&te("/"+se.substr(0,1).toUpperCase()+se.substr(1)+" ("+$o(V(Ge[se]))+")");te("/CreationDate ("+$o(V(U))+")"),te(">>"),te("endobj")},Om=f.__private__.putCatalog=function(P){var V=(P=P||{}).rootDictionaryObjId||Md;switch(Gr(),te("<<"),te("/Type /Catalog"),te("/Pages "+V+" 0 R"),ct||(ct="fullwidth"),ct){case"fullwidth":te("/OpenAction [3 0 R /FitH null]");break;case"fullheight":te("/OpenAction [3 0 R /FitV null]");break;case"fullpage":te("/OpenAction [3 0 R /Fit]");break;case"original":te("/OpenAction [3 0 R /XYZ null null 1]");break;default:var se=""+ct;se.substr(se.length-1)==="%"&&(ct=parseInt(ct)/100),typeof ct=="number"&&te("/OpenAction [3 0 R /XYZ null null "+T(ct)+"]")}switch(yt||(yt="continuous"),yt){case"continuous":te("/PageLayout /OneColumn");break;case"single":te("/PageLayout /SinglePage");break;case"two":case"twoleft":te("/PageLayout /TwoColumnLeft");break;case"tworight":te("/PageLayout /TwoColumnRight")}Ve&&te("/PageMode /"+Ve),Mn.publish("putCatalog"),te(">>"),te("endobj")},NT=f.__private__.putTrailer=function(){te("trailer"),te("<<"),te("/Size "+(q+1)),te("/Root "+q+" 0 R"),te("/Info "+(q-1)+" 0 R"),d!==null&&te("/Encrypt "+fs.oid+" 0 R"),te("/ID [ <"+H+"> <"+H+"> ]"),te(">>")},xi=f.__private__.putHeader=function(){te("%PDF-"+p),te("%ºß¬à")},AC=f.__private__.putXRef=function(){var P="0000000000";te("xref"),te("0 "+(q+1)),te("0000000000 65535 f ");for(var V=1;V<=q;V++)typeof Z[V]=="function"?te((P+Z[V]()).slice(-10)+" 00000 n "):Z[V]!==void 0?te((P+Z[V]).slice(-10)+" 00000 n "):te("0000000000 00000 n ")},Tc=f.__private__.buildDocument=function(){var P;q=0,ue=0,de=[],Z=[],ae=[],Md=Ji(),Ol=Ji(),Oe(de),Mn.publish("buildDocument"),xi(),Nc(),function(){Mn.publish("putAdditionalObjects");for(var se=0;se<ae.length;se++){var fe=ae[se];hs(fe.objId,!0),te(fe.content),te("endobj")}Mn.publish("postPutAdditionalObjects")}(),P=[],function(){for(var se in _t)_t.hasOwnProperty(se)&&(h===!1||h===!0&&A.hasOwnProperty(se))&&cA(_t[se])}(),function(){var se;for(se in Ft)Ft.hasOwnProperty(se)&&BT(Ft[se])}(),function(){for(var se in en)en.hasOwnProperty(se)&&Tm(en[se])}(),function(se){var fe;for(fe in vt)vt.hasOwnProperty(fe)&&(vt[fe]instanceof KA?Pm(vt[fe]):vt[fe]instanceof uy&&Im(vt[fe],se))}(P),Mn.publish("putResources"),P.forEach(D0),D0({resourcesOid:Ol,objectOid:Number.MAX_SAFE_INTEGER}),Mn.publish("postPutResources"),d!==null&&(fs.oid=Gr(),te("<<"),te("/Filter /Standard"),te("/V "+fs.v),te("/R "+fs.r),te("/U <"+fs.toHexString(fs.U)+">"),te("/O <"+fs.toHexString(fs.O)+">"),te("/P "+fs.P),te(">>"),te("endobj")),Ec(),Om();var V=ue;return AC(),NT(),te("startxref"),te(""+V),te("%%EOF"),Oe(he[M]),de.join(`
`)},Fm=f.__private__.getBlob=function(P){return new Blob([tt(P)],{type:"application/pdf"})},Q0=function(P){for(;P.firstChild;)P.removeChild(P.firstChild)},oo=function(P){var V,se=P.document,fe=se.documentElement,ve=se.head,Ne=se.body;return ve||(ve=se.createElement("head"),fe.appendChild(ve)),Ne||(Ne=se.createElement("body"),fe.appendChild(Ne)),Q0(ve),Q0(Ne),(V=se.createElement("style")).appendChild(se.createTextNode("html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}")),ve.appendChild(V),{document:se,body:Ne}},Mm=f.output=f.__private__.output=(ai=function(P,V){switch(typeof(V=V||{})=="string"?V={filename:V}:V.filename=V.filename||"generated.pdf",P){case void 0:return Tc();case"save":f.save(V.filename);break;case"arraybuffer":return tt(Tc());case"blob":return Fm(Tc());case"bloburi":case"bloburl":if(Yt.URL!==void 0&&typeof Yt.URL.createObjectURL=="function")return Yt.URL&&Yt.URL.createObjectURL(Fm(Tc()))||void 0;ir.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var se="",fe=Tc();try{se=iZ(fe)}catch{se=iZ(unescape(encodeURIComponent(fe)))}return"data:application/pdf;filename="+encodeURIComponent(V.filename)+";base64,"+se;case"pdfobjectnewwindow":if(Object.prototype.toString.call(Yt)==="[object Window]"){var ve="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",Ne=!V.pdfObjectUrl;Ne||(ve=V.pdfObjectUrl);var Le=Yt.open();if(Le!==null){var kt=oo(Le),Ct=kt.document.createElement("script"),tn=this;Ct.src=ve,Ne&&(Ct.integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==",Ct.crossOrigin="anonymous"),Ct.onload=function(){Le.PDFObject.embed(tn.output("dataurlstring"),V)},kt.body.appendChild(Ct)}return Le}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(Yt)==="[object Window]"){var an=V.pdfJsUrl||"examples/PDF.js/web/viewer.html",Nn=Yt.open();if(Nn!==null){var wi=oo(Nn),nr=wi.document.createElement("iframe"),Jn=an.indexOf("?")===-1?"?":"&";tn=this,nr.id="pdfViewer",nr.width="500px",nr.height="400px",nr.src=an+Jn+"file=&downloadName="+encodeURIComponent(V.filename),nr.onload=function(){Nn.document.title=V.filename,nr.contentWindow.PDFViewerApplication.open(tn.output("bloburl"))},wi.body.appendChild(nr)}return Nn}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(Yt)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var yr=Yt.open();if(yr!==null){var Rr=oo(yr),Dr=Rr.document.createElement("iframe");Dr.src=this.output("datauristring",V),Rr.body.appendChild(Dr),yr.document.title=V.filename}if(yr||typeof safari>"u")return yr;break;case"datauri":case"dataurl":return Yt.document.location.href=this.output("datauristring",V);default:return null}},ai.foo=function(){try{return ai.apply(this,arguments)}catch(se){var P=se.stack||"";~P.indexOf(" at ")&&(P=P.split(" at ")[1]);var V="Error in function "+P.split(`
`)[0].split("<")[0]+": "+se.message;if(!Yt.console)throw new Error(V);Yt.console.error(V,se),Yt.alert&&alert(V)}},ai.foo.bar=ai,ai.foo),bu=function(P){return Array.isArray(Ht)===!0&&Ht.indexOf(P)>-1};switch(r){case"pt":Ye=1;break;case"mm":Ye=72/25.4;break;case"cm":Ye=72/2.54;break;case"in":Ye=72;break;case"px":Ye=bu("px_scaling")==1?.75:96/72;break;case"pc":case"em":Ye=12;break;case"ex":Ye=6;break;default:if(typeof r!="number")throw new Error("Invalid unit: "+r);Ye=r}var fs=null;oe(),$();var pC=f.__private__.getPageInfo=f.getPageInfo=function(P){if(isNaN(P)||P%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Et[P].objId,pageNumber:P,pageContext:Et[P]}},ET=f.__private__.getPageInfoByObjId=function(P){if(isNaN(P)||P%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var V in Et)if(Et[V].objId===P)break;return pC(V)},TT=f.__private__.getCurrentPageInfo=f.getCurrentPageInfo=function(){return{objId:Et[M].objId,pageNumber:M,pageContext:Et[M]}};f.addPage=function(){return uC.apply(this,arguments),this},f.setPage=function(){return dC.apply(this,arguments),Oe.call(this,he[M]),this},f.insertPage=function(P){return this.addPage(),this.movePage(M,P),this},f.movePage=function(P,V){var se,fe;if(P>V){se=he[P],fe=Et[P];for(var ve=P;ve>V;ve--)he[ve]=he[ve-1],Et[ve]=Et[ve-1];he[V]=se,Et[V]=fe,this.setPage(V)}else if(P<V){se=he[P],fe=Et[P];for(var Ne=P;Ne<V;Ne++)he[Ne]=he[Ne+1],Et[Ne]=Et[Ne+1];he[V]=se,Et[V]=fe,this.setPage(V)}return this},f.deletePage=function(){return H0.apply(this,arguments),this},f.__private__.text=f.text=function(P,V,se,fe,ve){var Ne,Le,kt,Ct,tn,an,Nn,wi,nr,Jn=(fe=fe||{}).scope||this;if(typeof P=="number"&&typeof V=="number"&&(typeof se=="string"||Array.isArray(se))){var yr=se;se=V,V=P,P=yr}if(arguments[3]instanceof St==0?(kt=arguments[4],Ct=arguments[5],Gn(Nn=arguments[3])==="object"&&Nn!==null||(typeof kt=="string"&&(Ct=kt,kt=null),typeof Nn=="string"&&(Ct=Nn,Nn=null),typeof Nn=="number"&&(kt=Nn,Nn=null),fe={flags:Nn,angle:kt,align:Ct})):(E("The transform parameter of text() with a Matrix value"),nr=ve),isNaN(V)||isNaN(se)||P==null)throw new Error("Invalid arguments passed to jsPDF.text");if(P.length===0)return Jn;var Rr,Dr="",Fs=typeof fe.lineHeightFactor=="number"?fe.lineHeightFactor:uA,ju=Jn.internal.scaleFactor;function G0(cr){return cr=cr.split("	").join(Array(fe.TabLen||9).join(" ")),$o(cr,Nn)}function fA(cr){for(var ur,oi=cr.concat(),Ii=[],Nu=oi.length;Nu--;)typeof(ur=oi.shift())=="string"?Ii.push(ur):Array.isArray(cr)&&(ur.length===1||ur[1]===void 0&&ur[2]===void 0)?Ii.push(ur[0]):Ii.push([ur[0],ur[1],ur[2]]);return Ii}function AA(cr,ur){var oi;if(typeof cr=="string")oi=ur(cr)[0];else if(Array.isArray(cr)){for(var Ii,Nu,tx=cr.concat(),Xm=[],kC=tx.length;kC--;)typeof(Ii=tx.shift())=="string"?Xm.push(ur(Ii)[0]):Array.isArray(Ii)&&typeof Ii[0]=="string"&&(Nu=ur(Ii[0],Ii[1],Ii[2]),Xm.push([Nu[0],Nu[1],Nu[2]]));oi=Xm}return oi}var Ud=!1,pA=!0;if(typeof P=="string")Ud=!0;else if(Array.isArray(P)){var $m=P.concat();Le=[];for(var zm,Ms=$m.length;Ms--;)(typeof(zm=$m.shift())!="string"||Array.isArray(zm)&&typeof zm[0]!="string")&&(pA=!1);Ud=pA}if(Ud===!1)throw new Error('Type of text must be string or Array. "'+P+'" is not recognized.');typeof P=="string"&&(P=P.match(/[\r?\n]/)?P.split(/\r\n|\r|\n/g):[P]);var mA=Te/Jn.internal.scaleFactor,gA=mA*(Fs-1);switch(fe.baseline){case"bottom":se-=gA;break;case"top":se+=mA-gA;break;case"hanging":se+=mA-2*gA;break;case"middle":se+=mA/2-gA}if((an=fe.maxWidth||0)>0&&(typeof P=="string"?P=Jn.splitTextToSize(P,an):Object.prototype.toString.call(P)==="[object Array]"&&(P=P.reduce(function(cr,ur){return cr.concat(Jn.splitTextToSize(ur,an))},[]))),Ne={text:P,x:V,y:se,options:fe,mutex:{pdfEscape:$o,activeFontKey:Ue,fonts:_t,activeFontSize:Te}},Mn.publish("preProcessText",Ne),P=Ne.text,kt=(fe=Ne.options).angle,nr instanceof St==0&&kt&&typeof kt=="number"){kt*=Math.PI/180,fe.rotationDirection===0&&(kt=-kt),w===x&&(kt=-kt);var Y0=Math.cos(kt),Oc=Math.sin(kt);nr=new St(Y0,Oc,-Oc,Y0,0,0)}else kt&&kt instanceof St&&(nr=kt);w!==x||nr||(nr=ds),(tn=fe.charSpace||Um)!==void 0&&(Dr+=B(F(tn))+` Tc
`,this.setCharSpace(this.getCharSpace()||0)),(wi=fe.horizontalScale)!==void 0&&(Dr+=B(100*wi)+` Tz
`),fe.lang;var oa=-1,CC=fe.renderingMode!==void 0?fe.renderingMode:fe.stroke,Vm=Jn.internal.getCurrentPageInfo().pageContext;switch(CC){case 0:case!1:case"fill":oa=0;break;case 1:case!0:case"stroke":oa=1;break;case 2:case"fillThenStroke":oa=2;break;case 3:case"invisible":oa=3;break;case 4:case"fillAndAddForClipping":oa=4;break;case 5:case"strokeAndAddPathForClipping":oa=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":oa=6;break;case 7:case"addToPathForClipping":oa=7}var SC=Vm.usedRenderingMode!==void 0?Vm.usedRenderingMode:-1;oa!==-1?Dr+=oa+` Tr
`:SC!==-1&&(Dr+=`0 Tr
`),oa!==-1&&(Vm.usedRenderingMode=oa),Ct=fe.align||"left";var zo,yA=Te*Fs,X0=Jn.internal.pageSize.getWidth(),Km=_t[Ue];tn=fe.charSpace||Um,an=fe.maxWidth||0,Nn=Object.assign({autoencode:!0,noBOM:!0},fe.flags);var vA=[],J0=function(cr){return Jn.getStringUnitWidth(cr,{font:Km,charSpace:tn,fontSize:Te,doKerning:!1})*Te/ju};if(Object.prototype.toString.call(P)==="[object Array]"){var la;Le=fA(P),Ct!=="left"&&(zo=Le.map(J0));var Oa,qm=0;if(Ct==="right"){V-=zo[0],P=[],Ms=Le.length;for(var Hd=0;Hd<Ms;Hd++)Hd===0?(Oa=Cu(V),la=Su(se)):(Oa=F(qm-zo[Hd]),la=-yA),P.push([Le[Hd],Oa,la]),qm=zo[Hd]}else if(Ct==="center"){V-=zo[0]/2,P=[],Ms=Le.length;for(var Qd=0;Qd<Ms;Qd++)Qd===0?(Oa=Cu(V),la=Su(se)):(Oa=F((qm-zo[Qd])/2),la=-yA),P.push([Le[Qd],Oa,la]),qm=zo[Qd]}else if(Ct==="left"){P=[],Ms=Le.length;for(var Wm=0;Wm<Ms;Wm++)P.push(Le[Wm])}else if(Ct==="justify"&&Km.encoding==="Identity-H"){P=[],Ms=Le.length,an=an!==0?an:X0;for(var xA=0,bi=0;bi<Ms;bi++)if(la=bi===0?Su(se):-yA,Oa=bi===0?Cu(V):xA,bi<Ms-1){var KT=F((an-zo[bi])/(Le[bi].split(" ").length-1)),Fc=Le[bi].split(" ");P.push([Fc[0]+" ",Oa,la]),xA=0;for(var Ll=1;Ll<Fc.length;Ll++){var wA=(J0(Fc[Ll-1]+" "+Fc[Ll])-J0(Fc[Ll]))*ju+KT;Ll==Fc.length-1?P.push([Fc[Ll],wA,0]):P.push([Fc[Ll]+" ",wA,0]),xA-=wA}}else P.push([Le[bi],Oa,la]);P.push(["",xA,0])}else{if(Ct!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(P=[],Ms=Le.length,an=an!==0?an:X0,bi=0;bi<Ms;bi++){la=bi===0?Su(se):-yA,Oa=bi===0?Cu(V):0;var Z0=Le[bi].split(" ").length-1,ex=Z0>0?(an-zo[bi])/Z0:0;bi<Ms-1?vA.push(B(F(ex))):vA.push(0),P.push([Le[bi],Oa,la])}}}(typeof fe.R2L=="boolean"?fe.R2L:$e)===!0&&(P=AA(P,function(cr,ur,oi){return[cr.split("").reverse().join(""),ur,oi]})),Ne={text:P,x:V,y:se,options:fe,mutex:{pdfEscape:$o,activeFontKey:Ue,fonts:_t,activeFontSize:Te}},Mn.publish("postProcessText",Ne),P=Ne.text,Rr=Ne.mutex.isHex||!1;var Gm=_t[Ue].encoding;Gm!=="WinAnsiEncoding"&&Gm!=="StandardEncoding"||(P=AA(P,function(cr,ur,oi){return[G0(cr),ur,oi]})),Le=fA(P),P=[];for(var bA,CA,$d,Bu=Array.isArray(Le[0])?1:0,zd="",Ym=function(cr,ur,oi){var Ii="";return oi instanceof St?(oi=typeof fe.angle=="number"?Xi(oi,new St(1,0,0,1,cr,ur)):Xi(new St(1,0,0,1,cr,ur),oi),w===x&&(oi=Xi(new St(1,0,0,-1,0,0),oi)),Ii=oi.join(" ")+` Tm
`):Ii=B(cr)+" "+B(ur)+` Td
`,Ii},Ls=0;Ls<Le.length;Ls++){switch(zd="",Bu){case 1:$d=(Rr?"<":"(")+Le[Ls][0]+(Rr?">":")"),bA=parseFloat(Le[Ls][1]),CA=parseFloat(Le[Ls][2]);break;case 0:$d=(Rr?"<":"(")+Le[Ls]+(Rr?">":")"),bA=Cu(V),CA=Su(se)}vA!==void 0&&vA[Ls]!==void 0&&(zd=vA[Ls]+` Tw
`),Ls===0?P.push(zd+Ym(bA,CA,nr)+$d):Bu===0?P.push(zd+$d):Bu===1&&P.push(zd+Ym(bA,CA,nr)+$d)}P=Bu===0?P.join(` Tj
T* `):P.join(` Tj
`),P+=` Tj
`;var Mc=`BT
/`;return Mc+=Ue+" "+Te+` Tf
`,Mc+=B(Te*Fs)+` TL
`,Mc+=Ic+`
`,Mc+=Dr,Mc+=P,te(Mc+="ET"),A[Ue]=!0,Jn};var PT=f.__private__.clip=f.clip=function(P){return te(P==="evenodd"?"W*":"W"),this};f.clipEvenOdd=function(){return PT("evenodd")},f.__private__.discardPath=f.discardPath=function(){return te("n"),this};var Pc=f.__private__.isValidStyle=function(P){var V=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(P)!==-1&&(V=!0),V};f.__private__.setDefaultPathOperation=f.setDefaultPathOperation=function(P){return Pc(P)&&(u=P),this};var mC=f.__private__.getStyle=f.getStyle=function(P){var V=u;switch(P){case"D":case"S":V="S";break;case"F":V="f";break;case"FD":case"DF":V="B";break;case"f":case"f*":case"B":case"B*":V=P}return V},Lm=f.close=function(){return te("h"),this};f.stroke=function(){return te("S"),this},f.fill=function(P){return Rm("f",P),this},f.fillEvenOdd=function(P){return Rm("f*",P),this},f.fillStroke=function(P){return Rm("B",P),this},f.fillStrokeEvenOdd=function(P){return Rm("B*",P),this};var Rm=function(P,V){Gn(V)==="object"?OT(V,P):te(P)},$0=function(P){P===null||w===x&&P===void 0||(P=mC(P),te(P))};function IT(P,V,se,fe,ve){var Ne=new uy(V||this.boundingBox,se||this.xStep,fe||this.yStep,this.gState,ve||this.matrix);Ne.stream=this.stream;var Le=P+"$$"+this.cloneIndex+++"$$";return Er(Le,Ne),Ne}var OT=function(P,V){var se=Dt[P.key],fe=vt[se];if(fe instanceof KA)te("q"),te(FT(V)),fe.gState&&f.setGState(fe.gState),te(P.matrix.toString()+" cm"),te("/"+se+" sh"),te("Q");else if(fe instanceof uy){var ve=new St(1,0,0,-1,0,hA());P.matrix&&(ve=ve.multiply(P.matrix||ds),se=IT.call(fe,P.key,P.boundingBox,P.xStep,P.yStep,ve).id),te("q"),te("/Pattern cs"),te("/"+se+" scn"),fe.gState&&f.setGState(fe.gState),te(V),te("Q")}},FT=function(P){switch(P){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"}},Ld=f.moveTo=function(P,V){return te(B(F(P))+" "+B(L(V))+" m"),this},gC=f.lineTo=function(P,V){return te(B(F(P))+" "+B(L(V))+" l"),this},Rd=f.curveTo=function(P,V,se,fe,ve,Ne){return te([B(F(P)),B(L(V)),B(F(se)),B(L(fe)),B(F(ve)),B(L(Ne)),"c"].join(" ")),this};f.__private__.line=f.line=function(P,V,se,fe,ve){if(isNaN(P)||isNaN(V)||isNaN(se)||isNaN(fe)||!Pc(ve))throw new Error("Invalid arguments passed to jsPDF.line");return w===v?this.lines([[se-P,fe-V]],P,V,[1,1],ve||"S"):this.lines([[se-P,fe-V]],P,V,[1,1]).stroke()},f.__private__.lines=f.lines=function(P,V,se,fe,ve,Ne){var Le,kt,Ct,tn,an,Nn,wi,nr,Jn,yr,Rr,Dr;if(typeof P=="number"&&(Dr=se,se=V,V=P,P=Dr),fe=fe||[1,1],Ne=Ne||!1,isNaN(V)||isNaN(se)||!Array.isArray(P)||!Array.isArray(fe)||!Pc(ve)||typeof Ne!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(Ld(V,se),Le=fe[0],kt=fe[1],tn=P.length,yr=V,Rr=se,Ct=0;Ct<tn;Ct++)(an=P[Ct]).length===2?(yr=an[0]*Le+yr,Rr=an[1]*kt+Rr,gC(yr,Rr)):(Nn=an[0]*Le+yr,wi=an[1]*kt+Rr,nr=an[2]*Le+yr,Jn=an[3]*kt+Rr,yr=an[4]*Le+yr,Rr=an[5]*kt+Rr,Rd(Nn,wi,nr,Jn,yr,Rr));return Ne&&Lm(),$0(ve),this},f.path=function(P){for(var V=0;V<P.length;V++){var se=P[V],fe=se.c;switch(se.op){case"m":Ld(fe[0],fe[1]);break;case"l":gC(fe[0],fe[1]);break;case"c":Rd.apply(this,fe);break;case"h":Lm()}}return this},f.__private__.rect=f.rect=function(P,V,se,fe,ve){if(isNaN(P)||isNaN(V)||isNaN(se)||isNaN(fe)||!Pc(ve))throw new Error("Invalid arguments passed to jsPDF.rect");return w===v&&(fe=-fe),te([B(F(P)),B(L(V)),B(F(se)),B(F(fe)),"re"].join(" ")),$0(ve),this},f.__private__.triangle=f.triangle=function(P,V,se,fe,ve,Ne,Le){if(isNaN(P)||isNaN(V)||isNaN(se)||isNaN(fe)||isNaN(ve)||isNaN(Ne)||!Pc(Le))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[se-P,fe-V],[ve-se,Ne-fe],[P-ve,V-Ne]],P,V,[1,1],Le,!0),this},f.__private__.roundedRect=f.roundedRect=function(P,V,se,fe,ve,Ne,Le){if(isNaN(P)||isNaN(V)||isNaN(se)||isNaN(fe)||isNaN(ve)||isNaN(Ne)||!Pc(Le))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var kt=4/3*(Math.SQRT2-1);return ve=Math.min(ve,.5*se),Ne=Math.min(Ne,.5*fe),this.lines([[se-2*ve,0],[ve*kt,0,ve,Ne-Ne*kt,ve,Ne],[0,fe-2*Ne],[0,Ne*kt,-ve*kt,Ne,-ve,Ne],[2*ve-se,0],[-ve*kt,0,-ve,-Ne*kt,-ve,-Ne],[0,2*Ne-fe],[0,-Ne*kt,ve*kt,-Ne,ve,-Ne]],P+ve,V,[1,1],Le,!0),this},f.__private__.ellipse=f.ellipse=function(P,V,se,fe,ve){if(isNaN(P)||isNaN(V)||isNaN(se)||isNaN(fe)||!Pc(ve))throw new Error("Invalid arguments passed to jsPDF.ellipse");var Ne=4/3*(Math.SQRT2-1)*se,Le=4/3*(Math.SQRT2-1)*fe;return Ld(P+se,V),Rd(P+se,V-Le,P+Ne,V-fe,P,V-fe),Rd(P-Ne,V-fe,P-se,V-Le,P-se,V),Rd(P-se,V+Le,P-Ne,V+fe,P,V+fe),Rd(P+Ne,V+fe,P+se,V+Le,P+se,V),$0(ve),this},f.__private__.circle=f.circle=function(P,V,se,fe){if(isNaN(P)||isNaN(V)||isNaN(se)||!Pc(fe))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(P,V,se,se,fe)},f.setFont=function(P,V,se){return se&&(V=j(V,se)),Ue=fC(P,V,{disableWarning:!1}),this};var MT=f.__private__.getFont=f.getFont=function(){return _t[fC.apply(f,arguments)]};f.__private__.getFontList=f.getFontList=function(){var P,V,se={};for(P in Rt)if(Rt.hasOwnProperty(P))for(V in se[P]=[],Rt[P])Rt[P].hasOwnProperty(V)&&se[P].push(V);return se},f.addFont=function(P,V,se,fe,ve){var Ne=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&Ne.indexOf(arguments[3])!==-1?ve=arguments[3]:arguments[3]&&Ne.indexOf(arguments[3])==-1&&(se=j(se,fe)),cC.call(this,P,V,se,ve=ve||"Identity-H")};var uA,Gt=e.lineWidth||.200025,LT=f.__private__.getLineWidth=f.getLineWidth=function(){return Gt},RT=f.__private__.setLineWidth=f.setLineWidth=function(P){return Gt=P,te(B(F(P))+" w"),this};f.__private__.setLineDash=It.API.setLineDash=It.API.setLineDashPattern=function(P,V){if(P=P||[],V=V||0,isNaN(V)||!Array.isArray(P))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return P=P.map(function(se){return B(F(se))}).join(" "),V=B(F(V)),te("["+P+"] "+V+" d"),this};var DT=f.__private__.getLineHeight=f.getLineHeight=function(){return Te*uA};f.__private__.getLineHeight=f.getLineHeight=function(){return Te*uA};var UT=f.__private__.setLineHeightFactor=f.setLineHeightFactor=function(P){return typeof(P=P||1.15)=="number"&&(uA=P),this},HT=f.__private__.getLineHeightFactor=f.getLineHeightFactor=function(){return uA};UT(e.lineHeight);var Cu=f.__private__.getHorizontalCoordinate=function(P){return F(P)},Su=f.__private__.getVerticalCoordinate=function(P){return w===x?P:Et[M].mediaBox.topRightY-Et[M].mediaBox.bottomLeftY-F(P)},QT=f.__private__.getHorizontalCoordinateString=f.getHorizontalCoordinateString=function(P){return B(Cu(P))},$T=f.__private__.getVerticalCoordinateString=f.getVerticalCoordinateString=function(P){return B(Su(P))},Dm=e.strokeColor||"0 G";f.__private__.getStrokeColor=f.getDrawColor=function(){return Bc(Dm)},f.__private__.setStrokeColor=f.setDrawColor=function(P,V,se,fe){return Dm=Fl({ch1:P,ch2:V,ch3:se,ch4:fe,pdfColorType:"draw",precision:2}),te(Dm),this};var z0=e.fillColor||"0 g";f.__private__.getFillColor=f.getFillColor=function(){return Bc(z0)},f.__private__.setFillColor=f.setFillColor=function(P,V,se,fe){return z0=Fl({ch1:P,ch2:V,ch3:se,ch4:fe,pdfColorType:"fill",precision:2}),te(z0),this};var Ic=e.textColor||"0 g",zT=f.__private__.getTextColor=f.getTextColor=function(){return Bc(Ic)};f.__private__.setTextColor=f.setTextColor=function(P,V,se,fe){return Ic=Fl({ch1:P,ch2:V,ch3:se,ch4:fe,pdfColorType:"text",precision:3}),this};var Um=e.charSpace,VT=f.__private__.getCharSpace=f.getCharSpace=function(){return parseFloat(Um||0)};f.__private__.setCharSpace=f.setCharSpace=function(P){if(isNaN(P))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Um=P,this};var V0=0;f.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},f.__private__.setLineCap=f.setLineCap=function(P){var V=f.CapJoinStyles[P];if(V===void 0)throw new Error("Line cap style of '"+P+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return V0=V,te(V+" J"),this};var Dd=0;f.__private__.setLineJoin=f.setLineJoin=function(P){var V=f.CapJoinStyles[P];if(V===void 0)throw new Error("Line join style of '"+P+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Dd=V,te(V+" j"),this},f.__private__.setLineMiterLimit=f.__private__.setMiterLimit=f.setLineMiterLimit=f.setMiterLimit=function(P){if(P=P||0,isNaN(P))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return te(B(F(P))+" M"),this},f.GState=MN,f.setGState=function(P){(P=typeof P=="string"?Ft[Zt[P]]:K0(null,P)).equals(lr)||(te("/"+P.id+" gs"),lr=P)};var K0=function(P,V){if(!P||!Zt[P]){var se=!1;for(var fe in Ft)if(Ft.hasOwnProperty(fe)&&Ft[fe].equals(V)){se=!0;break}if(se)V=Ft[fe];else{var ve="GS"+(Object.keys(Ft).length+1).toString(10);Ft[ve]=V,V.id=ve}return P&&(Zt[P]=V.id),Mn.publish("addGState",V),V}};f.addGState=function(P,V){return K0(P,V),this},f.saveGraphicsState=function(){return te("q"),Wt.push({key:Ue,size:Te,color:Ic}),this},f.restoreGraphicsState=function(){te("Q");var P=Wt.pop();return Ue=P.key,Te=P.size,Ic=P.color,lr=null,this},f.setCurrentTransformationMatrix=function(P){return te(P.toString()+" cm"),this},f.comment=function(P){return te("#"+P),this};var dA=function(P,V){var se=P||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return se},set:function(Ne){isNaN(Ne)||(se=parseFloat(Ne))}});var fe=V||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return fe},set:function(Ne){isNaN(Ne)||(fe=parseFloat(Ne))}});var ve="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return ve},set:function(Ne){ve=Ne.toString()}}),this},q0=function(P,V,se,fe){dA.call(this,P,V),this.type="rect";var ve=se||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return ve},set:function(Le){isNaN(Le)||(ve=parseFloat(Le))}});var Ne=fe||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return Ne},set:function(Le){isNaN(Le)||(Ne=parseFloat(Le))}}),this},Hm=function(){this.page=cn,this.currentPage=M,this.pages=he.slice(0),this.pagesContext=Et.slice(0),this.x=pe,this.y=bt,this.matrix=mt,this.width=yC(M),this.height=_u(M),this.outputDestination=Ce,this.id="",this.objectNumber=-1};Hm.prototype.restore=function(){cn=this.page,M=this.currentPage,Et=this.pagesContext,he=this.pages,pe=this.x,bt=this.y,mt=this.matrix,ku(M,this.width),vC(M,this.height),Ce=this.outputDestination};var W0=function(P,V,se,fe,ve){Wr.push(new Hm),cn=M=0,he=[],pe=P,bt=V,mt=ve,U0([se,fe])};for(var Qm in f.beginFormObject=function(P,V,se,fe,ve){return W0(P,V,se,fe,ve),this},f.endFormObject=function(P){return function(V){if(Bn[V])Wr.pop().restore();else{var se=new Hm,fe="Xo"+(Object.keys(en).length+1).toString(10);se.id=fe,Bn[V]=fe,en[fe]=se,Mn.publish("addFormObject",se),Wr.pop().restore()}}(P),this},f.doFormObject=function(P,V){var se=en[Bn[P]];return te("q"),te(V.toString()+" cm"),te("/"+se.id+" Do"),te("Q"),this},f.getFormObject=function(P){var V=en[Bn[P]];return{x:V.x,y:V.y,width:V.width,height:V.height,matrix:V.matrix}},f.save=function(P,V){return P=P||"generated.pdf",(V=V||{}).returnPromise=V.returnPromise||!1,V.returnPromise===!1?(HA(Fm(Tc()),P),typeof HA.unload=="function"&&Yt.setTimeout&&setTimeout(HA.unload,911),this):new Promise(function(se,fe){try{var ve=HA(Fm(Tc()),P);typeof HA.unload=="function"&&Yt.setTimeout&&setTimeout(HA.unload,911),se(ve)}catch(Ne){fe(Ne.message)}})},It.API)It.API.hasOwnProperty(Qm)&&(Qm==="events"&&It.API.events.length?function(P,V){var se,fe,ve;for(ve=V.length-1;ve!==-1;ve--)se=V[ve][0],fe=V[ve][1],P.subscribe.apply(P,[se].concat(typeof fe=="function"?[fe]:fe))}(Mn,It.API.events):f[Qm]=It.API[Qm]);function yC(P){return Et[P].mediaBox.topRightX-Et[P].mediaBox.bottomLeftX}function ku(P,V){Et[P].mediaBox.topRightX=V+Et[P].mediaBox.bottomLeftX}function _u(P){return Et[P].mediaBox.topRightY-Et[P].mediaBox.bottomLeftY}function vC(P,V){Et[P].mediaBox.topRightY=V+Et[P].mediaBox.bottomLeftY}var xC=f.getPageWidth=function(P){return yC(P=P||M)/Ye},wC=f.setPageWidth=function(P,V){ku(P,V*Ye)},hA=f.getPageHeight=function(P){return _u(P=P||M)/Ye},bC=f.setPageHeight=function(P,V){vC(P,V*Ye)};return f.internal={pdfEscape:$o,getStyle:mC,getFont:MT,getFontSize:we,getCharSpace:VT,getTextColor:zT,getLineHeight:DT,getLineHeightFactor:HT,getLineWidth:LT,write:je,getHorizontalCoordinate:Cu,getVerticalCoordinate:Su,getCoordinateString:QT,getVerticalCoordinateString:$T,collections:{},newObject:Gr,newAdditionalObject:oA,newObjectDeferred:Ji,newObjectDeferredBegin:hs,getFilters:Ml,putStream:Qo,events:Mn,scaleFactor:Ye,pageSize:{getWidth:function(){return xC(M)},setWidth:function(P){wC(M,P)},getHeight:function(){return hA(M)},setHeight:function(P){bC(M,P)}},encryptionOptions:d,encryption:fs,getEncryptor:function(P){return d!==null?fs.encryptor(P,0):function(V){return V}},output:Mm,getNumberOfPages:hC,get pages(){return he},out:te,f2:T,f3:N,getPageInfo:pC,getPageInfoByObjId:ET,getCurrentPageInfo:TT,getPDFVersion:m,Point:dA,Rectangle:q0,Matrix:St,hasHotfix:bu},Object.defineProperty(f.internal.pageSize,"width",{get:function(){return xC(M)},set:function(P){wC(M,P)},enumerable:!0,configurable:!0}),Object.defineProperty(f.internal.pageSize,"height",{get:function(){return hA(M)},set:function(P){bC(M,P)},enumerable:!0,configurable:!0}),(function(P){for(var V=0,se=nt.length;V<se;V++){var fe=cC.call(this,P[V][0],P[V][1],P[V][2],nt[V][3],!0);h===!1&&(A[fe]=!0);var ve=P[V][0].split("-");lC({id:fe,fontName:ve[0],fontStyle:ve[1]||""})}Mn.publish("addFonts",{fonts:_t,dictionary:Rt})}).call(f,nt),Ue="F1",uC(i,n),Mn.publish("initialized"),f}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=[],n=0;n<e.length;n+=2)t.push(String.fromCharCode(parseInt(e.substr(n,2),16)));return t.join("")},Dg.prototype.processOwnerPassword=function(e,t){return LR(MR(t).substr(0,5),e)},Dg.prototype.encryptor=function(e,t){var n=MR(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(r){return LR(n,r)}},MN.prototype.equals=function(e){var t,n="id,objectNumber,equals";if(!e||Gn(e)!==Gn(this))return!1;var r=0;for(t in this)if(!(n.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t)||this[t]!==e[t])return!1;r++}for(t in e)e.hasOwnProperty(t)&&n.indexOf(t)<0&&r--;return r===0},It.API={events:[]},It.version="4.2.1";var ei=It.API,b$=1,Em=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Sg=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},hm=function(e){return e.toString().replace(/#/g,"#23").replace(/[\s\n\r()<>[\]{}\/%]/g,function(t){var n=t.charCodeAt(0).toString(16).toUpperCase();return"#"+(n.length===1?"0"+n:n)})},rn=function(e){return e.toFixed(2)},oh=function(e){return e.toFixed(5)};ei.__acroform__={};var ao=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},lZ=function(e){return e*b$},Uc=function(e){var t=new Kve,n=wt.internal.getHeight(e)||0,r=wt.internal.getWidth(e)||0;return t.BBox=[0,0,Number(rn(r)),Number(rn(n))],t},B_t=ei.__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},N_t=ei.__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)},E_t=ei.__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},Ai=ei.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return E_t(e,t-1)},pi=ei.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return B_t(e,t-1)},mi=ei.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return N_t(e,t-1)},T_t=ei.__acroform__.calculateCoordinates=function(e,t){var n=t.internal.getHorizontalCoordinate,r=t.internal.getVerticalCoordinate,i=e[0],s=e[1],a=e[2],o=e[3],c={};return c.lowerLeft_X=n(i)||0,c.lowerLeft_Y=r(s+o)||0,c.upperRight_X=n(i+a)||0,c.upperRight_Y=r(s)||0,[Number(rn(c.lowerLeft_X)),Number(rn(c.lowerLeft_Y)),Number(rn(c.upperRight_X)),Number(rn(c.upperRight_Y))]},P_t=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],n=e._V||e.DV,r=RR(e,n),i=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("/"+i+" "+rn(r.fontSize)+" Tf"),t.push("1 0 0 1 0 0 Tm"),t.push(r.text),t.push("ET"),t.push("Q"),t.push("EMC");var s=Uc(e);return s.scope=e.scope,s.stream=t.join(`
`),s}},RR=function(e,t){var n=e.fontSize===0?e.maxFontSize:e.fontSize,r={text:"",fontSize:""},i=(t=(t=t.substr(0,1)=="("?t.substr(1):t).substr(t.length-1)==")"?t.substr(0,t.length-1):t).split(" ");i=e.multiline?i.map(function(T){return T.split(`
`)}):i.map(function(T){return[T]});var s=n,a=wt.internal.getHeight(e)||0;a=a<0?-a:a;var o=wt.internal.getWidth(e)||0;o=o<0?-o:o;var c=function(T,N,F){if(T+1<i.length){var L=N+" "+i[T+1][0];return Ak(L,e,F).width<=o-4}return!1};s++;e:for(;s>0;){t="",s--;var u,d,h=Ak("3",e,s).height,A=e.multiline?a-s:(a-h)/2,f=A+=2,p=0,m=0,g=0;if(s<=0){t=`(...) Tj
`,t+="% Width of Text: "+Ak(t,e,s=12).width+", FieldWidth:"+o+`
`;break}for(var y="",v=0,x=0;x<i.length;x++)if(i.hasOwnProperty(x)){var w=!1;if(i[x].length!==1&&g!==i[x].length-1){if((h+2)*(v+2)+2>a)continue e;y+=i[x][g],w=!0,m=x,x--}else{y=(y+=i[x][g]+" ").substr(y.length-1)==" "?y.substr(0,y.length-1):y;var b=parseInt(x),k=c(b,y,s),j=x>=i.length-1;if(k&&!j){y+=" ",g=0;continue}if(k||j){if(j)m=b;else if(e.multiline&&(h+2)*(v+2)+2>a)continue e}else{if(!e.multiline||(h+2)*(v+2)+2>a)continue e;m=b}}for(var B="",E=p;E<=m;E++){var I=i[E];if(e.multiline){if(E===m){B+=I[g]+" ",g=(g+1)%I.length;continue}if(E===p){B+=I[I.length-1]+" ";continue}}B+=I[0]+" "}switch(B=B.substr(B.length-1)==" "?B.substr(0,B.length-1):B,d=Ak(B,e,s).width,e.textAlign){case"right":u=o-d-2;break;case"center":u=(o-d)/2;break;default:u=2}t+=rn(u)+" "+rn(f)+` Td
`,t+="("+Em(B)+`) Tj
`,t+=-rn(u)+` 0 Td
`,f=-(s+2),d=0,p=w?m:m+1,v++,y=""}break}return r.text=t,r.fontSize=s,r},Ak=function(e,t,n){var r=t.scope.internal.getFont(t.fontName,t.fontStyle),i=t.scope.getStringUnitWidth(e,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:t.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},I_t={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},O_t=function(e,t){var n={type:"reference",object:e};t.internal.getPageInfo(e.page).pageContext.annotations.find(function(r){return r.type===n.type&&r.object===n.object})===void 0&&t.internal.getPageInfo(e.page).pageContext.annotations.push(n)},F_t=function(e,t){if(t.scope=e,e.internal!==void 0&&(e.internal.acroformPlugin===void 0||e.internal.acroformPlugin.isInitialized===!1)){if(kc.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(I_t)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");b$=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new qve,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",function(){(function(n){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0})(e)}),e.internal.events.subscribe("buildDocument",function(){(function(n){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var r=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];s.objId=void 0,s.hasAnnotation&&O_t(s,n)}})(e)}),e.internal.events.subscribe("putCatalog",function(){(function(n){if(n.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(e)}),e.internal.events.subscribe("postPutPages",function(n){(function(r,i){var s=!r;for(var a in r||(i.internal.newObjectDeferredBegin(i.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),i.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),r=r||i.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(r.hasOwnProperty(a)){var o=r[a],c=[],u=o.Rect;if(o.Rect&&(o.Rect=T_t(o.Rect,i)),i.internal.newObjectDeferredBegin(o.objId,!0),o.DA=wt.createDefaultAppearanceStream(o),Gn(o)==="object"&&typeof o.getKeyValueListForStream=="function"&&(c=o.getKeyValueListForStream()),o.Rect=u,o.hasAppearanceStream&&!o.appearanceStreamContent){var d=P_t(o);c.push({key:"AP",value:"<</N "+d+">>"}),i.internal.acroformPlugin.xForms.push(d)}if(o.appearanceStreamContent){var h="";for(var A in o.appearanceStreamContent)if(o.appearanceStreamContent.hasOwnProperty(A)){var f=o.appearanceStreamContent[A];if(h+="/"+A+" ",h+="<<",Object.keys(f).length>=1||Array.isArray(f)){for(var a in f)if(f.hasOwnProperty(a)){var p=f[a];typeof p=="function"&&(p=p.call(i,o)),h+="/"+a+" "+p+" ",i.internal.acroformPlugin.xForms.indexOf(p)>=0||i.internal.acroformPlugin.xForms.push(p)}}else typeof(p=f)=="function"&&(p=p.call(i,o)),h+="/"+a+" "+p,i.internal.acroformPlugin.xForms.indexOf(p)>=0||i.internal.acroformPlugin.xForms.push(p);h+=">>"}c.push({key:"AP",value:`<<
`+h+">>"})}i.internal.putStream({additionalKeyValues:c,objectId:o.objId}),i.internal.out("endobj")}s&&function(m,g){for(var y in m)if(m.hasOwnProperty(y)){var v=y,x=m[y];g.internal.newObjectDeferredBegin(x.objId,!0),Gn(x)==="object"&&typeof x.putStream=="function"&&x.putStream(),delete m[v]}}(i.internal.acroformPlugin.xForms,i)})(n,e)}),e.internal.acroformPlugin.isInitialized=!0}},Vve=ei.__acroform__.arrayToPdfArray=function(e,t,n){var r=function(a){return a};if(Array.isArray(e)){for(var i="[",s=0;s<e.length;s++)switch(s!==0&&(i+=" "),Gn(e[s])){case"boolean":case"number":case"object":i+=e[s].toString();break;case"string":e[s].substr(0,1)==="/"?i+="/"+hm(e[s].substr(1)):(t!==void 0&&n&&(r=n.internal.getEncryptor(t)),i+="("+Em(r(e[s].toString()))+")")}return i+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},fO=function(e,t,n){var r=function(i){return i};return t!==void 0&&n&&(r=n.internal.getEncryptor(t)),(e=e||"").toString(),"("+Em(r(e))+")"},eu=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})};eu.prototype.toString=function(){return this.objId+" 0 R"},eu.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},eu.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter(function(s){return s!="content"&&s!="appearanceStreamContent"&&s!="scope"&&s!="objId"&&s.substring(0,1)!="_"});for(var n in t)if(Object.getOwnPropertyDescriptor(this,t[n]).configurable===!1){var r=t[n],i=this[r];i&&(Array.isArray(i)?e.push({key:r,value:Vve(i,this.objId,this.scope)}):i instanceof eu?(i.scope=this.scope,e.push({key:r,value:i.objId+" 0 R"})):typeof i!="function"&&e.push({key:r,value:i}))}return e};var Kve=function(){eu.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(n){t=n}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(n){e=n.trim()},get:function(){return e||null}})};ao(Kve,eu);var qve=function(){eu.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 n=function(r){return r};return this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),"("+Em(n(e))+")"}},set:function(n){e=n}})};ao(qve,eu);var kc=function e(){eu.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(y){if(isNaN(y))throw new Error('Invalid value "'+y+'" for attribute F supplied.');t=y}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!Ai(t,3)},set:function(y){y?this.F=pi(t,3):this.F=mi(t,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(y){if(isNaN(y))throw new Error('Invalid value "'+y+'" for attribute Ff supplied.');n=y}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(r.length!==0)return r},set:function(y){r=y!==void 0?y:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(y){r[0]=y}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(y){r[1]=y}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(y){r[2]=y}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(y){r[3]=y}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(y){switch(y){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=y;break;default:throw new Error('Invalid value "'+y+'" for attribute FT supplied.')}}});var s=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!s||s.length<1){if(this instanceof LN)return;s="FieldObject"+e.FieldNum++}var y=function(v){return v};return this.scope&&(y=this.scope.internal.getEncryptor(this.objId)),"("+Em(y(s))+")"},set:function(y){s=y.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return s},set:function(y){s=y}});var a="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return a},set:function(y){a=y}});var o="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return o},set:function(y){o=y}});var c=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return c},set:function(y){c=y}});var u=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return u===void 0?50/b$:u},set:function(y){u=y}});var d="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return d},set:function(y){d=y}});var h="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!h||this instanceof LN||this instanceof Op))return fO(h,this.objId,this.scope)},set:function(y){y=y.toString(),h=y}});var A=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(A)return this instanceof rs==0?fO(A,this.objId,this.scope):A},set:function(y){y=y.toString(),A=this instanceof rs==0?y.substr(0,1)==="("?Sg(y.substr(1,y.length-2)):Sg(y):y}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof rs==1?Sg(A.substr(1,A.length-1)):A},set:function(y){y=y.toString(),A=this instanceof rs==1?"/"+hm(y):y}});var f=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(f)return f},set:function(y){this.V=y}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof rs==0?fO(f,this.objId,this.scope):f},set:function(y){y=y.toString(),f=this instanceof rs==0?y.substr(0,1)==="("?Sg(y.substr(1,y.length-2)):Sg(y):y}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof rs==1?Sg(f.substr(1,f.length-1)):f},set:function(y){y=y.toString(),f=this instanceof rs==1?"/"+hm(y):y}}),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 p,m=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return m},set:function(y){y=!!y,m=y}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(p)return p},set:function(y){p=y}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,1)},set:function(y){y?this.Ff=pi(this.Ff,1):this.Ff=mi(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,2)},set:function(y){y?this.Ff=pi(this.Ff,2):this.Ff=mi(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,3)},set:function(y){y?this.Ff=pi(this.Ff,3):this.Ff=mi(this.Ff,3)}});var g=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(g!==null)return g},set:function(y){if([0,1,2].indexOf(y)===-1)throw new Error('Invalid value "'+y+'" for attribute Q supplied.');g=y}}),Object.defineProperty(this,"textAlign",{get:function(){var y;switch(g){case 0:default:y="left";break;case 1:y="center";break;case 2:y="right"}return y},configurable:!0,enumerable:!0,set:function(y){switch(y){case"right":case 2:g=2;break;case"center":case 1:g=1;break;default:g=0}}})};ao(kc,eu);var Ly=function(){kc.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(n){e=n}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(n){e=n}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return Vve(t,this.objId,this.scope)},set:function(n){var r,i;i=[],typeof(r=n)=="string"&&(i=function(s,a,o){o||(o=1);for(var c,u=[];c=a.exec(s);)u.push(c[o]);return u}(r,/\((.*?)\)/g)),t=i}}),this.getOptions=function(){return t},this.setOptions=function(n){t=n,this.sort&&t.sort()},this.addOption=function(n){n=(n=n||"").toString(),t.push(n),this.sort&&t.sort()},this.removeOption=function(n,r){for(r=r||!1,n=(n=n||"").toString();t.indexOf(n)!==-1&&(t.splice(t.indexOf(n),1),r!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,18)},set:function(n){n?this.Ff=pi(this.Ff,18):this.Ff=mi(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,19)},set:function(n){this.combo===!0&&(n?this.Ff=pi(this.Ff,19):this.Ff=mi(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,20)},set:function(n){n?(this.Ff=pi(this.Ff,20),t.sort()):this.Ff=mi(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,22)},set:function(n){n?this.Ff=pi(this.Ff,22):this.Ff=mi(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,23)},set:function(n){n?this.Ff=pi(this.Ff,23):this.Ff=mi(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,27)},set:function(n){n?this.Ff=pi(this.Ff,27):this.Ff=mi(this.Ff,27)}}),this.hasAppearanceStream=!1};ao(Ly,kc);var Ry=function(){Ly.call(this),this.fontName="helvetica",this.combo=!1};ao(Ry,Ly);var Dy=function(){Ry.call(this),this.combo=!0};ao(Dy,Ry);var j_=function(){Dy.call(this),this.edit=!0};ao(j_,Dy);var rs=function(){kc.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,15)},set:function(n){n?this.Ff=pi(this.Ff,15):this.Ff=mi(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,16)},set:function(n){n?this.Ff=pi(this.Ff,16):this.Ff=mi(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,17)},set:function(n){n?this.Ff=pi(this.Ff,17):this.Ff=mi(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,26)},set:function(n){n?this.Ff=pi(this.Ff,26):this.Ff=mi(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var n=function(s){return s};if(this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),Object.keys(t).length!==0){var r,i=[];for(r in i.push("<<"),t)i.push("/"+r+" ("+Em(n(t[r]))+")");return i.push(">>"),i.join(`
`)}},set:function(n){Gn(n)==="object"&&(t=n)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(n){typeof n=="string"&&(t.CA=n)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(n){var r=n==null?"":n.toString();r.substr(0,1)==="/"&&(r=r.substr(1)),e="/"+hm(r)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(n){e="/"+hm(n)}})};ao(rs,kc);var B_=function(){rs.call(this),this.pushButton=!0};ao(B_,rs);var Uy=function(){rs.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:[]}})};ao(Uy,rs);var LN=function(){var e,t;kc.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(i){e=i}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(i){t=i}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var i=function(o){return o};this.scope&&(i=this.scope.internal.getEncryptor(this.objId));var s,a=[];for(s in a.push("<<"),r)a.push("/"+s+" ("+Em(i(r[s]))+")");return a.push(">>"),a.join(`
`)},set:function(i){Gn(i)==="object"&&(r=i)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(i){typeof i=="string"&&(r.CA=i)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(i){var s=i==null?"":i.toString();s.substr(0,1)==="/"&&(s=s.substr(1)),n="/"+hm(s)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(i){var s=i==null?"":i.toString();s.substr(0,1)==="/"&&(s=s.substr(1)),n="/"+hm(s)}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=wt.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};ao(LN,kc),Uy.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 n=this.Kids[t];n.appearanceStreamContent=e.createAppearanceStream(n.optionName),n.caption=e.getCA()}},Uy.prototype.createOption=function(e){var t=new LN;return t.Parent=this,t.optionName=e,this.Kids.push(t),M_t.call(this.scope,t),t};var N_=function(){rs.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=wt.CheckBox.createAppearanceStream()};ao(N_,rs);var Op=function(){kc.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,13)},set:function(t){t?this.Ff=pi(this.Ff,13):this.Ff=mi(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,21)},set:function(t){t?this.Ff=pi(this.Ff,21):this.Ff=mi(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,23)},set:function(t){t?this.Ff=pi(this.Ff,23):this.Ff=mi(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,24)},set:function(t){t?this.Ff=pi(this.Ff,24):this.Ff=mi(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,25)},set:function(t){t?this.Ff=pi(this.Ff,25):this.Ff=mi(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,26)},set:function(t){t?this.Ff=pi(this.Ff,26):this.Ff=mi(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}})};ao(Op,kc);var E_=function(){Op.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!Ai(this.Ff,14)},set:function(e){e?this.Ff=pi(this.Ff,14):this.Ff=mi(this.Ff,14)}}),this.password=!0};ao(E_,Op);var wt={CheckBox:{createAppearanceStream:function(){return{N:{On:wt.CheckBox.YesNormal},D:{On:wt.CheckBox.YesPushDown,Off:wt.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=Uc(e);t.scope=e.scope;var n=[],r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,i=e.scope.__private__.encodeColorString(e.color),s=RR(e,e.caption);return n.push("0.749023 g"),n.push("0 0 "+rn(wt.internal.getWidth(e))+" "+rn(wt.internal.getHeight(e))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+rn(s.fontSize)+" Tf "+i),n.push("BT"),n.push(s.text),n.push("ET"),n.push("Q"),n.push("EMC"),t.stream=n.join(`
`),t},YesNormal:function(e){var t=Uc(e);t.scope=e.scope;var n=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color),i=[],s=wt.internal.getHeight(e),a=wt.internal.getWidth(e),o=RR(e,e.caption);return i.push("1 g"),i.push("0 0 "+rn(a)+" "+rn(s)+" re"),i.push("f"),i.push("q"),i.push("0 0 1 rg"),i.push("0 0 "+rn(a-1)+" "+rn(s-1)+" re"),i.push("W"),i.push("n"),i.push("0 g"),i.push("BT"),i.push("/"+n+" "+rn(o.fontSize)+" Tf "+r),i.push(o.text),i.push("ET"),i.push("Q"),t.stream=i.join(`
`),t},OffPushDown:function(e){var t=Uc(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+rn(wt.internal.getWidth(e))+" "+rn(wt.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join(`
`),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:wt.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=wt.RadioButton.Circle.YesNormal,t.D[e]=wt.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=Uc(e);t.scope=e.scope;var n=[],r=wt.internal.getWidth(e)<=wt.internal.getHeight(e)?wt.internal.getWidth(e)/4:wt.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=wt.internal.Bezier_C,s=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+oh(wt.internal.getWidth(e)/2)+" "+oh(wt.internal.getHeight(e)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
`),t},YesPushDown:function(e){var t=Uc(e);t.scope=e.scope;var n=[],r=wt.internal.getWidth(e)<=wt.internal.getHeight(e)?wt.internal.getWidth(e)/4:wt.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),s=Number((i*wt.internal.Bezier_C).toFixed(5)),a=Number((r*wt.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+oh(wt.internal.getWidth(e)/2)+" "+oh(wt.internal.getHeight(e)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+s+" "+s+" "+i+" 0 "+i+" c"),n.push("-"+s+" "+i+" -"+i+" "+s+" -"+i+" 0 c"),n.push("-"+i+" -"+s+" -"+s+" -"+i+" 0 -"+i+" c"),n.push(s+" -"+i+" "+i+" -"+s+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+oh(wt.internal.getWidth(e)/2)+" "+oh(wt.internal.getHeight(e)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
`),t},OffPushDown:function(e){var t=Uc(e);t.scope=e.scope;var n=[],r=wt.internal.getWidth(e)<=wt.internal.getHeight(e)?wt.internal.getWidth(e)/4:wt.internal.getHeight(e)/4;r=Number((.9*r).toFixed(5));var i=Number((2*r).toFixed(5)),s=Number((i*wt.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+oh(wt.internal.getWidth(e)/2)+" "+oh(wt.internal.getHeight(e)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+s+" "+s+" "+i+" 0 "+i+" c"),n.push("-"+s+" "+i+" -"+i+" "+s+" -"+i+" 0 c"),n.push("-"+i+" -"+s+" -"+s+" -"+i+" 0 -"+i+" c"),n.push(s+" -"+i+" "+i+" -"+s+" "+i+" 0 c"),n.push("f"),n.push("Q"),t.stream=n.join(`
`),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:wt.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=wt.RadioButton.Cross.YesNormal,t.D[e]=wt.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=Uc(e);t.scope=e.scope;var n=[],r=wt.internal.calculateCross(e);return n.push("q"),n.push("1 1 "+rn(wt.internal.getWidth(e)-2)+" "+rn(wt.internal.getHeight(e)-2)+" re"),n.push("W"),n.push("n"),n.push(rn(r.x1.x)+" "+rn(r.x1.y)+" m"),n.push(rn(r.x2.x)+" "+rn(r.x2.y)+" l"),n.push(rn(r.x4.x)+" "+rn(r.x4.y)+" m"),n.push(rn(r.x3.x)+" "+rn(r.x3.y)+" l"),n.push("s"),n.push("Q"),t.stream=n.join(`
`),t},YesPushDown:function(e){var t=Uc(e);t.scope=e.scope;var n=wt.internal.calculateCross(e),r=[];return r.push("0.749023 g"),r.push("0 0 "+rn(wt.internal.getWidth(e))+" "+rn(wt.internal.getHeight(e))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+rn(wt.internal.getWidth(e)-2)+" "+rn(wt.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(rn(n.x1.x)+" "+rn(n.x1.y)+" m"),r.push(rn(n.x2.x)+" "+rn(n.x2.y)+" l"),r.push(rn(n.x4.x)+" "+rn(n.x4.y)+" m"),r.push(rn(n.x3.x)+" "+rn(n.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join(`
`),t},OffPushDown:function(e){var t=Uc(e);t.scope=e.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+rn(wt.internal.getWidth(e))+" "+rn(wt.internal.getHeight(e))+" re"),n.push("f"),t.stream=n.join(`
`),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+n}};wt.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=wt.internal.getWidth(e),n=wt.internal.getHeight(e),r=Math.min(t,n);return{x1:{x:(t-r)/2,y:(n-r)/2+r},x2:{x:(t-r)/2+r,y:(n-r)/2},x3:{x:(t-r)/2,y:(n-r)/2},x4:{x:(t-r)/2+r,y:(n-r)/2+r}}}},wt.internal.getWidth=function(e){var t=0;return Gn(e)==="object"&&(t=lZ(e.Rect[2])),t},wt.internal.getHeight=function(e){var t=0;return Gn(e)==="object"&&(t=lZ(e.Rect[3])),t};var M_t=ei.addField=function(e){if(F_t(this,e),!(e instanceof kc))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};ei.AcroFormChoiceField=Ly,ei.AcroFormListBox=Ry,ei.AcroFormComboBox=Dy,ei.AcroFormEditBox=j_,ei.AcroFormButton=rs,ei.AcroFormPushButton=B_,ei.AcroFormRadioButton=Uy,ei.AcroFormCheckBox=N_,ei.AcroFormTextField=Op,ei.AcroFormPasswordField=E_,ei.AcroFormAppearance=wt,ei.AcroForm={ChoiceField:Ly,ListBox:Ry,ComboBox:Dy,EditBox:j_,Button:rs,PushButton:B_,RadioButton:Uy,CheckBox:N_,TextField:Op,PasswordField:E_,Appearance:wt},It.AcroForm={ChoiceField:Ly,ListBox:Ry,ComboBox:Dy,EditBox:j_,Button:rs,PushButton:B_,RadioButton:Uy,CheckBox:N_,TextField:Op,PasswordField:E_,Appearance:wt};function Wve(e){return e.reduce(function(t,n,r){return t[n]=r,t},{})}(function(e){var t="addImage_";e.__addimage__={};var n="UNKNOWN",r={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]]},i=e.__addimage__.getImageFileTypeByImageData=function(T,N){var F,L,U,H,K,$=n;if((N=N||n)==="RGBA"||T.data!==void 0&&T.data instanceof Uint8ClampedArray&&"height"in T&&"width"in T)return"RGBA";if(k(T))for(K in r)for(U=r[K],F=0;F<U.length;F+=1){for(H=!0,L=0;L<U[F].length;L+=1)if(U[F][L]!==void 0&&U[F][L]!==T[L]){H=!1;break}if(H===!0){$=K;break}}else for(K in r)for(U=r[K],F=0;F<U.length;F+=1){for(H=!0,L=0;L<U[F].length;L+=1)if(U[F][L]!==void 0&&U[F][L]!==T.charCodeAt(L)){H=!1;break}if(H===!0){$=K;break}}return $===n&&N!==n&&($=N),$},s=function T(N){for(var F=this.internal.write,L=this.internal.putStream,U=(0,this.internal.getFilters)();U.indexOf("FlateEncode")!==-1;)U.splice(U.indexOf("FlateEncode"),1);N.objectId=this.internal.newObject();var H=[];if(H.push({key:"Type",value:"/XObject"}),H.push({key:"Subtype",value:"/Image"}),H.push({key:"Width",value:N.width}),H.push({key:"Height",value:N.height}),N.colorSpace===y.INDEXED?H.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(N.palette.length/3-1)+" "+("sMask"in N&&N.sMask!==void 0?N.objectId+2:N.objectId+1)+" 0 R]"}):(H.push({key:"ColorSpace",value:"/"+N.colorSpace}),N.colorSpace===y.DEVICE_CMYK&&H.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),H.push({key:"BitsPerComponent",value:N.bitsPerComponent}),"decodeParameters"in N&&N.decodeParameters!==void 0&&H.push({key:"DecodeParms",value:"<<"+N.decodeParameters+">>"}),"transparency"in N&&Array.isArray(N.transparency)&&N.transparency.length>0){for(var K="",$=0,z=N.transparency.length;$<z;$++)K+=N.transparency[$]+" "+N.transparency[$]+" ";H.push({key:"Mask",value:"["+K+"]"})}N.sMask!==void 0&&H.push({key:"SMask",value:N.objectId+1+" 0 R"});var Q=N.filter!==void 0?["/"+N.filter]:void 0;if(L({data:N.data,additionalKeyValues:H,alreadyAppliedFilters:Q,objectId:N.objectId}),F("endobj"),"sMask"in N&&N.sMask!==void 0){var oe,R=(oe=N.sMaskBitsPerComponent)!==null&&oe!==void 0?oe:N.bitsPerComponent,M={width:N.width,height:N.height,colorSpace:"DeviceGray",bitsPerComponent:R,data:N.sMask};"filter"in N&&(M.decodeParameters="/Predictor ".concat(N.predictor," /Colors 1 /BitsPerComponent ").concat(R," /Columns ").concat(N.width),M.filter=N.filter),T.call(this,M)}if(N.colorSpace===y.INDEXED){var Y=this.internal.newObject();L({data:B(new Uint8Array(N.palette)),objectId:Y}),F("endobj")}},a=function(){var T=this.internal.collections[t+"images"];for(var N in T)s.call(this,T[N])},o=function(){var T,N=this.internal.collections[t+"images"],F=this.internal.write;for(var L in N)F("/I"+(T=N[L]).index,T.objectId,"0","R")},c=function(){this.internal.collections[t+"images"]||(this.internal.collections[t+"images"]={},this.internal.events.subscribe("putResources",a),this.internal.events.subscribe("putXobjectDict",o))},u=function(){var T=this.internal.collections[t+"images"];return c.call(this),T},d=function(){return Object.keys(this.internal.collections[t+"images"]).length},h=function(T){return typeof e["process"+T.toUpperCase()]=="function"},A=function(T){return Gn(T)==="object"&&T.nodeType===1},f=function(T,N){if(T.nodeName==="IMG"&&T.hasAttribute("src")){var F=""+T.getAttribute("src");if(F.indexOf("data:image/")===0)return __(unescape(F).split("base64,").pop());var L=e.loadFile(F,!0);if(L!==void 0)return L}if(T.nodeName==="CANVAS"){if(T.width===0||T.height===0)throw new Error("Given canvas must have data. Canvas width: "+T.width+", height: "+T.height);var U;switch(N){case"PNG":U="image/png";break;case"WEBP":U="image/webp";break;default:U="image/jpeg"}return __(T.toDataURL(U,1).split("base64,").pop())}},p=function(T){var N=this.internal.collections[t+"images"];if(N){for(var F in N)if(T===N[F].alias)return N[F]}},m=function(T,N,F){return T||N||(T=-96,N=-96),T<0&&(T=-1*F.width*72/T/this.internal.scaleFactor),N<0&&(N=-1*F.height*72/N/this.internal.scaleFactor),T===0&&(T=N*F.width/F.height),N===0&&(N=T*F.height/F.width),[T,N]},g=function(T,N,F,L,U,H){var K=m.call(this,F,L,U),$=this.internal.getCoordinateString,z=this.internal.getVerticalCoordinateString,Q=u.call(this);if(F=K[0],L=K[1],Q[U.index]=U,H){H*=Math.PI/180;var oe=Math.cos(H),R=Math.sin(H),M=function(X){return X.toFixed(4)},Y=[M(oe),M(R),M(-1*R),M(oe),0,0,"cm"]}this.internal.write("q"),H?(this.internal.write([1,"0","0",1,$(T),z(N+L),"cm"].join(" ")),this.internal.write(Y.join(" ")),this.internal.write([$(F),"0","0",$(L),"0","0","cm"].join(" "))):this.internal.write([$(F),"0","0",$(L),$(T),z(N+L),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+U.index+" Do"),this.internal.write("Q")},y=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 v=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},x=e.__addimage__.sHashCode=function(T){var N,F,L=0;if(typeof T=="string")for(F=T.length,N=0;N<F;N++)L=(L<<5)-L+T.charCodeAt(N),L|=0;else if(k(T))for(F=T.byteLength/2,N=0;N<F;N++)L=(L<<5)-L+T[N],L|=0;return L},w=e.__addimage__.validateStringAsBase64=function(T){(T=T||"").toString().trim();var N=!0;return T.length===0&&(N=!1),T.length%4!=0&&(N=!1),/^[A-Za-z0-9+/]+$/.test(T.substr(0,T.length-2))===!1&&(N=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(T.substr(-2))===!1&&(N=!1),N},b=e.__addimage__.extractImageFromDataUrl=function(T){if(T==null||!(T=T.trim()).startsWith("data:"))return null;var N=T.indexOf(",");return N<0?null:T.substring(0,N).trim().endsWith("base64")?T.substring(N+1):null};e.__addimage__.isArrayBuffer=function(T){return T instanceof ArrayBuffer};var k=e.__addimage__.isArrayBufferView=function(T){return T instanceof Int8Array||T instanceof Uint8Array||T instanceof Uint8ClampedArray||T instanceof Int16Array||T instanceof Uint16Array||T instanceof Int32Array||T instanceof Uint32Array||T instanceof Float32Array||T instanceof Float64Array},j=e.__addimage__.binaryStringToUint8Array=function(T){for(var N=T.length,F=new Uint8Array(N),L=0;L<N;L++)F[L]=T.charCodeAt(L);return F},B=e.__addimage__.arrayBufferToBinaryString=function(T){for(var N="",F=k(T)?T:new Uint8Array(T),L=0;L<F.length;L+=8192)N+=String.fromCharCode.apply(null,F.subarray(L,L+8192));return N};e.addImage=function(){var T,N,F,L,U,H,K,$,z;if(typeof arguments[1]=="number"?(N=n,F=arguments[1],L=arguments[2],U=arguments[3],H=arguments[4],K=arguments[5],$=arguments[6],z=arguments[7]):(N=arguments[1],F=arguments[2],L=arguments[3],U=arguments[4],H=arguments[5],K=arguments[6],$=arguments[7],z=arguments[8]),Gn(T=arguments[0])==="object"&&!A(T)&&"imageData"in T){var Q=T;T=Q.imageData,N=Q.format||N||n,F=Q.x||F||0,L=Q.y||L||0,U=Q.w||Q.width||U,H=Q.h||Q.height||H,K=Q.alias||K,$=Q.compression||$,z=Q.rotation||Q.angle||z}var oe=this.internal.getFilters();if($===void 0&&oe.indexOf("FlateEncode")!==-1&&($="SLOW"),isNaN(F)||isNaN(L))throw new Error("Invalid coordinates passed to jsPDF.addImage");c.call(this);var R=E.call(this,T,N,K,$);return g.call(this,F,L,U,H,R,z),this};var E=function(T,N,F,L){var U,H,K;if(typeof T=="string"&&i(T)===n){T=unescape(T);var $=I(T,!1);($!==""||($=e.loadFile(T,!0))!==void 0)&&(T=$)}if(A(T)&&(T=f(T,N)),N=i(T,N),!h(N))throw new Error("addImage does not support files of type '"+N+"', please ensure that a plugin for '"+N+"' support is added.");if(((K=F)==null||K.length===0)&&(F=function(z){return typeof z=="string"||k(z)?x(z):k(z.data)?x(z.data):null}(T)),(U=p.call(this,F))||(T instanceof Uint8Array||N==="RGBA"||(H=T,T=j(T)),U=this["process"+N.toUpperCase()](T,d.call(this),F,function(z){return z&&typeof z=="string"&&(z=z.toUpperCase()),z in e.image_compression?z:v.NONE}(L),H)),!U)throw new Error("An unknown error occurred whilst processing the image.");return U},I=e.__addimage__.convertBase64ToBinaryString=function(T,N){N=typeof N!="boolean"||N;var F,L="";if(typeof T=="string"){var U;F=(U=b(T))!==null&&U!==void 0?U:T;try{L=__(F)}catch(H){if(N)throw w(F)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+H.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return L};e.getImageProperties=function(T){var N,F,L="";if(A(T)&&(T=f(T)),typeof T=="string"&&i(T)===n&&((L=I(T,!1))===""&&(L=e.loadFile(T)||""),T=L),F=i(T),!h(F))throw new Error("addImage does not support files of type '"+F+"', please ensure that a plugin for '"+F+"' support is added.");if(T instanceof Uint8Array||(T=j(T)),!(N=this["process"+F.toUpperCase()](T)))throw new Error("An unknown error occurred whilst processing the image");return N.fileType=F,N}})(It.API),function(e){var t=function(n){if(n!==void 0&&n!="")return!0};It.API.events.push(["addPage",function(n){this.internal.getPageInfo(n.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(n){for(var r,i,s,a=this.internal.getCoordinateString,o=this.internal.getVerticalCoordinateString,c=this.internal.getPageInfoByObjId(n.objId),u=n.pageContext.annotations,d=!1,h=0;h<u.length&&!d;h++)switch((r=u[h]).type){case"link":(t(r.options.url)||t(r.options.pageNumber))&&(d=!0);break;case"reference":case"text":case"freetext":d=!0}if(d!=0){this.internal.write("/Annots [");for(var A=0;A<u.length;A++){r=u[A];var f=this.internal.pdfEscape,p=this.internal.getEncryptor(n.objId);switch(r.type){case"reference":this.internal.write(" "+r.object.objId+" 0 R ");break;case"text":var m=this.internal.newAdditionalObject(),g=this.internal.newAdditionalObject(),y=this.internal.getEncryptor(m.objId),v=r.title||"Note";s="<</Type /Annot /Subtype /Text "+(i="/Rect ["+a(r.bounds.x)+" "+o(r.bounds.y+r.bounds.h)+" "+a(r.bounds.x+r.bounds.w)+" "+o(r.bounds.y)+"] ")+"/Contents ("+f(y(r.contents))+")",s+=" /Popup "+g.objId+" 0 R",s+=" /P "+c.objId+" 0 R",s+=" /T ("+f(y(v))+") >>",m.content=s;var x=m.objId+" 0 R";s="<</Type /Annot /Subtype /Popup "+(i="/Rect ["+a(r.bounds.x+30)+" "+o(r.bounds.y+r.bounds.h)+" "+a(r.bounds.x+r.bounds.w+30)+" "+o(r.bounds.y)+"] ")+" /Parent "+x,r.open&&(s+=" /Open true"),s+=" >>",g.content=s,this.internal.write(m.objId,"0 R",g.objId,"0 R");break;case"freetext":i="/Rect ["+a(r.bounds.x)+" "+o(r.bounds.y)+" "+a(r.bounds.x+r.bounds.w)+" "+o(r.bounds.y+r.bounds.h)+"] ";var w="font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+(r.color||"#000000");s="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+f(p(r.contents))+")",s+=" /DS("+f(p(w))+")",s+=" /Border [0 0 0]",s+=" >>",this.internal.write(s);break;case"link":if(r.options.name){var b=this.annotations._nameMap[r.options.name];r.options.pageNumber=b.page,r.options.top=b.y}else r.options.top||(r.options.top=0);if(i="/Rect ["+r.finalBounds.x+" "+r.finalBounds.y+" "+r.finalBounds.w+" "+r.finalBounds.h+"] ",s="",r.options.url)s="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /A <</S /URI /URI ("+f(p(r.options.url))+") >>";else if(r.options.pageNumber)switch(s="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(r.options.pageNumber).objId+" 0 R",r.options.magFactor=r.options.magFactor||"XYZ",r.options.magFactor){case"Fit":s+=" /Fit]";break;case"FitH":s+=" /FitH "+r.options.top+"]";break;case"FitV":r.options.left=r.options.left||0,s+=" /FitV "+r.options.left+"]";break;default:var k=o(r.options.top);r.options.left=r.options.left||0,r.options.zoom===void 0&&(r.options.zoom=0),s+=" /XYZ "+r.options.left+" "+k+" "+r.options.zoom+"]"}s!=""&&(s+=" >>",this.internal.write(s))}}this.internal.write("]")}}]),e.createAnnotation=function(n){var r=this.internal.getCurrentPageInfo();switch(n.type){case"link":this.link(n.bounds.x,n.bounds.y,n.bounds.w,n.bounds.h,n);break;case"text":case"freetext":r.pageContext.annotations.push(n)}},e.link=function(n,r,i,s,a){var o=this.internal.getCurrentPageInfo(),c=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;o.pageContext.annotations.push({finalBounds:{x:c(n),y:u(r),w:c(n+i),h:u(r+s)},options:a,type:"link"})},e.textWithLink=function(n,r,i,s){var a,o,c=this.getTextWidth(n),u=this.internal.getLineHeight()/this.internal.scaleFactor;if(s.maxWidth!==void 0){o=s.maxWidth;var d=this.splitTextToSize(n,o).length;a=Math.ceil(u*d)}else o=c,a=u;return this.text(n,r,i,s),i+=.2*u,s.align==="center"&&(r-=c/2),s.align==="right"&&(r-=c),this.link(r,i-u,o,a,s),c},e.getTextWidth=function(n){var r=this.internal.getFontSize();return this.getStringUnitWidth(n)*r/this.internal.scaleFactor}}(It.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]},n={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}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];e.__arabicParser__={};var s=e.__arabicParser__.isInArabicSubstitutionA=function(m){return t[m.charCodeAt(0)]!==void 0},a=e.__arabicParser__.isArabicLetter=function(m){return typeof m=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(m)},o=e.__arabicParser__.isArabicEndLetter=function(m){return a(m)&&s(m)&&t[m.charCodeAt(0)].length<=2},c=e.__arabicParser__.isArabicAlfLetter=function(m){return a(m)&&i.indexOf(m.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(m){return a(m)&&s(m)&&t[m.charCodeAt(0)].length>=1};var u=e.__arabicParser__.arabicLetterHasFinalForm=function(m){return a(m)&&s(m)&&t[m.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(m){return a(m)&&s(m)&&t[m.charCodeAt(0)].length>=3};var d=e.__arabicParser__.arabicLetterHasMedialForm=function(m){return a(m)&&s(m)&&t[m.charCodeAt(0)].length==4},h=e.__arabicParser__.resolveLigatures=function(m){var g=0,y=n,v="",x=0;for(g=0;g<m.length;g+=1)y[m.charCodeAt(g)]!==void 0?(x++,typeof(y=y[m.charCodeAt(g)])=="number"&&(v+=String.fromCharCode(y),y=n,x=0),g===m.length-1&&(y=n,v+=m.charAt(g-(x-1)),g-=x-1,x=0)):(y=n,v+=m.charAt(g-x),g-=x,x=0);return v};e.__arabicParser__.isArabicDiacritic=function(m){return m!==void 0&&r[m.charCodeAt(0)]!==void 0};var A=e.__arabicParser__.getCorrectForm=function(m,g,y){return a(m)?s(m)===!1?-1:!u(m)||!a(g)&&!a(y)||!a(y)&&o(g)||o(m)&&!a(g)||o(m)&&c(g)||o(m)&&o(g)?0:d(m)&&a(g)&&!o(g)&&a(y)&&u(y)?3:o(m)||!a(y)?1:2:-1},f=function(m){var g=0,y=0,v=0,x="",w="",b="",k=(m=m||"").split("\\s+"),j=[];for(g=0;g<k.length;g+=1){for(j.push(""),y=0;y<k[g].length;y+=1)x=k[g][y],w=k[g][y-1],b=k[g][y+1],a(x)?(v=A(x,w,b),j[g]+=v!==-1?String.fromCharCode(t[x.charCodeAt(0)][v]):x):j[g]+=x;j[g]=h(j[g])}return j.join(" ")},p=e.__arabicParser__.processArabic=e.processArabic=function(){var m,g=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,y=[];if(Array.isArray(g)){var v=0;for(y=[],v=0;v<g.length;v+=1)Array.isArray(g[v])?y.push([f(g[v][0]),g[v][1],g[v][2]]):y.push([f(g[v])]);m=y}else m=f(g);return typeof arguments[0]=="string"?m:(arguments[0].text=m,arguments[0])};e.events.push(["preProcessText",p])}(It.API),It.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 n=void 0;Object.defineProperty(this,"pdf",{get:function(){return n},set:function(o){n=o}});var r=150;Object.defineProperty(this,"width",{get:function(){return r},set:function(o){r=isNaN(o)||Number.isInteger(o)===!1||o<0?150:o,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=r+1)}});var i=300;Object.defineProperty(this,"height",{get:function(){return i},set:function(o){i=isNaN(o)||Number.isInteger(o)===!1||o<0?300:o,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=i+1)}});var s=[];Object.defineProperty(this,"childNodes",{get:function(){return s},set:function(o){s=o}});var a={};Object.defineProperty(this,"style",{get:function(){return a},set:function(o){a=o}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(n,r){var i;if((n=n||"2d")!=="2d")return null;for(i in r)this.pdf.context2d.hasOwnProperty(i)&&(this.pdf.context2d[i]=r[i]);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}])}(It.API),function(e){var t={left:0,top:0,bottom:0,right:0},n=!1,r=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(),i.call(this))},i=function(){this.internal.__cell__.lastCell=new s,this.internal.__cell__.pages=1},s=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 h=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return h},set:function(m){h=m}});var A=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return A},set:function(m){A=m}});var f=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return f},set:function(m){f=m}});var p=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return p},set:function(m){p=m}}),this};s.prototype.clone=function(){return new s(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},s.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(c){return r.call(this),this.internal.__cell__.headerFunction=typeof c=="function"?c:void 0,this},e.getTextDimensions=function(c,u){r.call(this);var d=(u=u||{}).fontSize||this.getFontSize(),h=u.font||this.getFont(),A=u.scaleFactor||this.internal.scaleFactor,f=0,p=0,m=0,g=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 y=u.maxWidth;y>0?typeof c=="string"?c=this.splitTextToSize(c,y):Object.prototype.toString.call(c)==="[object Array]"&&(c=c.reduce(function(x,w){return x.concat(g.splitTextToSize(w,y))},[])):c=Array.isArray(c)?c:[c];for(var v=0;v<c.length;v++)f<(m=this.getStringUnitWidth(c[v],{font:h})*d)&&(f=m);return f!==0&&(p=c.length),{w:f/=A,h:Math.max((p*d*this.getLineHeightFactor()-d*(this.getLineHeightFactor()-1))/A,0)}},e.cellAddPage=function(){r.call(this),this.addPage();var c=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new s(c.left,c.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var a=e.cell=function(){var c;c=arguments[0]instanceof s?arguments[0]:new s(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),r.call(this);var u=this.internal.__cell__.lastCell,d=this.internal.__cell__.padding,h=this.internal.__cell__.margins||t,A=this.internal.__cell__.tableHeaderRow,f=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+h.bottom>this.getPageHeight()?(this.cellAddPage(),c.y=h.top,f&&A&&(this.printHeaderRow(c.lineNumber,!0),c.y+=A[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,n===!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,h,A){if(r.call(this),!d)throw new Error("No data for PDF table.");var f,p,m,g,y=[],v=[],x=[],w={},b={},k=[],j=[],B=(A=A||{}).autoSize||!1,E=A.printHeaders!==!1,I=A.css&&A.css["font-size"]!==void 0?16*A.css["font-size"]:A.fontSize||12,T=A.margins||Object.assign({width:this.getPageWidth()},t),N=typeof A.padding=="number"?A.padding:3,F=A.headerBackgroundColor||"#c8c8c8",L=A.headerTextColor||"#000";if(i.call(this),this.internal.__cell__.printHeaders=E,this.internal.__cell__.margins=T,this.internal.__cell__.table_font_size=I,this.internal.__cell__.padding=N,this.internal.__cell__.headerBackgroundColor=F,this.internal.__cell__.headerTextColor=L,this.setFontSize(I),h==null)v=y=Object.keys(d[0]),x=y.map(function(){return"left"});else if(Array.isArray(h)&&Gn(h[0])==="object")for(y=h.map(function(Q){return Q.name}),v=h.map(function(Q){return Q.prompt||Q.name||""}),x=h.map(function(Q){return Q.align||"left"}),f=0;f<h.length;f+=1)b[h[f].name]=.7499990551181103*h[f].width;else Array.isArray(h)&&typeof h[0]=="string"&&(v=y=h,x=y.map(function(){return"left"}));if(B||Array.isArray(h)&&typeof h[0]=="string")for(f=0;f<y.length;f+=1){for(w[g=y[f]]=d.map(function(Q){return Q[g]}),this.setFont(void 0,"bold"),k.push(this.getTextDimensions(v[f],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),p=w[g],this.setFont(void 0,"normal"),m=0;m<p.length;m+=1)k.push(this.getTextDimensions(p[m],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);b[g]=Math.max.apply(null,k)+N+N,k=[]}if(E){var U={};for(f=0;f<y.length;f+=1)U[y[f]]={},U[y[f]].text=v[f],U[y[f]].align=x[f];var H=o.call(this,U,b);j=y.map(function(Q){return new s(c,u,b[Q],H,U[Q].text,void 0,U[Q].align)}),this.setTableHeaderRow(j),this.printHeaderRow(1,!1)}var K=h.reduce(function(Q,oe){return Q[oe.name]=oe.align,Q},{});for(f=0;f<d.length;f+=1){"rowStart"in A&&A.rowStart instanceof Function&&A.rowStart({row:f,data:d[f]},this);var $=o.call(this,d[f],b);for(m=0;m<y.length;m+=1){var z=d[f][y[m]];"cellStart"in A&&A.cellStart instanceof Function&&A.cellStart({row:f,col:m,data:z},this),a.call(this,new s(c,u,b[y[m]],$,z,f+2,K[y[m]]))}}return this.internal.__cell__.table_x=c,this.internal.__cell__.table_y=u,this};var o=function(c,u){var d=this.internal.__cell__.padding,h=this.internal.__cell__.table_font_size,A=this.internal.scaleFactor;return Object.keys(c).map(function(f){var p=c[f];return this.splitTextToSize(p.hasOwnProperty("text")?p.text:p,u[f]-d-d)},this).map(function(f){return this.getLineHeightFactor()*f.length*h/A+d+d},this).reduce(function(f,p){return Math.max(f,p)},0)};e.setTableHeaderRow=function(c){r.call(this),this.internal.__cell__.tableHeaderRow=c},e.printHeaderRow=function(c,u){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var d;if(n=!0,typeof this.internal.__cell__.headerFunction=="function"){var h=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new s(h[0],h[1],h[2],h[3],void 0,-1)}this.setFont(void 0,"bold");for(var A=[],f=0;f<this.internal.__cell__.tableHeaderRow.length;f+=1){d=this.internal.__cell__.tableHeaderRow[f].clone(),u&&(d.y=this.internal.__cell__.margins.top||0,A.push(d)),d.lineNumber=c;var p=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),a.call(this,d),this.setTextColor(p)}A.length>0&&this.setTableHeaderRow(A),this.setFont(void 0,"normal"),n=!1}}(It.API);var Gve={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},Yve=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],DR=Wve(Yve),Xve=[100,200,300,400,500,600,700,800,900],L_t=Wve(Xve);function AO(e){var t=e.family.replace(/"|'/g,"").toLowerCase(),n=function(s){return Gve[s=s||"normal"]?s:"normal"}(e.style),r=function(s){return s?typeof s=="number"?s>=100&&s<=900&&s%100==0?s:400:/^\d00$/.test(s)?parseInt(s):s==="bold"?700:400:400}(e.weight),i=function(s){return typeof DR[s=s||"normal"]=="number"?s:"normal"}(e.stretch);return{family:t,style:n,weight:r,stretch:i,src:e.src||[],ref:e.ref||{name:t,style:[i,n,r].join(" ")}}}function cZ(e,t,n,r){var i;for(i=n;i>=0&&i<t.length;i+=r)if(e[t[i]])return e[t[i]];for(i=n;i>=0&&i<t.length;i-=r)if(e[t[i]])return e[t[i]]}var R_t={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},uZ={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function dZ(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function hZ(e){return e.trimLeft()}function D_t(e,t){for(var n=0;n<e.length;){if(e.charAt(n)===t)return[e.substring(0,n),e.substring(n+1)];n+=1}return null}function U_t(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 kg,pk,fZ,AZ,pZ,pO=["times"];function mZ(e,t,n,r,i){var s=4,a=yZ;switch(i){case It.API.image_compression.FAST:s=1,a=gZ;break;case It.API.image_compression.MEDIUM:s=6,a=vZ;break;case It.API.image_compression.SLOW:s=9,a=xZ}e=function(c,u,d,h){for(var A,f=c.length/u,p=new Uint8Array(c.length+f),m=[H_t,gZ,yZ,vZ,xZ],g=0;g<f;g+=1){var y=g*u,v=c.subarray(y,y+u);if(h)p.set(h(v,d,A),y+g);else{for(var x=m.length,w=[],b=0;b<x;b+=1)w[b]=m[b](v,d,A);var k=$_t(w.concat());p.set(w[k],y+g)}A=v}return p}(e,t,Math.ceil(n*r/8),a);var o=_R(e,{level:s});return It.API.__addimage__.arrayBufferToBinaryString(o)}function H_t(e){var t=Array.apply([],e);return t.unshift(0),t}function gZ(e,t){var n=e.length,r=[];r[0]=1;for(var i=0;i<n;i+=1){var s=e[i-t]||0;r[i+1]=e[i]-s+256&255}return r}function yZ(e,t,n){var r=e.length,i=[];i[0]=2;for(var s=0;s<r;s+=1){var a=n&&n[s]||0;i[s+1]=e[s]-a+256&255}return i}function vZ(e,t,n){var r=e.length,i=[];i[0]=3;for(var s=0;s<r;s+=1){var a=e[s-t]||0,o=n&&n[s]||0;i[s+1]=e[s]+256-(a+o>>>1)&255}return i}function xZ(e,t,n){var r=e.length,i=[];i[0]=4;for(var s=0;s<r;s+=1){var a=Q_t(e[s-t]||0,n&&n[s]||0,n&&n[s-t]||0);i[s+1]=e[s]-a+256&255}return i}function Q_t(e,t,n){if(e===t&&t===n)return e;var r=Math.abs(t-n),i=Math.abs(e-n),s=Math.abs(e+t-n-n);return r<=i&&r<=s?e:i<=s?t:n}function $_t(e){var t=e.map(function(n){return n.reduce(function(r,i){return r+Math.abs(i)},0)});return t.indexOf(Math.min.apply(null,t))}function mO(e,t,n){var r=t*n,i=Math.floor(r/8),s=16-(r-8*i+n),a=(1<<n)-1;return Jve(e,i)>>s&a}function wZ(e,t,n,r){var i=n*r,s=Math.floor(i/8),a=16-(i-8*s+r),o=(1<<r)-1,c=(t&o)<<a;(function(u,d,h){if(d+1<u.byteLength)u.setUint16(d,h,!1);else{var A=h>>8&255;u.setUint8(d,A)}})(e,s,Jve(e,s)&~(o<<a)&65535|c)}function Jve(e,t){return t+1<e.byteLength?e.getUint16(t,!1):e.getUint8(t)<<8}function z_t(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 n=e[t++]|e[t++]<<8,r=e[t++]|e[t++]<<8,i=e[t++],s=i>>7,a=1<<1+(7&i);e[t++],e[t++];var o=null,c=null;s&&(o=t,c=a,t+=3*a);var u=!0,d=[],h=0,A=null,f=0,p=null;for(this.width=n,this.height=r;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,p=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((T=e[t++])>=0))throw Error("Invalid block size");if(T===0)break;t+=T}break;case 249:if(e[t++]!==4||e[t+4]!==0)throw new Error("Invalid graphics extension block.");var m=e[t++];h=e[t++]|e[t++]<<8,A=e[t++],1&m||(A=null),f=m>>2&7,t++;break;case 254:for(;;){if(!((T=e[t++])>=0))throw Error("Invalid block size");if(T===0)break;t+=T}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var g=e[t++]|e[t++]<<8,y=e[t++]|e[t++]<<8,v=e[t++]|e[t++]<<8,x=e[t++]|e[t++]<<8,w=e[t++],b=w>>6&1,k=1<<1+(7&w),j=o,B=c,E=!1;w>>7&&(E=!0,j=t,B=k,t+=3*k);var I=t;for(t++;;){var T;if(!((T=e[t++])>=0))throw Error("Invalid block size");if(T===0)break;t+=T}d.push({x:g,y,width:v,height:x,has_local_palette:E,palette_offset:j,palette_size:B,data_offset:I,data_length:t-I,transparent_index:A,interlaced:!!b,delay:h,disposal:f});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 p},this.frameInfo=function(N){if(N<0||N>=d.length)throw new Error("Frame index out of range.");return d[N]},this.decodeAndBlitFrameBGRA=function(N,F){var L=this.frameInfo(N),U=L.width*L.height;if(U>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var H=new Uint8Array(U);bZ(e,L.data_offset,H,U);var K=L.palette_offset,$=L.transparent_index;$===null&&($=256);var z=L.width,Q=n-z,oe=z,R=4*(L.y*n+L.x),M=4*((L.y+L.height)*n+L.x),Y=R,X=4*Q;L.interlaced===!0&&(X+=4*n*7);for(var q=8,Z=0,de=H.length;Z<de;++Z){var ue=H[Z];if(oe===0&&(oe=z,(Y+=X)>=M&&(X=4*Q+4*n*(q-1),Y=R+(z+Q)*(q<<1),q>>=1)),ue===$)Y+=4;else{var ae=e[K+3*ue],he=e[K+3*ue+1],ie=e[K+3*ue+2];F[Y++]=ie,F[Y++]=he,F[Y++]=ae,F[Y++]=255}--oe}},this.decodeAndBlitFrameRGBA=function(N,F){var L=this.frameInfo(N),U=L.width*L.height;if(U>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var H=new Uint8Array(U);bZ(e,L.data_offset,H,U);var K=L.palette_offset,$=L.transparent_index;$===null&&($=256);var z=L.width,Q=n-z,oe=z,R=4*(L.y*n+L.x),M=4*((L.y+L.height)*n+L.x),Y=R,X=4*Q;L.interlaced===!0&&(X+=4*n*7);for(var q=8,Z=0,de=H.length;Z<de;++Z){var ue=H[Z];if(oe===0&&(oe=z,(Y+=X)>=M&&(X=4*Q+4*n*(q-1),Y=R+(z+Q)*(q<<1),q>>=1)),ue===$)Y+=4;else{var ae=e[K+3*ue],he=e[K+3*ue+1],ie=e[K+3*ue+2];F[Y++]=ae,F[Y++]=he,F[Y++]=ie,F[Y++]=255}--oe}}}function bZ(e,t,n,r){for(var i=e[t++],s=1<<i,a=s+1,o=a+1,c=i+1,u=(1<<c)-1,d=0,h=0,A=0,f=e[t++],p=new Int32Array(4096),m=null;;){for(;d<16&&f!==0;)h|=e[t++]<<d,d+=8,f===1?f=e[t++]:--f;if(d<c)break;var g=h&u;if(h>>=c,d-=c,g!==s){if(g===a)break;for(var y=g<o?g:m,v=0,x=y;x>s;)x=p[x]>>8,++v;var w=x;if(A+v+(y!==g?1:0)>r)return void ir.log("Warning, gif stream longer than expected.");n[A++]=w;var b=A+=v;for(y!==g&&(n[A++]=w),x=y;v--;)x=p[x],n[--b]=255&x,x>>=8;m!==null&&o<4096&&(p[o++]=m<<8|w,o>=u+1&&c<12&&(++c,u=u<<1|1)),m=g}else o=a+1,u=(1<<(c=i+1))-1,m=null}return A!==r&&ir.log("Warning, gif stream shorter than expected."),n}/**
 * @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 gO(e){var t,n,r,i,s,a=Math.floor,o=new Array(64),c=new Array(64),u=new Array(64),d=new Array(64),h=new Array(65535),A=new Array(65535),f=new Array(64),p=new Array(64),m=[],g=0,y=7,v=new Array(64),x=new Array(64),w=new Array(64),b=new Array(256),k=new Array(2048),j=[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],B=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],E=[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],T=[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],N=[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],U=[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 H(R,M){for(var Y=0,X=0,q=new Array,Z=1;Z<=16;Z++){for(var de=1;de<=R[Z];de++)q[M[X]]=[],q[M[X]][0]=Y,q[M[X]][1]=Z,X++,Y++;Y*=2}return q}function K(R){for(var M=R[0],Y=R[1]-1;Y>=0;)M&1<<Y&&(g|=1<<y),Y--,--y<0&&(g==255?($(255),$(0)):$(g),y=7,g=0)}function $(R){m.push(R)}function z(R){$(R>>8&255),$(255&R)}function Q(R,M,Y,X,q){for(var Z,de=q[0],ue=q[240],ae=function(Te,ct){var we,$e,Ve,$t,yt,ye,Be,Ge,Ue,Ye,pe=0;for(Ue=0;Ue<8;++Ue){we=Te[pe],$e=Te[pe+1],Ve=Te[pe+2],$t=Te[pe+3],yt=Te[pe+4],ye=Te[pe+5],Be=Te[pe+6];var bt=we+(Ge=Te[pe+7]),mt=we-Ge,_t=$e+Be,Rt=$e-Be,Wt=Ve+ye,vt=Ve-ye,Dt=$t+yt,Ft=$t-yt,Zt=bt+Dt,lr=bt-Dt,cn=_t+Wt,Et=_t-Wt;Te[pe]=Zt+cn,Te[pe+4]=Zt-cn;var Mn=.707106781*(Et+lr);Te[pe+2]=lr+Mn,Te[pe+6]=lr-Mn;var Ht=.382683433*((Zt=Ft+vt)-(Et=Rt+mt)),en=.5411961*Zt+Ht,Bn=1.306562965*Et+Ht,Wr=.707106781*(cn=vt+Rt),St=mt+Wr,Xi=mt-Wr;Te[pe+5]=Xi+en,Te[pe+3]=Xi-en,Te[pe+1]=St+Bn,Te[pe+7]=St-Bn,pe+=8}for(pe=0,Ue=0;Ue<8;++Ue){we=Te[pe],$e=Te[pe+8],Ve=Te[pe+16],$t=Te[pe+24],yt=Te[pe+32],ye=Te[pe+40],Be=Te[pe+48];var ds=we+(Ge=Te[pe+56]),Er=we-Ge,ai=$e+Be,Gr=$e-Be,Ji=Ve+ye,hs=Ve-ye,oA=$t+yt,Md=$t-yt,Ol=ds+oA,Bc=ds-oA,Fl=ai+Ji,Ml=ai-Ji;Te[pe]=Ol+Fl,Te[pe+32]=Ol-Fl;var Qo=.707106781*(Ml+Bc);Te[pe+16]=Bc+Qo,Te[pe+48]=Bc-Qo;var lA=.382683433*((Ol=Md+hs)-(Ml=Gr+Er)),Nc=.5411961*Ol+lA,cA=1.306562965*Ml+lA,Tm=.707106781*(Fl=hs+Gr),Pm=Er+Tm,Im=Er-Tm;Te[pe+40]=Im+Nc,Te[pe+24]=Im-Nc,Te[pe+8]=Pm+cA,Te[pe+56]=Pm-cA,pe++}for(Ue=0;Ue<64;++Ue)Ye=Te[Ue]*ct[Ue],f[Ue]=Ye>0?Ye+.5|0:Ye-.5|0;return f}(R,M),he=0;he<64;++he)p[j[he]]=ae[he];var ie=p[0]-Y;Y=p[0],ie==0?K(X[0]):(K(X[A[Z=32767+ie]]),K(h[Z]));for(var Ce=63;Ce>0&&p[Ce]==0;)Ce--;if(Ce==0)return K(de),Y;for(var Oe,te=1;te<=Ce;){for(var je=te;p[te]==0&&te<=Ce;)++te;var tt=te-je;if(tt>=16){Oe=tt>>4;for(var nt=1;nt<=Oe;++nt)K(ue);tt&=15}Z=32767+p[te],K(q[(tt<<4)+A[Z]]),K(h[Z]),te++}return Ce!=63&&K(de),Y}function oe(R){R=Math.min(Math.max(R,1),100),s!=R&&(function(M){for(var Y=[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],X=0;X<64;X++){var q=a((Y[X]*M+50)/100);q=Math.min(Math.max(q,1),255),o[j[X]]=q}for(var Z=[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],de=0;de<64;de++){var ue=a((Z[de]*M+50)/100);ue=Math.min(Math.max(ue,1),255),c[j[de]]=ue}for(var ae=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],he=0,ie=0;ie<8;ie++)for(var Ce=0;Ce<8;Ce++)u[he]=1/(o[j[he]]*ae[ie]*ae[Ce]*8),d[he]=1/(c[j[he]]*ae[ie]*ae[Ce]*8),he++}(R<50?Math.floor(5e3/R):Math.floor(200-2*R)),s=R)}this.encode=function(R,M){M&&oe(M),m=new Array,g=0,y=7,z(65496),z(65504),z(16),$(74),$(70),$(73),$(70),$(0),$(1),$(1),$(0),z(1),z(1),$(0),$(0),function(){z(65499),z(132),$(0);for(var $e=0;$e<64;$e++)$(o[$e]);$(1);for(var Ve=0;Ve<64;Ve++)$(c[Ve])}(),function($e,Ve){z(65472),z(17),$(8),z(Ve),z($e),$(3),$(1),$(17),$(0),$(2),$(17),$(1),$(3),$(17),$(1)}(R.width,R.height),function(){z(65476),z(418),$(0);for(var $e=0;$e<16;$e++)$(B[$e+1]);for(var Ve=0;Ve<=11;Ve++)$(E[Ve]);$(16);for(var $t=0;$t<16;$t++)$(I[$t+1]);for(var yt=0;yt<=161;yt++)$(T[yt]);$(1);for(var ye=0;ye<16;ye++)$(N[ye+1]);for(var Be=0;Be<=11;Be++)$(F[Be]);$(17);for(var Ge=0;Ge<16;Ge++)$(L[Ge+1]);for(var Ue=0;Ue<=161;Ue++)$(U[Ue])}(),z(65498),z(12),$(3),$(1),$(0),$(2),$(17),$(3),$(17),$(0),$(63),$(0);var Y=0,X=0,q=0;g=0,y=7,this.encode.displayName="_encode_";for(var Z,de,ue,ae,he,ie,Ce,Oe,te,je=R.data,tt=R.width,nt=R.height,Te=4*tt,ct=0;ct<nt;){for(Z=0;Z<Te;){for(he=Te*ct+Z,Ce=-1,Oe=0,te=0;te<64;te++)ie=he+(Oe=te>>3)*Te+(Ce=4*(7&te)),ct+Oe>=nt&&(ie-=Te*(ct+1+Oe-nt)),Z+Ce>=Te&&(ie-=Z+Ce-Te+4),de=je[ie++],ue=je[ie++],ae=je[ie++],v[te]=(k[de]+k[ue+256|0]+k[ae+512|0]>>16)-128,x[te]=(k[de+768|0]+k[ue+1024|0]+k[ae+1280|0]>>16)-128,w[te]=(k[de+1280|0]+k[ue+1536|0]+k[ae+1792|0]>>16)-128;Y=Q(v,u,Y,t,r),X=Q(x,d,X,n,i),q=Q(w,d,q,n,i),Z+=32}ct+=8}if(y>=0){var we=[];we[1]=y+1,we[0]=(1<<y+1)-1,K(we)}return z(65497),new Uint8Array(m)},e=e||50,function(){for(var R=String.fromCharCode,M=0;M<256;M++)b[M]=R(M)}(),t=H(B,E),n=H(N,F),r=H(I,T),i=H(L,U),function(){for(var R=1,M=2,Y=1;Y<=15;Y++){for(var X=R;X<M;X++)A[32767+X]=Y,h[32767+X]=[],h[32767+X][1]=Y,h[32767+X][0]=X;for(var q=-(M-1);q<=-R;q++)A[32767+q]=Y,h[32767+q]=[],h[32767+q][1]=Y,h[32767+q][0]=M-1+q;R<<=1,M<<=1}}(),function(){for(var R=0;R<256;R++)k[R]=19595*R,k[R+256|0]=38470*R,k[R+512|0]=7471*R+32768,k[R+768|0]=-11059*R,k[R+1024|0]=-21709*R,k[R+1280|0]=32768*R+8421375,k[R+1536|0]=-27439*R,k[R+1792|0]=-5329*R}(),oe(e)}/**
 * @license
 * Copyright (c) 2017 Aras Abbasi
 *
 * Licensed under the MIT License.
 * http://opensource.org/licenses/mit-license
 */function Vl(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 CZ(e){function t(E){if(!E)throw Error("assert :P")}function n(E,I,T){for(var N=0;4>N;N++)if(E[I+N]!=T.charCodeAt(N))return!0;return!1}function r(E,I,T,N,F){for(var L=0;L<F;L++)E[I+L]=T[N+L]}function i(E,I,T,N){for(var F=0;F<N;F++)E[I+F]=T}function s(E){return new Int32Array(E)}function a(E,I){for(var T=[],N=0;N<E;N++)T.push(new I);return T}function o(E,I){var T=[];return function N(F,L,U){for(var H=U[L],K=0;K<H&&(F.push(U.length>L+1?[]:new I),!(U.length<L+1));K++)N(F[K],L+1,U)}(T,0,E),T}var c=function(){var E=this;function I(S,_){for(var O=1<<_-1>>>0;S&O;)O>>>=1;return O?(S&O-1)+O:S}function T(S,_,O,D,W){t(!(D%O));do S[_+(D-=O)]=W;while(0<D)}function N(S,_,O,D,W){if(t(2328>=W),512>=W)var G=s(512);else if((G=s(W))==null)return 0;return function(J,ee,ne,le,me,ke){var ce,ge,be=ee,Ee=1<<ne,Se=s(16),Ie=s(16);for(t(me!=0),t(le!=null),t(J!=null),t(0<ne),ge=0;ge<me;++ge){if(15<le[ge])return 0;++Se[le[ge]]}if(Se[0]==me)return 0;for(Ie[1]=0,ce=1;15>ce;++ce){if(Se[ce]>1<<ce)return 0;Ie[ce+1]=Ie[ce]+Se[ce]}for(ge=0;ge<me;++ge)ce=le[ge],0<le[ge]&&(ke[Ie[ce]++]=ge);if(Ie[15]==1)return(le=new F).g=0,le.value=ke[0],T(J,be,1,Ee,le),Ee;var Fe,ze=-1,Re=Ee-1,Pt=0,gt=1,un=1,jt=1<<ne;for(ge=0,ce=1,me=2;ce<=ne;++ce,me<<=1){if(gt+=un<<=1,0>(un-=Se[ce]))return 0;for(;0<Se[ce];--Se[ce])(le=new F).g=ce,le.value=ke[ge++],T(J,be+Pt,me,jt,le),Pt=I(Pt,ce)}for(ce=ne+1,me=2;15>=ce;++ce,me<<=1){if(gt+=un<<=1,0>(un-=Se[ce]))return 0;for(;0<Se[ce];--Se[ce]){if(le=new F,(Pt&Re)!=ze){for(be+=jt,Fe=1<<(ze=ce)-ne;15>ze&&!(0>=(Fe-=Se[ze]));)++ze,Fe<<=1;Ee+=jt=1<<(Fe=ze-ne),J[ee+(ze=Pt&Re)].g=Fe+ne,J[ee+ze].value=be-ee-ze}le.g=ce-ne,le.value=ke[ge++],T(J,be+(Pt>>ne),me,jt,le),Pt=I(Pt,ce)}}return gt!=2*Ie[15]-1?0:Ee}(S,_,O,D,W,G)}function F(){this.value=this.g=0}function L(){this.value=this.g=0}function U(){this.G=a(5,F),this.H=s(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=a(Km,L)}function H(S,_,O,D){t(S!=null),t(_!=null),t(2147483648>D),S.Ca=254,S.I=0,S.b=-8,S.Ka=0,S.oa=_,S.pa=O,S.Jd=_,S.Yc=O+D,S.Zc=4<=D?O+D-4+1:O,de(S)}function K(S,_){for(var O=0;0<_--;)O|=ae(S,128)<<_;return O}function $(S,_){var O=K(S,_);return ue(S)?-O:O}function z(S,_,O,D){var W,G=0;for(t(S!=null),t(_!=null),t(4294967288>D),S.Sb=D,S.Ra=0,S.u=0,S.h=0,4<D&&(D=4),W=0;W<D;++W)G+=_[O+W]<<8*W;S.Ra=G,S.bb=D,S.oa=_,S.pa=O}function Q(S){for(;8<=S.u&&S.bb<S.Sb;)S.Ra>>>=8,S.Ra+=S.oa[S.pa+S.bb]<<la-8>>>0,++S.bb,S.u-=8;X(S)&&(S.h=1,S.u=0)}function oe(S,_){if(t(0<=_),!S.h&&_<=J0){var O=Y(S)&vA[_];return S.u+=_,Q(S),O}return S.h=1,S.u=0}function R(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function M(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function Y(S){return S.Ra>>>(S.u&la-1)>>>0}function X(S){return t(S.bb<=S.Sb),S.h||S.bb==S.Sb&&S.u>la}function q(S,_){S.u=_,S.h=X(S)}function Z(S){S.u>=Oa&&(t(S.u>=Oa),Q(S))}function de(S){t(S!=null&&S.oa!=null),S.pa<S.Zc?(S.I=(S.oa[S.pa++]|S.I<<8)>>>0,S.b+=8):(t(S!=null&&S.oa!=null),S.pa<S.Yc?(S.b+=8,S.I=S.oa[S.pa++]|S.I<<8):S.Ka?S.b=0:(S.I<<=8,S.b+=8,S.Ka=1))}function ue(S){return K(S,1)}function ae(S,_){var O=S.Ca;0>S.b&&de(S);var D=S.b,W=O*_>>>8,G=(S.I>>>D>W)+0;for(G?(O-=W,S.I-=W+1<<D>>>0):O=W+1,D=O,W=0;256<=D;)W+=8,D>>=8;return D=7^W+qm[D],S.b-=D,S.Ca=(O<<D)-1,G}function he(S,_,O){S[_+0]=O>>24&255,S[_+1]=O>>16&255,S[_+2]=O>>8&255,S[_+3]=255&O}function ie(S,_){return S[_+0]|S[_+1]<<8}function Ce(S,_){return ie(S,_)|S[_+2]<<16}function Oe(S,_){return ie(S,_)|ie(S,_+2)<<16}function te(S,_){var O=1<<_;return t(S!=null),t(0<_),S.X=s(O),S.X==null?0:(S.Mb=32-_,S.Xa=_,1)}function je(S,_){t(S!=null),t(_!=null),t(S.Xa==_.Xa),r(_.X,0,S.X,0,1<<_.Xa)}function tt(){this.X=[],this.Xa=this.Mb=0}function nt(S,_,O,D){t(O!=null),t(D!=null);var W=O[0],G=D[0];return W==0&&(W=(S*G+_/2)/_),G==0&&(G=(_*W+S/2)/S),0>=W||0>=G?0:(O[0]=W,D[0]=G,1)}function Te(S,_){return S+(1<<_)-1>>>_}function ct(S,_){return((4278255360&S)+(4278255360&_)>>>0&4278255360)+((16711935&S)+(16711935&_)>>>0&16711935)>>>0}function we(S,_){E[_]=function(O,D,W,G,J,ee,ne){var le;for(le=0;le<J;++le){var me=E[S](ee[ne+le-1],W,G+le);ee[ne+le]=ct(O[D+le],me)}}}function $e(){this.ud=this.hd=this.jd=0}function Ve(S,_){return((4278124286&(S^_))>>>1)+(S&_)>>>0}function $t(S){return 0<=S&&256>S?S:0>S?0:255<S?255:void 0}function yt(S,_){return $t(S+(S-_+.5>>1))}function ye(S,_,O){return Math.abs(_-O)-Math.abs(S-O)}function Be(S,_,O,D,W,G,J){for(D=G[J-1],O=0;O<W;++O)G[J+O]=D=ct(S[_+O],D)}function Ge(S,_,O,D,W){var G;for(G=0;G<O;++G){var J=S[_+G],ee=J>>8&255,ne=16711935&(ne=(ne=16711935&J)+((ee<<16)+ee));D[W+G]=(4278255360&J)+ne>>>0}}function Ue(S,_){_.jd=255&S,_.hd=S>>8&255,_.ud=S>>16&255}function Ye(S,_,O,D,W,G){var J;for(J=0;J<D;++J){var ee=_[O+J],ne=ee>>>8,le=ee,me=255&(me=(me=ee>>>16)+((S.jd<<24>>24)*(ne<<24>>24)>>>5));le=255&(le=(le+=(S.hd<<24>>24)*(ne<<24>>24)>>>5)+((S.ud<<24>>24)*(me<<24>>24)>>>5)),W[G+J]=(4278255360&ee)+(me<<16)+le}}function pe(S,_,O,D,W){E[_]=function(G,J,ee,ne,le,me,ke,ce,ge){for(ne=ke;ne<ce;++ne)for(ke=0;ke<ge;++ke)le[me++]=W(ee[D(G[J++])])},E[S]=function(G,J,ee,ne,le,me,ke){var ce=8>>G.b,ge=G.Ea,be=G.K[0],Ee=G.w;if(8>ce)for(G=(1<<G.b)-1,Ee=(1<<ce)-1;J<ee;++J){var Se,Ie=0;for(Se=0;Se<ge;++Se)Se&G||(Ie=D(ne[le++])),me[ke++]=W(be[Ie&Ee]),Ie>>=ce}else E["VP8LMapColor"+O](ne,le,be,Ee,me,ke,J,ee,ge)}}function bt(S,_,O,D,W){for(O=_+O;_<O;){var G=S[_++];D[W++]=G>>16&255,D[W++]=G>>8&255,D[W++]=255&G}}function mt(S,_,O,D,W){for(O=_+O;_<O;){var G=S[_++];D[W++]=G>>16&255,D[W++]=G>>8&255,D[W++]=255&G,D[W++]=G>>24&255}}function _t(S,_,O,D,W){for(O=_+O;_<O;){var G=(J=S[_++])>>16&240|J>>12&15,J=240&J|J>>28&15;D[W++]=G,D[W++]=J}}function Rt(S,_,O,D,W){for(O=_+O;_<O;){var G=(J=S[_++])>>16&248|J>>13&7,J=J>>5&224|J>>3&31;D[W++]=G,D[W++]=J}}function Wt(S,_,O,D,W){for(O=_+O;_<O;){var G=S[_++];D[W++]=255&G,D[W++]=G>>8&255,D[W++]=G>>16&255}}function vt(S,_,O,D,W,G){if(G==0)for(O=_+O;_<O;)he(D,((G=S[_++])[0]>>24|G[1]>>8&65280|G[2]<<8&16711680|G[3]<<24)>>>0),W+=32;else r(D,W,S,_,O)}function Dt(S,_){E[_][0]=E[S+"0"],E[_][1]=E[S+"1"],E[_][2]=E[S+"2"],E[_][3]=E[S+"3"],E[_][4]=E[S+"4"],E[_][5]=E[S+"5"],E[_][6]=E[S+"6"],E[_][7]=E[S+"7"],E[_][8]=E[S+"8"],E[_][9]=E[S+"9"],E[_][10]=E[S+"10"],E[_][11]=E[S+"11"],E[_][12]=E[S+"12"],E[_][13]=E[S+"13"],E[_][14]=E[S+"0"],E[_][15]=E[S+"0"]}function Ft(S){return S==GT||S==YT||S==TC||S==XT}function Zt(){this.eb=[],this.size=this.A=this.fb=0}function lr(){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 cn(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new Zt,this.f.kb=new lr,this.sd=null}function Et(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Mn(){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 Ht(S){return alert("todo:WebPSamplerProcessPlane"),S.T}function en(S,_){var O=S.T,D=_.ba.f.RGBA,W=D.eb,G=D.fb+S.ka*D.A,J=Ko[_.ba.S],ee=S.y,ne=S.O,le=S.f,me=S.N,ke=S.ea,ce=S.W,ge=_.cc,be=_.dc,Ee=_.Mc,Se=_.Nc,Ie=S.ka,Fe=S.ka+S.T,ze=S.U,Re=ze+1>>1;for(Ie==0?J(ee,ne,null,null,le,me,ke,ce,le,me,ke,ce,W,G,null,null,ze):(J(_.ec,_.fc,ee,ne,ge,be,Ee,Se,le,me,ke,ce,W,G-D.A,W,G,ze),++O);Ie+2<Fe;Ie+=2)ge=le,be=me,Ee=ke,Se=ce,me+=S.Rc,ce+=S.Rc,G+=2*D.A,J(ee,(ne+=2*S.fa)-S.fa,ee,ne,ge,be,Ee,Se,le,me,ke,ce,W,G-D.A,W,G,ze);return ne+=S.fa,S.j+Fe<S.o?(r(_.ec,_.fc,ee,ne,ze),r(_.cc,_.dc,le,me,Re),r(_.Mc,_.Nc,ke,ce,Re),O--):1&Fe||J(ee,ne,null,null,le,me,ke,ce,le,me,ke,ce,W,G+D.A,null,null,ze),O}function Bn(S,_,O){var D=S.F,W=[S.J];if(D!=null){var G=S.U,J=_.ba.S,ee=J==EC||J==TC;_=_.ba.f.RGBA;var ne=[0],le=S.ka;ne[0]=S.T,S.Kb&&(le==0?--ne[0]:(--le,W[0]-=S.width),S.j+S.ka+S.T==S.o&&(ne[0]=S.o-S.j-le));var me=_.eb;le=_.fb+le*_.A,S=F$(D,W[0],S.width,G,ne,me,le+(ee?0:3),_.A),t(O==ne),S&&Ft(J)&&nx(me,le,ee,G,ne,_.A)}return 0}function Wr(S){var _=S.ma,O=_.ba.S,D=11>O,W=O==BC||O==NC||O==EC||O==WT||O==12||Ft(O);if(_.memory=null,_.Ib=null,_.Jb=null,_.Nd=null,!zo(_.Oa,S,W?11:12))return 0;if(W&&Ft(O)&&ju(),S.da)alert("todo:use_scaling");else{if(D){if(_.Ib=Ht,S.Kb){if(O=S.U+1>>1,_.memory=s(S.U+2*O),_.memory==null)return 0;_.ec=_.memory,_.fc=0,_.cc=_.ec,_.dc=_.fc+S.U,_.Mc=_.cc,_.Nc=_.dc+O,_.Ib=en,ju()}}else alert("todo:EmitYUV");W&&(_.Jb=Bn,D&&Dr())}if(D&&!J$){for(S=0;256>S;++S)Sxe[S]=89858*(S-128)+IC>>PC,jxe[S]=-22014*(S-128)+IC,_xe[S]=-45773*(S-128),kxe[S]=113618*(S-128)+IC>>PC;for(S=ix;S<eP;++S)_=76283*(S-16)+IC>>PC,Bxe[S-ix]=Ec(_,255),Nxe[S-ix]=Ec(_+8>>4,15);J$=1}return 1}function St(S){var _=S.ma,O=S.U,D=S.T;return t(!(1&S.ka)),0>=O||0>=D?0:(O=_.Ib(S,_),_.Jb!=null&&_.Jb(S,_,O),_.Dc+=O,1)}function Xi(S){S.ma.memory=null}function ds(S,_,O,D){return oe(S,8)!=47?0:(_[0]=oe(S,14)+1,O[0]=oe(S,14)+1,D[0]=oe(S,1),oe(S,3)!=0?0:!S.h)}function Er(S,_){if(4>S)return S+1;var O=S-2>>1;return(2+(1&S)<<O)+oe(_,O)+1}function ai(S,_){return 120<_?_-120:1<=(O=((O=uxe[_-1])>>4)*S+(8-(15&O)))?O:1;var O}function Gr(S,_,O){var D=Y(O),W=S[_+=255&D].g-8;return 0<W&&(q(O,O.u+8),D=Y(O),_+=S[_].value,_+=D&(1<<W)-1),q(O,O.u+S[_].g),S[_].value}function Ji(S,_,O){return O.g+=S.g,O.value+=S.value<<_>>>0,t(8>=O.g),S.g}function hs(S,_,O){var D=S.xc;return t((_=D==0?0:S.vc[S.md*(O>>D)+(_>>D)])<S.Wb),S.Ya[_]}function oA(S,_,O,D){var W=S.ab,G=S.c*_,J=S.C;_=J+_;var ee=O,ne=D;for(D=S.Ta,O=S.Ua;0<W--;){var le=S.gc[W],me=J,ke=_,ce=ee,ge=ne,be=(ne=D,ee=O,le.Ea);switch(t(me<ke),t(ke<=le.nc),le.hc){case 2:Wm(ce,ge,(ke-me)*be,ne,ee);break;case 0:var Ee=me,Se=ke,Ie=ne,Fe=ee,ze=(jt=le).Ea;Ee==0&&(Hd(ce,ge,null,null,1,Ie,Fe),Be(ce,ge+1,0,0,ze-1,Ie,Fe+1),ge+=ze,Fe+=ze,++Ee);for(var Re=1<<jt.b,Pt=Re-1,gt=Te(ze,jt.b),un=jt.K,jt=jt.w+(Ee>>jt.b)*gt;Ee<Se;){var Sn=un,Oi=jt,dn=1;for(Qd(ce,ge,Ie,Fe-ze,1,Ie,Fe);dn<ze;){var Bt=(dn&~Pt)+Re;Bt>ze&&(Bt=ze),(0,Ll[Sn[Oi++]>>8&15])(ce,ge+ +dn,Ie,Fe+dn-ze,Bt-dn,Ie,Fe+dn),dn=Bt}ge+=ze,Fe+=ze,++Ee&Pt||(jt+=gt)}ke!=le.nc&&r(ne,ee-be,ne,ee+(ke-me-1)*be,be);break;case 1:for(be=ce,Se=ge,ze=(ce=le.Ea)-(Fe=ce&~(Ie=(ge=1<<le.b)-1)),Ee=Te(ce,le.b),Re=le.K,le=le.w+(me>>le.b)*Ee;me<ke;){for(Pt=Re,gt=le,un=new $e,jt=Se+Fe,Sn=Se+ce;Se<jt;)Ue(Pt[gt++],un),wA(un,be,Se,ge,ne,ee),Se+=ge,ee+=ge;Se<Sn&&(Ue(Pt[gt++],un),wA(un,be,Se,ze,ne,ee),Se+=ze,ee+=ze),++me&Ie||(le+=Ee)}break;case 3:if(ce==ne&&ge==ee&&0<le.b){for(Se=ne,ce=be=ee+(ke-me)*be-(Fe=(ke-me)*Te(le.Ea,le.b)),ge=ne,Ie=ee,Ee=[],Fe=(ze=Fe)-1;0<=Fe;--Fe)Ee[Fe]=ge[Ie+Fe];for(Fe=ze-1;0<=Fe;--Fe)Se[ce+Fe]=Ee[Fe];xA(le,me,ke,ne,be,ne,ee)}else xA(le,me,ke,ce,ge,ne,ee)}ee=D,ne=O}ne!=O&&r(D,O,ee,ne,G)}function Md(S,_){var O=S.V,D=S.Ba+S.c*S.C,W=_-S.C;if(t(_<=S.l.o),t(16>=W),0<W){var G=S.l,J=S.Ta,ee=S.Ua,ne=G.width;if(oA(S,W,O,D),W=ee=[ee],t((O=S.C)<(D=_)),t(G.v<G.va),D>G.o&&(D=G.o),O<G.j){var le=G.j-O;O=G.j,W[0]+=le*ne}if(O>=D?O=0:(W[0]+=4*G.v,G.ka=O-G.j,G.U=G.va-G.v,G.T=D-O,O=1),O){if(ee=ee[0],11>(O=S.ca).S){var me=O.f.RGBA,ke=(D=O.S,W=G.U,G=G.T,le=me.eb,me.A),ce=G;for(me=me.fb+S.Ma*me.A;0<ce--;){var ge=J,be=ee,Ee=W,Se=le,Ie=me;switch(D){case jC:Z0(ge,be,Ee,Se,Ie);break;case BC:ex(ge,be,Ee,Se,Ie);break;case GT:ex(ge,be,Ee,Se,Ie),nx(Se,Ie,0,Ee,1,0);break;case Q$:CA(ge,be,Ee,Se,Ie);break;case NC:vt(ge,be,Ee,Se,Ie,1);break;case YT:vt(ge,be,Ee,Se,Ie,1),nx(Se,Ie,0,Ee,1,0);break;case EC:vt(ge,be,Ee,Se,Ie,0);break;case TC:vt(ge,be,Ee,Se,Ie,0),nx(Se,Ie,1,Ee,1,0);break;case WT:Gm(ge,be,Ee,Se,Ie);break;case XT:Gm(ge,be,Ee,Se,Ie),O$(Se,Ie,Ee,1,0);break;case $$:bA(ge,be,Ee,Se,Ie);break;default:t(0)}ee+=ne,me+=ke}S.Ma+=G}else alert("todo:EmitRescaledRowsYUVA");t(S.Ma<=O.height)}}S.C=_,t(S.C<=S.i)}function Ol(S){var _;if(0<S.ua)return 0;for(_=0;_<S.Wb;++_){var O=S.Ya[_].G,D=S.Ya[_].H;if(0<O[1][D[1]+0].g||0<O[2][D[2]+0].g||0<O[3][D[3]+0].g)return 0}return 1}function Bc(S,_,O,D,W,G){if(S.Z!=0){var J=S.qd,ee=S.rd;for(t(Kd[S.Z]!=null);_<O;++_)Kd[S.Z](J,ee,D,W,D,W,G),J=D,ee=W,W+=G;S.qd=J,S.rd=ee}}function Fl(S,_){var O=S.l.ma,D=O.Z==0||O.Z==1?S.l.j:S.C;if(D=S.C<D?D:S.C,t(_<=S.l.o),_>D){var W=S.l.width,G=O.ca,J=O.tb+W*D,ee=S.V,ne=S.Ba+S.c*D,le=S.gc;t(S.ab==1),t(le[0].hc==3),KT(le[0],D,_,ee,ne,G,J),Bc(O,D,_,G,J,W)}S.C=S.Ma=_}function Ml(S,_,O,D,W,G,J){var ee=S.$/D,ne=S.$%D,le=S.m,me=S.s,ke=O+S.$,ce=ke;W=O+D*W;var ge=O+D*G,be=280+me.ua,Ee=S.Pb?ee:16777216,Se=0<me.ua?me.Wa:null,Ie=me.wc,Fe=ke<ge?hs(me,ne,ee):null;t(S.C<G),t(ge<=W);var ze=!1;e:for(;;){for(;ze||ke<ge;){var Re=0;if(ee>=Ee){var Pt=ke-O;t((Ee=S).Pb),Ee.wd=Ee.m,Ee.xd=Pt,0<Ee.s.ua&&je(Ee.s.Wa,Ee.s.vb),Ee=ee+hxe}if(ne&Ie||(Fe=hs(me,ne,ee)),t(Fe!=null),Fe.Qb&&(_[ke]=Fe.qb,ze=!0),!ze)if(Z(le),Fe.jc){Re=le,Pt=_;var gt=ke,un=Fe.pd[Y(Re)&Km-1];t(Fe.jc),256>un.g?(q(Re,Re.u+un.g),Pt[gt]=un.value,Re=0):(q(Re,Re.u+un.g-256),t(256<=un.value),Re=un.value),Re==0&&(ze=!0)}else Re=Gr(Fe.G[0],Fe.H[0],le);if(le.h)break;if(ze||256>Re){if(!ze)if(Fe.nd)_[ke]=(Fe.qb|Re<<8)>>>0;else{if(Z(le),ze=Gr(Fe.G[1],Fe.H[1],le),Z(le),Pt=Gr(Fe.G[2],Fe.H[2],le),gt=Gr(Fe.G[3],Fe.H[3],le),le.h)break;_[ke]=(gt<<24|ze<<16|Re<<8|Pt)>>>0}if(ze=!1,++ke,++ne>=D&&(ne=0,++ee,J!=null&&ee<=G&&!(ee%16)&&J(S,ee),Se!=null))for(;ce<ke;)Re=_[ce++],Se.X[(506832829*Re&4294967295)>>>Se.Mb]=Re}else if(280>Re){if(Re=Er(Re-256,le),Pt=Gr(Fe.G[4],Fe.H[4],le),Z(le),Pt=ai(D,Pt=Er(Pt,le)),le.h)break;if(ke-O<Pt||W-ke<Re)break e;for(gt=0;gt<Re;++gt)_[ke+gt]=_[ke+gt-Pt];for(ke+=Re,ne+=Re;ne>=D;)ne-=D,++ee,J!=null&&ee<=G&&!(ee%16)&&J(S,ee);if(t(ke<=W),ne&Ie&&(Fe=hs(me,ne,ee)),Se!=null)for(;ce<ke;)Re=_[ce++],Se.X[(506832829*Re&4294967295)>>>Se.Mb]=Re}else{if(!(Re<be))break e;for(ze=Re-280,t(Se!=null);ce<ke;)Re=_[ce++],Se.X[(506832829*Re&4294967295)>>>Se.Mb]=Re;Re=ke,t(!(ze>>>(Pt=Se).Xa)),_[Re]=Pt.X[ze],ze=!0}ze||t(le.h==X(le))}if(S.Pb&&le.h&&ke<W)t(S.m.h),S.a=5,S.m=S.wd,S.$=S.xd,0<S.s.ua&&je(S.s.vb,S.s.Wa);else{if(le.h)break e;J!=null&&J(S,ee>G?G:ee),S.a=0,S.$=ke-O}return 1}return S.a=3,0}function Qo(S){t(S!=null),S.vc=null,S.yc=null,S.Ya=null;var _=S.Wa;_!=null&&(_.X=null),S.vb=null,t(S!=null)}function lA(){var S=new kt;return S==null?null:(S.a=0,S.xb=K$,Dt("Predictor","VP8LPredictors"),Dt("Predictor","VP8LPredictors_C"),Dt("PredictorAdd","VP8LPredictorsAdd"),Dt("PredictorAdd","VP8LPredictorsAdd_C"),Wm=Ge,wA=Ye,Z0=bt,ex=mt,Gm=_t,bA=Rt,CA=Wt,E.VP8LMapColor32b=bi,E.VP8LMapColor8b=Fc,S)}function Nc(S,_,O,D,W){var G=1,J=[S],ee=[_],ne=D.m,le=D.s,me=null,ke=0;e:for(;;){if(O)for(;G&&oe(ne,1);){var ce=J,ge=ee,be=D,Ee=1,Se=be.m,Ie=be.gc[be.ab],Fe=oe(Se,2);if(be.Oc&1<<Fe)G=0;else{switch(be.Oc|=1<<Fe,Ie.hc=Fe,Ie.Ea=ce[0],Ie.nc=ge[0],Ie.K=[null],++be.ab,t(4>=be.ab),Fe){case 0:case 1:Ie.b=oe(Se,3)+2,Ee=Nc(Te(Ie.Ea,Ie.b),Te(Ie.nc,Ie.b),0,be,Ie.K),Ie.K=Ie.K[0];break;case 3:var ze,Re=oe(Se,8)+1,Pt=16<Re?0:4<Re?1:2<Re?2:3;if(ce[0]=Te(Ie.Ea,Pt),Ie.b=Pt,ze=Ee=Nc(Re,1,0,be,Ie.K)){var gt,un=Re,jt=Ie,Sn=1<<(8>>jt.b),Oi=s(Sn);if(Oi==null)ze=0;else{var dn=jt.K[0],Bt=jt.w;for(Oi[0]=jt.K[0][0],gt=1;gt<1*un;++gt)Oi[gt]=ct(dn[Bt+gt],Oi[gt-1]);for(;gt<4*Sn;++gt)Oi[gt]=0;jt.K[0]=null,jt.K[0]=Oi,ze=1}}Ee=ze;break;case 2:break;default:t(0)}G=Ee}}if(J=J[0],ee=ee[0],G&&oe(ne,1)&&!(G=1<=(ke=oe(ne,4))&&11>=ke)){D.a=3;break e}var Je;if(Je=G)t:{var li,on,En,vr=D,As=J,ca=ee,Yr=ke,Rs=O,ua=vr.m,Fi=vr.s,On=[null],Kn=1,Xr=0,qn=dxe[Yr];n:for(;;){if(Rs&&oe(ua,1)){var ps=oe(ua,3)+2,Dl=Te(As,ps),ci=Te(ca,ps),Fa=Dl*ci;if(!Nc(Dl,ci,0,vr,On))break n;for(On=On[0],Fi.xc=ps,li=0;li<Fa;++li){var rr=On[li]>>8&65535;On[li]=rr,rr>=Kn&&(Kn=rr+1)}}if(ua.h)break n;for(on=0;5>on;++on){var Mi=z$[on];!on&&0<Yr&&(Mi+=1<<Yr),Xr<Mi&&(Xr=Mi)}var co=a(Kn*qn,F),da=Kn,uo=a(da,U);if(uo==null)var ho=null;else t(65536>=da),ho=uo;var Ma=s(Xr);if(ho==null||Ma==null||co==null){vr.a=1;break n}var fo=co;for(li=En=0;li<Kn;++li){var dr=ho[li],Ao=dr.G,Ul=dr.H,SA=0,Tu=1,ms=0;for(on=0;5>on;++on){Mi=z$[on],Ao[on]=fo,Ul[on]=En,!on&&0<Yr&&(Mi+=1<<Yr);i:{var FC,tP=Mi,MC=vr,sx=Ma,Pxe=fo,Ixe=En,nP=0,qd=MC.m,Oxe=oe(qd,1);if(i(sx,0,0,tP),Oxe){var Fxe=oe(qd,1)+1,Mxe=oe(qd,1),t8=oe(qd,Mxe==0?1:8);sx[t8]=1,Fxe==2&&(sx[t8=oe(qd,8)]=1);var LC=1}else{var n8=s(19),r8=oe(qd,4)+4;if(19<r8){MC.a=3;var RC=0;break i}for(FC=0;FC<r8;++FC)n8[cxe[FC]]=oe(qd,3);var rP=void 0,ax=void 0,i8=MC,Lxe=n8,DC=tP,s8=sx,iP=0,Wd=i8.m,a8=8,o8=a(128,F);r:for(;N(o8,0,7,Lxe,19);){if(oe(Wd,1)){var Rxe=2+2*oe(Wd,3);if((rP=2+oe(Wd,Rxe))>DC)break r}else rP=DC;for(ax=0;ax<DC&&rP--;){Z(Wd);var l8=o8[0+(127&Y(Wd))];q(Wd,Wd.u+l8.g);var Jm=l8.value;if(16>Jm)s8[ax++]=Jm,Jm!=0&&(a8=Jm);else{var Dxe=Jm==16,c8=Jm-16,Uxe=oxe[c8],u8=oe(Wd,axe[c8])+Uxe;if(ax+u8>DC)break r;for(var Hxe=Dxe?a8:0;0<u8--;)s8[ax++]=Hxe}}iP=1;break r}iP||(i8.a=3),LC=iP}(LC=LC&&!qd.h)&&(nP=N(Pxe,Ixe,8,sx,tP)),LC&&nP!=0?RC=nP:(MC.a=3,RC=0)}if(RC==0)break n;if(Tu&&lxe[on]==1&&(Tu=fo[En].g==0),SA+=fo[En].g,En+=RC,3>=on){var ox,sP=Ma[0];for(ox=1;ox<Mi;++ox)Ma[ox]>sP&&(sP=Ma[ox]);ms+=sP}}if(dr.nd=Tu,dr.Qb=0,Tu&&(dr.qb=(Ao[3][Ul[3]+0].value<<24|Ao[1][Ul[1]+0].value<<16|Ao[2][Ul[2]+0].value)>>>0,SA==0&&256>Ao[0][Ul[0]+0].value&&(dr.Qb=1,dr.qb+=Ao[0][Ul[0]+0].value<<8)),dr.jc=!dr.Qb&&6>ms,dr.jc){var UC,Pu=dr;for(UC=0;UC<Km;++UC){var Gd=UC,Yd=Pu.pd[Gd],HC=Pu.G[0][Pu.H[0]+Gd];256<=HC.value?(Yd.g=HC.g+256,Yd.value=HC.value):(Yd.g=0,Yd.value=0,Gd>>=Ji(HC,8,Yd),Gd>>=Ji(Pu.G[1][Pu.H[1]+Gd],16,Yd),Gd>>=Ji(Pu.G[2][Pu.H[2]+Gd],0,Yd),Ji(Pu.G[3][Pu.H[3]+Gd],24,Yd))}}}Fi.vc=On,Fi.Wb=Kn,Fi.Ya=ho,Fi.yc=co,Je=1;break t}Je=0}if(!(G=Je)){D.a=3;break e}if(0<ke){if(le.ua=1<<ke,!te(le.Wa,ke)){D.a=1,G=0;break e}}else le.ua=0;var aP=D,d8=J,Qxe=ee,oP=aP.s,lP=oP.xc;if(aP.c=d8,aP.i=Qxe,oP.md=Te(d8,lP),oP.wc=lP==0?-1:(1<<lP)-1,O){D.xb=vxe;break e}if((me=s(J*ee))==null){D.a=1,G=0;break e}G=(G=Ml(D,me,0,J,ee,ee,null))&&!ne.h;break e}return G?(W!=null?W[0]=me:(t(me==null),t(O)),D.$=0,O||Qo(le)):Qo(le),G}function cA(S,_){var O=S.c*S.i,D=O+_+16*_;return t(S.c<=_),S.V=s(D),S.V==null?(S.Ta=null,S.Ua=0,S.a=1,0):(S.Ta=S.V,S.Ua=S.Ba+O+_,1)}function Tm(S,_){var O=S.C,D=_-O,W=S.V,G=S.Ba+S.c*O;for(t(_<=S.l.o);0<D;){var J=16<D?16:D,ee=S.l.ma,ne=S.l.width,le=ne*J,me=ee.ca,ke=ee.tb+ne*O,ce=S.Ta,ge=S.Ua;oA(S,J,W,G),M$(ce,ge,me,ke,le),Bc(ee,O,O+J,me,ke,ne),D-=J,W+=J*S.c,O+=J}t(O==_),S.C=S.Ma=_}function Pm(){this.ub=this.yd=this.td=this.Rb=0}function Im(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function BT(){this.Fb=this.Bb=this.Cb=0,this.Zb=s(4),this.Lb=s(4)}function D0(){this.Yb=function(){var S=[];return function _(O,D,W){for(var G=W[D],J=0;J<G&&(O.push(W.length>D+1?[]:0),!(W.length<D+1));J++)_(O[J],D+1,W)}(S,0,[3,11]),S}()}function lC(){this.jb=s(3),this.Wc=o([4,8],D0),this.Xc=o([4,17],D0)}function cC(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new s(4),this.od=new s(4)}function $o(){this.ld=this.La=this.dd=this.tc=0}function U0(){this.Na=this.la=0}function uC(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function H0(){this.ad=s(384),this.Za=0,this.Ob=s(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function dC(){this.uc=this.M=this.Nb=0,this.wa=Array(new $o),this.Y=0,this.ya=Array(new H0),this.aa=0,this.l=new Om}function hC(){this.y=s(16),this.f=s(8),this.ea=s(8)}function fC(){this.cb=this.a=0,this.sc="",this.m=new R,this.Od=new Pm,this.Kc=new Im,this.ed=new cC,this.Qa=new BT,this.Ic=this.$c=this.Aa=0,this.D=new dC,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=a(8,R),this.ia=0,this.pb=a(4,uC),this.Pa=new lC,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new hC),this.Hd=0,this.rb=Array(new U0),this.sb=0,this.wa=Array(new $o),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 H0),this.L=this.aa=0,this.gd=o([4,2],$o),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 Ec(S,_){return 0>S?0:S>_?_:S}function Om(){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 NT(){var S=new fC;return S!=null&&(S.a=0,S.sc="OK",S.cb=0,S.Xb=0,rx||(rx=Fm)),S}function xi(S,_,O){return S.a==0&&(S.a=_,S.sc=O,S.cb=0),0}function AC(S,_,O){return 3<=O&&S[_+0]==157&&S[_+1]==1&&S[_+2]==42}function Tc(S,_){if(S==null)return 0;if(S.a=0,S.sc="OK",_==null)return xi(S,2,"null VP8Io passed to VP8GetHeaders()");var O=_.data,D=_.w,W=_.ha;if(4>W)return xi(S,7,"Truncated header.");var G=O[D+0]|O[D+1]<<8|O[D+2]<<16,J=S.Od;if(J.Rb=!(1&G),J.td=G>>1&7,J.yd=G>>4&1,J.ub=G>>5,3<J.td)return xi(S,3,"Incorrect keyframe parameters.");if(!J.yd)return xi(S,4,"Frame not displayable.");D+=3,W-=3;var ee=S.Kc;if(J.Rb){if(7>W)return xi(S,7,"cannot parse picture header");if(!AC(O,D,W))return xi(S,3,"Bad code word");ee.c=16383&(O[D+4]<<8|O[D+3]),ee.Td=O[D+4]>>6,ee.i=16383&(O[D+6]<<8|O[D+5]),ee.Ud=O[D+6]>>6,D+=7,W-=7,S.za=ee.c+15>>4,S.Ub=ee.i+15>>4,_.width=ee.c,_.height=ee.i,_.Da=0,_.j=0,_.v=0,_.va=_.width,_.o=_.height,_.da=0,_.ib=_.width,_.hb=_.height,_.U=_.width,_.T=_.height,i((G=S.Pa).jb,0,255,G.jb.length),t((G=S.Qa)!=null),G.Cb=0,G.Bb=0,G.Fb=1,i(G.Zb,0,0,G.Zb.length),i(G.Lb,0,0,G.Lb)}if(J.ub>W)return xi(S,7,"bad partition length");H(G=S.m,O,D,J.ub),D+=J.ub,W-=J.ub,J.Rb&&(ee.Ld=ue(G),ee.Kd=ue(G)),ee=S.Qa;var ne,le=S.Pa;if(t(G!=null),t(ee!=null),ee.Cb=ue(G),ee.Cb){if(ee.Bb=ue(G),ue(G)){for(ee.Fb=ue(G),ne=0;4>ne;++ne)ee.Zb[ne]=ue(G)?$(G,7):0;for(ne=0;4>ne;++ne)ee.Lb[ne]=ue(G)?$(G,6):0}if(ee.Bb)for(ne=0;3>ne;++ne)le.jb[ne]=ue(G)?K(G,8):255}else ee.Bb=0;if(G.Ka)return xi(S,3,"cannot parse segment header");if((ee=S.ed).zd=ue(G),ee.Tb=K(G,6),ee.wb=K(G,3),ee.Pc=ue(G),ee.Pc&&ue(G)){for(le=0;4>le;++le)ue(G)&&(ee.vd[le]=$(G,6));for(le=0;4>le;++le)ue(G)&&(ee.od[le]=$(G,6))}if(S.L=ee.Tb==0?0:ee.zd?1:2,G.Ka)return xi(S,3,"cannot parse filter header");var me=W;if(W=ne=D,D=ne+me,ee=me,S.Xb=(1<<K(S.m,2))-1,me<3*(le=S.Xb))O=7;else{for(ne+=3*le,ee-=3*le,me=0;me<le;++me){var ke=O[W+0]|O[W+1]<<8|O[W+2]<<16;ke>ee&&(ke=ee),H(S.Jc[+me],O,ne,ke),ne+=ke,ee-=ke,W+=3}H(S.Jc[+le],O,ne,ee),O=ne<D?0:5}if(O!=0)return xi(S,O,"cannot parse partitions");for(O=K(ne=S.m,7),W=ue(ne)?$(ne,4):0,D=ue(ne)?$(ne,4):0,ee=ue(ne)?$(ne,4):0,le=ue(ne)?$(ne,4):0,ne=ue(ne)?$(ne,4):0,me=S.Qa,ke=0;4>ke;++ke){if(me.Cb){var ce=me.Zb[ke];me.Fb||(ce+=O)}else{if(0<ke){S.pb[ke]=S.pb[0];continue}ce=O}var ge=S.pb[ke];ge.Sc[0]=JT[Ec(ce+W,127)],ge.Sc[1]=ZT[Ec(ce+0,127)],ge.Eb[0]=2*JT[Ec(ce+D,127)],ge.Eb[1]=101581*ZT[Ec(ce+ee,127)]>>16,8>ge.Eb[1]&&(ge.Eb[1]=8),ge.Qc[0]=JT[Ec(ce+le,117)],ge.Qc[1]=ZT[Ec(ce+ne,127)],ge.lc=ce+ne}if(!J.Rb)return xi(S,4,"Not a key frame.");for(ue(G),J=S.Pa,O=0;4>O;++O){for(W=0;8>W;++W)for(D=0;3>D;++D)for(ee=0;11>ee;++ee)le=ae(G,gxe[O][W][D][ee])?K(G,8):pxe[O][W][D][ee],J.Wc[O][W].Yb[D][ee]=le;for(W=0;17>W;++W)J.Xc[O][W]=J.Wc[O][yxe[W]]}return S.kc=ue(G),S.kc&&(S.Bd=K(G,8)),S.cb=1}function Fm(S,_,O,D,W,G,J){var ee=_[W].Yb[O];for(O=0;16>W;++W){if(!ae(S,ee[O+0]))return W;for(;!ae(S,ee[O+1]);)if(ee=_[++W].Yb[0],O=0,W==16)return 16;var ne=_[W+1].Yb;if(ae(S,ee[O+2])){var le=S,me=0;if(ae(le,(ce=ee)[(ke=O)+3]))if(ae(le,ce[ke+6])){for(ee=0,ke=2*(me=ae(le,ce[ke+8]))+(ce=ae(le,ce[ke+9+me])),me=0,ce=fxe[ke];ce[ee];++ee)me+=me+ae(le,ce[ee]);me+=3+(8<<ke)}else ae(le,ce[ke+7])?(me=7+2*ae(le,165),me+=ae(le,145)):me=5+ae(le,159);else me=ae(le,ce[ke+4])?3+ae(le,ce[ke+5]):2;ee=ne[2]}else me=1,ee=ne[1];ne=J+Axe[W],0>(le=S).b&&de(le);var ke,ce=le.b,ge=(ke=le.Ca>>1)-(le.I>>ce)>>31;--le.b,le.Ca+=ge,le.Ca|=1,le.I-=(ke+1&ge)<<ce,G[ne]=((me^ge)-ge)*D[(0<W)+0]}return 16}function Q0(S){var _=S.rb[S.sb-1];_.la=0,_.Na=0,i(S.zc,0,0,S.zc.length),S.ja=0}function oo(S,_,O,D,W){W=S[_+O+32*D]+(W>>3),S[_+O+32*D]=-256&W?0>W?0:255:W}function Mm(S,_,O,D,W,G){oo(S,_,0,O,D+W),oo(S,_,1,O,D+G),oo(S,_,2,O,D-G),oo(S,_,3,O,D-W)}function bu(S){return(20091*S>>16)+S}function fs(S,_,O,D){var W,G=0,J=s(16);for(W=0;4>W;++W){var ee=S[_+0]+S[_+8],ne=S[_+0]-S[_+8],le=(35468*S[_+4]>>16)-bu(S[_+12]),me=bu(S[_+4])+(35468*S[_+12]>>16);J[G+0]=ee+me,J[G+1]=ne+le,J[G+2]=ne-le,J[G+3]=ee-me,G+=4,_++}for(W=G=0;4>W;++W)ee=(S=J[G+0]+4)+J[G+8],ne=S-J[G+8],le=(35468*J[G+4]>>16)-bu(J[G+12]),oo(O,D,0,0,ee+(me=bu(J[G+4])+(35468*J[G+12]>>16))),oo(O,D,1,0,ne+le),oo(O,D,2,0,ne-le),oo(O,D,3,0,ee-me),G++,D+=32}function pC(S,_,O,D){var W=S[_+0]+4,G=35468*S[_+4]>>16,J=bu(S[_+4]),ee=35468*S[_+1]>>16;Mm(O,D,0,W+J,S=bu(S[_+1]),ee),Mm(O,D,1,W+G,S,ee),Mm(O,D,2,W-G,S,ee),Mm(O,D,3,W-J,S,ee)}function ET(S,_,O,D,W){fs(S,_,O,D),W&&fs(S,_+16,O,D+4)}function TT(S,_,O,D){Bu(S,_+0,O,D,1),Bu(S,_+32,O,D+128,1)}function PT(S,_,O,D){var W;for(S=S[_+0]+4,W=0;4>W;++W)for(_=0;4>_;++_)oo(O,D,_,W,S)}function Pc(S,_,O,D){S[_+0]&&Ls(S,_+0,O,D),S[_+16]&&Ls(S,_+16,O,D+4),S[_+32]&&Ls(S,_+32,O,D+128),S[_+48]&&Ls(S,_+48,O,D+128+4)}function mC(S,_,O,D){var W,G=s(16);for(W=0;4>W;++W){var J=S[_+0+W]+S[_+12+W],ee=S[_+4+W]+S[_+8+W],ne=S[_+4+W]-S[_+8+W],le=S[_+0+W]-S[_+12+W];G[0+W]=J+ee,G[8+W]=J-ee,G[4+W]=le+ne,G[12+W]=le-ne}for(W=0;4>W;++W)J=(S=G[0+4*W]+3)+G[3+4*W],ee=G[1+4*W]+G[2+4*W],ne=G[1+4*W]-G[2+4*W],le=S-G[3+4*W],O[D+0]=J+ee>>3,O[D+16]=le+ne>>3,O[D+32]=J-ee>>3,O[D+48]=le-ne>>3,D+=64}function Lm(S,_,O){var D,W=_-32,G=lo,J=255-S[W-1];for(D=0;D<O;++D){var ee,ne=G,le=J+S[_-1];for(ee=0;ee<O;++ee)S[_+ee]=ne[le+S[W+ee]];_+=32}}function Rm(S,_){Lm(S,_,4)}function $0(S,_){Lm(S,_,8)}function IT(S,_){Lm(S,_,16)}function OT(S,_){var O;for(O=0;16>O;++O)r(S,_+32*O,S,_-32,16)}function FT(S,_){var O;for(O=16;0<O;--O)i(S,_,S[_-1],16),_+=32}function Ld(S,_,O){var D;for(D=0;16>D;++D)i(_,O+32*D,S,16)}function gC(S,_){var O,D=16;for(O=0;16>O;++O)D+=S[_-1+32*O]+S[_+O-32];Ld(D>>5,S,_)}function Rd(S,_){var O,D=8;for(O=0;16>O;++O)D+=S[_-1+32*O];Ld(D>>4,S,_)}function MT(S,_){var O,D=8;for(O=0;16>O;++O)D+=S[_+O-32];Ld(D>>4,S,_)}function uA(S,_){Ld(128,S,_)}function Gt(S,_,O){return S+2*_+O+2>>2}function LT(S,_){var O,D=_-32;for(D=new Uint8Array([Gt(S[D-1],S[D+0],S[D+1]),Gt(S[D+0],S[D+1],S[D+2]),Gt(S[D+1],S[D+2],S[D+3]),Gt(S[D+2],S[D+3],S[D+4])]),O=0;4>O;++O)r(S,_+32*O,D,0,D.length)}function RT(S,_){var O=S[_-1],D=S[_-1+32],W=S[_-1+64],G=S[_-1+96];he(S,_+0,16843009*Gt(S[_-1-32],O,D)),he(S,_+32,16843009*Gt(O,D,W)),he(S,_+64,16843009*Gt(D,W,G)),he(S,_+96,16843009*Gt(W,G,G))}function DT(S,_){var O,D=4;for(O=0;4>O;++O)D+=S[_+O-32]+S[_-1+32*O];for(D>>=3,O=0;4>O;++O)i(S,_+32*O,D,4)}function UT(S,_){var O=S[_-1+0],D=S[_-1+32],W=S[_-1+64],G=S[_-1-32],J=S[_+0-32],ee=S[_+1-32],ne=S[_+2-32],le=S[_+3-32];S[_+0+96]=Gt(D,W,S[_-1+96]),S[_+1+96]=S[_+0+64]=Gt(O,D,W),S[_+2+96]=S[_+1+64]=S[_+0+32]=Gt(G,O,D),S[_+3+96]=S[_+2+64]=S[_+1+32]=S[_+0+0]=Gt(J,G,O),S[_+3+64]=S[_+2+32]=S[_+1+0]=Gt(ee,J,G),S[_+3+32]=S[_+2+0]=Gt(ne,ee,J),S[_+3+0]=Gt(le,ne,ee)}function HT(S,_){var O=S[_+1-32],D=S[_+2-32],W=S[_+3-32],G=S[_+4-32],J=S[_+5-32],ee=S[_+6-32],ne=S[_+7-32];S[_+0+0]=Gt(S[_+0-32],O,D),S[_+1+0]=S[_+0+32]=Gt(O,D,W),S[_+2+0]=S[_+1+32]=S[_+0+64]=Gt(D,W,G),S[_+3+0]=S[_+2+32]=S[_+1+64]=S[_+0+96]=Gt(W,G,J),S[_+3+32]=S[_+2+64]=S[_+1+96]=Gt(G,J,ee),S[_+3+64]=S[_+2+96]=Gt(J,ee,ne),S[_+3+96]=Gt(ee,ne,ne)}function Cu(S,_){var O=S[_-1+0],D=S[_-1+32],W=S[_-1+64],G=S[_-1-32],J=S[_+0-32],ee=S[_+1-32],ne=S[_+2-32],le=S[_+3-32];S[_+0+0]=S[_+1+64]=G+J+1>>1,S[_+1+0]=S[_+2+64]=J+ee+1>>1,S[_+2+0]=S[_+3+64]=ee+ne+1>>1,S[_+3+0]=ne+le+1>>1,S[_+0+96]=Gt(W,D,O),S[_+0+64]=Gt(D,O,G),S[_+0+32]=S[_+1+96]=Gt(O,G,J),S[_+1+32]=S[_+2+96]=Gt(G,J,ee),S[_+2+32]=S[_+3+96]=Gt(J,ee,ne),S[_+3+32]=Gt(ee,ne,le)}function Su(S,_){var O=S[_+0-32],D=S[_+1-32],W=S[_+2-32],G=S[_+3-32],J=S[_+4-32],ee=S[_+5-32],ne=S[_+6-32],le=S[_+7-32];S[_+0+0]=O+D+1>>1,S[_+1+0]=S[_+0+64]=D+W+1>>1,S[_+2+0]=S[_+1+64]=W+G+1>>1,S[_+3+0]=S[_+2+64]=G+J+1>>1,S[_+0+32]=Gt(O,D,W),S[_+1+32]=S[_+0+96]=Gt(D,W,G),S[_+2+32]=S[_+1+96]=Gt(W,G,J),S[_+3+32]=S[_+2+96]=Gt(G,J,ee),S[_+3+64]=Gt(J,ee,ne),S[_+3+96]=Gt(ee,ne,le)}function QT(S,_){var O=S[_-1+0],D=S[_-1+32],W=S[_-1+64],G=S[_-1+96];S[_+0+0]=O+D+1>>1,S[_+2+0]=S[_+0+32]=D+W+1>>1,S[_+2+32]=S[_+0+64]=W+G+1>>1,S[_+1+0]=Gt(O,D,W),S[_+3+0]=S[_+1+32]=Gt(D,W,G),S[_+3+32]=S[_+1+64]=Gt(W,G,G),S[_+3+64]=S[_+2+64]=S[_+0+96]=S[_+1+96]=S[_+2+96]=S[_+3+96]=G}function $T(S,_){var O=S[_-1+0],D=S[_-1+32],W=S[_-1+64],G=S[_-1+96],J=S[_-1-32],ee=S[_+0-32],ne=S[_+1-32],le=S[_+2-32];S[_+0+0]=S[_+2+32]=O+J+1>>1,S[_+0+32]=S[_+2+64]=D+O+1>>1,S[_+0+64]=S[_+2+96]=W+D+1>>1,S[_+0+96]=G+W+1>>1,S[_+3+0]=Gt(ee,ne,le),S[_+2+0]=Gt(J,ee,ne),S[_+1+0]=S[_+3+32]=Gt(O,J,ee),S[_+1+32]=S[_+3+64]=Gt(D,O,J),S[_+1+64]=S[_+3+96]=Gt(W,D,O),S[_+1+96]=Gt(G,W,D)}function Dm(S,_){var O;for(O=0;8>O;++O)r(S,_+32*O,S,_-32,8)}function z0(S,_){var O;for(O=0;8>O;++O)i(S,_,S[_-1],8),_+=32}function Ic(S,_,O){var D;for(D=0;8>D;++D)i(_,O+32*D,S,8)}function zT(S,_){var O,D=8;for(O=0;8>O;++O)D+=S[_+O-32]+S[_-1+32*O];Ic(D>>4,S,_)}function Um(S,_){var O,D=4;for(O=0;8>O;++O)D+=S[_+O-32];Ic(D>>3,S,_)}function VT(S,_){var O,D=4;for(O=0;8>O;++O)D+=S[_-1+32*O];Ic(D>>3,S,_)}function V0(S,_){Ic(128,S,_)}function Dd(S,_,O){var D=S[_-O],W=S[_+0],G=3*(W-D)+qT[1020+S[_-2*O]-S[_+O]],J=_C[112+(G+4>>3)];S[_-O]=lo[255+D+_C[112+(G+3>>3)]],S[_+0]=lo[255+W-J]}function K0(S,_,O,D){var W=S[_+0],G=S[_+O];return Vo[255+S[_-2*O]-S[_-O]]>D||Vo[255+G-W]>D}function dA(S,_,O,D){return 4*Vo[255+S[_-O]-S[_+0]]+Vo[255+S[_-2*O]-S[_+O]]<=D}function q0(S,_,O,D,W){var G=S[_-3*O],J=S[_-2*O],ee=S[_-O],ne=S[_+0],le=S[_+O],me=S[_+2*O],ke=S[_+3*O];return 4*Vo[255+ee-ne]+Vo[255+J-le]>D?0:Vo[255+S[_-4*O]-G]<=W&&Vo[255+G-J]<=W&&Vo[255+J-ee]<=W&&Vo[255+ke-me]<=W&&Vo[255+me-le]<=W&&Vo[255+le-ne]<=W}function Hm(S,_,O,D){var W=2*D+1;for(D=0;16>D;++D)dA(S,_+D,O,W)&&Dd(S,_+D,O)}function W0(S,_,O,D){var W=2*D+1;for(D=0;16>D;++D)dA(S,_+D*O,1,W)&&Dd(S,_+D*O,1)}function Qm(S,_,O,D){var W;for(W=3;0<W;--W)Hm(S,_+=4*O,O,D)}function yC(S,_,O,D){var W;for(W=3;0<W;--W)W0(S,_+=4,O,D)}function ku(S,_,O,D,W,G,J,ee){for(G=2*G+1;0<W--;){if(q0(S,_,O,G,J))if(K0(S,_,O,ee))Dd(S,_,O);else{var ne=S,le=_,me=O,ke=ne[le-2*me],ce=ne[le-me],ge=ne[le+0],be=ne[le+me],Ee=ne[le+2*me],Se=27*(Fe=qT[1020+3*(ge-ce)+qT[1020+ke-be]])+63>>7,Ie=18*Fe+63>>7,Fe=9*Fe+63>>7;ne[le-3*me]=lo[255+ne[le-3*me]+Fe],ne[le-2*me]=lo[255+ke+Ie],ne[le-me]=lo[255+ce+Se],ne[le+0]=lo[255+ge-Se],ne[le+me]=lo[255+be-Ie],ne[le+2*me]=lo[255+Ee-Fe]}_+=D}}function _u(S,_,O,D,W,G,J,ee){for(G=2*G+1;0<W--;){if(q0(S,_,O,G,J))if(K0(S,_,O,ee))Dd(S,_,O);else{var ne=S,le=_,me=O,ke=ne[le-me],ce=ne[le+0],ge=ne[le+me],be=_C[112+(4+(Ee=3*(ce-ke))>>3)],Ee=_C[112+(Ee+3>>3)],Se=be+1>>1;ne[le-2*me]=lo[255+ne[le-2*me]+Se],ne[le-me]=lo[255+ke+Ee],ne[le+0]=lo[255+ce-be],ne[le+me]=lo[255+ge-Se]}_+=D}}function vC(S,_,O,D,W,G){ku(S,_,O,1,16,D,W,G)}function xC(S,_,O,D,W,G){ku(S,_,1,O,16,D,W,G)}function wC(S,_,O,D,W,G){var J;for(J=3;0<J;--J)_u(S,_+=4*O,O,1,16,D,W,G)}function hA(S,_,O,D,W,G){var J;for(J=3;0<J;--J)_u(S,_+=4,1,O,16,D,W,G)}function bC(S,_,O,D,W,G,J,ee){ku(S,_,W,1,8,G,J,ee),ku(O,D,W,1,8,G,J,ee)}function P(S,_,O,D,W,G,J,ee){ku(S,_,1,W,8,G,J,ee),ku(O,D,1,W,8,G,J,ee)}function V(S,_,O,D,W,G,J,ee){_u(S,_+4*W,W,1,8,G,J,ee),_u(O,D+4*W,W,1,8,G,J,ee)}function se(S,_,O,D,W,G,J,ee){_u(S,_+4,1,W,8,G,J,ee),_u(O,D+4,1,W,8,G,J,ee)}function fe(){this.ba=new cn,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new Mn,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function ve(){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 Ne(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Le(){this.ua=0,this.Wa=new tt,this.vb=new tt,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new U,this.yc=new F}function kt(){this.xb=this.a=0,this.l=new Om,this.ca=new cn,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new M,this.Pb=0,this.wd=new M,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Le,this.ab=0,this.gc=a(4,Ne),this.Oc=0}function Ct(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Om,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function tn(S,_,O,D,W,G,J){for(S=S==null?0:S[_+0],_=0;_<J;++_)W[G+_]=S+O[D+_]&255,S=W[G+_]}function an(S,_,O,D,W,G,J){var ee;if(S==null)tn(null,null,O,D,W,G,J);else for(ee=0;ee<J;++ee)W[G+ee]=S[_+ee]+O[D+ee]&255}function Nn(S,_,O,D,W,G,J){if(S==null)tn(null,null,O,D,W,G,J);else{var ee,ne=S[_+0],le=ne,me=ne;for(ee=0;ee<J;++ee)le=me+(ne=S[_+ee])-le,me=O[D+ee]+(-256&le?0>le?0:255:le)&255,le=ne,W[G+ee]=me}}function wi(S,_,O,D){var W=_.width,G=_.o;if(t(S!=null&&_!=null),0>O||0>=D||O+D>G)return null;if(!S.Cc){if(S.ga==null){var J;if(S.ga=new Ct,(J=S.ga==null)||(J=_.width*_.o,t(S.Gb.length==0),S.Gb=s(J),S.Uc=0,S.Gb==null?J=0:(S.mb=S.Gb,S.nb=S.Uc,S.rc=null,J=1),J=!J),!J){J=S.ga;var ee=S.Fa,ne=S.P,le=S.qc,me=S.mb,ke=S.nb,ce=ne+1,ge=le-1,be=J.l;if(t(ee!=null&&me!=null&&_!=null),Kd[0]=null,Kd[1]=tn,Kd[2]=an,Kd[3]=Nn,J.ca=me,J.tb=ke,J.c=_.width,J.i=_.height,t(0<J.c&&0<J.i),1>=le)_=0;else if(J.$a=3&ee[ne+0],J.Z=ee[ne+0]>>2&3,J.Lc=ee[ne+0]>>4&3,ne=ee[ne+0]>>6&3,0>J.$a||1<J.$a||4<=J.Z||1<J.Lc||ne)_=0;else if(be.put=St,be.ac=Wr,be.bc=Xi,be.ma=J,be.width=_.width,be.height=_.height,be.Da=_.Da,be.v=_.v,be.va=_.va,be.j=_.j,be.o=_.o,J.$a)e:{t(J.$a==1),_=lA();t:for(;;){if(_==null){_=0;break e}if(t(J!=null),J.mc=_,_.c=J.c,_.i=J.i,_.l=J.l,_.l.ma=J,_.l.width=J.c,_.l.height=J.i,_.a=0,z(_.m,ee,ce,ge),!Nc(J.c,J.i,1,_,null)||(_.ab==1&&_.gc[0].hc==3&&Ol(_.s)?(J.ic=1,ee=_.c*_.i,_.Ta=null,_.Ua=0,_.V=s(ee),_.Ba=0,_.V==null?(_.a=1,_=0):_=1):(J.ic=0,_=cA(_,J.c)),!_))break t;_=1;break e}J.mc=null,_=0}else _=ge>=J.c*J.i;J=!_}if(J)return null;S.ga.Lc!=1?S.Ga=0:D=G-O}t(S.ga!=null),t(O+D<=G);e:{if(_=(ee=S.ga).c,G=ee.l.o,ee.$a==0){if(ce=S.rc,ge=S.Vc,be=S.Fa,ne=S.P+1+O*_,le=S.mb,me=S.nb+O*_,t(ne<=S.P+S.qc),ee.Z!=0)for(t(Kd[ee.Z]!=null),J=0;J<D;++J)Kd[ee.Z](ce,ge,be,ne,le,me,_),ce=le,ge=me,me+=_,ne+=_;else for(J=0;J<D;++J)r(le,me,be,ne,_),ce=le,ge=me,me+=_,ne+=_;S.rc=ce,S.Vc=ge}else{if(t(ee.mc!=null),_=O+D,t((J=ee.mc)!=null),t(_<=J.i),J.C>=_)_=1;else if(ee.ic||Dr(),ee.ic){ee=J.V,ce=J.Ba,ge=J.c;var Ee=J.i,Se=(be=1,ne=J.$/ge,le=J.$%ge,me=J.m,ke=J.s,J.$),Ie=ge*Ee,Fe=ge*_,ze=ke.wc,Re=Se<Fe?hs(ke,le,ne):null;t(Se<=Ie),t(_<=Ee),t(Ol(ke));t:for(;;){for(;!me.h&&Se<Fe;){if(le&ze||(Re=hs(ke,le,ne)),t(Re!=null),Z(me),256>(Ee=Gr(Re.G[0],Re.H[0],me)))ee[ce+Se]=Ee,++Se,++le>=ge&&(le=0,++ne<=_&&!(ne%16)&&Fl(J,ne));else{if(!(280>Ee)){be=0;break t}Ee=Er(Ee-256,me);var Pt,gt=Gr(Re.G[4],Re.H[4],me);if(Z(me),!(Se>=(gt=ai(ge,gt=Er(gt,me)))&&Ie-Se>=Ee)){be=0;break t}for(Pt=0;Pt<Ee;++Pt)ee[ce+Se+Pt]=ee[ce+Se+Pt-gt];for(Se+=Ee,le+=Ee;le>=ge;)le-=ge,++ne<=_&&!(ne%16)&&Fl(J,ne);Se<Fe&&le&ze&&(Re=hs(ke,le,ne))}t(me.h==X(me))}Fl(J,ne>_?_:ne);break t}!be||me.h&&Se<Ie?(be=0,J.a=me.h?5:3):J.$=Se,_=be}else _=Ml(J,J.V,J.Ba,J.c,J.i,_,Tm);if(!_){D=0;break e}}O+D>=G&&(S.Cc=1),D=1}if(!D)return null;if(S.Cc&&((D=S.ga)!=null&&(D.mc=null),S.ga=null,0<S.Ga))return alert("todo:WebPDequantizeLevels"),null}return S.nb+O*W}function nr(S,_,O,D,W,G){for(;0<W--;){var J,ee=S,ne=_+(O?1:0),le=S,me=_+(O?0:3);for(J=0;J<D;++J){var ke=le[me+4*J];ke!=255&&(ke*=32897,ee[ne+4*J+0]=ee[ne+4*J+0]*ke>>23,ee[ne+4*J+1]=ee[ne+4*J+1]*ke>>23,ee[ne+4*J+2]=ee[ne+4*J+2]*ke>>23)}_+=G}}function Jn(S,_,O,D,W){for(;0<D--;){var G;for(G=0;G<O;++G){var J=S[_+2*G+0],ee=15&(le=S[_+2*G+1]),ne=4369*ee,le=(240&le|le>>4)*ne>>16;S[_+2*G+0]=(240&J|J>>4)*ne>>16&240|(15&J|J<<4)*ne>>16>>4&15,S[_+2*G+1]=240&le|ee}_+=W}}function yr(S,_,O,D,W,G,J,ee){var ne,le,me=255;for(le=0;le<W;++le){for(ne=0;ne<D;++ne){var ke=S[_+ne];G[J+4*ne]=ke,me&=ke}_+=O,J+=ee}return me!=255}function Rr(S,_,O,D,W){var G;for(G=0;G<W;++G)O[D+G]=S[_+G]>>8}function Dr(){nx=nr,O$=Jn,F$=yr,M$=Rr}function Fs(S,_,O){E[S]=function(D,W,G,J,ee,ne,le,me,ke,ce,ge,be,Ee,Se,Ie,Fe,ze){var Re,Pt=ze-1>>1,gt=ee[ne+0]|le[me+0]<<16,un=ke[ce+0]|ge[be+0]<<16;t(D!=null);var jt=3*gt+un+131074>>2;for(_(D[W+0],255&jt,jt>>16,Ee,Se),G!=null&&(jt=3*un+gt+131074>>2,_(G[J+0],255&jt,jt>>16,Ie,Fe)),Re=1;Re<=Pt;++Re){var Sn=ee[ne+Re]|le[me+Re]<<16,Oi=ke[ce+Re]|ge[be+Re]<<16,dn=gt+Sn+un+Oi+524296,Bt=dn+2*(Sn+un)>>3;jt=Bt+gt>>1,gt=(dn=dn+2*(gt+Oi)>>3)+Sn>>1,_(D[W+2*Re-1],255&jt,jt>>16,Ee,Se+(2*Re-1)*O),_(D[W+2*Re-0],255&gt,gt>>16,Ee,Se+(2*Re-0)*O),G!=null&&(jt=dn+un>>1,gt=Bt+Oi>>1,_(G[J+2*Re-1],255&jt,jt>>16,Ie,Fe+(2*Re-1)*O),_(G[J+2*Re+0],255&gt,gt>>16,Ie,Fe+(2*Re+0)*O)),gt=Sn,un=Oi}1&ze||(jt=3*gt+un+131074>>2,_(D[W+ze-1],255&jt,jt>>16,Ee,Se+(ze-1)*O),G!=null&&(jt=3*un+gt+131074>>2,_(G[J+ze-1],255&jt,jt>>16,Ie,Fe+(ze-1)*O)))}}function ju(){Ko[jC]=xxe,Ko[BC]=q$,Ko[Q$]=wxe,Ko[NC]=W$,Ko[EC]=G$,Ko[WT]=Y$,Ko[$$]=bxe,Ko[GT]=q$,Ko[YT]=W$,Ko[TC]=G$,Ko[XT]=Y$}function G0(S){return S&~Cxe?0>S?0:255:S>>X$}function fA(S,_){return G0((19077*S>>8)+(26149*_>>8)-14234)}function AA(S,_,O){return G0((19077*S>>8)-(6419*_>>8)-(13320*O>>8)+8708)}function Ud(S,_){return G0((19077*S>>8)+(33050*_>>8)-17685)}function pA(S,_,O,D,W){D[W+0]=fA(S,O),D[W+1]=AA(S,_,O),D[W+2]=Ud(S,_)}function $m(S,_,O,D,W){D[W+0]=Ud(S,_),D[W+1]=AA(S,_,O),D[W+2]=fA(S,O)}function zm(S,_,O,D,W){var G=AA(S,_,O);_=G<<3&224|Ud(S,_)>>3,D[W+0]=248&fA(S,O)|G>>5,D[W+1]=_}function Ms(S,_,O,D,W){var G=240&Ud(S,_)|15;D[W+0]=240&fA(S,O)|AA(S,_,O)>>4,D[W+1]=G}function mA(S,_,O,D,W){D[W+0]=255,pA(S,_,O,D,W+1)}function gA(S,_,O,D,W){$m(S,_,O,D,W),D[W+3]=255}function Y0(S,_,O,D,W){pA(S,_,O,D,W),D[W+3]=255}function Oc(S,_,O){E[S]=function(D,W,G,J,ee,ne,le,me,ke){for(var ce=me+(-2&ke)*O;me!=ce;)_(D[W+0],G[J+0],ee[ne+0],le,me),_(D[W+1],G[J+0],ee[ne+0],le,me+O),W+=2,++J,++ne,me+=2*O;1&ke&&_(D[W+0],G[J+0],ee[ne+0],le,me)}}function oa(S,_,O){return O==0?S==0?_==0?6:5:_==0?4:0:O}function CC(S,_,O,D,W){switch(S>>>30){case 3:Bu(_,O,D,W,0);break;case 2:zd(_,O,D,W);break;case 1:Ls(_,O,D,W)}}function Vm(S,_){var O,D,W=_.M,G=_.Nb,J=S.oc,ee=S.pc+40,ne=S.oc,le=S.pc+584,me=S.oc,ke=S.pc+600;for(O=0;16>O;++O)J[ee+32*O-1]=129;for(O=0;8>O;++O)ne[le+32*O-1]=129,me[ke+32*O-1]=129;for(0<W?J[ee-1-32]=ne[le-1-32]=me[ke-1-32]=129:(i(J,ee-32-1,127,21),i(ne,le-32-1,127,9),i(me,ke-32-1,127,9)),D=0;D<S.za;++D){var ce=_.ya[_.aa+D];if(0<D){for(O=-1;16>O;++O)r(J,ee+32*O-4,J,ee+32*O+12,4);for(O=-1;8>O;++O)r(ne,le+32*O-4,ne,le+32*O+4,4),r(me,ke+32*O-4,me,ke+32*O+4,4)}var ge=S.Gd,be=S.Hd+D,Ee=ce.ad,Se=ce.Hc;if(0<W&&(r(J,ee-32,ge[be].y,0,16),r(ne,le-32,ge[be].f,0,8),r(me,ke-32,ge[be].ea,0,8)),ce.Za){var Ie=J,Fe=ee-32+16;for(0<W&&(D>=S.za-1?i(Ie,Fe,ge[be].y[15],4):r(Ie,Fe,ge[be+1].y,0,4)),O=0;4>O;O++)Ie[Fe+128+O]=Ie[Fe+256+O]=Ie[Fe+384+O]=Ie[Fe+0+O];for(O=0;16>O;++O,Se<<=2)Ie=J,Fe=ee+Z$[O],Rl[ce.Ob[O]](Ie,Fe),CC(Se,Ee,16*+O,Ie,Fe)}else if(Ie=oa(D,W,ce.Ob[0]),Vd[Ie](J,ee),Se!=0)for(O=0;16>O;++O,Se<<=2)CC(Se,Ee,16*+O,J,ee+Z$[O]);for(O=ce.Gc,Ie=oa(D,W,ce.Dd),Eu[Ie](ne,le),Eu[Ie](me,ke),Se=Ee,Ie=ne,Fe=le,255&(ce=0|O)&&(170&ce?Ym(Se,256,Ie,Fe):Mc(Se,256,Ie,Fe)),ce=me,Se=ke,255&(O>>=8)&&(170&O?Ym(Ee,320,ce,Se):Mc(Ee,320,ce,Se)),W<S.Ub-1&&(r(ge[be].y,0,J,ee+480,16),r(ge[be].f,0,ne,le+224,8),r(ge[be].ea,0,me,ke+224,8)),O=8*G*S.B,ge=S.sa,be=S.ta+16*D+16*G*S.R,Ee=S.qa,ce=S.ra+8*D+O,Se=S.Ha,Ie=S.Ia+8*D+O,O=0;16>O;++O)r(ge,be+O*S.R,J,ee+32*O,16);for(O=0;8>O;++O)r(Ee,ce+O*S.B,ne,le+32*O,8),r(Se,Ie+O*S.B,me,ke+32*O,8)}}function SC(S,_,O,D,W,G,J,ee,ne){var le=[0],me=[0],ke=0,ce=ne!=null?ne.kd:0,ge=ne??new ve;if(S==null||12>O)return 7;ge.data=S,ge.w=_,ge.ha=O,_=[_],O=[O],ge.gb=[ge.gb];e:{var be=_,Ee=O,Se=ge.gb;if(t(S!=null),t(Ee!=null),t(Se!=null),Se[0]=0,12<=Ee[0]&&!n(S,be[0],"RIFF")){if(n(S,be[0]+8,"WEBP")){Se=3;break e}var Ie=Oe(S,be[0]+4);if(12>Ie||4294967286<Ie){Se=3;break e}if(ce&&Ie>Ee[0]-8){Se=7;break e}Se[0]=Ie,be[0]+=12,Ee[0]-=12}Se=0}if(Se!=0)return Se;for(Ie=0<ge.gb[0],O=O[0];;){e:{var Fe=S;Ee=_,Se=O;var ze=le,Re=me,Pt=be=[0];if((jt=ke=[ke])[0]=0,8>Se[0])Se=7;else{if(!n(Fe,Ee[0],"VP8X")){if(Oe(Fe,Ee[0]+4)!=10){Se=3;break e}if(18>Se[0]){Se=7;break e}var gt=Oe(Fe,Ee[0]+8),un=1+Ce(Fe,Ee[0]+12);if(2147483648<=un*(Fe=1+Ce(Fe,Ee[0]+15))){Se=3;break e}Pt!=null&&(Pt[0]=gt),ze!=null&&(ze[0]=un),Re!=null&&(Re[0]=Fe),Ee[0]+=18,Se[0]-=18,jt[0]=1}Se=0}}if(ke=ke[0],be=be[0],Se!=0)return Se;if(Ee=!!(2&be),!Ie&&ke)return 3;if(G!=null&&(G[0]=!!(16&be)),J!=null&&(J[0]=Ee),ee!=null&&(ee[0]=0),J=le[0],be=me[0],ke&&Ee&&ne==null){Se=0;break}if(4>O){Se=7;break}if(Ie&&ke||!Ie&&!ke&&!n(S,_[0],"ALPH")){O=[O],ge.na=[ge.na],ge.P=[ge.P],ge.Sa=[ge.Sa];e:{gt=S,Se=_,Ie=O;var jt=ge.gb;ze=ge.na,Re=ge.P,Pt=ge.Sa,un=22,t(gt!=null),t(Ie!=null),Fe=Se[0];var Sn=Ie[0];for(t(ze!=null),t(Pt!=null),ze[0]=null,Re[0]=null,Pt[0]=0;;){if(Se[0]=Fe,Ie[0]=Sn,8>Sn){Se=7;break e}var Oi=Oe(gt,Fe+4);if(4294967286<Oi){Se=3;break e}var dn=8+Oi+1&-2;if(un+=dn,0<jt&&un>jt){Se=3;break e}if(!n(gt,Fe,"VP8 ")||!n(gt,Fe,"VP8L")){Se=0;break e}if(Sn[0]<dn){Se=7;break e}n(gt,Fe,"ALPH")||(ze[0]=gt,Re[0]=Fe+8,Pt[0]=Oi),Fe+=dn,Sn-=dn}}if(O=O[0],ge.na=ge.na[0],ge.P=ge.P[0],ge.Sa=ge.Sa[0],Se!=0)break}O=[O],ge.Ja=[ge.Ja],ge.xa=[ge.xa];e:if(jt=S,Se=_,Ie=O,ze=ge.gb[0],Re=ge.Ja,Pt=ge.xa,gt=Se[0],Fe=!n(jt,gt,"VP8 "),un=!n(jt,gt,"VP8L"),t(jt!=null),t(Ie!=null),t(Re!=null),t(Pt!=null),8>Ie[0])Se=7;else{if(Fe||un){if(jt=Oe(jt,gt+4),12<=ze&&jt>ze-12){Se=3;break e}if(ce&&jt>Ie[0]-8){Se=7;break e}Re[0]=jt,Se[0]+=8,Ie[0]-=8,Pt[0]=un}else Pt[0]=5<=Ie[0]&&jt[gt+0]==47&&!(jt[gt+4]>>5),Re[0]=Ie[0];Se=0}if(O=O[0],ge.Ja=ge.Ja[0],ge.xa=ge.xa[0],_=_[0],Se!=0)break;if(4294967286<ge.Ja)return 3;if(ee==null||Ee||(ee[0]=ge.xa?2:1),J=[J],be=[be],ge.xa){if(5>O){Se=7;break}ee=J,ce=be,Ee=G,S==null||5>O?S=0:5<=O&&S[_+0]==47&&!(S[_+4]>>5)?(Ie=[0],jt=[0],ze=[0],z(Re=new M,S,_,O),ds(Re,Ie,jt,ze)?(ee!=null&&(ee[0]=Ie[0]),ce!=null&&(ce[0]=jt[0]),Ee!=null&&(Ee[0]=ze[0]),S=1):S=0):S=0}else{if(10>O){Se=7;break}ee=be,S==null||10>O||!AC(S,_+3,O-3)?S=0:(ce=S[_+0]|S[_+1]<<8|S[_+2]<<16,Ee=16383&(S[_+7]<<8|S[_+6]),S=16383&(S[_+9]<<8|S[_+8]),1&ce||3<(ce>>1&7)||!(ce>>4&1)||ce>>5>=ge.Ja||!Ee||!S?S=0:(J&&(J[0]=Ee),ee&&(ee[0]=S),S=1))}if(!S||(J=J[0],be=be[0],ke&&(le[0]!=J||me[0]!=be)))return 3;ne!=null&&(ne[0]=ge,ne.offset=_-ne.w,t(4294967286>_-ne.w),t(ne.offset==ne.ha-O));break}return Se==0||Se==7&&ke&&ne==null?(G!=null&&(G[0]|=ge.na!=null&&0<ge.na.length),D!=null&&(D[0]=J),W!=null&&(W[0]=be),0):Se}function zo(S,_,O){var D=_.width,W=_.height,G=0,J=0,ee=D,ne=W;if(_.Da=S!=null&&0<S.Da,_.Da&&(ee=S.cd,ne=S.bd,G=S.v,J=S.j,11>O||(G&=-2,J&=-2),0>G||0>J||0>=ee||0>=ne||G+ee>D||J+ne>W))return 0;if(_.v=G,_.j=J,_.va=G+ee,_.o=J+ne,_.U=ee,_.T=ne,_.da=S!=null&&0<S.da,_.da){if(!nt(ee,ne,O=[S.ib],G=[S.hb]))return 0;_.ib=O[0],_.hb=G[0]}return _.ob=S!=null&&S.ob,_.Kb=S==null||!S.Sd,_.da&&(_.ob=_.ib<3*D/4&&_.hb<3*W/4,_.Kb=0),1}function yA(S){if(S==null)return 2;if(11>S.S){var _=S.f.RGBA;_.fb+=(S.height-1)*_.A,_.A=-_.A}else _=S.f.kb,S=S.height,_.O+=(S-1)*_.fa,_.fa=-_.fa,_.N+=(S-1>>1)*_.Ab,_.Ab=-_.Ab,_.W+=(S-1>>1)*_.Db,_.Db=-_.Db,_.F!=null&&(_.J+=(S-1)*_.lb,_.lb=-_.lb);return 0}function X0(S,_,O,D){if(D==null||0>=S||0>=_)return 2;if(O!=null){if(O.Da){var W=O.cd,G=O.bd,J=-2&O.v,ee=-2&O.j;if(0>J||0>ee||0>=W||0>=G||J+W>S||ee+G>_)return 2;S=W,_=G}if(O.da){if(!nt(S,_,W=[O.ib],G=[O.hb]))return 2;S=W[0],_=G[0]}}D.width=S,D.height=_;e:{var ne=D.width,le=D.height;if(S=D.S,0>=ne||0>=le||!(S>=jC&&13>S))S=2;else{if(0>=D.Rd&&D.sd==null){J=G=W=_=0;var me=(ee=ne*e8[S])*le;if(11>S||(G=(le+1)/2*(_=(ne+1)/2),S==12&&(J=(W=ne)*le)),(le=s(me+2*G+J))==null){S=1;break e}D.sd=le,11>S?((ne=D.f.RGBA).eb=le,ne.fb=0,ne.A=ee,ne.size=me):((ne=D.f.kb).y=le,ne.O=0,ne.fa=ee,ne.Fd=me,ne.f=le,ne.N=0+me,ne.Ab=_,ne.Cd=G,ne.ea=le,ne.W=0+me+G,ne.Db=_,ne.Ed=G,S==12&&(ne.F=le,ne.J=0+me+2*G),ne.Tc=J,ne.lb=W)}if(_=1,W=D.S,G=D.width,J=D.height,W>=jC&&13>W)if(11>W)S=D.f.RGBA,_&=(ee=Math.abs(S.A))*(J-1)+G<=S.size,_&=ee>=G*e8[W],_&=S.eb!=null;else{S=D.f.kb,ee=(G+1)/2,me=(J+1)/2,ne=Math.abs(S.fa),le=Math.abs(S.Ab);var ke=Math.abs(S.Db),ce=Math.abs(S.lb),ge=ce*(J-1)+G;_&=ne*(J-1)+G<=S.Fd,_&=le*(me-1)+ee<=S.Cd,_=(_&=ke*(me-1)+ee<=S.Ed)&ne>=G&le>=ee&ke>=ee,_&=S.y!=null,_&=S.f!=null,_&=S.ea!=null,W==12&&(_&=ce>=G,_&=ge<=S.Tc,_&=S.F!=null)}else _=0;S=_?0:2}}return S!=0||O!=null&&O.fd&&(S=yA(D)),S}var Km=64,vA=[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],J0=24,la=32,Oa=8,qm=[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];we("Predictor0","PredictorAdd0"),E.Predictor0=function(){return 4278190080},E.Predictor1=function(S){return S},E.Predictor2=function(S,_,O){return _[O+0]},E.Predictor3=function(S,_,O){return _[O+1]},E.Predictor4=function(S,_,O){return _[O-1]},E.Predictor5=function(S,_,O){return Ve(Ve(S,_[O+1]),_[O+0])},E.Predictor6=function(S,_,O){return Ve(S,_[O-1])},E.Predictor7=function(S,_,O){return Ve(S,_[O+0])},E.Predictor8=function(S,_,O){return Ve(_[O-1],_[O+0])},E.Predictor9=function(S,_,O){return Ve(_[O+0],_[O+1])},E.Predictor10=function(S,_,O){return Ve(Ve(S,_[O-1]),Ve(_[O+0],_[O+1]))},E.Predictor11=function(S,_,O){var D=_[O+0];return 0>=ye(D>>24&255,S>>24&255,(_=_[O-1])>>24&255)+ye(D>>16&255,S>>16&255,_>>16&255)+ye(D>>8&255,S>>8&255,_>>8&255)+ye(255&D,255&S,255&_)?D:S},E.Predictor12=function(S,_,O){var D=_[O+0];return($t((S>>24&255)+(D>>24&255)-((_=_[O-1])>>24&255))<<24|$t((S>>16&255)+(D>>16&255)-(_>>16&255))<<16|$t((S>>8&255)+(D>>8&255)-(_>>8&255))<<8|$t((255&S)+(255&D)-(255&_)))>>>0},E.Predictor13=function(S,_,O){var D=_[O-1];return(yt((S=Ve(S,_[O+0]))>>24&255,D>>24&255)<<24|yt(S>>16&255,D>>16&255)<<16|yt(S>>8&255,D>>8&255)<<8|yt(255&S,255&D))>>>0};var Hd=E.PredictorAdd0;E.PredictorAdd1=Be,we("Predictor2","PredictorAdd2"),we("Predictor3","PredictorAdd3"),we("Predictor4","PredictorAdd4"),we("Predictor5","PredictorAdd5"),we("Predictor6","PredictorAdd6"),we("Predictor7","PredictorAdd7"),we("Predictor8","PredictorAdd8"),we("Predictor9","PredictorAdd9"),we("Predictor10","PredictorAdd10"),we("Predictor11","PredictorAdd11"),we("Predictor12","PredictorAdd12"),we("Predictor13","PredictorAdd13");var Qd=E.PredictorAdd2;pe("ColorIndexInverseTransform","MapARGB","32b",function(S){return S>>8&255},function(S){return S}),pe("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(S){return S},function(S){return S>>8&255});var Wm,xA=E.ColorIndexInverseTransform,bi=E.MapARGB,KT=E.VP8LColorIndexInverseTransformAlpha,Fc=E.MapAlpha,Ll=E.VP8LPredictorsAdd=[];Ll.length=16,(E.VP8LPredictors=[]).length=16,(E.VP8LPredictorsAdd_C=[]).length=16,(E.VP8LPredictors_C=[]).length=16;var wA,Z0,ex,Gm,bA,CA,$d,Bu,zd,Ym,Ls,Mc,cr,ur,oi,Ii,Nu,tx,Xm,kC,E$,T$,P$,I$,nx,O$,F$,M$,L$=s(511),R$=s(2041),D$=s(225),U$=s(767),H$=0,qT=R$,_C=D$,lo=U$,Vo=L$,jC=0,BC=1,Q$=2,NC=3,EC=4,WT=5,$$=6,GT=7,YT=8,TC=9,XT=10,axe=[2,3,7],oxe=[3,3,11],z$=[280,256,256,256,40],lxe=[0,1,1,1,0],cxe=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],uxe=[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],dxe=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],hxe=8,JT=[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],ZT=[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],rx=null,fxe=[[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]],Axe=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],V$=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],pxe=[[[[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]]]],mxe=[[[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]]],gxe=[[[[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]]]],yxe=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Vd=[],Rl=[],Eu=[],vxe=1,K$=2,Kd=[],Ko=[];Fs("UpsampleRgbLinePair",pA,3),Fs("UpsampleBgrLinePair",$m,3),Fs("UpsampleRgbaLinePair",Y0,4),Fs("UpsampleBgraLinePair",gA,4),Fs("UpsampleArgbLinePair",mA,4),Fs("UpsampleRgba4444LinePair",Ms,2),Fs("UpsampleRgb565LinePair",zm,2);var xxe=E.UpsampleRgbLinePair,wxe=E.UpsampleBgrLinePair,q$=E.UpsampleRgbaLinePair,W$=E.UpsampleBgraLinePair,G$=E.UpsampleArgbLinePair,Y$=E.UpsampleRgba4444LinePair,bxe=E.UpsampleRgb565LinePair,PC=16,IC=1<<PC-1,ix=-227,eP=482,X$=6,Cxe=(256<<X$)-1,J$=0,Sxe=s(256),kxe=s(256),_xe=s(256),jxe=s(256),Bxe=s(eP-ix),Nxe=s(eP-ix);Oc("YuvToRgbRow",pA,3),Oc("YuvToBgrRow",$m,3),Oc("YuvToRgbaRow",Y0,4),Oc("YuvToBgraRow",gA,4),Oc("YuvToArgbRow",mA,4),Oc("YuvToRgba4444Row",Ms,2),Oc("YuvToRgb565Row",zm,2);var Z$=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],OC=[0,2,8],Exe=[8,7,6,4,4,2,2,2,1,1,1,1],Txe=1;this.WebPDecodeRGBA=function(S,_,O,D,W){var G=BC,J=new fe,ee=new cn;J.ba=ee,ee.S=G,ee.width=[ee.width],ee.height=[ee.height];var ne=ee.width,le=ee.height,me=new Et;if(me==null||S==null)var ke=2;else t(me!=null),ke=SC(S,_,O,me.width,me.height,me.Pd,me.Qd,me.format,null);if(ke!=0?ne=0:(ne!=null&&(ne[0]=me.width[0]),le!=null&&(le[0]=me.height[0]),ne=1),ne){ee.width=ee.width[0],ee.height=ee.height[0],D!=null&&(D[0]=ee.width),W!=null&&(W[0]=ee.height);e:{if(D=new Om,(W=new ve).data=S,W.w=_,W.ha=O,W.kd=1,_=[0],t(W!=null),((S=SC(W.data,W.w,W.ha,null,null,null,_,null,W))==0||S==7)&&_[0]&&(S=4),(_=S)==0){if(t(J!=null),D.data=W.data,D.w=W.w+W.offset,D.ha=W.ha-W.offset,D.put=St,D.ac=Wr,D.bc=Xi,D.ma=J,W.xa){if((S=lA())==null){J=1;break e}if(function(ce,ge){var be=[0],Ee=[0],Se=[0];t:for(;;){if(ce==null)return 0;if(ge==null)return ce.a=2,0;if(ce.l=ge,ce.a=0,z(ce.m,ge.data,ge.w,ge.ha),!ds(ce.m,be,Ee,Se)){ce.a=3;break t}if(ce.xb=K$,ge.width=be[0],ge.height=Ee[0],!Nc(be[0],Ee[0],1,ce,null))break t;return 1}return t(ce.a!=0),0}(S,D)){if(D=(_=X0(D.width,D.height,J.Oa,J.ba))==0){t:{D=S;n:for(;;){if(D==null){D=0;break t}if(t(D.s.yc!=null),t(D.s.Ya!=null),t(0<D.s.Wb),t((O=D.l)!=null),t((W=O.ma)!=null),D.xb!=0){if(D.ca=W.ba,D.tb=W.tb,t(D.ca!=null),!zo(W.Oa,O,NC)){D.a=2;break n}if(!cA(D,O.width)||O.da)break n;if((O.da||Ft(D.ca.S))&&Dr(),11>D.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),D.ca.f.kb.F!=null&&Dr()),D.Pb&&0<D.s.ua&&D.s.vb.X==null&&!te(D.s.vb,D.s.Wa.Xa)){D.a=1;break n}D.xb=0}if(!Ml(D,D.V,D.Ba,D.c,D.i,O.o,Md))break n;W.Dc=D.Ma,D=1;break t}t(D.a!=0),D=0}D=!D}D&&(_=S.a)}else _=S.a}else{if((S=new NT)==null){J=1;break e}if(S.Fa=W.na,S.P=W.P,S.qc=W.Sa,Tc(S,D)){if((_=X0(D.width,D.height,J.Oa,J.ba))==0){if(S.Aa=0,O=J.Oa,t((W=S)!=null),O!=null){if(0<(ne=0>(ne=O.Md)?0:100<ne?255:255*ne/100)){for(le=me=0;4>le;++le)12>(ke=W.pb[le]).lc&&(ke.ia=ne*Exe[0>ke.lc?0:ke.lc]>>3),me|=ke.ia;me&&(alert("todo:VP8InitRandom"),W.ia=1)}W.Ga=O.Id,100<W.Ga?W.Ga=100:0>W.Ga&&(W.Ga=0)}(function(ce,ge){if(ce==null)return 0;if(ge==null)return xi(ce,2,"NULL VP8Io parameter in VP8Decode().");if(!ce.cb&&!Tc(ce,ge))return 0;if(t(ce.cb),ge.ac==null||ge.ac(ge)){ge.ob&&(ce.L=0);var be=OC[ce.L];if(ce.L==2?(ce.yb=0,ce.zb=0):(ce.yb=ge.v-be>>4,ce.zb=ge.j-be>>4,0>ce.yb&&(ce.yb=0),0>ce.zb&&(ce.zb=0)),ce.Va=ge.o+15+be>>4,ce.Hb=ge.va+15+be>>4,ce.Hb>ce.za&&(ce.Hb=ce.za),ce.Va>ce.Ub&&(ce.Va=ce.Ub),0<ce.L){var Ee=ce.ed;for(be=0;4>be;++be){var Se;if(ce.Qa.Cb){var Ie=ce.Qa.Lb[be];ce.Qa.Fb||(Ie+=Ee.Tb)}else Ie=Ee.Tb;for(Se=0;1>=Se;++Se){var Fe=ce.gd[be][Se],ze=Ie;if(Ee.Pc&&(ze+=Ee.vd[0],Se&&(ze+=Ee.od[0])),0<(ze=0>ze?0:63<ze?63:ze)){var Re=ze;0<Ee.wb&&(Re=4<Ee.wb?Re>>2:Re>>1)>9-Ee.wb&&(Re=9-Ee.wb),1>Re&&(Re=1),Fe.dd=Re,Fe.tc=2*ze+Re,Fe.ld=40<=ze?2:15<=ze?1:0}else Fe.tc=0;Fe.La=Se}}}be=0}else xi(ce,6,"Frame setup failed"),be=ce.a;if(be=be==0){if(be){ce.$c=0,0<ce.Aa||(ce.Ic=Txe);t:{be=ce.Ic,Ee=4*(Re=ce.za);var Pt=32*Re,gt=Re+1,un=0<ce.L?Re*(0<ce.Aa?2:1):0,jt=(ce.Aa==2?2:1)*Re;if((Fe=Ee+832+(Se=3*(16*be+OC[ce.L])/2*Pt)+(Ie=ce.Fa!=null&&0<ce.Fa.length?ce.Kc.c*ce.Kc.i:0))!=Fe)be=0;else{if(Fe>ce.Vb){if(ce.Vb=0,ce.Ec=s(Fe),ce.Fc=0,ce.Ec==null){be=xi(ce,1,"no memory during frame initialization.");break t}ce.Vb=Fe}Fe=ce.Ec,ze=ce.Fc,ce.Ac=Fe,ce.Bc=ze,ze+=Ee,ce.Gd=a(Pt,hC),ce.Hd=0,ce.rb=a(gt+1,U0),ce.sb=1,ce.wa=un?a(un,$o):null,ce.Y=0,ce.D.Nb=0,ce.D.wa=ce.wa,ce.D.Y=ce.Y,0<ce.Aa&&(ce.D.Y+=Re),t(!0),ce.oc=Fe,ce.pc=ze,ze+=832,ce.ya=a(jt,H0),ce.aa=0,ce.D.ya=ce.ya,ce.D.aa=ce.aa,ce.Aa==2&&(ce.D.aa+=Re),ce.R=16*Re,ce.B=8*Re,Re=(Pt=OC[ce.L])*ce.R,Pt=Pt/2*ce.B,ce.sa=Fe,ce.ta=ze+Re,ce.qa=ce.sa,ce.ra=ce.ta+16*be*ce.R+Pt,ce.Ha=ce.qa,ce.Ia=ce.ra+8*be*ce.B+Pt,ce.$c=0,ze+=Se,ce.mb=Ie?Fe:null,ce.nb=Ie?ze:null,t(ze+Ie<=ce.Fc+ce.Vb),Q0(ce),i(ce.Ac,ce.Bc,0,Ee),be=1}}if(be){if(ge.ka=0,ge.y=ce.sa,ge.O=ce.ta,ge.f=ce.qa,ge.N=ce.ra,ge.ea=ce.Ha,ge.Vd=ce.Ia,ge.fa=ce.R,ge.Rc=ce.B,ge.F=null,ge.J=0,!H$){for(be=-255;255>=be;++be)L$[255+be]=0>be?-be:be;for(be=-1020;1020>=be;++be)R$[1020+be]=-128>be?-128:127<be?127:be;for(be=-112;112>=be;++be)D$[112+be]=-16>be?-16:15<be?15:be;for(be=-255;510>=be;++be)U$[255+be]=0>be?0:255<be?255:be;H$=1}$d=mC,Bu=ET,Ym=TT,Ls=PT,Mc=Pc,zd=pC,cr=vC,ur=xC,oi=bC,Ii=P,Nu=wC,tx=hA,Xm=V,kC=se,E$=Hm,T$=W0,P$=Qm,I$=yC,Rl[0]=DT,Rl[1]=Rm,Rl[2]=LT,Rl[3]=RT,Rl[4]=UT,Rl[5]=Cu,Rl[6]=HT,Rl[7]=Su,Rl[8]=$T,Rl[9]=QT,Vd[0]=gC,Vd[1]=IT,Vd[2]=OT,Vd[3]=FT,Vd[4]=Rd,Vd[5]=MT,Vd[6]=uA,Eu[0]=zT,Eu[1]=$0,Eu[2]=Dm,Eu[3]=z0,Eu[4]=VT,Eu[5]=Um,Eu[6]=V0,be=1}else be=0}be&&(be=function(Sn,Oi){for(Sn.M=0;Sn.M<Sn.Va;++Sn.M){var dn,Bt=Sn.Jc[Sn.M&Sn.Xb],Je=Sn.m,li=Sn;for(dn=0;dn<li.za;++dn){var on=Je,En=li,vr=En.Ac,As=En.Bc+4*dn,ca=En.zc,Yr=En.ya[En.aa+dn];if(En.Qa.Bb?Yr.$b=ae(on,En.Pa.jb[0])?2+ae(on,En.Pa.jb[2]):ae(on,En.Pa.jb[1]):Yr.$b=0,En.kc&&(Yr.Ad=ae(on,En.Bd)),Yr.Za=!ae(on,145)+0,Yr.Za){var Rs=Yr.Ob,ua=0;for(En=0;4>En;++En){var Fi,On=ca[0+En];for(Fi=0;4>Fi;++Fi){On=mxe[vr[As+Fi]][On];for(var Kn=V$[ae(on,On[0])];0<Kn;)Kn=V$[2*Kn+ae(on,On[Kn])];On=-Kn,vr[As+Fi]=On}r(Rs,ua,vr,As,4),ua+=4,ca[0+En]=On}}else On=ae(on,156)?ae(on,128)?1:3:ae(on,163)?2:0,Yr.Ob[0]=On,i(vr,As,On,4),i(ca,0,On,4);Yr.Dd=ae(on,142)?ae(on,114)?ae(on,183)?1:3:2:0}if(li.m.Ka)return xi(Sn,7,"Premature end-of-partition0 encountered.");for(;Sn.ja<Sn.za;++Sn.ja){if(li=Bt,on=(Je=Sn).rb[Je.sb-1],vr=Je.rb[Je.sb+Je.ja],dn=Je.ya[Je.aa+Je.ja],As=Je.kc?dn.Ad:0)on.la=vr.la=0,dn.Za||(on.Na=vr.Na=0),dn.Hc=0,dn.Gc=0,dn.ia=0;else{var Xr,qn;if(on=vr,vr=li,As=Je.Pa.Xc,ca=Je.ya[Je.aa+Je.ja],Yr=Je.pb[ca.$b],En=ca.ad,Rs=0,ua=Je.rb[Je.sb-1],On=Fi=0,i(En,Rs,0,384),ca.Za)var ps=0,Dl=As[3];else{Kn=s(16);var ci=on.Na+ua.Na;if(ci=rx(vr,As[1],ci,Yr.Eb,0,Kn,0),on.Na=ua.Na=(0<ci)+0,1<ci)$d(Kn,0,En,Rs);else{var Fa=Kn[0]+3>>3;for(Kn=0;256>Kn;Kn+=16)En[Rs+Kn]=Fa}ps=1,Dl=As[0]}var rr=15&on.la,Mi=15&ua.la;for(Kn=0;4>Kn;++Kn){var co=1&Mi;for(Fa=qn=0;4>Fa;++Fa)rr=rr>>1|(co=(ci=rx(vr,Dl,ci=co+(1&rr),Yr.Sc,ps,En,Rs))>ps)<<7,qn=qn<<2|(3<ci?3:1<ci?2:En[Rs+0]!=0),Rs+=16;rr>>=4,Mi=Mi>>1|co<<7,Fi=(Fi<<8|qn)>>>0}for(Dl=rr,ps=Mi>>4,Xr=0;4>Xr;Xr+=2){for(qn=0,rr=on.la>>4+Xr,Mi=ua.la>>4+Xr,Kn=0;2>Kn;++Kn){for(co=1&Mi,Fa=0;2>Fa;++Fa)ci=co+(1&rr),rr=rr>>1|(co=0<(ci=rx(vr,As[2],ci,Yr.Qc,0,En,Rs)))<<3,qn=qn<<2|(3<ci?3:1<ci?2:En[Rs+0]!=0),Rs+=16;rr>>=2,Mi=Mi>>1|co<<5}On|=qn<<4*Xr,Dl|=rr<<4<<Xr,ps|=(240&Mi)<<Xr}on.la=Dl,ua.la=ps,ca.Hc=Fi,ca.Gc=On,ca.ia=43690&On?0:Yr.ia,As=!(Fi|On)}if(0<Je.L&&(Je.wa[Je.Y+Je.ja]=Je.gd[dn.$b][dn.Za],Je.wa[Je.Y+Je.ja].La|=!As),li.Ka)return xi(Sn,7,"Premature end-of-file encountered.")}if(Q0(Sn),Je=Oi,li=1,dn=(Bt=Sn).D,on=0<Bt.L&&Bt.M>=Bt.zb&&Bt.M<=Bt.Va,Bt.Aa==0)t:{if(dn.M=Bt.M,dn.uc=on,Vm(Bt,dn),li=1,dn=(qn=Bt.D).Nb,on=(On=OC[Bt.L])*Bt.R,vr=On/2*Bt.B,Kn=16*dn*Bt.R,Fa=8*dn*Bt.B,As=Bt.sa,ca=Bt.ta-on+Kn,Yr=Bt.qa,En=Bt.ra-vr+Fa,Rs=Bt.Ha,ua=Bt.Ia-vr+Fa,Mi=(rr=qn.M)==0,Fi=rr>=Bt.Va-1,Bt.Aa==2&&Vm(Bt,qn),qn.uc)for(co=(ci=Bt).D.M,t(ci.D.uc),qn=ci.yb;qn<ci.Hb;++qn){ps=qn,Dl=co;var da=(uo=(ms=ci).D).Nb;Xr=ms.R;var uo=uo.wa[uo.Y+ps],ho=ms.sa,Ma=ms.ta+16*da*Xr+16*ps,fo=uo.dd,dr=uo.tc;if(dr!=0)if(t(3<=dr),ms.L==1)0<ps&&T$(ho,Ma,Xr,dr+4),uo.La&&I$(ho,Ma,Xr,dr),0<Dl&&E$(ho,Ma,Xr,dr+4),uo.La&&P$(ho,Ma,Xr,dr);else{var Ao=ms.B,Ul=ms.qa,SA=ms.ra+8*da*Ao+8*ps,Tu=ms.Ha,ms=ms.Ia+8*da*Ao+8*ps;da=uo.ld,0<ps&&(ur(ho,Ma,Xr,dr+4,fo,da),Ii(Ul,SA,Tu,ms,Ao,dr+4,fo,da)),uo.La&&(tx(ho,Ma,Xr,dr,fo,da),kC(Ul,SA,Tu,ms,Ao,dr,fo,da)),0<Dl&&(cr(ho,Ma,Xr,dr+4,fo,da),oi(Ul,SA,Tu,ms,Ao,dr+4,fo,da)),uo.La&&(Nu(ho,Ma,Xr,dr,fo,da),Xm(Ul,SA,Tu,ms,Ao,dr,fo,da))}}if(Bt.ia&&alert("todo:DitherRow"),Je.put!=null){if(qn=16*rr,rr=16*(rr+1),Mi?(Je.y=Bt.sa,Je.O=Bt.ta+Kn,Je.f=Bt.qa,Je.N=Bt.ra+Fa,Je.ea=Bt.Ha,Je.W=Bt.Ia+Fa):(qn-=On,Je.y=As,Je.O=ca,Je.f=Yr,Je.N=En,Je.ea=Rs,Je.W=ua),Fi||(rr-=On),rr>Je.o&&(rr=Je.o),Je.F=null,Je.J=null,Bt.Fa!=null&&0<Bt.Fa.length&&qn<rr&&(Je.J=wi(Bt,Je,qn,rr-qn),Je.F=Bt.mb,Je.F==null&&Je.F.length==0)){li=xi(Bt,3,"Could not decode alpha data.");break t}qn<Je.j&&(On=Je.j-qn,qn=Je.j,t(!(1&On)),Je.O+=Bt.R*On,Je.N+=Bt.B*(On>>1),Je.W+=Bt.B*(On>>1),Je.F!=null&&(Je.J+=Je.width*On)),qn<rr&&(Je.O+=Je.v,Je.N+=Je.v>>1,Je.W+=Je.v>>1,Je.F!=null&&(Je.J+=Je.v),Je.ka=qn-Je.j,Je.U=Je.va-Je.v,Je.T=rr-qn,li=Je.put(Je))}dn+1!=Bt.Ic||Fi||(r(Bt.sa,Bt.ta-on,As,ca+16*Bt.R,on),r(Bt.qa,Bt.ra-vr,Yr,En+8*Bt.B,vr),r(Bt.Ha,Bt.Ia-vr,Rs,ua+8*Bt.B,vr))}if(!li)return xi(Sn,6,"Output aborted.")}return 1}(ce,ge)),ge.bc!=null&&ge.bc(ge),be&=1}return be?(ce.cb=0,be):0})(S,D)||(_=S.a)}}else _=S.a}_==0&&J.Oa!=null&&J.Oa.fd&&(_=yA(J.ba))}J=_}G=J!=0?null:11>G?ee.f.RGBA.eb:ee.f.kb.y}else G=null;return G};var e8=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function u(E,I){for(var T="",N=0;N<4;N++)T+=String.fromCharCode(E[I++]);return T}function d(E,I){return E[I+0]|E[I+1]<<8}function h(E,I){return(E[I+0]|E[I+1]<<8|E[I+2]<<16)>>>0}function A(E,I){return(E[I+0]|E[I+1]<<8|E[I+2]<<16|E[I+3]<<24)>>>0}new c;var f=[0],p=[0],m=[],g=new c,y=e,v=function(E,I){var T={},N=0,F=!1,L=0,U=0;if(T.frames=[],!function(R,M){for(var Y=0;Y<4;Y++)if(R[M+Y]!="RIFF".charCodeAt(Y))return!0;return!1}(E,I)){for(A(E,I+=4),I+=8;I<E.length;){var H=u(E,I),K=A(E,I+=4);I+=4;var $=K+(1&K);switch(H){case"VP8 ":case"VP8L":T.frames[N]===void 0&&(T.frames[N]={}),(oe=T.frames[N]).src_off=F?U:I-8,oe.src_size=L+K+8,N++,F&&(F=!1,L=0,U=0);break;case"VP8X":(oe=T.header={}).feature_flags=E[I];var z=I+4;oe.canvas_width=1+h(E,z),z+=3,oe.canvas_height=1+h(E,z),z+=3;break;case"ALPH":F=!0,L=$+8,U=I-8;break;case"ANIM":(oe=T.header).bgcolor=A(E,I),z=I+4,oe.loop_count=d(E,z),z+=2;break;case"ANMF":var Q,oe;(oe=T.frames[N]={}).offset_x=2*h(E,I),I+=3,oe.offset_y=2*h(E,I),I+=3,oe.width=1+h(E,I),I+=3,oe.height=1+h(E,I),I+=3,oe.duration=h(E,I),I+=3,Q=E[I++],oe.dispose=1&Q,oe.blend=Q>>1&1}H!="ANMF"&&(I+=$)}return T}}(y,0);v.response=y,v.rgbaoutput=!0,v.dataurl=!1;var x=v.header?v.header:null,w=v.frames?v.frames:null;if(x){x.loop_counter=x.loop_count,f=[x.canvas_height],p=[x.canvas_width];for(var b=0;b<w.length&&w[b].blend!=0;b++);}var k=w[0],j=g.WebPDecodeRGBA(y,k.src_off,k.src_size,p,f);k.rgba=j,k.imgwidth=p[0],k.imgheight=f[0];for(var B=0;B<p[0]*f[0]*4;B++)m[B]=j[B];return this.width=p,this.height=f,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 V_t(){var e,t=this.internal.__metadata__.metadata,n=unescape(encodeURIComponent(t));e=this.internal.__metadata__.rawXml?n:'<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>'+n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")+"</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 K_t(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write("/Metadata "+this.internal.__metadata__.metadataObjectNumber+" 0 R")}(function(e){var t,n,r,i,s,a,o,c,u,d=function(R){return R=R||{},this.isStrokeTransparent=R.isStrokeTransparent||!1,this.strokeOpacity=R.strokeOpacity||1,this.strokeStyle=R.strokeStyle||"#000000",this.fillStyle=R.fillStyle||"#000000",this.isFillTransparent=R.isFillTransparent||!1,this.fillOpacity=R.fillOpacity||1,this.font=R.font||"10px sans-serif",this.textBaseline=R.textBaseline||"alphabetic",this.textAlign=R.textAlign||"left",this.lineWidth=R.lineWidth||1,this.lineJoin=R.lineJoin||"miter",this.lineCap=R.lineCap||"butt",this.path=R.path||[],this.transform=R.transform!==void 0?R.transform.clone():new c,this.globalCompositeOperation=R.globalCompositeOperation||"normal",this.globalAlpha=R.globalAlpha||1,this.clip_path=R.clip_path||[],this.currentPoint=R.currentPoint||new a,this.miterLimit=R.miterLimit||10,this.lastPoint=R.lastPoint||new a,this.lineDashOffset=R.lineDashOffset||0,this.lineDash=R.lineDash||[],this.margin=R.margin||[0,0,0,0],this.prevPageLastElemOffset=R.prevPageLastElemOffset||0,this.ignoreClearRect=typeof R.ignoreClearRect!="boolean"||R.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new h(this),t=this.internal.f2,n=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,i=this.internal.getHorizontalCoordinate,s=this.internal.getVerticalCoordinate,a=this.internal.Point,o=this.internal.Rectangle,c=this.internal.Matrix,u=new d}]);var h=function(R){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var M=R;Object.defineProperty(this,"pdf",{get:function(){return M}});var Y=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return Y},set:function(te){Y=!!te}});var X=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return X},set:function(te){X=!!te}});var q=0;Object.defineProperty(this,"posX",{get:function(){return q},set:function(te){isNaN(te)||(q=te)}});var Z=0;Object.defineProperty(this,"posY",{get:function(){return Z},set:function(te){isNaN(te)||(Z=te)}}),Object.defineProperty(this,"margin",{get:function(){return u.margin},set:function(te){var je;typeof te=="number"?je=[te,te,te,te]:((je=new Array(4))[0]=te[0],je[1]=te.length>=2?te[1]:je[0],je[2]=te.length>=3?te[2]:je[0],je[3]=te.length>=4?te[3]:je[1]),u.margin=je}});var de=!1;Object.defineProperty(this,"autoPaging",{get:function(){return de},set:function(te){de=te}});var ue=0;Object.defineProperty(this,"lastBreak",{get:function(){return ue},set:function(te){ue=te}});var ae=[];Object.defineProperty(this,"pageBreaks",{get:function(){return ae},set:function(te){ae=te}}),Object.defineProperty(this,"ctx",{get:function(){return u},set:function(te){te instanceof d&&(u=te)}}),Object.defineProperty(this,"path",{get:function(){return u.path},set:function(te){u.path=te}});var he=[];Object.defineProperty(this,"ctxStack",{get:function(){return he},set:function(te){he=te}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(te){var je;je=A(te),this.ctx.fillStyle=je.style,this.ctx.isFillTransparent=je.a===0,this.ctx.fillOpacity=je.a,this.pdf.setFillColor(je.r,je.g,je.b,{a:je.a}),this.pdf.setTextColor(je.r,je.g,je.b,{a:je.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(te){var je=A(te);this.ctx.strokeStyle=je.style,this.ctx.isStrokeTransparent=je.a===0,this.ctx.strokeOpacity=je.a,je.a===0?this.pdf.setDrawColor(255,255,255):(je.a,this.pdf.setDrawColor(je.r,je.g,je.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(te){["butt","round","square"].indexOf(te)!==-1&&(this.ctx.lineCap=te,this.pdf.setLineCap(te))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(te){isNaN(te)||(this.ctx.lineWidth=te,this.pdf.setLineWidth(te))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(te){["bevel","round","miter"].indexOf(te)!==-1&&(this.ctx.lineJoin=te,this.pdf.setLineJoin(te))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(te){isNaN(te)||(this.ctx.miterLimit=te,this.pdf.setMiterLimit(te))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(te){this.ctx.textBaseline=te}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(te){["right","end","center","left","start"].indexOf(te)!==-1&&(this.ctx.textAlign=te)}});var ie=null,Ce=null,Oe=null;Object.defineProperty(this,"fontFaces",{get:function(){return Oe},set:function(te){ie=null,Ce=null,Oe=te}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(te){var je;if(this.ctx.font=te,(je=/^\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(te))!==null){var tt=je[1];je[2];var nt=je[3],Te=je[4];je[5];var ct=je[6],we=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Te)[2];Te=Math.floor(we==="px"?parseFloat(Te)*this.pdf.internal.scaleFactor:we==="em"?parseFloat(Te)*this.pdf.getFontSize():parseFloat(Te)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Te);var $e=function(pe){var bt,mt,_t=[],Rt=pe.trim();if(Rt==="")return pO;if(Rt in uZ)return[uZ[Rt]];for(;Rt!=="";){switch(mt=null,bt=(Rt=hZ(Rt)).charAt(0)){case'"':case"'":mt=D_t(Rt.substring(1),bt);break;default:mt=U_t(Rt)}if(mt===null||(_t.push(mt[0]),(Rt=hZ(mt[1]))!==""&&Rt.charAt(0)!==","))return pO;Rt=Rt.replace(/^,/,"")}return _t}(ct);if(this.fontFaces){var Ve=function(pe,bt){var mt=pe.getFontList(),_t=JSON.stringify(mt);if(ie===null||Ce!==_t){var Rt=function(Wt){var vt=[];return Object.keys(Wt).forEach(function(Dt){Wt[Dt].forEach(function(Ft){var Zt=null;switch(Ft){case"bold":Zt={family:Dt,weight:"bold"};break;case"italic":Zt={family:Dt,style:"italic"};break;case"bolditalic":Zt={family:Dt,weight:"bold",style:"italic"};break;case"":case"normal":Zt={family:Dt}}Zt!==null&&(Zt.ref={name:Dt,style:Ft},vt.push(Zt))})}),vt}(mt);ie=function(Wt){for(var vt={},Dt=0;Dt<Wt.length;++Dt){var Ft=AO(Wt[Dt]),Zt=Ft.family,lr=Ft.stretch,cn=Ft.style,Et=Ft.weight;vt[Zt]=vt[Zt]||{},vt[Zt][lr]=vt[Zt][lr]||{},vt[Zt][lr][cn]=vt[Zt][lr][cn]||{},vt[Zt][lr][cn][Et]=Ft}return vt}(Rt.concat(bt)),Ce=_t}return ie}(this.pdf,this.fontFaces),$t=$e.map(function(pe){return{family:pe,stretch:"normal",weight:nt,style:tt}}),yt=function(pe,bt,mt){for(var _t=(mt=mt||{}).defaultFontFamily||"times",Rt=Object.assign({},R_t,mt.genericFontFamilies||{}),Wt=null,vt=null,Dt=0;Dt<bt.length;++Dt)if(Rt[(Wt=AO(bt[Dt])).family]&&(Wt.family=Rt[Wt.family]),pe.hasOwnProperty(Wt.family)){vt=pe[Wt.family];break}if(!(vt=vt||pe[_t]))throw new Error("Could not find a font-family for the rule '"+dZ(Wt)+"' and default family '"+_t+"'.");if(vt=function(Ft,Zt){if(Zt[Ft])return Zt[Ft];var lr=DR[Ft],cn=lr<=DR.normal?-1:1,Et=cZ(Zt,Yve,lr,cn);if(!Et)throw new Error("Could not find a matching font-stretch value for "+Ft);return Et}(Wt.stretch,vt),vt=function(Ft,Zt){if(Zt[Ft])return Zt[Ft];for(var lr=Gve[Ft],cn=0;cn<lr.length;++cn)if(Zt[lr[cn]])return Zt[lr[cn]];throw new Error("Could not find a matching font-style for "+Ft)}(Wt.style,vt),!(vt=function(Ft,Zt){if(Zt[Ft])return Zt[Ft];if(Ft===400&&Zt[500])return Zt[500];if(Ft===500&&Zt[400])return Zt[400];var lr=L_t[Ft],cn=cZ(Zt,Xve,lr,Ft<400?-1:1);if(!cn)throw new Error("Could not find a matching font-weight for value "+Ft);return cn}(Wt.weight,vt)))throw new Error("Failed to resolve a font for the rule '"+dZ(Wt)+"'.");return vt}(Ve,$t);this.pdf.setFont(yt.ref.name,yt.ref.style)}else{var ye="";(nt==="bold"||parseInt(nt,10)>=700||tt==="bold")&&(ye="bold"),tt==="italic"&&(ye+="italic"),ye.length===0&&(ye="normal");for(var Be="",Ge={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"},Ue=0;Ue<$e.length;Ue++){if(this.pdf.internal.getFont($e[Ue],ye,{noFallback:!0,disableWarning:!0})!==void 0){Be=$e[Ue];break}if(ye==="bolditalic"&&this.pdf.internal.getFont($e[Ue],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Be=$e[Ue],ye="bold";else if(this.pdf.internal.getFont($e[Ue],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Be=$e[Ue],ye="normal";break}}if(Be===""){for(var Ye=0;Ye<$e.length;Ye++)if(Ge[$e[Ye]]){Be=Ge[$e[Ye]];break}}Be=Be===""?"Times":Be,this.pdf.setFont(Be,ye)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(te){this.ctx.globalCompositeOperation=te}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(te){this.ctx.globalAlpha=te}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(te){this.ctx.lineDashOffset=te,oe.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(te){this.ctx.lineDash=te,oe.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(te){this.ctx.ignoreClearRect=!!te}})};h.prototype.setLineDash=function(R){this.lineDash=R},h.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},h.prototype.fill=function(){w.call(this,"fill",!1)},h.prototype.stroke=function(){w.call(this,"stroke",!1)},h.prototype.beginPath=function(){this.path=[{type:"begin"}]},h.prototype.moveTo=function(R,M){if(isNaN(R)||isNaN(M))throw ir.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var Y=this.ctx.transform.applyToPoint(new a(R,M));this.path.push({type:"mt",x:Y.x,y:Y.y}),this.ctx.lastPoint=new a(R,M)},h.prototype.closePath=function(){var R=new a(0,0),M=0;for(M=this.path.length-1;M!==-1;M--)if(this.path[M].type==="begin"&&Gn(this.path[M+1])==="object"&&typeof this.path[M+1].x=="number"){R=new a(this.path[M+1].x,this.path[M+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new a(R.x,R.y)},h.prototype.lineTo=function(R,M){if(isNaN(R)||isNaN(M))throw ir.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var Y=this.ctx.transform.applyToPoint(new a(R,M));this.path.push({type:"lt",x:Y.x,y:Y.y}),this.ctx.lastPoint=new a(Y.x,Y.y)},h.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),w.call(this,null,!0)},h.prototype.quadraticCurveTo=function(R,M,Y,X){if(isNaN(Y)||isNaN(X)||isNaN(R)||isNaN(M))throw ir.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var q=this.ctx.transform.applyToPoint(new a(Y,X)),Z=this.ctx.transform.applyToPoint(new a(R,M));this.path.push({type:"qct",x1:Z.x,y1:Z.y,x:q.x,y:q.y}),this.ctx.lastPoint=new a(q.x,q.y)},h.prototype.bezierCurveTo=function(R,M,Y,X,q,Z){if(isNaN(q)||isNaN(Z)||isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X))throw ir.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var de=this.ctx.transform.applyToPoint(new a(q,Z)),ue=this.ctx.transform.applyToPoint(new a(R,M)),ae=this.ctx.transform.applyToPoint(new a(Y,X));this.path.push({type:"bct",x1:ue.x,y1:ue.y,x2:ae.x,y2:ae.y,x:de.x,y:de.y}),this.ctx.lastPoint=new a(de.x,de.y)},h.prototype.arc=function(R,M,Y,X,q,Z){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X)||isNaN(q))throw ir.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(Z=!!Z,!this.ctx.transform.isIdentity){var de=this.ctx.transform.applyToPoint(new a(R,M));R=de.x,M=de.y;var ue=this.ctx.transform.applyToPoint(new a(0,Y)),ae=this.ctx.transform.applyToPoint(new a(0,0));Y=Math.sqrt(Math.pow(ue.x-ae.x,2)+Math.pow(ue.y-ae.y,2))}Math.abs(q-X)>=2*Math.PI&&(X=0,q=2*Math.PI),this.path.push({type:"arc",x:R,y:M,radius:Y,startAngle:X,endAngle:q,counterclockwise:Z})},h.prototype.arcTo=function(R,M,Y,X,q){throw new Error("arcTo not implemented.")},h.prototype.rect=function(R,M,Y,X){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X))throw ir.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(R,M),this.lineTo(R+Y,M),this.lineTo(R+Y,M+X),this.lineTo(R,M+X),this.lineTo(R,M),this.lineTo(R+Y,M),this.lineTo(R,M)},h.prototype.fillRect=function(R,M,Y,X){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X))throw ir.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!f.call(this)){var q={};this.lineCap!=="butt"&&(q.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(q.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(R,M,Y,X),this.fill(),q.hasOwnProperty("lineCap")&&(this.lineCap=q.lineCap),q.hasOwnProperty("lineJoin")&&(this.lineJoin=q.lineJoin)}},h.prototype.strokeRect=function(R,M,Y,X){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X))throw ir.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");p.call(this)||(this.beginPath(),this.rect(R,M,Y,X),this.stroke())},h.prototype.clearRect=function(R,M,Y,X){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X))throw ir.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(R,M,Y,X))},h.prototype.save=function(R){R=typeof R!="boolean"||R;for(var M=this.pdf.internal.getCurrentPageInfo().pageNumber,Y=0;Y<this.pdf.internal.getNumberOfPages();Y++)this.pdf.setPage(Y+1),this.pdf.internal.out("q");if(this.pdf.setPage(M),R){this.ctx.fontSize=this.pdf.internal.getFontSize();var X=new d(this.ctx);this.ctxStack.push(this.ctx),this.ctx=X}},h.prototype.restore=function(R){R=typeof R!="boolean"||R;for(var M=this.pdf.internal.getCurrentPageInfo().pageNumber,Y=0;Y<this.pdf.internal.getNumberOfPages();Y++)this.pdf.setPage(Y+1),this.pdf.internal.out("Q");this.pdf.setPage(M),R&&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)},h.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var A=function(R){var M,Y,X,q;if(R.isCanvasGradient===!0&&(R=R.getColor()),!R)return{r:0,g:0,b:0,a:0,style:R};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(R))M=0,Y=0,X=0,q=0;else{var Z=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(R);if(Z!==null)M=parseInt(Z[1]),Y=parseInt(Z[2]),X=parseInt(Z[3]),q=1;else if((Z=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(R))!==null)M=parseInt(Z[1]),Y=parseInt(Z[2]),X=parseInt(Z[3]),q=parseFloat(Z[4]);else{if(q=1,typeof R=="string"&&R.charAt(0)!=="#"){var de=new Qve(R);R=de.ok?de.toHex():"#000000"}R.length===4?(M=R.substring(1,2),M+=M,Y=R.substring(2,3),Y+=Y,X=R.substring(3,4),X+=X):(M=R.substring(1,3),Y=R.substring(3,5),X=R.substring(5,7)),M=parseInt(M,16),Y=parseInt(Y,16),X=parseInt(X,16)}}return{r:M,g:Y,b:X,a:q,style:R}},f=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},p=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};h.prototype.fillText=function(R,M,Y,X){if(isNaN(M)||isNaN(Y)||typeof R!="string")throw ir.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(X=isNaN(X)?void 0:X,!f.call(this)){var q=$(this.ctx.transform.rotation),Z=this.ctx.transform.scaleX;N.call(this,{text:R,x:M,y:Y,scale:Z,angle:q,align:this.textAlign,maxWidth:X})}},h.prototype.strokeText=function(R,M,Y,X){if(isNaN(M)||isNaN(Y)||typeof R!="string")throw ir.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!p.call(this)){X=isNaN(X)?void 0:X;var q=$(this.ctx.transform.rotation),Z=this.ctx.transform.scaleX;N.call(this,{text:R,x:M,y:Y,scale:Z,renderingMode:"stroke",angle:q,align:this.textAlign,maxWidth:X})}},h.prototype.measureText=function(R){if(typeof R!="string")throw ir.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var M=this.pdf,Y=this.pdf.internal.scaleFactor,X=M.internal.getFontSize(),q=M.getStringUnitWidth(R)*X/M.internal.scaleFactor;return new function(Z){var de=(Z=Z||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return de}}),this}({width:q*=Math.round(96*Y/72*1e4)/1e4})},h.prototype.scale=function(R,M){if(isNaN(R)||isNaN(M))throw ir.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var Y=new c(R,0,0,M,0,0);this.ctx.transform=this.ctx.transform.multiply(Y)},h.prototype.rotate=function(R){if(isNaN(R))throw ir.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var M=new c(Math.cos(R),Math.sin(R),-Math.sin(R),Math.cos(R),0,0);this.ctx.transform=this.ctx.transform.multiply(M)},h.prototype.translate=function(R,M){if(isNaN(R)||isNaN(M))throw ir.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var Y=new c(1,0,0,1,R,M);this.ctx.transform=this.ctx.transform.multiply(Y)},h.prototype.transform=function(R,M,Y,X,q,Z){if(isNaN(R)||isNaN(M)||isNaN(Y)||isNaN(X)||isNaN(q)||isNaN(Z))throw ir.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var de=new c(R,M,Y,X,q,Z);this.ctx.transform=this.ctx.transform.multiply(de)},h.prototype.setTransform=function(R,M,Y,X,q,Z){R=isNaN(R)?1:R,M=isNaN(M)?0:M,Y=isNaN(Y)?0:Y,X=isNaN(X)?1:X,q=isNaN(q)?0:q,Z=isNaN(Z)?0:Z,this.ctx.transform=new c(R,M,Y,X,q,Z)};var m=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};h.prototype.drawImage=function(R,M,Y,X,q,Z,de,ue,ae){var he=this.pdf.getImageProperties(R),ie=1,Ce=1,Oe=1,te=1;X!==void 0&&ue!==void 0&&(Oe=ue/X,te=ae/q,ie=he.width/X*ue/X,Ce=he.height/q*ae/q),Z===void 0&&(Z=M,de=Y,M=0,Y=0),X!==void 0&&ue===void 0&&(ue=X,ae=q),X===void 0&&ue===void 0&&(ue=he.width,ae=he.height);var je=this.ctx.transform.decompose(),tt=$(je.rotate.shx),nt=new c,Te=(nt=(nt=(nt=nt.multiply(je.translate)).multiply(je.skew)).multiply(je.scale)).applyToRectangle(new o(Z-M*Oe,de-Y*te,X*ie,q*Ce));if(this.autoPaging){for(var ct,we=g.call(this,Te),$e=[],Ve=0;Ve<we.length;Ve+=1)$e.indexOf(we[Ve])===-1&&$e.push(we[Ve]);x($e);for(var $t=$e[0],yt=$e[$e.length-1],ye=$t;ye<yt+1;ye++){this.pdf.setPage(ye);var Be=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ge=ye===1?this.posY+this.margin[0]:this.margin[0],Ue=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ye=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],pe=ye===1?0:Ue+(ye-2)*Ye;if(this.ctx.clip_path.length!==0){var bt=this.path;ct=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(ct,this.posX+this.margin[3],-pe+Ge+this.ctx.prevPageLastElemOffset),b.call(this,"fill",!0),this.path=bt}var mt=JSON.parse(JSON.stringify(Te));mt=v([mt],this.posX+this.margin[3],-pe+Ge+this.ctx.prevPageLastElemOffset)[0];var _t=(ye>$t||ye<yt)&&m.call(this);_t&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Be,Ye,null).clip().discardPath()),this.pdf.addImage(R,"JPEG",mt.x,mt.y,mt.w,mt.h,null,null,tt),_t&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(R,"JPEG",Te.x,Te.y,Te.w,Te.h,null,null,tt)};var g=function(R,M,Y){var X=[];M=M||this.pdf.internal.pageSize.width,Y=Y||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var q=this.posY+this.ctx.prevPageLastElemOffset;switch(R.type){default:case"mt":case"lt":X.push(Math.floor((R.y+q)/Y)+1);break;case"arc":X.push(Math.floor((R.y+q-R.radius)/Y)+1),X.push(Math.floor((R.y+q+R.radius)/Y)+1);break;case"qct":var Z=z(this.ctx.lastPoint.x,this.ctx.lastPoint.y,R.x1,R.y1,R.x,R.y);X.push(Math.floor((Z.y+q)/Y)+1),X.push(Math.floor((Z.y+Z.h+q)/Y)+1);break;case"bct":var de=Q(this.ctx.lastPoint.x,this.ctx.lastPoint.y,R.x1,R.y1,R.x2,R.y2,R.x,R.y);X.push(Math.floor((de.y+q)/Y)+1),X.push(Math.floor((de.y+de.h+q)/Y)+1);break;case"rect":X.push(Math.floor((R.y+q)/Y)+1),X.push(Math.floor((R.y+R.h+q)/Y)+1)}for(var ue=0;ue<X.length;ue+=1)for(;this.pdf.internal.getNumberOfPages()<X[ue];)y.call(this);return X},y=function(){var R=this.fillStyle,M=this.strokeStyle,Y=this.font,X=this.lineCap,q=this.lineWidth,Z=this.lineJoin;this.pdf.addPage(),this.fillStyle=R,this.strokeStyle=M,this.font=Y,this.lineCap=X,this.lineWidth=q,this.lineJoin=Z},v=function(R,M,Y){for(var X=0;X<R.length;X++)switch(R[X].type){case"bct":R[X].x2+=M,R[X].y2+=Y;case"qct":R[X].x1+=M,R[X].y1+=Y;default:R[X].x+=M,R[X].y+=Y}return R},x=function(R){return R.sort(function(M,Y){return M-Y})},w=function(R,M){var Y=this.fillStyle,X=this.strokeStyle,q=this.lineCap,Z=this.lineWidth,de=Math.abs(Z*this.ctx.transform.scaleX),ue=this.lineJoin;if(this.autoPaging){for(var ae,he,ie=JSON.parse(JSON.stringify(this.path)),Ce=JSON.parse(JSON.stringify(this.path)),Oe=[],te=0;te<Ce.length;te++)if(Ce[te].x!==void 0)for(var je=g.call(this,Ce[te]),tt=0;tt<je.length;tt+=1)Oe.indexOf(je[tt])===-1&&Oe.push(je[tt]);for(var nt=0;nt<Oe.length;nt++)for(;this.pdf.internal.getNumberOfPages()<Oe[nt];)y.call(this);x(Oe);for(var Te=Oe[0],ct=Oe[Oe.length-1],we=Te;we<ct+1;we++){this.pdf.setPage(we),this.fillStyle=Y,this.strokeStyle=X,this.lineCap=q,this.lineWidth=de,this.lineJoin=ue;var $e=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ve=we===1?this.posY+this.margin[0]:this.margin[0],$t=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],yt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],ye=we===1?0:$t+(we-2)*yt;if(this.ctx.clip_path.length!==0){var Be=this.path;ae=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(ae,this.posX+this.margin[3],-ye+Ve+this.ctx.prevPageLastElemOffset),b.call(this,R,!0),this.path=Be}if(he=JSON.parse(JSON.stringify(ie)),this.path=v(he,this.posX+this.margin[3],-ye+Ve+this.ctx.prevPageLastElemOffset),M===!1||we===0){var Ge=(we>Te||we<ct)&&m.call(this);Ge&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],$e,yt,null).clip().discardPath()),b.call(this,R,M),Ge&&this.pdf.restoreGraphicsState()}this.lineWidth=Z}this.path=ie}else this.lineWidth=de,b.call(this,R,M),this.lineWidth=Z},b=function(R,M){if((R!=="stroke"||M||!p.call(this))&&(R==="stroke"||M||!f.call(this))){for(var Y,X,q=[],Z=this.path,de=0;de<Z.length;de++){var ue=Z[de];switch(ue.type){case"begin":q.push({begin:!0});break;case"close":q.push({close:!0});break;case"mt":q.push({start:ue,deltas:[],abs:[]});break;case"lt":var ae=q.length;if(Z[de-1]&&!isNaN(Z[de-1].x)&&(Y=[ue.x-Z[de-1].x,ue.y-Z[de-1].y],ae>0)){for(;ae>=0;ae--)if(q[ae-1].close!==!0&&q[ae-1].begin!==!0){q[ae-1].deltas.push(Y),q[ae-1].abs.push(ue);break}}break;case"bct":Y=[ue.x1-Z[de-1].x,ue.y1-Z[de-1].y,ue.x2-Z[de-1].x,ue.y2-Z[de-1].y,ue.x-Z[de-1].x,ue.y-Z[de-1].y],q[q.length-1].deltas.push(Y);break;case"qct":var he=Z[de-1].x+2/3*(ue.x1-Z[de-1].x),ie=Z[de-1].y+2/3*(ue.y1-Z[de-1].y),Ce=ue.x+2/3*(ue.x1-ue.x),Oe=ue.y+2/3*(ue.y1-ue.y),te=ue.x,je=ue.y;Y=[he-Z[de-1].x,ie-Z[de-1].y,Ce-Z[de-1].x,Oe-Z[de-1].y,te-Z[de-1].x,je-Z[de-1].y],q[q.length-1].deltas.push(Y);break;case"arc":q.push({deltas:[],abs:[],arc:!0}),Array.isArray(q[q.length-1].abs)&&q[q.length-1].abs.push(ue)}}X=M?null:R==="stroke"?"stroke":"fill";for(var tt=!1,nt=0;nt<q.length;nt++)if(q[nt].arc)for(var Te=q[nt].abs,ct=0;ct<Te.length;ct++){var we=Te[ct];we.type==="arc"?B.call(this,we.x,we.y,we.radius,we.startAngle,we.endAngle,we.counterclockwise,void 0,M,!tt):F.call(this,we.x,we.y),tt=!0}else if(q[nt].close===!0)this.pdf.internal.out("h"),tt=!1;else if(q[nt].begin!==!0){var $e=q[nt].start.x,Ve=q[nt].start.y;L.call(this,q[nt].deltas,$e,Ve),tt=!0}X&&E.call(this,X),M&&I.call(this)}},k=function(R){var M=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,Y=M*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return R-Y;case"top":return R+M-Y;case"hanging":return R+M-2*Y;case"middle":return R+M/2-Y;default:return R}},j=function(R){return R+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};h.prototype.createLinearGradient=function(){var R=function(){};return R.colorStops=[],R.addColorStop=function(M,Y){this.colorStops.push([M,Y])},R.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},R.isCanvasGradient=!0,R},h.prototype.createPattern=function(){return this.createLinearGradient()},h.prototype.createRadialGradient=function(){return this.createLinearGradient()};var B=function(R,M,Y,X,q,Z,de,ue,ae){for(var he=H.call(this,Y,X,q,Z),ie=0;ie<he.length;ie++){var Ce=he[ie];ie===0&&(ae?T.call(this,Ce.x1+R,Ce.y1+M):F.call(this,Ce.x1+R,Ce.y1+M)),U.call(this,R,M,Ce.x2,Ce.y2,Ce.x3,Ce.y3,Ce.x4,Ce.y4)}ue?I.call(this):E.call(this,de)},E=function(R){switch(R){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},I=function(){this.pdf.clip(),this.pdf.discardPath()},T=function(R,M){this.pdf.internal.out(n(R)+" "+r(M)+" m")},N=function(R){var M;switch(R.align){case"right":case"end":M="right";break;case"center":M="center";break;default:M="left"}var Y,X,q,Z=this.pdf.getTextDimensions(R.text),de=k.call(this,R.y),ue=j.call(this,de)-Z.h,ae=this.ctx.transform.applyToPoint(new a(R.x,de));if(this.autoPaging){var he=this.ctx.transform.decompose(),ie=new c;ie=(ie=(ie=ie.multiply(he.translate)).multiply(he.skew)).multiply(he.scale);for(var Ce=this.ctx.transform.applyToRectangle(new o(R.x,de,Z.w,Z.h)),Oe=ie.applyToRectangle(new o(R.x,ue,Z.w,Z.h)),te=g.call(this,Oe),je=[],tt=0;tt<te.length;tt+=1)je.indexOf(te[tt])===-1&&je.push(te[tt]);x(je);for(var nt=je[0],Te=je[je.length-1],ct=nt;ct<Te+1;ct++){this.pdf.setPage(ct);var we=ct===1?this.posY+this.margin[0]:this.margin[0],$e=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ve=this.pdf.internal.pageSize.height-this.margin[2],$t=Ve-this.margin[0],yt=this.pdf.internal.pageSize.width-this.margin[1],ye=yt-this.margin[3],Be=ct===1?0:$e+(ct-2)*$t;if(this.ctx.clip_path.length!==0){var Ge=this.path;Y=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=v(Y,this.posX+this.margin[3],-1*Be+we),b.call(this,"fill",!0),this.path=Ge}var Ue=v([JSON.parse(JSON.stringify(Oe))],this.posX+this.margin[3],-Be+we+this.ctx.prevPageLastElemOffset)[0];R.scale>=.01&&(X=this.pdf.internal.getFontSize(),this.pdf.setFontSize(X*R.scale),q=this.lineWidth,this.lineWidth=q*R.scale);var Ye=this.autoPaging!=="text";if(Ye||Ue.y+Ue.h<=Ve){if(Ye||Ue.y>=we&&Ue.x<=yt){var pe=Ye?R.text:this.pdf.splitTextToSize(R.text,R.maxWidth||yt-Ue.x)[0],bt=v([JSON.parse(JSON.stringify(Ce))],this.posX+this.margin[3],-Be+we+this.ctx.prevPageLastElemOffset)[0],mt=Ye&&(ct>nt||ct<Te)&&m.call(this);mt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],ye,$t,null).clip().discardPath()),this.pdf.text(pe,bt.x,bt.y,{angle:R.angle,align:M,renderingMode:R.renderingMode}),mt&&this.pdf.restoreGraphicsState()}}else Ue.y<Ve&&(this.ctx.prevPageLastElemOffset+=Ve-Ue.y);R.scale>=.01&&(this.pdf.setFontSize(X),this.lineWidth=q)}}else R.scale>=.01&&(X=this.pdf.internal.getFontSize(),this.pdf.setFontSize(X*R.scale),q=this.lineWidth,this.lineWidth=q*R.scale),this.pdf.text(R.text,ae.x+this.posX,ae.y+this.posY,{angle:R.angle,align:M,renderingMode:R.renderingMode,maxWidth:R.maxWidth}),R.scale>=.01&&(this.pdf.setFontSize(X),this.lineWidth=q)},F=function(R,M,Y,X){Y=Y||0,X=X||0,this.pdf.internal.out(n(R+Y)+" "+r(M+X)+" l")},L=function(R,M,Y){return this.pdf.lines(R,M,Y,null,null)},U=function(R,M,Y,X,q,Z,de,ue){this.pdf.internal.out([t(i(Y+R)),t(s(X+M)),t(i(q+R)),t(s(Z+M)),t(i(de+R)),t(s(ue+M)),"c"].join(" "))},H=function(R,M,Y,X){for(var q=2*Math.PI,Z=Math.PI/2;M>Y;)M-=q;var de=Math.abs(Y-M);de<q&&X&&(de=q-de);for(var ue=[],ae=X?-1:1,he=M;de>1e-5;){var ie=he+ae*Math.min(de,Z);ue.push(K.call(this,R,he,ie)),de-=Math.abs(ie-he),he=ie}return ue},K=function(R,M,Y){var X=(Y-M)/2,q=R*Math.cos(X),Z=R*Math.sin(X),de=q,ue=-Z,ae=de*de+ue*ue,he=ae+de*q+ue*Z,ie=4/3*(Math.sqrt(2*ae*he)-he)/(de*Z-ue*q),Ce=de-ie*ue,Oe=ue+ie*de,te=Ce,je=-Oe,tt=X+M,nt=Math.cos(tt),Te=Math.sin(tt);return{x1:R*Math.cos(M),y1:R*Math.sin(M),x2:Ce*nt-Oe*Te,y2:Ce*Te+Oe*nt,x3:te*nt-je*Te,y3:te*Te+je*nt,x4:R*Math.cos(Y),y4:R*Math.sin(Y)}},$=function(R){return 180*R/Math.PI},z=function(R,M,Y,X,q,Z){var de=R+.5*(Y-R),ue=M+.5*(X-M),ae=q+.5*(Y-q),he=Z+.5*(X-Z),ie=Math.min(R,q,de,ae),Ce=Math.max(R,q,de,ae),Oe=Math.min(M,Z,ue,he),te=Math.max(M,Z,ue,he);return new o(ie,Oe,Ce-ie,te-Oe)},Q=function(R,M,Y,X,q,Z,de,ue){var ae,he,ie,Ce,Oe,te,je,tt,nt,Te,ct,we,$e,Ve,$t=Y-R,yt=X-M,ye=q-Y,Be=Z-X,Ge=de-q,Ue=ue-Z;for(he=0;he<41;he++)nt=(je=(ie=R+(ae=he/40)*$t)+ae*((Oe=Y+ae*ye)-ie))+ae*(Oe+ae*(q+ae*Ge-Oe)-je),Te=(tt=(Ce=M+ae*yt)+ae*((te=X+ae*Be)-Ce))+ae*(te+ae*(Z+ae*Ue-te)-tt),he==0?(ct=nt,we=Te,$e=nt,Ve=Te):(ct=Math.min(ct,nt),we=Math.min(we,Te),$e=Math.max($e,nt),Ve=Math.max(Ve,Te));return new o(Math.round(ct),Math.round(we),Math.round($e-ct),Math.round(Ve-we))},oe=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var R,M,Y=(R=this.ctx.lineDash,M=this.ctx.lineDashOffset,JSON.stringify({lineDash:R,lineDashOffset:M}));this.prevLineDash!==Y&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=Y)}}})(It.API),function(e){var t=function(a){var o,c,u,d,h,A,f,p,m,g;for(c=[],u=0,d=(a+=o="\0\0\0\0".slice(a.length%4||4)).length;d>u;u+=4)(h=(a.charCodeAt(u)<<24)+(a.charCodeAt(u+1)<<16)+(a.charCodeAt(u+2)<<8)+a.charCodeAt(u+3))!==0?(A=(h=((h=((h=((h=(h-(g=h%85))/85)-(m=h%85))/85)-(p=h%85))/85)-(f=h%85))/85)%85,c.push(A+33,f+33,p+33,m+33,g+33)):c.push(122);return function(y,v){for(var x=v;x>0;x--)y.pop()}(c,o.length),String.fromCharCode.apply(String,c)+"~>"},n=function(a){var o,c,u,d,h,A=String,f="length",p=255,m="charCodeAt",g="slice",y="replace";for(a[g](-2),a=a[g](0,-2)[y](/\s/g,"")[y]("z","!!!!!"),u=[],d=0,h=(a+=o="uuuuu"[g](a[f]%5||5))[f];h>d;d+=5)c=52200625*(a[m](d)-33)+614125*(a[m](d+1)-33)+7225*(a[m](d+2)-33)+85*(a[m](d+3)-33)+(a[m](d+4)-33),u.push(p&c>>24,p&c>>16,p&c>>8,p&c);return function(v,x){for(var w=x;w>0;w--)v.pop()}(u,o[f]),A.fromCharCode.apply(A,u)},r=function(a){return a.split("").map(function(o){return("0"+o.charCodeAt().toString(16)).slice(-2)}).join("")+">"},i=function(a){var o=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((a=a.replace(/\s/g,"")).indexOf(">")!==-1&&(a=a.substr(0,a.indexOf(">"))),a.length%2&&(a+="0"),o.test(a)===!1)return"";for(var c="",u=0;u<a.length;u+=2)c+=String.fromCharCode("0x"+(a[u]+a[u+1]));return c},s=function(a){for(var o=new Uint8Array(a.length),c=a.length;c--;)o[c]=a.charCodeAt(c);return(o=_R(o)).reduce(function(u,d){return u+String.fromCharCode(d)},"")};e.processDataByFilters=function(a,o){var c=0,u=a||"",d=[];for(typeof(o=o||[])=="string"&&(o=[o]),c=0;c<o.length;c+=1)switch(o[c]){case"ASCII85Decode":case"/ASCII85Decode":u=n(u),d.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":u=t(u),d.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":u=i(u),d.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":u=r(u),d.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":u=s(u),d.push("/FlateDecode");break;default:throw new Error('The filter: "'+o[c]+'" is not implemented')}return{data:u,reverseChain:d.reverse().join(" ")}}}(It.API),function(e){e.loadFile=function(t,n,r){return function(i,s,a){s=s!==!1,a=typeof a=="function"?a:function(){};var o=void 0;try{o=function(c,u,d){var h=new XMLHttpRequest,A=0,f=function(p){var m=p.length,g=[],y=String.fromCharCode;for(A=0;A<m;A+=1)g.push(y(255&p.charCodeAt(A)));return g.join("")};if(h.open("GET",c,!u),h.overrideMimeType("text/plain; charset=x-user-defined"),u===!1&&(h.onload=function(){h.status===200?d(f(this.responseText)):d(void 0)}),h.send(null),u&&h.status===200)return f(h.responseText)}(i,s,a)}catch{}return o}(t,n,r)},e.allowFsRead=void 0,e.loadImageFile=e.loadFile}(It.API),function(e){function t(){return(Yt.html2canvas?Promise.resolve(Yt.html2canvas):C_(()=>Promise.resolve().then(()=>PTt),void 0)).catch(function(o){return Promise.reject(new Error("Could not load html2canvas: "+o))}).then(function(o){return o.default?o.default:o})}function n(){return(Yt.DOMPurify?Promise.resolve(Yt.DOMPurify):C_(()=>import("./purify.es-dhnUglUx.js"),[])).catch(function(o){return Promise.reject(new Error("Could not load dompurify: "+o))}).then(function(o){return o.default?o.default:o})}var r=function(o){var c=Gn(o);return c==="undefined"?"undefined":c==="string"||o instanceof String?"string":c==="number"||o instanceof Number?"number":c==="function"||o instanceof Function?"function":o&&o.constructor===Array?"array":o&&o.nodeType===1?"element":c==="object"?"object":"unknown"},i=function(o,c){var u=document.createElement(o);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},s=function o(c,u){for(var d=c.nodeType===3?document.createTextNode(c.nodeValue):c.cloneNode(!1),h=c.firstChild;h;h=h.nextSibling)u!==!0&&h.nodeType===1&&h.nodeName==="SCRIPT"||d.appendChild(o(h,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},a=function o(c){var u=Object.assign(o.convert(Promise.resolve()),JSON.parse(JSON.stringify(o.template))),d=o.convert(Promise.resolve(),u);return(d=d.setProgress(1,o,1,[o])).set(c)};(a.prototype=Object.create(Promise.prototype)).constructor=a,a.convert=function(o,c){return o.__proto__=c||a.prototype,o},a.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"}},a.prototype.from=function(o,c){return this.then(function(){switch(c=c||function(u){switch(r(u)){case"string":return"string";case"element":return u.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(o),c){case"string":return this.then(n).then(function(u){return this.set({src:i("div",{innerHTML:o,dompurify:u})})});case"element":return this.set({src:o});case"canvas":return this.set({canvas:o});case"img":return this.set({img:o});default:return this.error("Unknown source type.")}})},a.prototype.to=function(o){switch(o){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.")}},a.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 o={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=s(this.prop.src,this.opt.html2canvas.javascriptEnabled);c.tagName==="BODY"&&(o.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=i("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=i("div",{className:"html2pdf__container",style:o}),this.prop.container.appendChild(c),this.prop.container.firstChild.appendChild(i("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"})},a.prototype.toCanvas=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).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)})},a.prototype.toContext2d=function(){var o=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(o).then(t).then(function(c){var u=this.opt.jsPDF,d=this.opt.fontFaces,h=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,A=Object.assign({async:!0,allowTaint:!0,scale:h,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 A.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 f=0;f<d.length;++f){var p=d[f],m=p.src.find(function(g){return g.format==="truetype"});m&&u.addFont(m.url,p.ref.name,p.ref.style)}return A.windowHeight=A.windowHeight||0,A.windowHeight=A.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):A.windowHeight,u.context2d.save(!0),c(this.prop.container,A)}).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)})},a.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var o=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=o})},a.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},a.prototype.output=function(o,c,u){return(u=u||"pdf").toLowerCase()==="img"||u.toLowerCase()==="image"?this.outputImg(o,c):this.outputPdf(o,c)},a.prototype.outputPdf=function(o,c){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(o,c)})},a.prototype.outputImg=function(o){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(o){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 "'+o+'" is not supported.'}})},a.prototype.save=function(o){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(o?{filename:o}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},a.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},a.prototype.set=function(o){if(r(o)!=="object")return this;var c=Object.keys(o||{}).map(function(u){if(u in a.template.prop)return function(){this.prop[u]=o[u]};switch(u){case"margin":return this.setMargin.bind(this,o.margin);case"jsPDF":return function(){return this.opt.jsPDF=o.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,o.pageSize);default:return function(){this.opt[u]=o[u]}}},this);return this.then(function(){return this.thenList(c)})},a.prototype.get=function(o,c){return this.then(function(){var u=o in a.template.prop?this.prop[o]:this.opt[o];return c?c(u):u})},a.prototype.setMargin=function(o){return this.then(function(){switch(r(o)){case"number":o=[o,o,o,o];case"array":if(o.length===2&&(o=[o[0],o[1],o[0],o[1]]),o.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=o}).then(this.setPageSize)},a.prototype.setPageSize=function(o){function c(u,d){return Math.floor(u*d/72*96)}return this.then(function(){(o=o||It.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(o.inner={width:o.width-this.opt.margin[1]-this.opt.margin[3],height:o.height-this.opt.margin[0]-this.opt.margin[2]},o.inner.px={width:c(o.inner.width,o.k),height:c(o.inner.height,o.k)},o.inner.ratio=o.inner.height/o.inner.width),this.prop.pageSize=o})},a.prototype.setProgress=function(o,c,u,d){return o!=null&&(this.progress.val=o),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},a.prototype.updateProgress=function(o,c,u,d){return this.setProgress(o?this.progress.val+o:null,c||null,u?this.progress.n+u:null,d?this.progress.stack.concat(d):null)},a.prototype.then=function(o,c){var u=this;return this.thenCore(o,c,function(d,h){return u.updateProgress(null,null,1,[d]),Promise.prototype.then.call(this,function(A){return u.updateProgress(null,d),A}).then(d,h).then(function(A){return u.updateProgress(1),A})})},a.prototype.thenCore=function(o,c,u){u=u||Promise.prototype.then;var d=this;o&&(o=o.bind(d)),c&&(c=c.bind(d));var h=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?d:a.convert(Object.assign({},d),Promise.prototype),A=u.call(h,o,c);return a.convert(A,d.__proto__)},a.prototype.thenExternal=function(o,c){return Promise.prototype.then.call(this,o,c)},a.prototype.thenList=function(o){var c=this;return o.forEach(function(u){c=c.thenCore(u)}),c},a.prototype.catch=function(o){o&&(o=o.bind(this));var c=Promise.prototype.catch.call(this,o);return a.convert(c,this)},a.prototype.catchExternal=function(o){return Promise.prototype.catch.call(this,o)},a.prototype.error=function(o){return this.then(function(){throw new Error(o)})},a.prototype.using=a.prototype.set,a.prototype.saveAs=a.prototype.save,a.prototype.export=a.prototype.output,a.prototype.run=a.prototype.then,It.getPageSize=function(o,c,u){if(Gn(o)==="object"){var d=o;o=d.orientation,c=d.unit||c,u=d.format||u}c=c||"mm",u=u||"a4",o=(""+(o||"P")).toLowerCase();var h,A=(""+u).toLowerCase(),f={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":h=1;break;case"mm":h=72/25.4;break;case"cm":h=72/2.54;break;case"in":h=72;break;case"px":h=.75;break;case"pc":case"em":h=12;break;case"ex":h=6;break;default:throw"Invalid unit: "+c}var p,m=0,g=0;if(f.hasOwnProperty(A))m=f[A][1]/h,g=f[A][0]/h;else try{m=u[1],g=u[0]}catch{throw new Error("Invalid format: "+u)}if(o==="p"||o==="portrait")o="p",g>m&&(p=g,g=m,m=p);else{if(o!=="l"&&o!=="landscape")throw"Invalid orientation: "+o;o="l",m>g&&(p=g,g=m,m=p)}return{width:g,height:m,unit:c,k:h,orientation:o}},e.html=function(o,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(AO):null;var u=new a(c);return c.worker?u:u.from(o).doCallback()}}(It.API),It.API.addJS=function(e){var t,n,r=function(i){for(var s="",a=0;a<i.length;a++){var o=i[a];if(o==="("||o===")"){for(var c=0,u=a-1;u>=0&&i[u]==="\\";u--)c++;s+=c%2==0?"\\"+o:o}else s+=o}return s}(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"),n=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+r+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){t!==void 0&&n!==void 0&&this.internal.out("/Names <</JavaScript "+t+" 0 R>>")}),this},function(e){var t;e.events.push(["postPutResources",function(){var n=this,r=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=n.outline.render().split(/\r\n/),s=0;s<i.length;s++){var a=i[s],o=r.exec(a);if(o!=null){var c=o[1];n.internal.newObjectDeferredBegin(c,!1)}n.internal.write(a)}if(this.outline.createNamedDestinations){var u=this.internal.pages.length,d=[];for(s=0;s<u;s++){var h=n.internal.newObject();d.push(h);var A=n.internal.getPageInfo(s+1);n.internal.write("<< /D["+A.objId+" 0 R /XYZ null null null]>> endobj")}var f=n.internal.newObject();for(n.internal.write("<< /Names [ "),s=0;s<d.length;s++)n.internal.write("(page_"+(s+1)+")"+d[s]+" 0 R");n.internal.write(" ] >>","endobj"),t=n.internal.newObject(),n.internal.write("<< /Dests "+f+" 0 R"),n.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){var n=this;n.outline.root.children.length>0&&(n.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&n.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var n=this;n.outline={createNamedDestinations:!1,root:{children:[]}},n.outline.add=function(r,i,s){var a={title:i,options:s,children:[]};return r==null&&(r=this.root),r.children.push(a),a},n.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=n,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},n.outline.genIds_r=function(r){r.id=n.internal.newObjectDeferred();for(var i=0;i<r.children.length;i++)this.genIds_r(r.children[i])},n.outline.renderRoot=function(r){this.objStart(r),this.line("/Type /Outlines"),r.children.length>0&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1]))),this.line("/Count "+this.count_r({count:0},r)),this.objEnd()},n.outline.renderItems=function(r){for(var i=this.ctx.pdf.internal.getVerticalCoordinateString,s=0;s<r.children.length;s++){var a=r.children[s];this.objStart(a),this.line("/Title "+this.makeString(a.title)),this.line("/Parent "+this.makeRef(r)),s>0&&this.line("/Prev "+this.makeRef(r.children[s-1])),s<r.children.length-1&&this.line("/Next "+this.makeRef(r.children[s+1])),a.children.length>0&&(this.line("/First "+this.makeRef(a.children[0])),this.line("/Last "+this.makeRef(a.children[a.children.length-1])));var o=this.count=this.count_r({count:0},a);if(o>0&&this.line("/Count "+o),a.options&&a.options.pageNumber){var c=n.internal.getPageInfo(a.options.pageNumber);this.line("/Dest ["+c.objId+" 0 R /XYZ 0 "+i(0)+" 0]")}this.objEnd()}for(var u=0;u<r.children.length;u++)this.renderItems(r.children[u])},n.outline.line=function(r){this.ctx.val+=r+`\r
`},n.outline.makeRef=function(r){return r.id+" 0 R"},n.outline.makeString=function(r){return"("+n.internal.pdfEscape(r)+")"},n.outline.objStart=function(r){this.ctx.val+=`\r
`+r.id+` 0 obj\r
<<\r
`},n.outline.objEnd=function(){this.ctx.val+=`>> \r
endobj\r
`},n.outline.count_r=function(r,i){for(var s=0;s<i.children.length;s++)r.count++,this.count_r(r,i.children[s]);return r.count}}])}(It.API),function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(n,r,i,s,a,o){var c,u=this.decode.DCT_DECODE,d=null;if(typeof n=="string"||this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n)){switch(n=a||n,n=this.__addimage__.isArrayBuffer(n)?new Uint8Array(n):n,c=function(h){for(var A,f=256*h.charCodeAt(4)+h.charCodeAt(5),p=h.length,m={width:0,height:0,numcomponents:1},g=4;g<p;g+=2){if(g+=f,t.indexOf(h.charCodeAt(g+1))!==-1){A=256*h.charCodeAt(g+5)+h.charCodeAt(g+6),m={width:256*h.charCodeAt(g+7)+h.charCodeAt(g+8),height:A,numcomponents:h.charCodeAt(g+9)};break}f=256*h.charCodeAt(g+2)+h.charCodeAt(g+3)}return m}(n=this.__addimage__.isArrayBufferView(n)?this.__addimage__.arrayBufferToBinaryString(n):n),c.numcomponents){case 1:o=this.color_spaces.DEVICE_GRAY;break;case 4:o=this.color_spaces.DEVICE_CMYK;break;case 3:o=this.color_spaces.DEVICE_RGB}d={data:n,width:c.width,height:c.height,colorSpace:o,bitsPerComponent:8,filter:u,index:r,alias:i}}return d}}(It.API),It.API.processPNG=function(e,t,n,r){if(this.__addimage__.isArrayBuffer(e)&&(e=new Uint8Array(e)),this.__addimage__.isArrayBufferView(e)){var i,s=C_t(e,{checkCrc:!0}),a=s.width,o=s.height,c=s.channels,u=s.palette,d=s.depth;i=u&&c===1?function(B){for(var E=B.width,I=B.height,T=B.data,N=B.palette,F=B.depth,L=!1,U=[],H=[],K=void 0,$=!1,z=0,Q=0;Q<N.length;Q++){var oe=lJ(N[Q],4),R=oe[0],M=oe[1],Y=oe[2],X=oe[3];U.push(R,M,Y),X!=null&&(X===0?(z++,H.length<1&&H.push(Q)):X<255&&($=!0))}if($||z>1){L=!0,H=void 0;var q=E*I;K=new Uint8Array(q);for(var Z=new DataView(T.buffer),de=0;de<q;de++){var ue=mO(Z,de,F),ae=lJ(N[ue],4)[3];K[de]=ae}}else z===0&&(H=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:L?8:void 0,colorBytes:T,alphaBytes:K,needSMask:L,palette:U,mask:H}}(s):c===2||c===4?function(B){for(var E=B.data,I=B.width,T=B.height,N=B.channels,F=B.depth,L=N===2?"DeviceGray":"DeviceRGB",U=N-1,H=I*T,K=U,$=H*K,z=1*H,Q=Math.ceil($*F/8),oe=Math.ceil(z*F/8),R=new Uint8Array(Q),M=new Uint8Array(oe),Y=new DataView(E.buffer),X=new DataView(R.buffer),q=new DataView(M.buffer),Z=!1,de=0;de<H;de++){for(var ue=de*N,ae=0;ae<K;ae++)wZ(X,mO(Y,ue+ae,F),de*K+ae,F);var he=mO(Y,ue+K,F);he<(1<<F)-1&&(Z=!0),wZ(q,he,1*de,F)}return{colorSpace:L,colorsPerPixel:U,sMaskBitsPerComponent:Z?F:void 0,colorBytes:R,alphaBytes:M,needSMask:Z}}(s):function(B){var E=B.data,I=B.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:I,colorsPerPixel:I==="DeviceGray"?1:3,colorBytes:E instanceof Uint16Array?function(T){for(var N=T.length,F=new Uint8Array(2*N),L=new DataView(F.buffer,F.byteOffset,F.byteLength),U=0;U<N;U++)L.setUint16(2*U,T[U],!1);return F}(E):E,needSMask:!1}}(s);var h,A,f,p=i,m=p.colorSpace,g=p.colorsPerPixel,y=p.sMaskBitsPerComponent,v=p.colorBytes,x=p.alphaBytes,w=p.needSMask,b=p.palette,k=p.mask,j=null;return r!==It.API.image_compression.NONE&&typeof _R=="function"?(j=function(B){var E;switch(B){case It.API.image_compression.FAST:E=11;break;case It.API.image_compression.MEDIUM:E=13;break;case It.API.image_compression.SLOW:E=14;break;default:E=12}return E}(r),h=this.decode.FLATE_DECODE,A="/Predictor ".concat(j," /Colors ").concat(g," /BitsPerComponent ").concat(d," /Columns ").concat(a),e=mZ(v,Math.ceil(a*g*d/8),g,d,r),w&&(f=mZ(x,Math.ceil(a*y/8),1,y,r))):(h=void 0,A=void 0,e=v,w&&(f=x)),(this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e))&&(e=this.__addimage__.arrayBufferToBinaryString(e)),(f&&this.__addimage__.isArrayBuffer(f)||this.__addimage__.isArrayBufferView(f))&&(f=this.__addimage__.arrayBufferToBinaryString(f)),{alias:n,data:e,index:t,filter:h,decodeParameters:A,transparency:k,palette:b,sMask:f,predictor:j,width:a,height:o,bitsPerComponent:d,sMaskBitsPerComponent:y,colorSpace:m}}},function(e){e.processGIF89A=function(t,n,r,i){var s=new z_t(t),a=s.width,o=s.height,c=[];s.decodeAndBlitFrameRGBA(0,c);var u={data:c,width:a,height:o},d=new gO(100).encode(u,100);return e.processJPEG.call(this,d,n,r,i)},e.processGIF87A=e.processGIF89A}(It.API),Vl.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 n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:i,green:r,blue:n,quad:s}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Vl.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(n){ir.log("bit decode error:"+n)}},Vl.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),n=t%4;for(e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,i=0;i<t;i++)for(var s=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+8*i*4,o=0;o<8&&8*i+o<this.width;o++){var c=this.palette[s>>7-o&1];this.data[a+4*o]=c.blue,this.data[a+4*o+1]=c.green,this.data[a+4*o+2]=c.red,this.data[a+4*o+3]=255}n!==0&&(this.pos+=4-n)}},Vl.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<e;i++){var s=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+2*i*4,o=s>>4,c=15&s,u=this.palette[o];if(this.data[a]=u.blue,this.data[a+1]=u.green,this.data[a+2]=u.red,this.data[a+3]=255,2*i+1>=this.width)break;u=this.palette[c],this.data[a+4]=u.blue,this.data[a+4+1]=u.green,this.data[a+4+2]=u.red,this.data[a+4+3]=255}t!==0&&(this.pos+=4-t)}},Vl.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),s=n*this.width*4+4*r;if(i<this.palette.length){var a=this.palette[i];this.data[s]=a.red,this.data[s+1]=a.green,this.data[s+2]=a.blue,this.data[s+3]=255}else this.data[s]=255,this.data[s+1]=255,this.data[s+2]=255,this.data[s+3]=255}e!==0&&(this.pos+=4-e)}},Vl.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var s=this.datav.getUint16(this.pos,!0);this.pos+=2;var a=(s&t)/t*255|0,o=(s>>5&t)/t*255|0,c=(s>>10&t)/t*255|0,u=s>>15?255:0,d=r*this.width*4+4*i;this.data[d]=c,this.data[d+1]=o,this.data[d+2]=a,this.data[d+3]=u}this.pos+=e}},Vl.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,s=0;s<this.width;s++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(a&t)/t*255|0,c=(a>>5&n)/n*255|0,u=(a>>11)/t*255|0,d=i*this.width*4+4*s;this.data[d]=u,this.data[d+1]=c,this.data[d+2]=o,this.data[d+3]=255}this.pos+=e}},Vl.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),a=t*this.width*4+4*n;this.data[a]=s,this.data[a+1]=i,this.data[a+2]=r,this.data[a+3]=255}this.pos+=this.width%4}},Vl.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),o=t*this.width*4+4*n;this.data[o]=s,this.data[o+1]=i,this.data[o+2]=r,this.data[o+3]=a}},Vl.prototype.getData=function(){return this.data},function(e){e.processBMP=function(t,n,r,i){var s=new Vl(t,!1),a=s.width,o=s.height,c={data:s.getData(),width:a,height:o},u=new gO(100).encode(c,100);return e.processJPEG.call(this,u,n,r,i)}}(It.API),CZ.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(t,n,r,i){var s=new CZ(t),a=s.width,o=s.height,c={data:s.getData(),width:a,height:o},u=new gO(100).encode(c,100);return e.processJPEG.call(this,u,n,r,i)}}(It.API),It.API.processRGBA=function(e,t,n){for(var r=e.data,i=r.length,s=new Uint8Array(i/4*3),a=new Uint8Array(i/4),o=0,c=0,u=0;u<i;u+=4){var d=r[u],h=r[u+1],A=r[u+2],f=r[u+3];s[o++]=d,s[o++]=h,s[o++]=A,a[c++]=f}var p=this.__addimage__.arrayBufferToBinaryString(s);return{alpha:this.__addimage__.arrayBufferToBinaryString(a),data:p,index:t,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},It.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},kg=It.API,pk=kg.getCharWidthsArray=function(e,t){var n,r,i=(t=t||{}).font||this.internal.getFont(),s=t.fontSize||this.internal.getFontSize(),a=t.charSpace||this.internal.getCharSpace(),o=t.widths?t.widths:i.metadata.Unicode.widths,c=o.fof?o.fof:1,u=t.kerning?t.kerning:i.metadata.Unicode.kerning,d=u.fof?u.fof:1,h=t.doKerning!==!1,A=0,f=e.length,p=0,m=o[0]||c,g=[];for(n=0;n<f;n++)r=e.charCodeAt(n),typeof i.metadata.widthOfString=="function"?g.push((i.metadata.widthOfGlyph(i.metadata.characterToGlyph(r))+a*(1e3/s)||0)/1e3):(A=h&&Gn(u[r])==="object"&&!isNaN(parseInt(u[r][p],10))?u[r][p]/d:0,g.push((o[r]||m)/c+A)),p=r;return g},fZ=kg.getStringUnitWidth=function(e,t){var n=(t=t||{}).fontSize||this.internal.getFontSize(),r=t.font||this.internal.getFont(),i=t.charSpace||this.internal.getCharSpace();return kg.processArabic&&(e=kg.processArabic(e)),typeof r.metadata.widthOfString=="function"?r.metadata.widthOfString(e,n,i)/n:pk.apply(this,arguments).reduce(function(s,a){return s+a},0)},AZ=function(e,t,n,r){for(var i=[],s=0,a=e.length,o=0;s!==a&&o+t[s]<n;)o+=t[s],s++;i.push(e.slice(0,s));var c=s;for(o=0;s!==a;)o+t[s]>r&&(i.push(e.slice(c,s)),o=0,c=s),o+=t[s],s++;return c!==s&&i.push(e.slice(c,s)),i},pZ=function(e,t,n){n||(n={});var r,i,s,a,o,c,u,d=[],h=[d],A=n.textIndent||0,f=0,p=0,m=e.split(" "),g=pk.apply(this,[" ",n])[0];if(c=n.lineIndent===-1?m[0].length+2:n.lineIndent||0){var y=Array(c).join(" "),v=[];m.map(function(w){(w=w.split(/\s*\n/)).length>1?v=v.concat(w.map(function(b,k){return(k&&b.length?`
`:"")+b})):v.push(w[0])}),m=v,c=fZ.apply(this,[y,n])}for(s=0,a=m.length;s<a;s++){var x=0;if(r=m[s],c&&r[0]==`
`&&(r=r.substr(1),x=1),A+f+(p=(i=pk.apply(this,[r,n])).reduce(function(w,b){return w+b},0))>t||x){if(p>t){for(o=AZ.apply(this,[r,i,t-(A+f),t]),d.push(o.shift()),d=[o.pop()];o.length;)h.push([o.shift()]);p=i.slice(r.length-(d[0]?d[0].length:0)).reduce(function(w,b){return w+b},0)}else d=[r];h.push(d),A=p+c,f=g}else d.push(r),A+=f+p,f=g}return u=c?function(w,b){return(b?y:"")+w.join(" ")}:function(w){return w.join(" ")},h.map(u)},kg.splitTextToSize=function(e,t,n){var r,i=(n=n||{}).fontSize||this.internal.getFontSize(),s=(function(d){if(d.widths&&d.kerning)return{widths:d.widths,kerning:d.kerning};var h=this.internal.getFont(d.fontName,d.fontStyle),A="Unicode";return h.metadata[A]?{widths:h.metadata[A].widths||{0:1},kerning:h.metadata[A].kerning||{}}:{font:h.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);r=Array.isArray(e)?e:String(e).split(/\r?\n/);var a=1*this.internal.scaleFactor*t/i;s.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/i:0,s.lineIndent=n.lineIndent;var o,c,u=[];for(o=0,c=r.length;o<c;o++)u=u.concat(pZ.apply(this,[r[o],a,s]));return u},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="0123456789abcdef",n="klmnopqrstuvwxyz",r={},i={},s=0;s<16;s++)r[n[s]]=t[s],i[t[s]]=n[s];var a=function(A){return"0x"+parseInt(A,10).toString(16)},o=e.__fontmetrics__.compress=function(A){var f,p,m,g,y=["{"];for(var v in A){if(f=A[v],isNaN(parseInt(v,10))?p="'"+v+"'":(v=parseInt(v,10),p=(p=a(v).slice(2)).slice(0,-1)+i[p.slice(-1)]),typeof f=="number")f<0?(m=a(f).slice(3),g="-"):(m=a(f).slice(2),g=""),m=g+m.slice(0,-1)+i[m.slice(-1)];else{if(Gn(f)!=="object")throw new Error("Don't know what to do with value type "+Gn(f)+".");m=o(f)}y.push(p+m)}return y.push("}"),y.join("")},c=e.__fontmetrics__.uncompress=function(A){if(typeof A!="string")throw new Error("Invalid argument passed to uncompress.");for(var f,p,m,g,y={},v=1,x=y,w=[],b="",k="",j=A.length-1,B=1;B<j;B+=1)(g=A[B])=="'"?f?(m=f.join(""),f=void 0):f=[]:f?f.push(g):g=="{"?(w.push([x,m]),x={},m=void 0):g=="}"?((p=w.pop())[0][p[1]]=x,m=void 0,x=p[0]):g=="-"?v=-1:m===void 0?r.hasOwnProperty(g)?(b+=r[g],m=parseInt(b,16)*v,v=1,b=""):b+=g:r.hasOwnProperty(g)?(k+=r[g],x[m]=parseInt(k,16)*v,v=1,m=void 0,k=""):k+=g;return y},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}},h={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(A){var f=A.font,p=h.Unicode[f.postScriptName];p&&(f.metadata.Unicode={},f.metadata.Unicode.widths=p.widths,f.metadata.Unicode.kerning=p.kerning);var m=d.Unicode[f.postScriptName];m&&(f.metadata.Unicode.encoding=m,f.encoding=m.codePages[0])}])}(It.API),function(e){var t=function(n){for(var r=n.length,i=new Uint8Array(r),s=0;s<r;s++)i[s]=n.charCodeAt(s);return i};e.API.events.push(["addFont",function(n){var r=void 0,i=n.font,s=n.instance;if(!i.isStandardFont){if(s===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");if(typeof(r=s.existsFileInVFS(i.postScriptName)===!1?s.loadFile(i.postScriptName):s.getFileFromVFS(i.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+i.postScriptName+"').");(function(a,o){o=/^\x00\x01\x00\x00/.test(o)?t(o):t(__(o)),a.metadata=e.API.TTFFont.open(o),a.metadata.Unicode=a.metadata.Unicode||{encoding:{},kerning:{},widths:[]},a.metadata.glyIdsUsed=[0]})(i,r)}}])}(It),It.API.addSvgAsImage=function(e,t,n,r,i,s,a,o){if(isNaN(t)||isNaN(n))throw ir.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(i))throw ir.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=r,c.height=i;var u=c.getContext("2d");u.fillStyle="#fff",u.fillRect(0,0,c.width,c.height);var d={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},h=this;return(Yt.canvg?Promise.resolve(Yt.canvg):C_(()=>import("./index.es-Dl1eEI1O.js"),[])).catch(function(A){return Promise.reject(new Error("Could not load canvg: "+A))}).then(function(A){return A.default?A.default:A}).then(function(A){return A.fromString(u,e,d)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(A){return A.render(d)}).then(function(){h.addImage(c.toDataURL("image/jpeg",1),t,n,r,i,a,o)})},It.API.putTotalPages=function(e){var t,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),n=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var i=0;i<this.internal.pages[r].length;i++)this.internal.pages[r][i]=this.internal.pages[r][i].replace(t,n);return this},It.API.viewerPreferences=function(e,t){var n;e=e||{},t=t||!1;var r,i,s,a={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}},o=Object.keys(a),c=[],u=0,d=0,h=0;function A(p,m){var g,y=!1;for(g=0;g<p.length;g+=1)p[g]===m&&(y=!0);return y}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(a)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var f=o.length;for(h=0;h<f;h+=1)n[o[h]].value=n[o[h]].defaultValue,n[o[h]].explicitSet=!1}if(Gn(e)==="object"){for(i in e)if(s=e[i],A(o,i)&&s!==void 0){if(n[i].type==="boolean"&&typeof s=="boolean")n[i].value=s;else if(n[i].type==="name"&&A(n[i].valueSet,s))n[i].value=s;else if(n[i].type==="integer"&&Number.isInteger(s))n[i].value=s;else if(n[i].type==="array"){for(u=0;u<s.length;u+=1)if(r=!0,s[u].length===1&&typeof s[u][0]=="number")c.push(String(s[u]-1));else if(s[u].length>1){for(d=0;d<s[u].length;d+=1)typeof s[u][d]!="number"&&(r=!1);r===!0&&c.push([s[u][0]-1,s[u][1]-1].join(" "))}n[i].value="["+c.join(" ")+"]"}else n[i].value=n[i].defaultValue;n[i].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var p,m=[];for(p in n)n[p].explicitSet===!0&&(n[p].type==="name"?m.push("/"+p+" /"+n[p].value):m.push("/"+p+" "+n[p].value));m.length!==0&&this.internal.write(`/ViewerPreferences
<<
`+m.join(`
`)+`
>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},It.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",K_t),this.internal.events.subscribe("postPutResources",V_t)),this},function(e){var t=e.API,n=t.pdfEscape16=function(s,a){for(var o,c=a.metadata.Unicode.widths,u=["","0","00","000","0000"],d=[""],h=0,A=s.length;h<A;++h){if(o=a.metadata.characterToGlyph(s.charCodeAt(h)),a.metadata.glyIdsUsed.push(o),a.metadata.toUnicode[o]=s.charCodeAt(h),c.indexOf(o)==-1&&(c.push(o),c.push([parseInt(a.metadata.widthOfGlyph(o),10)])),o=="0")return d.join("");o=o.toString(16),d.push(u[4-o.length],o)}return d.join("")},r=function(s){var a,o,c,u,d,h,A;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=[],h=0,A=(o=Object.keys(s).sort(function(f,p){return f-p})).length;h<A;h++)a=o[h],c.length>=100&&(d+=`
`+c.length+` beginbfchar
`+c.join(`
`)+`
endbfchar`,c=[]),s[a]!==void 0&&s[a]!==null&&typeof s[a].toString=="function"&&(u=("0000"+s[a].toString(16)).slice(-4),a=("0000"+(+a).toString(16)).slice(-4),c.push("<"+a+"><"+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(s){(function(a){var o=a.font,c=a.out,u=a.newObject,d=a.putStream;if(o.metadata instanceof e.API.TTFFont&&o.encoding==="Identity-H"){for(var h=o.metadata.Unicode.widths,A=o.metadata.subset.encode(o.metadata.glyIdsUsed,1),f="",p=0;p<A.length;p++)f+=String.fromCharCode(A[p]);var m=u();d({data:f,addLength1:!0,objectId:m}),c("endobj");var g=u();d({data:r(o.metadata.toUnicode),addLength1:!0,objectId:g}),c("endobj");var y=u();c("<<"),c("/Type /FontDescriptor"),c("/FontName /"+Ug(o.fontName)),c("/FontFile2 "+m+" 0 R"),c("/FontBBox "+e.API.PDFObject.convert(o.metadata.bbox)),c("/Flags "+o.metadata.flags),c("/StemV "+o.metadata.stemV),c("/ItalicAngle "+o.metadata.italicAngle),c("/Ascent "+o.metadata.ascender),c("/Descent "+o.metadata.decender),c("/CapHeight "+o.metadata.capHeight),c(">>"),c("endobj");var v=u();c("<<"),c("/Type /Font"),c("/BaseFont /"+Ug(o.fontName)),c("/FontDescriptor "+y+" 0 R"),c("/W "+e.API.PDFObject.convert(h)),c("/CIDToGIDMap /Identity"),c("/DW 1000"),c("/Subtype /CIDFontType2"),c("/CIDSystemInfo"),c("<<"),c("/Supplement 0"),c("/Registry (Adobe)"),c("/Ordering ("+o.encoding+")"),c(">>"),c(">>"),c("endobj"),o.objectNumber=u(),c("<<"),c("/Type /Font"),c("/Subtype /Type0"),c("/ToUnicode "+g+" 0 R"),c("/BaseFont /"+Ug(o.fontName)),c("/Encoding /"+o.encoding),c("/DescendantFonts ["+v+" 0 R]"),c(">>"),c("endobj"),o.isAlreadyPutted=!0}})(s)}]),t.events.push(["putFont",function(s){(function(a){var o=a.font,c=a.out,u=a.newObject,d=a.putStream;if(o.metadata instanceof e.API.TTFFont&&o.encoding==="WinAnsiEncoding"){for(var h=o.metadata.rawData,A="",f=0;f<h.length;f++)A+=String.fromCharCode(h[f]);var p=u();d({data:A,addLength1:!0,objectId:p}),c("endobj");var m=u();d({data:r(o.metadata.toUnicode),addLength1:!0,objectId:m}),c("endobj");var g=u();c("<<"),c("/Descent "+o.metadata.decender),c("/CapHeight "+o.metadata.capHeight),c("/StemV "+o.metadata.stemV),c("/Type /FontDescriptor"),c("/FontFile2 "+p+" 0 R"),c("/Flags 96"),c("/FontBBox "+e.API.PDFObject.convert(o.metadata.bbox)),c("/FontName /"+Ug(o.fontName)),c("/ItalicAngle "+o.metadata.italicAngle),c("/Ascent "+o.metadata.ascender),c(">>"),c("endobj"),o.objectNumber=u();for(var y=0;y<o.metadata.hmtx.widths.length;y++)o.metadata.hmtx.widths[y]=parseInt(o.metadata.hmtx.widths[y]*(1e3/o.metadata.head.unitsPerEm));c("<</Subtype/TrueType/Type/Font/ToUnicode "+m+" 0 R/BaseFont/"+Ug(o.fontName)+"/FontDescriptor "+g+" 0 R/Encoding/"+o.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(o.metadata.hmtx.widths)+">>"),c("endobj"),o.isAlreadyPutted=!0}})(s)}]);var i=function(s){var a,o=s.text||"",c=s.x,u=s.y,d=s.options||{},h=s.mutex||{},A=h.pdfEscape,f=h.activeFontKey,p=h.fonts,m=f,g="",y=0,v="",x=p[m].encoding;if(p[m].encoding!=="Identity-H")return{text:o,x:c,y:u,options:d,mutex:h};for(v=o,m=f,Array.isArray(o)&&(v=o[0]),y=0;y<v.length;y+=1)p[m].metadata.hasOwnProperty("cmap")&&(a=p[m].metadata.cmap.unicode.codeMap[v[y].charCodeAt(0)]),a||v[y].charCodeAt(0)<256&&p[m].metadata.hasOwnProperty("Unicode")?g+=v[y]:g+="";var w="";return parseInt(m.slice(1))<14||x==="WinAnsiEncoding"?w=A(g,m).split("").map(function(b){return b.charCodeAt(0).toString(16)}).join(""):x==="Identity-H"&&(w=n(g,p[m])),h.isHex=!0,{text:w,x:c,y:u,options:d,mutex:h}};t.events.push(["postProcessText",function(s){var a=s.text||"",o=[],c={text:a,x:s.x,y:s.y,options:s.options,mutex:s.mutex};if(Array.isArray(a)){var u=0;for(u=0;u<a.length;u+=1)Array.isArray(a[u])&&a[u].length===3?o.push([i(Object.assign({},c,{text:a[u][0]})).text,a[u][1],a[u][2]]):o.push(i(Object.assign({},c,{text:a[u]})).text);s.text=o}else s.text=i(Object.assign({},c,{text:a})).text}])}(It),function(e){var t=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(n){return t.call(this),this.internal.vFS[n]!==void 0},e.addFileToVFS=function(n,r){return t.call(this),this.internal.vFS[n]=r,this},e.getFileFromVFS=function(n){return t.call(this),this.internal.vFS[n]!==void 0?this.internal.vFS[n]:null}}(It.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(r){var i,s,a,o,c,u,d,h=t,A=[[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]],f=[[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]],p={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},g=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],y=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)$/),v=!1,x=0;this.__bidiEngine__={};var w=function(T){var N=T.charCodeAt(),F=N>>8,L=m[F];return L!==void 0?h[256*L+(255&N)]:F===252||F===253?"AL":y.test(F)?"L":F===8?"R":"N"},b=function(T){for(var N,F=0;F<T.length;F++){if((N=w(T.charAt(F)))==="L")return!1;if(N==="R")return!0}return!1},k=function(T,N,F,L){var U,H,K,$,z=N[L];switch(z){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":v=!1;break;case"N":case"AN":break;case"EN":v&&(z="AN");break;case"AL":v=!0,z="R";break;case"WS":case"BN":z="N";break;case"CS":L<1||L+1>=N.length||(U=F[L-1])!=="EN"&&U!=="AN"||(H=N[L+1])!=="EN"&&H!=="AN"?z="N":v&&(H="AN"),z=H===U?H:"N";break;case"ES":z=(U=L>0?F[L-1]:"B")==="EN"&&L+1<N.length&&N[L+1]==="EN"?"EN":"N";break;case"ET":if(L>0&&F[L-1]==="EN"){z="EN";break}if(v){z="N";break}for(K=L+1,$=N.length;K<$&&N[K]==="ET";)K++;z=K<$&&N[K]==="EN"?"EN":"N";break;case"NSM":if(a&&!o){for($=N.length,K=L+1;K<$&&N[K]==="NSM";)K++;if(K<$){var Q=T[L],oe=Q>=1425&&Q<=2303||Q===64286;if(U=N[K],oe&&(U==="R"||U==="AL")){z="R";break}}}z=L<1||(U=N[L-1])==="B"?"N":F[L-1];break;case"B":v=!1,i=!0,z=x;break;case"S":s=!0,z="N"}return z},j=function(T,N,F){var L=T.split("");return F&&B(L,F,{hiLevel:x}),L.reverse(),N&&N.reverse(),L.join("")},B=function(T,N,F){var L,U,H,K,$,z=-1,Q=T.length,oe=0,R=[],M=x?f:A,Y=[];for(v=!1,i=!1,s=!1,U=0;U<Q;U++)Y[U]=w(T[U]);for(H=0;H<Q;H++){if($=oe,R[H]=k(T,Y,R,H),L=240&(oe=M[$][p[R[H]]]),oe&=15,N[H]=K=M[oe][5],L>0)if(L===16){for(U=z;U<H;U++)N[U]=1;z=-1}else z=-1;if(M[oe][6])z===-1&&(z=H);else if(z>-1){for(U=z;U<H;U++)N[U]=K;z=-1}Y[H]==="B"&&(N[H]=0),F.hiLevel|=K}s&&function(X,q,Z){for(var de=0;de<Z;de++)if(X[de]==="S"){q[de]=x;for(var ue=de-1;ue>=0&&X[ue]==="WS";ue--)q[ue]=x}}(Y,N,Q)},E=function(T,N,F,L,U){if(!(U.hiLevel<T)){if(T===1&&x===1&&!i)return N.reverse(),void(F&&F.reverse());for(var H,K,$,z,Q=N.length,oe=0;oe<Q;){if(L[oe]>=T){for($=oe+1;$<Q&&L[$]>=T;)$++;for(z=oe,K=$-1;z<K;z++,K--)H=N[z],N[z]=N[K],N[K]=H,F&&(H=F[z],F[z]=F[K],F[K]=H);oe=$}oe++}}},I=function(T,N,F){var L=T.split(""),U={hiLevel:x};return F||(F=[]),B(L,F,U),function(H,K,$){if($.hiLevel!==0&&d)for(var z,Q=0;Q<H.length;Q++)K[Q]===1&&(z=g.indexOf(H[Q]))>=0&&(H[Q]=g[z+1])}(L,F,U),E(2,L,N,F,U),E(1,L,N,F,U),L.join("")};return this.__bidiEngine__.doBidiReorder=function(T,N,F){if(function(U,H){if(H)for(var K=0;K<U.length;K++)H[K]=K;o===void 0&&(o=b(U)),u===void 0&&(u=b(U))}(T,N),a||!c||u)if(a&&c&&o^u)x=o?1:0,T=j(T,N,F);else if(!a&&c&&u)x=o?1:0,T=I(T,N,F),T=j(T,N);else if(!a||o||c||u){if(a&&!c&&o^u)T=j(T,N),o?(x=0,T=I(T,N,F)):(x=1,T=I(T,N,F),T=j(T,N));else if(a&&o&&!c&&u)x=1,T=I(T,N,F),T=j(T,N);else if(!a&&!c&&o^u){var L=d;o?(x=1,T=I(T,N,F),x=0,d=!1,T=I(T,N,F),d=L):(x=0,T=I(T,N,F),T=j(T,N),x=1,d=!1,T=I(T,N,F),d=L,T=j(T,N))}}else x=0,T=I(T,N,F);else x=o?1:0,T=I(T,N,F);return T},this.__bidiEngine__.setOptions=function(T){T&&(a=T.isInputVisual,c=T.isOutputVisual,o=T.isInputRtl,u=T.isOutputRtl,d=T.isSymmetricSwapping)},this.__bidiEngine__.setOptions(r),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"],n=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(r){var i=r.text;r.x,r.y;var s=r.options||{};r.mutex,s.lang;var a=[];if(s.isInputVisual=typeof s.isInputVisual!="boolean"||s.isInputVisual,n.setOptions(s),Object.prototype.toString.call(i)==="[object Array]"){var o=0;for(a=[],o=0;o<i.length;o+=1)Object.prototype.toString.call(i[o])==="[object Array]"?a.push([n.doBidiReorder(i[o][0]),i[o][1],i[o][2]]):a.push([n.doBidiReorder(i[o])]);r.text=a}else r.text=n.doBidiReorder(i);n.setOptions({isInputVisual:!0})}])}(It),It.API.TTFFont=function(){function e(t){var n;if(this.rawData=t,n=this.contents=new Mf(t),this.contents.pos=4,n.readString(4)==="ttcf")throw new Error("TTCF not supported.");n.pos=0,this.parse(),this.subset=new ojt(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new q_t(this.contents),this.head=new G_t(this),this.name=new ejt(this),this.cmap=new Zve(this),this.toUnicode={},this.hhea=new Y_t(this),this.maxp=new tjt(this),this.hmtx=new njt(this),this.post=new J_t(this),this.os2=new X_t(this),this.loca=new ajt(this),this.glyf=new rjt(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,n,r,i,s;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var a,o,c,u;for(u=[],a=0,o=(c=this.bbox).length;a<o;a++)t=c[a],u.push(Math.round(t*this.scaleFactor));return u}).call(this),this.stemV=0,this.post.exists?(r=255&(i=this.post.italic_angle),32768&(n=i>>16)&&(n=-(1+(65535^n))),this.italicAngle=+(n+"."+r)):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=(s=this.familyClass)===1||s===2||s===3||s===4||s===5||s===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 n;return((n=this.cmap.unicode)!=null?n.codeMap[t]:void 0)||0},e.prototype.widthOfGlyph=function(t){var n;return n=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*n},e.prototype.widthOfString=function(t,n,r){var i,s,a,o;for(a=0,s=0,o=(t=""+t).length;0<=o?s<o:s>o;s=0<=o?++s:--s)i=t.charCodeAt(s),a+=this.widthOfGlyph(this.characterToGlyph(i))+r*(1e3/n)||0;return a*(n/1e3)},e.prototype.lineHeight=function(t,n){var r;return n==null&&(n=!1),r=n?this.lineGap:0,(this.ascender+r-this.decender)/1e3*t},e}();var _c,Mf=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 n,r;for(r=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)r[n]=String.fromCharCode(this.readByte());return r.join("")},e.prototype.writeString=function(t){var n,r,i;for(i=[],n=0,r=t.length;0<=r?n<r:n>r;n=0<=r?++n:--n)i.push(this.writeByte(t.charCodeAt(n)));return i},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(t){return this.writeInt16(t)},e.prototype.readLongLong=function(){var t,n,r,i,s,a,o,c;return t=this.readByte(),n=this.readByte(),r=this.readByte(),i=this.readByte(),s=this.readByte(),a=this.readByte(),o=this.readByte(),c=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^n)+1099511627776*(255^r)+4294967296*(255^i)+16777216*(255^s)+65536*(255^a)+256*(255^o)+(255^c)+1):72057594037927940*t+281474976710656*n+1099511627776*r+4294967296*i+16777216*s+65536*a+256*o+c},e.prototype.writeLongLong=function(t){var n,r;return n=Math.floor(t/4294967296),r=4294967295&t,this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n),this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(t){return this.writeInt32(t)},e.prototype.read=function(t){var n,r;for(n=[],r=0;0<=t?r<t:r>t;r=0<=t?++r:--r)n.push(this.readByte());return n},e.prototype.write=function(t){var n,r,i,s;for(s=[],r=0,i=t.length;r<i;r++)n=t[r],s.push(this.writeByte(n));return s},e}(),q_t=function(){var e;function t(n){var r,i,s;for(this.scalarType=n.readInt(),this.tableCount=n.readShort(),this.searchRange=n.readShort(),this.entrySelector=n.readShort(),this.rangeShift=n.readShort(),this.tables={},i=0,s=this.tableCount;0<=s?i<s:i>s;i=0<=s?++i:--i)r={tag:n.readString(4),checksum:n.readInt(),offset:n.readInt(),length:n.readInt()},this.tables[r.tag]=r}return t.prototype.encode=function(n){var r,i,s,a,o,c,u,d,h,A,f,p,m;for(m in f=Object.keys(n).length,c=Math.log(2),h=16*Math.floor(Math.log(f)/c),a=Math.floor(h/c),d=16*f-h,(i=new Mf).writeInt(this.scalarType),i.writeShort(f),i.writeShort(h),i.writeShort(a),i.writeShort(d),s=16*f,u=i.pos+s,o=null,p=[],n)for(A=n[m],i.writeString(m),i.writeInt(e(A)),i.writeInt(u),i.writeInt(A.length),p=p.concat(A),m==="head"&&(o=u),u+=A.length;u%4;)p.push(0),u++;return i.write(p),r=2981146554-e(i.data),i.pos=o+8,i.writeUInt32(r),i.data},e=function(n){var r,i,s,a;for(n=e0e.call(n);n.length%4;)n.push(0);for(s=new Mf(n),i=0,r=0,a=n.length;r<a;r=r+=4)i+=s.readUInt32();return 4294967295&i},t}(),W_t={}.hasOwnProperty,vu=function(e,t){for(var n in t)W_t.call(t,n)&&(e[n]=t[n]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};_c=function(){function e(t){var n;this.file=t,n=this.file.directory.tables[this.tag],this.exists=!!n,n&&(this.offset=n.offset,this.length=n.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 G_t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return vu(e,_c),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 n;return(n=new Mf).writeInt(this.version),n.writeInt(this.revision),n.writeInt(this.checkSumAdjustment),n.writeInt(this.magicNumber),n.writeShort(this.flags),n.writeShort(this.unitsPerEm),n.writeLongLong(this.created),n.writeLongLong(this.modified),n.writeShort(this.xMin),n.writeShort(this.yMin),n.writeShort(this.xMax),n.writeShort(this.yMax),n.writeShort(this.macStyle),n.writeShort(this.lowestRecPPEM),n.writeShort(this.fontDirectionHint),n.writeShort(t),n.writeShort(this.glyphDataFormat),n.data},e}(),SZ=function(){function e(t,n){var r,i,s,a,o,c,u,d,h,A,f,p,m,g,y,v,x;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=n+t.readInt(),h=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(f=t.readUInt16(),A=f/2,t.pos+=6,s=function(){var w,b;for(b=[],c=w=0;0<=A?w<A:w>A;c=0<=A?++w:--w)b.push(t.readUInt16());return b}(),t.pos+=2,m=function(){var w,b;for(b=[],c=w=0;0<=A?w<A:w>A;c=0<=A?++w:--w)b.push(t.readUInt16());return b}(),u=function(){var w,b;for(b=[],c=w=0;0<=A?w<A:w>A;c=0<=A?++w:--w)b.push(t.readUInt16());return b}(),d=function(){var w,b;for(b=[],c=w=0;0<=A?w<A:w>A;c=0<=A?++w:--w)b.push(t.readUInt16());return b}(),i=(this.length-t.pos+this.offset)/2,o=function(){var w,b;for(b=[],c=w=0;0<=i?w<i:w>i;c=0<=i?++w:--w)b.push(t.readUInt16());return b}(),c=y=0,x=s.length;y<x;c=++y)for(g=s[c],r=v=p=m[c];p<=g?v<=g:v>=g;r=p<=g?++v:--v)d[c]===0?a=r+u[c]:(a=o[d[c]/2+(r-p)-(A-c)]||0)!==0&&(a+=u[c]),this.codeMap[r]=65535&a}t.pos=h}return e.encode=function(t,n){var r,i,s,a,o,c,u,d,h,A,f,p,m,g,y,v,x,w,b,k,j,B,E,I,T,N,F,L,U,H,K,$,z,Q,oe,R,M,Y,X,q,Z,de,ue,ae,he,ie;switch(L=new Mf,a=Object.keys(t).sort(function(Ce,Oe){return Ce-Oe}),n){case"macroman":for(m=0,g=function(){var Ce=[];for(p=0;p<256;++p)Ce.push(0);return Ce}(),v={0:0},s={},U=0,z=a.length;U<z;U++)v[ue=t[i=a[U]]]==null&&(v[ue]=++m),s[i]={old:t[i],new:v[t[i]]},g[i]=v[t[i]];return L.writeUInt16(1),L.writeUInt16(0),L.writeUInt32(12),L.writeUInt16(0),L.writeUInt16(262),L.writeUInt16(0),L.write(g),{charMap:s,subtable:L.data,maxGlyphID:m+1};case"unicode":for(N=[],h=[],x=0,v={},r={},y=u=null,H=0,Q=a.length;H<Q;H++)v[b=t[i=a[H]]]==null&&(v[b]=++x),r[i]={old:b,new:v[b]},o=v[b]-i,y!=null&&o===u||(y&&h.push(y),N.push(i),u=o),y=i;for(y&&h.push(y),h.push(65535),N.push(65535),I=2*(E=N.length),B=2*Math.pow(Math.log(E)/Math.LN2,2),A=Math.log(B/2)/Math.LN2,j=2*E-B,c=[],k=[],f=[],p=K=0,oe=N.length;K<oe;p=++K){if(T=N[p],d=h[p],T===65535){c.push(0),k.push(0);break}if(T-(F=r[T].new)>=32768)for(c.push(0),k.push(2*(f.length+E-p)),i=$=T;T<=d?$<=d:$>=d;i=T<=d?++$:--$)f.push(r[i].new);else c.push(F-T),k.push(0)}for(L.writeUInt16(3),L.writeUInt16(1),L.writeUInt32(12),L.writeUInt16(4),L.writeUInt16(16+8*E+2*f.length),L.writeUInt16(0),L.writeUInt16(I),L.writeUInt16(B),L.writeUInt16(A),L.writeUInt16(j),Z=0,R=h.length;Z<R;Z++)i=h[Z],L.writeUInt16(i);for(L.writeUInt16(0),de=0,M=N.length;de<M;de++)i=N[de],L.writeUInt16(i);for(ae=0,Y=c.length;ae<Y;ae++)o=c[ae],L.writeUInt16(o);for(he=0,X=k.length;he<X;he++)w=k[he],L.writeUInt16(w);for(ie=0,q=f.length;ie<q;ie++)m=f[ie],L.writeUInt16(m);return{charMap:r,subtable:L.data,maxGlyphID:x+1}}},e}(),Zve=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return vu(e,_c),e.prototype.tag="cmap",e.prototype.parse=function(t){var n,r,i;for(t.pos=this.offset,this.version=t.readUInt16(),i=t.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=i?r<i:r>i;r=0<=i?++r:--r)n=new SZ(t,this.offset),this.tables.push(n),n.isUnicode&&this.unicode==null&&(this.unicode=n);return!0},e.encode=function(t,n){var r,i;return n==null&&(n="macroman"),r=SZ.encode(t,n),(i=new Mf).writeUInt16(0),i.writeUInt16(1),r.table=i.data.concat(r.subtable),r},e}(),Y_t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return vu(e,_c),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}(),X_t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return vu(e,_c),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 n,r;for(r=[],n=0;n<10;++n)r.push(t.readByte());return r}(),this.charRange=function(){var n,r;for(r=[],n=0;n<4;++n)r.push(t.readInt());return r}(),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 n,r;for(r=[],n=0;n<2;n=++n)r.push(t.readInt());return r}(),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}(),J_t=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return vu(e,_c),e.prototype.tag="post",e.prototype.parse=function(t){var n,r,i;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 s;for(r=t.readUInt16(),this.glyphNameIndex=[],s=0;0<=r?s<r:s>r;s=0<=r?++s:--s)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],i=[];t.pos<this.offset+this.length;)n=t.readByte(),i.push(this.names.push(t.readString(n)));return i;case 151552:return r=t.readUInt16(),this.offsets=t.read(r);case 262144:return this.map=(function(){var a,o,c;for(c=[],s=a=0,o=this.file.maxp.numGlyphs;0<=o?a<o:a>o;s=0<=o?++a:--a)c.push(t.readUInt32());return c}).call(this)}},e}(),Z_t=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},ejt=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return vu(e,_c),e.prototype.tag="name",e.prototype.parse=function(t){var n,r,i,s,a,o,c,u,d,h,A;for(t.pos=this.offset,t.readShort(),n=t.readShort(),o=t.readShort(),r=[],s=0;0<=n?s<n:s>n;s=0<=n?++s:--s)r.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+o+t.readShort()});for(c={},s=d=0,h=r.length;d<h;s=++d)i=r[s],t.pos=i.offset,u=t.readString(i.length),a=new Z_t(u,i),c[A=i.nameID]==null&&(c[A]=[]),c[i.nameID].push(a);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}(),tjt=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return vu(e,_c),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}(),njt=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return vu(e,_c),e.prototype.tag="hmtx",e.prototype.parse=function(t){var n,r,i,s,a,o,c;for(t.pos=this.offset,this.metrics=[],n=0,o=this.file.hhea.numberOfMetrics;0<=o?n<o:n>o;n=0<=o?++n:--n)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var u,d;for(d=[],n=u=0;0<=i?u<i:u>i;n=0<=i?++u:--u)d.push(t.readInt16());return d}(),this.widths=(function(){var u,d,h,A;for(A=[],u=0,d=(h=this.metrics).length;u<d;u++)s=h[u],A.push(s.advance);return A}).call(this),r=this.widths[this.widths.length-1],c=[],n=a=0;0<=i?a<i:a>i;n=0<=i?++a:--a)c.push(this.widths.push(r));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}(),e0e=[].slice,rjt=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return vu(e,_c),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(t){var n,r,i,s,a,o,c,u,d,h;return t in this.cache?this.cache[t]:(s=this.file.loca,n=this.file.contents,r=s.indexOf(t),(i=s.lengthOf(t))===0?this.cache[t]=null:(n.pos=this.offset+r,a=(o=new Mf(n.read(i))).readShort(),u=o.readShort(),h=o.readShort(),c=o.readShort(),d=o.readShort(),this.cache[t]=a===-1?new sjt(o,u,h,c,d):new ijt(o,a,u,h,c,d),this.cache[t]))},e.prototype.encode=function(t,n,r){var i,s,a,o,c;for(a=[],s=[],o=0,c=n.length;o<c;o++)i=t[n[o]],s.push(a.length),i&&(a=a.concat(i.encode(r)));return s.push(a.length),{table:a,offsets:s}},e}(),ijt=function(){function e(t,n,r,i,s,a){this.raw=t,this.numberOfContours=n,this.xMin=r,this.yMin=i,this.xMax=s,this.yMax=a,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),sjt=function(){function e(t,n,r,i,s){var a,o;for(this.raw=t,this.xMin=n,this.yMin=r,this.xMax=i,this.yMax=s,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],a=this.raw;o=a.readShort(),this.glyphOffsets.push(a.pos),this.glyphIDs.push(a.readUInt16()),32&o;)a.pos+=1&o?4:2,128&o?a.pos+=8:64&o?a.pos+=4:8&o&&(a.pos+=2)}return e.prototype.encode=function(){var t,n,r;for(n=new Mf(e0e.call(this.raw.data)),t=0,r=this.glyphIDs.length;t<r;++t)n.pos=this.glyphOffsets[t];return n.data},e}(),ajt=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return vu(e,_c),e.prototype.tag="loca",e.prototype.parse=function(t){var n,r;return t.pos=this.offset,n=this.file.head.indexToLocFormat,this.offsets=n===0?(function(){var i,s;for(s=[],r=0,i=this.length;r<i;r+=2)s.push(2*t.readUInt16());return s}).call(this):(function(){var i,s;for(s=[],r=0,i=this.length;r<i;r+=4)s.push(t.readUInt32());return s}).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,n){for(var r=new Uint32Array(this.offsets.length),i=0,s=0,a=0;a<r.length;++a)if(r[a]=i,s<n.length&&n[s]==a){++s,r[a]=i;var o=this.offsets[a],c=this.offsets[a+1]-o;c>0&&(i+=c)}for(var u=new Array(4*r.length),d=0;d<r.length;++d)u[4*d+3]=255&r[d],u[4*d+2]=(65280&r[d])>>8,u[4*d+1]=(16711680&r[d])>>16,u[4*d]=(4278190080&r[d])>>24;return u},e}(),ojt=function(){function e(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var t,n,r,i,s;for(n in i=this.font.cmap.tables[0].codeMap,t={},s=this.subset)r=s[n],t[n]=i[r];return t},e.prototype.glyphsFor=function(t){var n,r,i,s,a,o,c;for(i={},a=0,o=t.length;a<o;a++)i[s=t[a]]=this.font.glyf.glyphFor(s);for(s in n=[],i)(r=i[s])!=null&&r.compound&&n.push.apply(n,r.glyphIDs);if(n.length>0)for(s in c=this.glyphsFor(n))r=c[s],i[s]=r;return i},e.prototype.encode=function(t,n){var r,i,s,a,o,c,u,d,h,A,f,p,m,g,y;for(i in r=Zve.encode(this.generateCmap(),"unicode"),a=this.glyphsFor(t),f={0:0},y=r.charMap)f[(c=y[i]).old]=c.new;for(p in A=r.maxGlyphID,a)p in f||(f[p]=A++);return d=function(v){var x,w;for(x in w={},v)w[v[x]]=x;return w}(f),h=Object.keys(d).sort(function(v,x){return v-x}),m=function(){var v,x,w;for(w=[],v=0,x=h.length;v<x;v++)o=h[v],w.push(d[o]);return w}(),s=this.font.glyf.encode(a,m,f),u=this.font.loca.encode(s.offsets,m),g={cmap:this.font.cmap.raw(),glyf:s.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(n)},this.font.os2.exists&&(g["OS/2"]=this.font.os2.raw()),this.font.directory.encode(g)},e}();It.API.PDFObject=function(){var e;function t(){}return e=function(n,r){return(Array(r+1).join("0")+n).slice(-r)},t.convert=function(n){var r,i,s,a;if(Array.isArray(n))return"["+function(){var o,c,u;for(u=[],o=0,c=n.length;o<c;o++)r=n[o],u.push(t.convert(r));return u}().join(" ")+"]";if(typeof n=="string")return"/"+n;if(n!=null&&n.isString)return"("+n+")";if(n instanceof Date)return"(D:"+e(n.getUTCFullYear(),4)+e(n.getUTCMonth(),2)+e(n.getUTCDate(),2)+e(n.getUTCHours(),2)+e(n.getUTCMinutes(),2)+e(n.getUTCSeconds(),2)+"Z)";if({}.toString.call(n)==="[object Object]"){for(i in s=["<<"],n)a=n[i],s.push("/"+i+" "+t.convert(a));return s.push(">>"),s.join(`
`)}return""+n},t}();/*!
 * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
 * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
 * Released under MIT License
 *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var UR=function(e,t){return UR=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},UR(e,t)};function jc(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");UR(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var HR=function(){return HR=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},HR.apply(this,arguments)};function pa(e,t,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function o(d){try{u(r.next(d))}catch(h){a(h)}}function c(d){try{u(r.throw(d))}catch(h){a(h)}}function u(d){d.done?s(d.value):i(d.value).then(o,c)}u((r=r.apply(e,[])).next())})}function Ks(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(u){return function(d){return c([u,d])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function mk(e,t,n){if(arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||t)}var _d=function(){function e(t,n,r,i){this.left=t,this.top=n,this.width=r,this.height=i}return e.prototype.add=function(t,n,r,i){return new e(this.left+t,this.top+n,this.width+r,this.height+i)},e.fromClientRect=function(t,n){return new e(n.left+t.windowBounds.left,n.top+t.windowBounds.top,n.width,n.height)},e.fromDOMRectList=function(t,n){var r=Array.from(n).find(function(i){return i.width!==0});return r?new e(r.left+t.windowBounds.left,r.top+t.windowBounds.top,r.width,r.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),yT=function(e,t){return _d.fromClientRect(e,t.getBoundingClientRect())},ljt=function(e){var t=e.body,n=e.documentElement;if(!t||!n)throw new Error("Unable to get document size");var r=Math.max(Math.max(t.scrollWidth,n.scrollWidth),Math.max(t.offsetWidth,n.offsetWidth),Math.max(t.clientWidth,n.clientWidth)),i=Math.max(Math.max(t.scrollHeight,n.scrollHeight),Math.max(t.offsetHeight,n.offsetHeight),Math.max(t.clientHeight,n.clientHeight));return new _d(0,0,r,i)},vT=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var s=e.charCodeAt(n++);(s&64512)===56320?t.push(((i&1023)<<10)+(s&1023)+65536):(t.push(i),n--)}else t.push(i)}return t},di=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var n=e.length;if(!n)return"";for(var r=[],i=-1,s="";++i<n;){var a=e[i];a<=65535?r.push(a):(a-=65536,r.push((a>>10)+55296,a%1024+56320)),(i+1===n||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},kZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",cjt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var gk=0;gk<kZ.length;gk++)cjt[kZ.charCodeAt(gk)]=gk;var _Z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fw=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var yk=0;yk<_Z.length;yk++)fw[_Z.charCodeAt(yk)]=yk;var ujt=function(e){var t=e.length*.75,n=e.length,r,i=0,s,a,o,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var u=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(t):new Array(t),d=Array.isArray(u)?u:new Uint8Array(u);for(r=0;r<n;r+=4)s=fw[e.charCodeAt(r)],a=fw[e.charCodeAt(r+1)],o=fw[e.charCodeAt(r+2)],c=fw[e.charCodeAt(r+3)],d[i++]=s<<2|a>>4,d[i++]=(a&15)<<4|o>>2,d[i++]=(o&3)<<6|c&63;return u},djt=function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n.push(e[r+1]<<8|e[r]);return n},hjt=function(e){for(var t=e.length,n=[],r=0;r<t;r+=4)n.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return n},Fp=5,C$=11,yO=2,fjt=C$-Fp,t0e=65536>>Fp,Ajt=1<<Fp,vO=Ajt-1,pjt=1024>>Fp,mjt=t0e+pjt,gjt=mjt,yjt=32,vjt=gjt+yjt,xjt=65536>>C$,wjt=1<<fjt,bjt=wjt-1,jZ=function(e,t,n){return e.slice?e.slice(t,n):new Uint16Array(Array.prototype.slice.call(e,t,n))},Cjt=function(e,t,n){return e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n))},Sjt=function(e,t){var n=ujt(e),r=Array.isArray(n)?hjt(n):new Uint32Array(n),i=Array.isArray(n)?djt(n):new Uint16Array(n),s=24,a=jZ(i,s/2,r[4]/2),o=r[5]===2?jZ(i,(s+r[4])/2):Cjt(r,Math.ceil((s+r[4])/4));return new kjt(r[0],r[1],r[2],r[3],a,o)},kjt=function(){function e(t,n,r,i,s,a){this.initialValue=t,this.errorValue=n,this.highStart=r,this.highValueIndex=i,this.index=s,this.data=a}return e.prototype.get=function(t){var n;if(t>=0){if(t<55296||t>56319&&t<=65535)return n=this.index[t>>Fp],n=(n<<yO)+(t&vO),this.data[n];if(t<=65535)return n=this.index[t0e+(t-55296>>Fp)],n=(n<<yO)+(t&vO),this.data[n];if(t<this.highStart)return n=vjt-xjt+(t>>C$),n=this.index[n],n+=t>>Fp&bjt,n=this.index[n],n=(n<<yO)+(t&vO),this.data[n];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),BZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_jt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var vk=0;vk<BZ.length;vk++)_jt[BZ.charCodeAt(vk)]=vk;var jjt="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",NZ=50,Bjt=1,n0e=2,r0e=3,Njt=4,Ejt=5,EZ=7,i0e=8,TZ=9,Yh=10,QR=11,PZ=12,$R=13,Tjt=14,Aw=15,zR=16,xk=17,Vx=18,Pjt=19,IZ=20,VR=21,Kx=22,xO=23,_g=24,xo=25,pw=26,mw=27,jg=28,Ijt=29,qA=30,Ojt=31,wk=32,bk=33,KR=34,qR=35,WR=36,a2=37,GR=38,T_=39,P_=40,wO=41,s0e=42,Fjt=43,Mjt=[9001,65288],a0e="!",bn="×",Ck="÷",YR=Sjt(jjt),Hu=[qA,WR],XR=[Bjt,n0e,r0e,Ejt],o0e=[Yh,i0e],OZ=[mw,pw],Ljt=XR.concat(o0e),FZ=[GR,T_,P_,KR,qR],Rjt=[Aw,$R],Djt=function(e,t){t===void 0&&(t="strict");var n=[],r=[],i=[];return e.forEach(function(s,a){var o=YR.get(s);if(o>NZ?(i.push(!0),o-=NZ):i.push(!1),["normal","auto","loose"].indexOf(t)!==-1&&[8208,8211,12316,12448].indexOf(s)!==-1)return r.push(a),n.push(zR);if(o===Njt||o===QR){if(a===0)return r.push(a),n.push(qA);var c=n[a-1];return Ljt.indexOf(c)===-1?(r.push(r[a-1]),n.push(c)):(r.push(a),n.push(qA))}if(r.push(a),o===Ojt)return n.push(t==="strict"?VR:a2);if(o===s0e||o===Ijt)return n.push(qA);if(o===Fjt)return s>=131072&&s<=196605||s>=196608&&s<=262141?n.push(a2):n.push(qA);n.push(o)}),[r,n,i]},bO=function(e,t,n,r){var i=r[n];if(Array.isArray(e)?e.indexOf(i)!==-1:e===i)for(var s=n;s<=r.length;){s++;var a=r[s];if(a===t)return!0;if(a!==Yh)break}if(i===Yh)for(var s=n;s>0;){s--;var o=r[s];if(Array.isArray(e)?e.indexOf(o)!==-1:e===o)for(var c=n;c<=r.length;){c++;var a=r[c];if(a===t)return!0;if(a!==Yh)break}if(o!==Yh)break}return!1},MZ=function(e,t){for(var n=e;n>=0;){var r=t[n];if(r===Yh)n--;else return r}return 0},Ujt=function(e,t,n,r,i){if(n[r]===0)return bn;var s=r-1;if(Array.isArray(i)&&i[s]===!0)return bn;var a=s-1,o=s+1,c=t[s],u=a>=0?t[a]:0,d=t[o];if(c===n0e&&d===r0e)return bn;if(XR.indexOf(c)!==-1)return a0e;if(XR.indexOf(d)!==-1||o0e.indexOf(d)!==-1)return bn;if(MZ(s,t)===i0e)return Ck;if(YR.get(e[s])===QR||(c===wk||c===bk)&&YR.get(e[o])===QR||c===EZ||d===EZ||c===TZ||[Yh,$R,Aw].indexOf(c)===-1&&d===TZ||[xk,Vx,Pjt,_g,jg].indexOf(d)!==-1||MZ(s,t)===Kx||bO(xO,Kx,s,t)||bO([xk,Vx],VR,s,t)||bO(PZ,PZ,s,t))return bn;if(c===Yh)return Ck;if(c===xO||d===xO)return bn;if(d===zR||c===zR)return Ck;if([$R,Aw,VR].indexOf(d)!==-1||c===Tjt||u===WR&&Rjt.indexOf(c)!==-1||c===jg&&d===WR||d===IZ||Hu.indexOf(d)!==-1&&c===xo||Hu.indexOf(c)!==-1&&d===xo||c===mw&&[a2,wk,bk].indexOf(d)!==-1||[a2,wk,bk].indexOf(c)!==-1&&d===pw||Hu.indexOf(c)!==-1&&OZ.indexOf(d)!==-1||OZ.indexOf(c)!==-1&&Hu.indexOf(d)!==-1||[mw,pw].indexOf(c)!==-1&&(d===xo||[Kx,Aw].indexOf(d)!==-1&&t[o+1]===xo)||[Kx,Aw].indexOf(c)!==-1&&d===xo||c===xo&&[xo,jg,_g].indexOf(d)!==-1)return bn;if([xo,jg,_g,xk,Vx].indexOf(d)!==-1)for(var h=s;h>=0;){var A=t[h];if(A===xo)return bn;if([jg,_g].indexOf(A)!==-1)h--;else break}if([mw,pw].indexOf(d)!==-1)for(var h=[xk,Vx].indexOf(c)!==-1?a:s;h>=0;){var A=t[h];if(A===xo)return bn;if([jg,_g].indexOf(A)!==-1)h--;else break}if(GR===c&&[GR,T_,KR,qR].indexOf(d)!==-1||[T_,KR].indexOf(c)!==-1&&[T_,P_].indexOf(d)!==-1||[P_,qR].indexOf(c)!==-1&&d===P_||FZ.indexOf(c)!==-1&&[IZ,pw].indexOf(d)!==-1||FZ.indexOf(d)!==-1&&c===mw||Hu.indexOf(c)!==-1&&Hu.indexOf(d)!==-1||c===_g&&Hu.indexOf(d)!==-1||Hu.concat(xo).indexOf(c)!==-1&&d===Kx&&Mjt.indexOf(e[o])===-1||Hu.concat(xo).indexOf(d)!==-1&&c===Vx)return bn;if(c===wO&&d===wO){for(var f=n[s],p=1;f>0&&(f--,t[f]===wO);)p++;if(p%2!==0)return bn}return c===wk&&d===bk?bn:Ck},Hjt=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var n=Djt(e,t.lineBreak),r=n[0],i=n[1],s=n[2];(t.wordBreak==="break-all"||t.wordBreak==="break-word")&&(i=i.map(function(o){return[xo,qA,s0e].indexOf(o)!==-1?a2:o}));var a=t.wordBreak==="keep-all"?s.map(function(o,c){return o&&e[c]>=19968&&e[c]<=40959}):void 0;return[r,i,a]},Qjt=function(){function e(t,n,r,i){this.codePoints=t,this.required=n===a0e,this.start=r,this.end=i}return e.prototype.slice=function(){return di.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),$jt=function(e,t){var n=vT(e),r=Hjt(n,t),i=r[0],s=r[1],a=r[2],o=n.length,c=0,u=0;return{next:function(){if(u>=o)return{done:!0,value:null};for(var d=bn;u<o&&(d=Ujt(n,s,i,++u,a))===bn;);if(d!==bn||u===o){var h=new Qjt(n,d,c,u);return c=u,{value:h,done:!1}}return{done:!0,value:null}}}},zjt=1,Vjt=2,aC=4,LZ=8,RN=10,RZ=47,cb=92,Kjt=9,qjt=32,Sk=34,qx=61,Wjt=35,Gjt=36,Yjt=37,kk=39,_k=40,Wx=41,Xjt=95,Ha=45,Jjt=33,Zjt=60,eBt=62,tBt=64,nBt=91,rBt=93,iBt=61,sBt=123,jk=63,aBt=125,DZ=124,oBt=126,lBt=128,UZ=65533,CO=42,dp=43,cBt=44,uBt=58,dBt=59,o2=46,hBt=0,fBt=8,ABt=11,pBt=14,mBt=31,gBt=127,Dc=-1,l0e=48,c0e=97,u0e=101,yBt=102,vBt=117,xBt=122,d0e=65,h0e=69,f0e=70,wBt=85,bBt=90,Gs=function(e){return e>=l0e&&e<=57},CBt=function(e){return e>=55296&&e<=57343},Bg=function(e){return Gs(e)||e>=d0e&&e<=f0e||e>=c0e&&e<=yBt},SBt=function(e){return e>=c0e&&e<=xBt},kBt=function(e){return e>=d0e&&e<=bBt},_Bt=function(e){return SBt(e)||kBt(e)},jBt=function(e){return e>=lBt},Bk=function(e){return e===RN||e===Kjt||e===qjt},DN=function(e){return _Bt(e)||jBt(e)||e===Xjt},HZ=function(e){return DN(e)||Gs(e)||e===Ha},BBt=function(e){return e>=hBt&&e<=fBt||e===ABt||e>=pBt&&e<=mBt||e===gBt},wh=function(e,t){return e!==cb?!1:t!==RN},Nk=function(e,t,n){return e===Ha?DN(t)||wh(t,n):DN(e)?!0:!!(e===cb&&wh(e,t))},SO=function(e,t,n){return e===dp||e===Ha?Gs(t)?!0:t===o2&&Gs(n):Gs(e===o2?t:e)},NBt=function(e){var t=0,n=1;(e[t]===dp||e[t]===Ha)&&(e[t]===Ha&&(n=-1),t++);for(var r=[];Gs(e[t]);)r.push(e[t++]);var i=r.length?parseInt(di.apply(void 0,r),10):0;e[t]===o2&&t++;for(var s=[];Gs(e[t]);)s.push(e[t++]);var a=s.length,o=a?parseInt(di.apply(void 0,s),10):0;(e[t]===h0e||e[t]===u0e)&&t++;var c=1;(e[t]===dp||e[t]===Ha)&&(e[t]===Ha&&(c=-1),t++);for(var u=[];Gs(e[t]);)u.push(e[t++]);var d=u.length?parseInt(di.apply(void 0,u),10):0;return n*(i+o*Math.pow(10,-a))*Math.pow(10,c*d)},EBt={type:2},TBt={type:3},PBt={type:4},IBt={type:13},OBt={type:8},FBt={type:21},MBt={type:9},LBt={type:10},RBt={type:11},DBt={type:12},UBt={type:14},Ek={type:23},HBt={type:1},QBt={type:25},$Bt={type:24},zBt={type:26},VBt={type:27},KBt={type:28},qBt={type:29},WBt={type:31},JR={type:32},A0e=function(){function e(){this._value=[]}return e.prototype.write=function(t){this._value=this._value.concat(vT(t))},e.prototype.read=function(){for(var t=[],n=this.consumeToken();n!==JR;)t.push(n),n=this.consumeToken();return t},e.prototype.consumeToken=function(){var t=this.consumeCodePoint();switch(t){case Sk:return this.consumeStringToken(Sk);case Wjt:var n=this.peekCodePoint(0),r=this.peekCodePoint(1),i=this.peekCodePoint(2);if(HZ(n)||wh(r,i)){var s=Nk(n,r,i)?Vjt:zjt,a=this.consumeName();return{type:5,value:a,flags:s}}break;case Gjt:if(this.peekCodePoint(0)===qx)return this.consumeCodePoint(),IBt;break;case kk:return this.consumeStringToken(kk);case _k:return EBt;case Wx:return TBt;case CO:if(this.peekCodePoint(0)===qx)return this.consumeCodePoint(),UBt;break;case dp:if(SO(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case cBt:return PBt;case Ha:var o=t,c=this.peekCodePoint(0),u=this.peekCodePoint(1);if(SO(o,c,u))return this.reconsumeCodePoint(t),this.consumeNumericToken();if(Nk(o,c,u))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();if(c===Ha&&u===eBt)return this.consumeCodePoint(),this.consumeCodePoint(),$Bt;break;case o2:if(SO(t,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(t),this.consumeNumericToken();break;case RZ:if(this.peekCodePoint(0)===CO)for(this.consumeCodePoint();;){var d=this.consumeCodePoint();if(d===CO&&(d=this.consumeCodePoint(),d===RZ))return this.consumeToken();if(d===Dc)return this.consumeToken()}break;case uBt:return zBt;case dBt:return VBt;case Zjt:if(this.peekCodePoint(0)===Jjt&&this.peekCodePoint(1)===Ha&&this.peekCodePoint(2)===Ha)return this.consumeCodePoint(),this.consumeCodePoint(),QBt;break;case tBt:var h=this.peekCodePoint(0),A=this.peekCodePoint(1),f=this.peekCodePoint(2);if(Nk(h,A,f)){var a=this.consumeName();return{type:7,value:a}}break;case nBt:return KBt;case cb:if(wh(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),this.consumeIdentLikeToken();break;case rBt:return qBt;case iBt:if(this.peekCodePoint(0)===qx)return this.consumeCodePoint(),OBt;break;case sBt:return RBt;case aBt:return DBt;case vBt:case wBt:var p=this.peekCodePoint(0),m=this.peekCodePoint(1);return p===dp&&(Bg(m)||m===jk)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(t),this.consumeIdentLikeToken();case DZ:if(this.peekCodePoint(0)===qx)return this.consumeCodePoint(),MBt;if(this.peekCodePoint(0)===DZ)return this.consumeCodePoint(),FBt;break;case oBt:if(this.peekCodePoint(0)===qx)return this.consumeCodePoint(),LBt;break;case Dc:return JR}return Bk(t)?(this.consumeWhiteSpace(),WBt):Gs(t)?(this.reconsumeCodePoint(t),this.consumeNumericToken()):DN(t)?(this.reconsumeCodePoint(t),this.consumeIdentLikeToken()):{type:6,value:di(t)}},e.prototype.consumeCodePoint=function(){var t=this._value.shift();return typeof t>"u"?-1:t},e.prototype.reconsumeCodePoint=function(t){this._value.unshift(t)},e.prototype.peekCodePoint=function(t){return t>=this._value.length?-1:this._value[t]},e.prototype.consumeUnicodeRangeToken=function(){for(var t=[],n=this.consumeCodePoint();Bg(n)&&t.length<6;)t.push(n),n=this.consumeCodePoint();for(var r=!1;n===jk&&t.length<6;)t.push(n),n=this.consumeCodePoint(),r=!0;if(r){var i=parseInt(di.apply(void 0,t.map(function(c){return c===jk?l0e:c})),16),s=parseInt(di.apply(void 0,t.map(function(c){return c===jk?f0e:c})),16);return{type:30,start:i,end:s}}var a=parseInt(di.apply(void 0,t),16);if(this.peekCodePoint(0)===Ha&&Bg(this.peekCodePoint(1))){this.consumeCodePoint(),n=this.consumeCodePoint();for(var o=[];Bg(n)&&o.length<6;)o.push(n),n=this.consumeCodePoint();var s=parseInt(di.apply(void 0,o),16);return{type:30,start:a,end:s}}else return{type:30,start:a,end:a}},e.prototype.consumeIdentLikeToken=function(){var t=this.consumeName();return t.toLowerCase()==="url"&&this.peekCodePoint(0)===_k?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===_k?(this.consumeCodePoint(),{type:19,value:t}):{type:20,value:t}},e.prototype.consumeUrlToken=function(){var t=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Dc)return{type:22,value:""};var n=this.peekCodePoint(0);if(n===kk||n===Sk){var r=this.consumeStringToken(this.consumeCodePoint());return r.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Dc||this.peekCodePoint(0)===Wx)?(this.consumeCodePoint(),{type:22,value:r.value}):(this.consumeBadUrlRemnants(),Ek)}for(;;){var i=this.consumeCodePoint();if(i===Dc||i===Wx)return{type:22,value:di.apply(void 0,t)};if(Bk(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Dc||this.peekCodePoint(0)===Wx?(this.consumeCodePoint(),{type:22,value:di.apply(void 0,t)}):(this.consumeBadUrlRemnants(),Ek);if(i===Sk||i===kk||i===_k||BBt(i))return this.consumeBadUrlRemnants(),Ek;if(i===cb)if(wh(i,this.peekCodePoint(0)))t.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),Ek;else t.push(i)}},e.prototype.consumeWhiteSpace=function(){for(;Bk(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var t=this.consumeCodePoint();if(t===Wx||t===Dc)return;wh(t,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(t){for(var n=5e4,r="";t>0;){var i=Math.min(n,t);r+=di.apply(void 0,this._value.splice(0,i)),t-=i}return this._value.shift(),r},e.prototype.consumeStringToken=function(t){var n="",r=0;do{var i=this._value[r];if(i===Dc||i===void 0||i===t)return n+=this.consumeStringSlice(r),{type:0,value:n};if(i===RN)return this._value.splice(0,r),HBt;if(i===cb){var s=this._value[r+1];s!==Dc&&s!==void 0&&(s===RN?(n+=this.consumeStringSlice(r),r=-1,this._value.shift()):wh(i,s)&&(n+=this.consumeStringSlice(r),n+=di(this.consumeEscapedCodePoint()),r=-1))}r++}while(!0)},e.prototype.consumeNumber=function(){var t=[],n=aC,r=this.peekCodePoint(0);for((r===dp||r===Ha)&&t.push(this.consumeCodePoint());Gs(this.peekCodePoint(0));)t.push(this.consumeCodePoint());r=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(r===o2&&Gs(i))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),n=LZ;Gs(this.peekCodePoint(0));)t.push(this.consumeCodePoint());r=this.peekCodePoint(0),i=this.peekCodePoint(1);var s=this.peekCodePoint(2);if((r===h0e||r===u0e)&&((i===dp||i===Ha)&&Gs(s)||Gs(i)))for(t.push(this.consumeCodePoint(),this.consumeCodePoint()),n=LZ;Gs(this.peekCodePoint(0));)t.push(this.consumeCodePoint());return[NBt(t),n]},e.prototype.consumeNumericToken=function(){var t=this.consumeNumber(),n=t[0],r=t[1],i=this.peekCodePoint(0),s=this.peekCodePoint(1),a=this.peekCodePoint(2);if(Nk(i,s,a)){var o=this.consumeName();return{type:15,number:n,flags:r,unit:o}}return i===Yjt?(this.consumeCodePoint(),{type:16,number:n,flags:r}):{type:17,number:n,flags:r}},e.prototype.consumeEscapedCodePoint=function(){var t=this.consumeCodePoint();if(Bg(t)){for(var n=di(t);Bg(this.peekCodePoint(0))&&n.length<6;)n+=di(this.consumeCodePoint());Bk(this.peekCodePoint(0))&&this.consumeCodePoint();var r=parseInt(n,16);return r===0||CBt(r)||r>1114111?UZ:r}return t===Dc?UZ:t},e.prototype.consumeName=function(){for(var t="";;){var n=this.consumeCodePoint();if(HZ(n))t+=di(n);else if(wh(n,this.peekCodePoint(0)))t+=di(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(n),t}},e}(),p0e=function(){function e(t){this._tokens=t}return e.create=function(t){var n=new A0e;return n.write(t),new e(n.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var t=this.consumeToken();t.type===31;)t=this.consumeToken();if(t.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(t);var n=this.consumeComponentValue();do t=this.consumeToken();while(t.type===31);if(t.type===32)return n;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var t=[];;){var n=this.consumeComponentValue();if(n.type===32)return t;t.push(n),t.push()}},e.prototype.consumeComponentValue=function(){var t=this.consumeToken();switch(t.type){case 11:case 28:case 2:return this.consumeSimpleBlock(t.type);case 19:return this.consumeFunction(t)}return t},e.prototype.consumeSimpleBlock=function(t){for(var n={type:t,values:[]},r=this.consumeToken();;){if(r.type===32||YBt(r,t))return n;this.reconsumeToken(r),n.values.push(this.consumeComponentValue()),r=this.consumeToken()}},e.prototype.consumeFunction=function(t){for(var n={name:t.value,values:[],type:18};;){var r=this.consumeToken();if(r.type===32||r.type===3)return n;this.reconsumeToken(r),n.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var t=this._tokens.shift();return typeof t>"u"?JR:t},e.prototype.reconsumeToken=function(t){this._tokens.unshift(t)},e}(),oC=function(e){return e.type===15},R0=function(e){return e.type===17},er=function(e){return e.type===20},GBt=function(e){return e.type===0},ZR=function(e,t){return er(e)&&e.value===t},m0e=function(e){return e.type!==31},Gv=function(e){return e.type!==31&&e.type!==4},xu=function(e){var t=[],n=[];return e.forEach(function(r){if(r.type===4){if(n.length===0)throw new Error("Error parsing function args, zero tokens for arg");t.push(n),n=[];return}r.type!==31&&n.push(r)}),n.length&&t.push(n),t},YBt=function(e,t){return t===11&&e.type===12||t===28&&e.type===29?!0:t===2&&e.type===3},Lf=function(e){return e.type===17||e.type===15},ji=function(e){return e.type===16||Lf(e)},g0e=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},Ns={type:17,number:0,flags:aC},S$={type:16,number:50,flags:aC},Xh={type:16,number:100,flags:aC},gw=function(e,t,n){var r=e[0],i=e[1];return[pr(r,t),pr(typeof i<"u"?i:r,n)]},pr=function(e,t){if(e.type===16)return e.number/100*t;if(oC(e))switch(e.unit){case"rem":case"em":return 16*e.number;case"px":default:return e.number}return e.number},y0e="deg",v0e="grad",x0e="rad",w0e="turn",xT={name:"angle",parse:function(e,t){if(t.type===15)switch(t.unit){case y0e:return Math.PI*t.number/180;case v0e:return Math.PI/200*t.number;case x0e:return t.number;case w0e:return Math.PI*2*t.number}throw new Error("Unsupported angle type")}},b0e=function(e){return e.type===15&&(e.unit===y0e||e.unit===v0e||e.unit===x0e||e.unit===w0e)},C0e=function(e){var t=e.filter(er).map(function(n){return n.value}).join(" ");switch(t){case"to bottom right":case"to right bottom":case"left top":case"top left":return[Ns,Ns];case"to top":case"bottom":return pl(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[Ns,Xh];case"to right":case"left":return pl(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Xh,Xh];case"to bottom":case"top":return pl(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Xh,Ns];case"to left":case"right":return pl(270)}return 0},pl=function(e){return Math.PI*e/180},bf={name:"color",parse:function(e,t){if(t.type===18){var n=XBt[t.name];if(typeof n>"u")throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return n(e,t.values)}if(t.type===5){if(t.value.length===3){var r=t.value.substring(0,1),i=t.value.substring(1,2),s=t.value.substring(2,3);return Jh(parseInt(r+r,16),parseInt(i+i,16),parseInt(s+s,16),1)}if(t.value.length===4){var r=t.value.substring(0,1),i=t.value.substring(1,2),s=t.value.substring(2,3),a=t.value.substring(3,4);return Jh(parseInt(r+r,16),parseInt(i+i,16),parseInt(s+s,16),parseInt(a+a,16)/255)}if(t.value.length===6){var r=t.value.substring(0,2),i=t.value.substring(2,4),s=t.value.substring(4,6);return Jh(parseInt(r,16),parseInt(i,16),parseInt(s,16),1)}if(t.value.length===8){var r=t.value.substring(0,2),i=t.value.substring(2,4),s=t.value.substring(4,6),a=t.value.substring(6,8);return Jh(parseInt(r,16),parseInt(i,16),parseInt(s,16),parseInt(a,16)/255)}}if(t.type===20){var o=hd[t.value.toUpperCase()];if(typeof o<"u")return o}return hd.TRANSPARENT}},Cf=function(e){return(255&e)===0},Zi=function(e){var t=255&e,n=255&e>>8,r=255&e>>16,i=255&e>>24;return t<255?"rgba("+i+","+r+","+n+","+t/255+")":"rgb("+i+","+r+","+n+")"},Jh=function(e,t,n,r){return(e<<24|t<<16|n<<8|Math.round(r*255)<<0)>>>0},QZ=function(e,t){if(e.type===17)return e.number;if(e.type===16){var n=t===3?1:255;return t===3?e.number/100*n:Math.round(e.number/100*n)}return 0},$Z=function(e,t){var n=t.filter(Gv);if(n.length===3){var r=n.map(QZ),i=r[0],s=r[1],a=r[2];return Jh(i,s,a,1)}if(n.length===4){var o=n.map(QZ),i=o[0],s=o[1],a=o[2],c=o[3];return Jh(i,s,a,c)}return 0};function kO(e,t,n){return n<0&&(n+=1),n>=1&&(n-=1),n<1/6?(t-e)*n*6+e:n<1/2?t:n<2/3?(t-e)*6*(2/3-n)+e:e}var zZ=function(e,t){var n=t.filter(Gv),r=n[0],i=n[1],s=n[2],a=n[3],o=(r.type===17?pl(r.number):xT.parse(e,r))/(Math.PI*2),c=ji(i)?i.number/100:0,u=ji(s)?s.number/100:0,d=typeof a<"u"&&ji(a)?pr(a,1):1;if(c===0)return Jh(u*255,u*255,u*255,1);var h=u<=.5?u*(c+1):u+c-u*c,A=u*2-h,f=kO(A,h,o+1/3),p=kO(A,h,o),m=kO(A,h,o-1/3);return Jh(f*255,p*255,m*255,d)},XBt={hsl:zZ,hsla:zZ,rgb:$Z,rgba:$Z},ub=function(e,t){return bf.parse(e,p0e.create(t).parseComponentValue())},hd={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},JBt={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(n){if(er(n))switch(n.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},ZBt={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},wT=function(e,t){var n=bf.parse(e,t[0]),r=t[1];return r&&ji(r)?{color:n,stop:r}:{color:n,stop:null}},VZ=function(e,t){var n=e[0],r=e[e.length-1];n.stop===null&&(n.stop=Ns),r.stop===null&&(r.stop=Xh);for(var i=[],s=0,a=0;a<e.length;a++){var o=e[a].stop;if(o!==null){var c=pr(o,t);c>s?i.push(c):i.push(s),s=c}else i.push(null)}for(var u=null,a=0;a<i.length;a++){var d=i[a];if(d===null)u===null&&(u=a);else if(u!==null){for(var h=a-u,A=i[u-1],f=(d-A)/(h+1),p=1;p<=h;p++)i[u+p-1]=f*p;u=null}}return e.map(function(m,g){var y=m.color;return{color:y,stop:Math.max(Math.min(1,i[g]/t),0)}})},eNt=function(e,t,n){var r=t/2,i=n/2,s=pr(e[0],t)-r,a=i-pr(e[1],n);return(Math.atan2(a,s)+Math.PI*2)%(Math.PI*2)},tNt=function(e,t,n){var r=typeof e=="number"?e:eNt(e,t,n),i=Math.abs(t*Math.sin(r))+Math.abs(n*Math.cos(r)),s=t/2,a=n/2,o=i/2,c=Math.sin(r-Math.PI/2)*o,u=Math.cos(r-Math.PI/2)*o;return[i,s-u,s+u,a-c,a+c]},ql=function(e,t){return Math.sqrt(e*e+t*t)},KZ=function(e,t,n,r,i){var s=[[0,0],[0,t],[e,0],[e,t]];return s.reduce(function(a,o){var c=o[0],u=o[1],d=ql(n-c,r-u);return(i?d<a.optimumDistance:d>a.optimumDistance)?{optimumCorner:o,optimumDistance:d}:a},{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},nNt=function(e,t,n,r,i){var s=0,a=0;switch(e.size){case 0:e.shape===0?s=a=Math.min(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):e.shape===1&&(s=Math.min(Math.abs(t),Math.abs(t-r)),a=Math.min(Math.abs(n),Math.abs(n-i)));break;case 2:if(e.shape===0)s=a=Math.min(ql(t,n),ql(t,n-i),ql(t-r,n),ql(t-r,n-i));else if(e.shape===1){var o=Math.min(Math.abs(n),Math.abs(n-i))/Math.min(Math.abs(t),Math.abs(t-r)),c=KZ(r,i,t,n,!0),u=c[0],d=c[1];s=ql(u-t,(d-n)/o),a=o*s}break;case 1:e.shape===0?s=a=Math.max(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):e.shape===1&&(s=Math.max(Math.abs(t),Math.abs(t-r)),a=Math.max(Math.abs(n),Math.abs(n-i)));break;case 3:if(e.shape===0)s=a=Math.max(ql(t,n),ql(t,n-i),ql(t-r,n),ql(t-r,n-i));else if(e.shape===1){var o=Math.max(Math.abs(n),Math.abs(n-i))/Math.max(Math.abs(t),Math.abs(t-r)),h=KZ(r,i,t,n,!1),u=h[0],d=h[1];s=ql(u-t,(d-n)/o),a=o*s}break}return Array.isArray(e.size)&&(s=pr(e.size[0],r),a=e.size.length===2?pr(e.size[1],i):s),[s,a]},rNt=function(e,t){var n=pl(180),r=[];return xu(t).forEach(function(i,s){if(s===0){var a=i[0];if(a.type===20&&a.value==="to"){n=C0e(i);return}else if(b0e(a)){n=xT.parse(e,a);return}}var o=wT(e,i);r.push(o)}),{angle:n,stops:r,type:1}},Tk=function(e,t){var n=pl(180),r=[];return xu(t).forEach(function(i,s){if(s===0){var a=i[0];if(a.type===20&&["top","left","right","bottom"].indexOf(a.value)!==-1){n=C0e(i);return}else if(b0e(a)){n=(xT.parse(e,a)+pl(270))%pl(360);return}}var o=wT(e,i);r.push(o)}),{angle:n,stops:r,type:1}},iNt=function(e,t){var n=pl(180),r=[],i=1,s=0,a=3,o=[];return xu(t).forEach(function(c,u){var d=c[0];if(u===0){if(er(d)&&d.value==="linear"){i=1;return}else if(er(d)&&d.value==="radial"){i=2;return}}if(d.type===18){if(d.name==="from"){var h=bf.parse(e,d.values[0]);r.push({stop:Ns,color:h})}else if(d.name==="to"){var h=bf.parse(e,d.values[0]);r.push({stop:Xh,color:h})}else if(d.name==="color-stop"){var A=d.values.filter(Gv);if(A.length===2){var h=bf.parse(e,A[1]),f=A[0];R0(f)&&r.push({stop:{type:16,number:f.number*100,flags:f.flags},color:h})}}}}),i===1?{angle:(n+pl(180))%pl(360),stops:r,type:i}:{size:a,shape:s,stops:r,position:o,type:i}},S0e="closest-side",k0e="farthest-side",_0e="closest-corner",j0e="farthest-corner",B0e="circle",N0e="ellipse",E0e="cover",T0e="contain",sNt=function(e,t){var n=0,r=3,i=[],s=[];return xu(t).forEach(function(a,o){var c=!0;if(o===0){var u=!1;c=a.reduce(function(h,A){if(u)if(er(A))switch(A.value){case"center":return s.push(S$),h;case"top":case"left":return s.push(Ns),h;case"right":case"bottom":return s.push(Xh),h}else(ji(A)||Lf(A))&&s.push(A);else if(er(A))switch(A.value){case B0e:return n=0,!1;case N0e:return n=1,!1;case"at":return u=!0,!1;case S0e:return r=0,!1;case E0e:case k0e:return r=1,!1;case T0e:case _0e:return r=2,!1;case j0e:return r=3,!1}else if(Lf(A)||ji(A))return Array.isArray(r)||(r=[]),r.push(A),!1;return h},c)}if(c){var d=wT(e,a);i.push(d)}}),{size:r,shape:n,stops:i,position:s,type:2}},Pk=function(e,t){var n=0,r=3,i=[],s=[];return xu(t).forEach(function(a,o){var c=!0;if(o===0?c=a.reduce(function(d,h){if(er(h))switch(h.value){case"center":return s.push(S$),!1;case"top":case"left":return s.push(Ns),!1;case"right":case"bottom":return s.push(Xh),!1}else if(ji(h)||Lf(h))return s.push(h),!1;return d},c):o===1&&(c=a.reduce(function(d,h){if(er(h))switch(h.value){case B0e:return n=0,!1;case N0e:return n=1,!1;case T0e:case S0e:return r=0,!1;case k0e:return r=1,!1;case _0e:return r=2,!1;case E0e:case j0e:return r=3,!1}else if(Lf(h)||ji(h))return Array.isArray(r)||(r=[]),r.push(h),!1;return d},c)),c){var u=wT(e,a);i.push(u)}}),{size:r,shape:n,stops:i,position:s,type:2}},aNt=function(e){return e.type===1},oNt=function(e){return e.type===2},k$={name:"image",parse:function(e,t){if(t.type===22){var n={url:t.value,type:0};return e.cache.addImage(t.value),n}if(t.type===18){var r=P0e[t.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return r(e,t.values)}throw new Error("Unsupported image type "+t.type)}};function lNt(e){return!(e.type===20&&e.value==="none")&&(e.type!==18||!!P0e[e.name])}var P0e={"linear-gradient":rNt,"-moz-linear-gradient":Tk,"-ms-linear-gradient":Tk,"-o-linear-gradient":Tk,"-webkit-linear-gradient":Tk,"radial-gradient":sNt,"-moz-radial-gradient":Pk,"-ms-radial-gradient":Pk,"-o-radial-gradient":Pk,"-webkit-radial-gradient":Pk,"-webkit-gradient":iNt},cNt={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(t.length===0)return[];var n=t[0];return n.type===20&&n.value==="none"?[]:t.filter(function(r){return Gv(r)&&lNt(r)}).map(function(r){return k$.parse(e,r)})}},uNt={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map(function(n){if(er(n))switch(n.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},dNt={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return xu(t).map(function(n){return n.filter(ji)}).map(g0e)}},hNt={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return xu(t).map(function(n){return n.filter(er).map(function(r){return r.value}).join(" ")}).map(fNt)}},fNt=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},Hy;(function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"})(Hy||(Hy={}));var ANt={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return xu(t).map(function(n){return n.filter(pNt)})}},pNt=function(e){return er(e)||ji(e)},bT=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},mNt=bT("top"),gNt=bT("right"),yNt=bT("bottom"),vNt=bT("left"),CT=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(t,n){return g0e(n.filter(ji))}}},xNt=CT("top-left"),wNt=CT("top-right"),bNt=CT("bottom-right"),CNt=CT("bottom-left"),ST=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(t,n){switch(n){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},SNt=ST("top"),kNt=ST("right"),_Nt=ST("bottom"),jNt=ST("left"),kT=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(t,n){return oC(n)?n.number:0}}},BNt=kT("top"),NNt=kT("right"),ENt=kT("bottom"),TNt=kT("left"),PNt={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},INt={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){switch(t){case"rtl":return 1;case"ltr":default:return 0}}},ONt={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(er).reduce(function(n,r){return n|FNt(r.value)},0)}},FNt=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},MNt={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},LNt={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return t.type===20&&t.value==="normal"?0:t.type===17||t.type===15?t.number:0}},UN;(function(e){e.NORMAL="normal",e.STRICT="strict"})(UN||(UN={}));var RNt={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"strict":return UN.STRICT;case"normal":default:return UN.NORMAL}}},DNt={name:"line-height",initialValue:"normal",prefix:!1,type:4},qZ=function(e,t){return er(e)&&e.value==="normal"?1.2*t:e.type===17?t*e.number:ji(e)?pr(e,t):t},UNt={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return t.type===20&&t.value==="none"?null:k$.parse(e,t)}},HNt={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){switch(t){case"inside":return 0;case"outside":default:return 1}}},eD={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},_T=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},QNt=_T("top"),$Nt=_T("right"),zNt=_T("bottom"),VNt=_T("left"),KNt={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(er).map(function(n){switch(n.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},qNt={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-word":return"break-word";case"normal":default:return"normal"}}},jT=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},WNt=jT("top"),GNt=jT("right"),YNt=jT("bottom"),XNt=jT("left"),JNt={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},ZNt={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},eEt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.length===1&&ZR(t[0],"none")?[]:xu(t).map(function(n){for(var r={color:hd.TRANSPARENT,offsetX:Ns,offsetY:Ns,blur:Ns},i=0,s=0;s<n.length;s++){var a=n[s];Lf(a)?(i===0?r.offsetX=a:i===1?r.offsetY=a:r.blur=a,i++):r.color=bf.parse(e,a)}return r})}},tEt={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},nEt={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,t){if(t.type===20&&t.value==="none")return null;if(t.type===18){var n=sEt[t.name];if(typeof n>"u")throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return n(t.values)}return null}},rEt=function(e){var t=e.filter(function(n){return n.type===17}).map(function(n){return n.number});return t.length===6?t:null},iEt=function(e){var t=e.filter(function(c){return c.type===17}).map(function(c){return c.number}),n=t[0],r=t[1];t[2],t[3];var i=t[4],s=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var a=t[12],o=t[13];return t[14],t[15],t.length===16?[n,r,i,s,a,o]:null},sEt={matrix:rEt,matrix3d:iEt},WZ={type:16,number:50,flags:aC},aEt=[WZ,WZ],oEt={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var n=t.filter(ji);return n.length!==2?aEt:[n[0],n[1]]}},lEt={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},db;(function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"})(db||(db={}));var cEt={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return db.BREAK_ALL;case"keep-all":return db.KEEP_ALL;case"normal":default:return db.NORMAL}}},uEt={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(t.type===20)return{auto:!0,order:0};if(R0(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},I0e={name:"time",parse:function(e,t){if(t.type===15)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")}},dEt={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return R0(t)?t.number:1}},hEt={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},fEt={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter(er).map(function(n){switch(n.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(n){return n!==0})}},AEt={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,t){var n=[],r=[];return t.forEach(function(i){switch(i.type){case 20:case 0:n.push(i.value);break;case 17:n.push(i.number.toString());break;case 4:r.push(n.join(" ")),n.length=0;break}}),n.length&&r.push(n.join(" ")),r.map(function(i){return i.indexOf(" ")===-1?i:"'"+i+"'"})}},pEt={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},mEt={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){if(R0(t))return t.number;if(er(t))switch(t.value){case"bold":return 700;case"normal":default:return 400}return 400}},gEt={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(er).map(function(n){return n.value})}},yEt={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},Qi=function(e,t){return(e&t)!==0},vEt={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(t.length===0)return[];var n=t[0];return n.type===20&&n.value==="none"?[]:t}},xEt={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(t.length===0)return null;var n=t[0];if(n.type===20&&n.value==="none")return null;for(var r=[],i=t.filter(m0e),s=0;s<i.length;s++){var a=i[s],o=i[s+1];if(a.type===20){var c=o&&R0(o)?o.number:1;r.push({counter:a.value,increment:c})}}return r}},wEt={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(t.length===0)return[];for(var n=[],r=t.filter(m0e),i=0;i<r.length;i++){var s=r[i],a=r[i+1];if(er(s)&&s.value!=="none"){var o=a&&R0(a)?a.number:0;n.push({counter:s.value,reset:o})}}return n}},bEt={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(oC).map(function(n){return I0e.parse(e,n)})}},CEt={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(t.length===0)return null;var n=t[0];if(n.type===20&&n.value==="none")return null;var r=[],i=t.filter(GBt);if(i.length%2!==0)return null;for(var s=0;s<i.length;s+=2){var a=i[s].value,o=i[s+1].value;r.push({open:a,close:o})}return r}},GZ=function(e,t,n){if(!e)return"";var r=e[Math.min(t,e.length-1)];return r?n?r.open:r.close:""},SEt={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.length===1&&ZR(t[0],"none")?[]:xu(t).map(function(n){for(var r={color:255,offsetX:Ns,offsetY:Ns,blur:Ns,spread:Ns,inset:!1},i=0,s=0;s<n.length;s++){var a=n[s];ZR(a,"inset")?r.inset=!0:Lf(a)?(i===0?r.offsetX=a:i===1?r.offsetY=a:i===2?r.blur=a:r.spread=a,i++):r.color=bf.parse(e,a)}return r})}},kEt={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,t){var n=[0,1,2],r=[];return t.filter(er).forEach(function(i){switch(i.value){case"stroke":r.push(1);break;case"fill":r.push(0);break;case"markers":r.push(2);break}}),n.forEach(function(i){r.indexOf(i)===-1&&r.push(i)}),r}},_Et={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},jEt={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return oC(t)?t.number:0}},BEt=function(){function e(t,n){var r,i;this.animationDuration=ot(t,bEt,n.animationDuration),this.backgroundClip=ot(t,JBt,n.backgroundClip),this.backgroundColor=ot(t,ZBt,n.backgroundColor),this.backgroundImage=ot(t,cNt,n.backgroundImage),this.backgroundOrigin=ot(t,uNt,n.backgroundOrigin),this.backgroundPosition=ot(t,dNt,n.backgroundPosition),this.backgroundRepeat=ot(t,hNt,n.backgroundRepeat),this.backgroundSize=ot(t,ANt,n.backgroundSize),this.borderTopColor=ot(t,mNt,n.borderTopColor),this.borderRightColor=ot(t,gNt,n.borderRightColor),this.borderBottomColor=ot(t,yNt,n.borderBottomColor),this.borderLeftColor=ot(t,vNt,n.borderLeftColor),this.borderTopLeftRadius=ot(t,xNt,n.borderTopLeftRadius),this.borderTopRightRadius=ot(t,wNt,n.borderTopRightRadius),this.borderBottomRightRadius=ot(t,bNt,n.borderBottomRightRadius),this.borderBottomLeftRadius=ot(t,CNt,n.borderBottomLeftRadius),this.borderTopStyle=ot(t,SNt,n.borderTopStyle),this.borderRightStyle=ot(t,kNt,n.borderRightStyle),this.borderBottomStyle=ot(t,_Nt,n.borderBottomStyle),this.borderLeftStyle=ot(t,jNt,n.borderLeftStyle),this.borderTopWidth=ot(t,BNt,n.borderTopWidth),this.borderRightWidth=ot(t,NNt,n.borderRightWidth),this.borderBottomWidth=ot(t,ENt,n.borderBottomWidth),this.borderLeftWidth=ot(t,TNt,n.borderLeftWidth),this.boxShadow=ot(t,SEt,n.boxShadow),this.color=ot(t,PNt,n.color),this.direction=ot(t,INt,n.direction),this.display=ot(t,ONt,n.display),this.float=ot(t,MNt,n.cssFloat),this.fontFamily=ot(t,AEt,n.fontFamily),this.fontSize=ot(t,pEt,n.fontSize),this.fontStyle=ot(t,yEt,n.fontStyle),this.fontVariant=ot(t,gEt,n.fontVariant),this.fontWeight=ot(t,mEt,n.fontWeight),this.letterSpacing=ot(t,LNt,n.letterSpacing),this.lineBreak=ot(t,RNt,n.lineBreak),this.lineHeight=ot(t,DNt,n.lineHeight),this.listStyleImage=ot(t,UNt,n.listStyleImage),this.listStylePosition=ot(t,HNt,n.listStylePosition),this.listStyleType=ot(t,eD,n.listStyleType),this.marginTop=ot(t,QNt,n.marginTop),this.marginRight=ot(t,$Nt,n.marginRight),this.marginBottom=ot(t,zNt,n.marginBottom),this.marginLeft=ot(t,VNt,n.marginLeft),this.opacity=ot(t,dEt,n.opacity);var s=ot(t,KNt,n.overflow);this.overflowX=s[0],this.overflowY=s[s.length>1?1:0],this.overflowWrap=ot(t,qNt,n.overflowWrap),this.paddingTop=ot(t,WNt,n.paddingTop),this.paddingRight=ot(t,GNt,n.paddingRight),this.paddingBottom=ot(t,YNt,n.paddingBottom),this.paddingLeft=ot(t,XNt,n.paddingLeft),this.paintOrder=ot(t,kEt,n.paintOrder),this.position=ot(t,ZNt,n.position),this.textAlign=ot(t,JNt,n.textAlign),this.textDecorationColor=ot(t,hEt,(r=n.textDecorationColor)!==null&&r!==void 0?r:n.color),this.textDecorationLine=ot(t,fEt,(i=n.textDecorationLine)!==null&&i!==void 0?i:n.textDecoration),this.textShadow=ot(t,eEt,n.textShadow),this.textTransform=ot(t,tEt,n.textTransform),this.transform=ot(t,nEt,n.transform),this.transformOrigin=ot(t,oEt,n.transformOrigin),this.visibility=ot(t,lEt,n.visibility),this.webkitTextStrokeColor=ot(t,_Et,n.webkitTextStrokeColor),this.webkitTextStrokeWidth=ot(t,jEt,n.webkitTextStrokeWidth),this.wordBreak=ot(t,cEt,n.wordBreak),this.zIndex=ot(t,uEt,n.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},e.prototype.isTransparent=function(){return Cf(this.backgroundColor)},e.prototype.isTransformed=function(){return this.transform!==null},e.prototype.isPositioned=function(){return this.position!==0},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return this.float!==0},e.prototype.isInlineLevel=function(){return Qi(this.display,4)||Qi(this.display,33554432)||Qi(this.display,268435456)||Qi(this.display,536870912)||Qi(this.display,67108864)||Qi(this.display,134217728)},e}(),NEt=function(){function e(t,n){this.content=ot(t,vEt,n.content),this.quotes=ot(t,CEt,n.quotes)}return e}(),YZ=function(){function e(t,n){this.counterIncrement=ot(t,xEt,n.counterIncrement),this.counterReset=ot(t,wEt,n.counterReset)}return e}(),ot=function(e,t,n){var r=new A0e,i=n!==null&&typeof n<"u"?n.toString():t.initialValue;r.write(i);var s=new p0e(r.read());switch(t.type){case 2:var a=s.parseComponentValue();return t.parse(e,er(a)?a.value:t.initialValue);case 0:return t.parse(e,s.parseComponentValue());case 1:return t.parse(e,s.parseComponentValues());case 4:return s.parseComponentValue();case 3:switch(t.format){case"angle":return xT.parse(e,s.parseComponentValue());case"color":return bf.parse(e,s.parseComponentValue());case"image":return k$.parse(e,s.parseComponentValue());case"length":var o=s.parseComponentValue();return Lf(o)?o:Ns;case"length-percentage":var c=s.parseComponentValue();return ji(c)?c:Ns;case"time":return I0e.parse(e,s.parseComponentValue())}break}},EEt="data-html2canvas-debug",TEt=function(e){var t=e.getAttribute(EEt);switch(t){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},tD=function(e,t){var n=TEt(e);return n===1||t===n},wu=function(){function e(t,n){if(this.context=t,this.textNodes=[],this.elements=[],this.flags=0,tD(n,3))debugger;this.styles=new BEt(t,window.getComputedStyle(n,null)),iD(n)&&(this.styles.animationDuration.some(function(r){return r>0})&&(n.style.animationDuration="0s"),this.styles.transform!==null&&(n.style.transform="none")),this.bounds=yT(this.context,n),tD(n,4)&&(this.flags|=16)}return e}(),PEt="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",XZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",yw=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Ik=0;Ik<XZ.length;Ik++)yw[XZ.charCodeAt(Ik)]=Ik;var IEt=function(e){var t=e.length*.75,n=e.length,r,i=0,s,a,o,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var u=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(t):new Array(t),d=Array.isArray(u)?u:new Uint8Array(u);for(r=0;r<n;r+=4)s=yw[e.charCodeAt(r)],a=yw[e.charCodeAt(r+1)],o=yw[e.charCodeAt(r+2)],c=yw[e.charCodeAt(r+3)],d[i++]=s<<2|a>>4,d[i++]=(a&15)<<4|o>>2,d[i++]=(o&3)<<6|c&63;return u},OEt=function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n.push(e[r+1]<<8|e[r]);return n},FEt=function(e){for(var t=e.length,n=[],r=0;r<t;r+=4)n.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return n},Mp=5,_$=11,_O=2,MEt=_$-Mp,O0e=65536>>Mp,LEt=1<<Mp,jO=LEt-1,REt=1024>>Mp,DEt=O0e+REt,UEt=DEt,HEt=32,QEt=UEt+HEt,$Et=65536>>_$,zEt=1<<MEt,VEt=zEt-1,JZ=function(e,t,n){return e.slice?e.slice(t,n):new Uint16Array(Array.prototype.slice.call(e,t,n))},KEt=function(e,t,n){return e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n))},qEt=function(e,t){var n=IEt(e),r=Array.isArray(n)?FEt(n):new Uint32Array(n),i=Array.isArray(n)?OEt(n):new Uint16Array(n),s=24,a=JZ(i,s/2,r[4]/2),o=r[5]===2?JZ(i,(s+r[4])/2):KEt(r,Math.ceil((s+r[4])/4));return new WEt(r[0],r[1],r[2],r[3],a,o)},WEt=function(){function e(t,n,r,i,s,a){this.initialValue=t,this.errorValue=n,this.highStart=r,this.highValueIndex=i,this.index=s,this.data=a}return e.prototype.get=function(t){var n;if(t>=0){if(t<55296||t>56319&&t<=65535)return n=this.index[t>>Mp],n=(n<<_O)+(t&jO),this.data[n];if(t<=65535)return n=this.index[O0e+(t-55296>>Mp)],n=(n<<_O)+(t&jO),this.data[n];if(t<this.highStart)return n=QEt-$Et+(t>>_$),n=this.index[n],n+=t>>Mp&VEt,n=this.index[n],n=(n<<_O)+(t&jO),this.data[n];if(t<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),ZZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",GEt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Ok=0;Ok<ZZ.length;Ok++)GEt[ZZ.charCodeAt(Ok)]=Ok;var YEt=1,BO=2,NO=3,eee=4,tee=5,XEt=7,nee=8,EO=9,TO=10,ree=11,iee=12,see=13,aee=14,PO=15,JEt=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var s=e.charCodeAt(n++);(s&64512)===56320?t.push(((i&1023)<<10)+(s&1023)+65536):(t.push(i),n--)}else t.push(i)}return t},ZEt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var n=e.length;if(!n)return"";for(var r=[],i=-1,s="";++i<n;){var a=e[i];a<=65535?r.push(a):(a-=65536,r.push((a>>10)+55296,a%1024+56320)),(i+1===n||r.length>16384)&&(s+=String.fromCharCode.apply(String,r),r.length=0)}return s},e5t=qEt(PEt),tl="×",IO="÷",t5t=function(e){return e5t.get(e)},n5t=function(e,t,n){var r=n-2,i=t[r],s=t[n-1],a=t[n];if(s===BO&&a===NO)return tl;if(s===BO||s===NO||s===eee||a===BO||a===NO||a===eee)return IO;if(s===nee&&[nee,EO,ree,iee].indexOf(a)!==-1||(s===ree||s===EO)&&(a===EO||a===TO)||(s===iee||s===TO)&&a===TO||a===see||a===tee||a===XEt||s===YEt)return tl;if(s===see&&a===aee){for(;i===tee;)i=t[--r];if(i===aee)return tl}if(s===PO&&a===PO){for(var o=0;i===PO;)o++,i=t[--r];if(o%2===0)return tl}return IO},r5t=function(e){var t=JEt(e),n=t.length,r=0,i=0,s=t.map(t5t);return{next:function(){if(r>=n)return{done:!0,value:null};for(var a=tl;r<n&&(a=n5t(t,s,++r))===tl;);if(a!==tl||r===n){var o=ZEt.apply(null,t.slice(i,r));return i=r,{value:o,done:!1}}return{done:!0,value:null}}}},i5t=function(e){for(var t=r5t(e),n=[],r;!(r=t.next()).done;)r.value&&n.push(r.value.slice());return n},s5t=function(e){var t=123;if(e.createRange){var n=e.createRange();if(n.getBoundingClientRect){var r=e.createElement("boundtest");r.style.height=t+"px",r.style.display="block",e.body.appendChild(r),n.selectNode(r);var i=n.getBoundingClientRect(),s=Math.round(i.height);if(e.body.removeChild(r),s===t)return!0}}return!1},a5t=function(e){var t=e.createElement("boundtest");t.style.width="50px",t.style.display="block",t.style.fontSize="12px",t.style.letterSpacing="0px",t.style.wordSpacing="0px",e.body.appendChild(t);var n=e.createRange();t.innerHTML=typeof"".repeat=="function"?"&#128104;".repeat(10):"";var r=t.firstChild,i=vT(r.data).map(function(c){return di(c)}),s=0,a={},o=i.every(function(c,u){n.setStart(r,s),n.setEnd(r,s+c.length);var d=n.getBoundingClientRect();s+=c.length;var h=d.x>a.x||d.y>a.y;return a=d,u===0?!0:h});return e.body.removeChild(t),o},o5t=function(){return typeof new Image().crossOrigin<"u"},l5t=function(){return typeof new XMLHttpRequest().responseType=="string"},c5t=function(e){var t=new Image,n=e.createElement("canvas"),r=n.getContext("2d");if(!r)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(t,0,0),n.toDataURL()}catch{return!1}return!0},oee=function(e){return e[0]===0&&e[1]===255&&e[2]===0&&e[3]===255},u5t=function(e){var t=e.createElement("canvas"),n=100;t.width=n,t.height=n;var r=t.getContext("2d");if(!r)return Promise.reject(!1);r.fillStyle="rgb(0, 255, 0)",r.fillRect(0,0,n,n);var i=new Image,s=t.toDataURL();i.src=s;var a=nD(n,n,0,0,i);return r.fillStyle="red",r.fillRect(0,0,n,n),lee(a).then(function(o){r.drawImage(o,0,0);var c=r.getImageData(0,0,n,n).data;r.fillStyle="red",r.fillRect(0,0,n,n);var u=e.createElement("div");return u.style.backgroundImage="url("+s+")",u.style.height=n+"px",oee(c)?lee(nD(n,n,0,0,u)):Promise.reject(!1)}).then(function(o){return r.drawImage(o,0,0),oee(r.getImageData(0,0,n,n).data)}).catch(function(){return!1})},nD=function(e,t,n,r,i){var s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),o=document.createElementNS(s,"foreignObject");return a.setAttributeNS(null,"width",e.toString()),a.setAttributeNS(null,"height",t.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",n.toString()),o.setAttributeNS(null,"y",r.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),a.appendChild(o),o.appendChild(i),a},lee=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){return t(r)},r.onerror=n,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},Ss={get SUPPORT_RANGE_BOUNDS(){var e=s5t(document);return Object.defineProperty(Ss,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=Ss.SUPPORT_RANGE_BOUNDS&&a5t(document);return Object.defineProperty(Ss,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=c5t(document);return Object.defineProperty(Ss,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e=typeof Array.from=="function"&&typeof window.fetch=="function"?u5t(document):Promise.resolve(!1);return Object.defineProperty(Ss,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=o5t();return Object.defineProperty(Ss,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=l5t();return Object.defineProperty(Ss,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Ss,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(Ss,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},hb=function(){function e(t,n){this.text=t,this.bounds=n}return e}(),d5t=function(e,t,n,r){var i=A5t(t,n),s=[],a=0;return i.forEach(function(o){if(n.textDecorationLine.length||o.trim().length>0)if(Ss.SUPPORT_RANGE_BOUNDS){var c=cee(r,a,o.length).getClientRects();if(c.length>1){var u=j$(o),d=0;u.forEach(function(A){s.push(new hb(A,_d.fromDOMRectList(e,cee(r,d+a,A.length).getClientRects()))),d+=A.length})}else s.push(new hb(o,_d.fromDOMRectList(e,c)))}else{var h=r.splitText(o.length);s.push(new hb(o,h5t(e,r))),r=h}else Ss.SUPPORT_RANGE_BOUNDS||(r=r.splitText(o.length));a+=o.length}),s},h5t=function(e,t){var n=t.ownerDocument;if(n){var r=n.createElement("html2canvaswrapper");r.appendChild(t.cloneNode(!0));var i=t.parentNode;if(i){i.replaceChild(r,t);var s=yT(e,r);return r.firstChild&&i.replaceChild(r.firstChild,r),s}}return _d.EMPTY},cee=function(e,t,n){var r=e.ownerDocument;if(!r)throw new Error("Node has no owner document");var i=r.createRange();return i.setStart(e,t),i.setEnd(e,t+n),i},j$=function(e){if(Ss.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map(function(n){return n.segment})}return i5t(e)},f5t=function(e,t){if(Ss.SUPPORT_NATIVE_TEXT_SEGMENTATION){var n=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(n.segment(e)).map(function(r){return r.segment})}return m5t(e,t)},A5t=function(e,t){return t.letterSpacing!==0?j$(e):f5t(e,t)},p5t=[32,160,4961,65792,65793,4153,4241],m5t=function(e,t){for(var n=$jt(e,{lineBreak:t.lineBreak,wordBreak:t.overflowWrap==="break-word"?"break-word":t.wordBreak}),r=[],i,s=function(){if(i.value){var a=i.value.slice(),o=vT(a),c="";o.forEach(function(u){p5t.indexOf(u)===-1?c+=di(u):(c.length&&r.push(c),r.push(di(u)),c="")}),c.length&&r.push(c)}};!(i=n.next()).done;)s();return r},g5t=function(){function e(t,n,r){this.text=y5t(n.data,r.textTransform),this.textBounds=d5t(t,this.text,r,n)}return e}(),y5t=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(v5t,x5t);case 2:return e.toUpperCase();default:return e}},v5t=/(^|\s|:|-|\(|\))([a-z])/g,x5t=function(e,t,n){return e.length>0?t+n.toUpperCase():e},F0e=function(e){jc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.src=r.currentSrc||r.src,i.intrinsicWidth=r.naturalWidth,i.intrinsicHeight=r.naturalHeight,i.context.cache.addImage(i.src),i}return t}(wu),M0e=function(e){jc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.canvas=r,i.intrinsicWidth=r.width,i.intrinsicHeight=r.height,i}return t}(wu),L0e=function(e){jc(t,e);function t(n,r){var i=e.call(this,n,r)||this,s=new XMLSerializer,a=yT(n,r);return r.setAttribute("width",a.width+"px"),r.setAttribute("height",a.height+"px"),i.svg="data:image/svg+xml,"+encodeURIComponent(s.serializeToString(r)),i.intrinsicWidth=r.width.baseVal.value,i.intrinsicHeight=r.height.baseVal.value,i.context.cache.addImage(i.svg),i}return t}(wu),R0e=function(e){jc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.value=r.value,i}return t}(wu),rD=function(e){jc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.start=r.start,i.reversed=typeof r.reversed=="boolean"&&r.reversed===!0,i}return t}(wu),w5t=[{type:15,flags:0,unit:"px",number:3}],b5t=[{type:16,flags:0,number:50}],C5t=function(e){return e.width>e.height?new _d(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new _d(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e},S5t=function(e){var t=e.type===k5t?new Array(e.value.length+1).join("•"):e.value;return t.length===0?e.placeholder||"":t},HN="checkbox",QN="radio",k5t="password",uee=707406591,B$=function(e){jc(t,e);function t(n,r){var i=e.call(this,n,r)||this;switch(i.type=r.type.toLowerCase(),i.checked=r.checked,i.value=S5t(r),(i.type===HN||i.type===QN)&&(i.styles.backgroundColor=3739148031,i.styles.borderTopColor=i.styles.borderRightColor=i.styles.borderBottomColor=i.styles.borderLeftColor=2779096575,i.styles.borderTopWidth=i.styles.borderRightWidth=i.styles.borderBottomWidth=i.styles.borderLeftWidth=1,i.styles.borderTopStyle=i.styles.borderRightStyle=i.styles.borderBottomStyle=i.styles.borderLeftStyle=1,i.styles.backgroundClip=[0],i.styles.backgroundOrigin=[0],i.bounds=C5t(i.bounds)),i.type){case HN:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=w5t;break;case QN:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=b5t;break}return i}return t}(wu),D0e=function(e){jc(t,e);function t(n,r){var i=e.call(this,n,r)||this,s=r.options[r.selectedIndex||0];return i.value=s&&s.text||"",i}return t}(wu),U0e=function(e){jc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.value=r.value,i}return t}(wu),H0e=function(e){jc(t,e);function t(n,r){var i=e.call(this,n,r)||this;i.src=r.src,i.width=parseInt(r.width,10)||0,i.height=parseInt(r.height,10)||0,i.backgroundColor=i.styles.backgroundColor;try{if(r.contentWindow&&r.contentWindow.document&&r.contentWindow.document.documentElement){i.tree=$0e(n,r.contentWindow.document.documentElement);var s=r.contentWindow.document.documentElement?ub(n,getComputedStyle(r.contentWindow.document.documentElement).backgroundColor):hd.TRANSPARENT,a=r.contentWindow.document.body?ub(n,getComputedStyle(r.contentWindow.document.body).backgroundColor):hd.TRANSPARENT;i.backgroundColor=Cf(s)?Cf(a)?i.styles.backgroundColor:a:s}}catch{}return i}return t}(wu),_5t=["OL","UL","MENU"],I_=function(e,t,n,r){for(var i=t.firstChild,s=void 0;i;i=s)if(s=i.nextSibling,z0e(i)&&i.data.trim().length>0)n.textNodes.push(new g5t(e,i,n.styles));else if(dy(i))if(W0e(i)&&i.assignedNodes)i.assignedNodes().forEach(function(o){return I_(e,o,n,r)});else{var a=Q0e(e,i);a.styles.isVisible()&&(j5t(i,a,r)?a.flags|=4:B5t(a.styles)&&(a.flags|=2),_5t.indexOf(i.tagName)!==-1&&(a.flags|=8),n.elements.push(a),i.slot,i.shadowRoot?I_(e,i.shadowRoot,a,r):!$N(i)&&!V0e(i)&&!zN(i)&&I_(e,i,a,r))}},Q0e=function(e,t){return sD(t)?new F0e(e,t):K0e(t)?new M0e(e,t):V0e(t)?new L0e(e,t):N5t(t)?new R0e(e,t):E5t(t)?new rD(e,t):T5t(t)?new B$(e,t):zN(t)?new D0e(e,t):$N(t)?new U0e(e,t):q0e(t)?new H0e(e,t):new wu(e,t)},$0e=function(e,t){var n=Q0e(e,t);return n.flags|=4,I_(e,t,n,n),n},j5t=function(e,t,n){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||N$(e)&&n.styles.isTransparent()},B5t=function(e){return e.isPositioned()||e.isFloating()},z0e=function(e){return e.nodeType===Node.TEXT_NODE},dy=function(e){return e.nodeType===Node.ELEMENT_NODE},iD=function(e){return dy(e)&&typeof e.style<"u"&&!O_(e)},O_=function(e){return typeof e.className=="object"},N5t=function(e){return e.tagName==="LI"},E5t=function(e){return e.tagName==="OL"},T5t=function(e){return e.tagName==="INPUT"},P5t=function(e){return e.tagName==="HTML"},V0e=function(e){return e.tagName==="svg"},N$=function(e){return e.tagName==="BODY"},K0e=function(e){return e.tagName==="CANVAS"},dee=function(e){return e.tagName==="VIDEO"},sD=function(e){return e.tagName==="IMG"},q0e=function(e){return e.tagName==="IFRAME"},hee=function(e){return e.tagName==="STYLE"},I5t=function(e){return e.tagName==="SCRIPT"},$N=function(e){return e.tagName==="TEXTAREA"},zN=function(e){return e.tagName==="SELECT"},W0e=function(e){return e.tagName==="SLOT"},fee=function(e){return e.tagName.indexOf("-")>0},O5t=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(t){var n=this.counters[t];return n&&n.length?n[n.length-1]:1},e.prototype.getCounterValues=function(t){var n=this.counters[t];return n||[]},e.prototype.pop=function(t){var n=this;t.forEach(function(r){return n.counters[r].pop()})},e.prototype.parse=function(t){var n=this,r=t.counterIncrement,i=t.counterReset,s=!0;r!==null&&r.forEach(function(o){var c=n.counters[o.counter];c&&o.increment!==0&&(s=!1,c.length||c.push(1),c[Math.max(0,c.length-1)]+=o.increment)});var a=[];return s&&i.forEach(function(o){var c=n.counters[o.counter];a.push(o.counter),c||(c=n.counters[o.counter]=[]),c.push(o.reset)}),a},e}(),Aee={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},pee={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},F5t={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},M5t={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Ng=function(e,t,n,r,i,s){return e<t||e>n?l2(e,i,s.length>0):r.integers.reduce(function(a,o,c){for(;e>=o;)e-=o,a+=r.values[c];return a},"")+s},G0e=function(e,t,n,r){var i="";do n||e--,i=r(e)+i,e/=t;while(e*t>=t);return i},ui=function(e,t,n,r,i){var s=n-t+1;return(e<0?"-":"")+(G0e(Math.abs(e),s,r,function(a){return di(Math.floor(a%s)+t)})+i)},PA=function(e,t,n){n===void 0&&(n=". ");var r=t.length;return G0e(Math.abs(e),r,!1,function(i){return t[Math.floor(i%r)]})+n},Hg=1,hh=2,fh=4,vw=8,Qu=function(e,t,n,r,i,s){if(e<-9999||e>9999)return l2(e,4,i.length>0);var a=Math.abs(e),o=i;if(a===0)return t[0]+o;for(var c=0;a>0&&c<=4;c++){var u=a%10;u===0&&Qi(s,Hg)&&o!==""?o=t[u]+o:u>1||u===1&&c===0||u===1&&c===1&&Qi(s,hh)||u===1&&c===1&&Qi(s,fh)&&e>100||u===1&&c>1&&Qi(s,vw)?o=t[u]+(c>0?n[c-1]:"")+o:u===1&&c>0&&(o=n[c-1]+o),a=Math.floor(a/10)}return(e<0?r:"")+o},mee="十百千萬",gee="拾佰仟萬",yee="マイナス",OO="마이너스",l2=function(e,t,n){var r=n?". ":"",i=n?"、":"",s=n?", ":"",a=n?" ":"";switch(t){case 0:return"•"+a;case 1:return"◦"+a;case 2:return"◾"+a;case 5:var o=ui(e,48,57,!0,r);return o.length<4?"0"+o:o;case 4:return PA(e,"〇一二三四五六七八九",i);case 6:return Ng(e,1,3999,Aee,3,r).toLowerCase();case 7:return Ng(e,1,3999,Aee,3,r);case 8:return ui(e,945,969,!1,r);case 9:return ui(e,97,122,!1,r);case 10:return ui(e,65,90,!1,r);case 11:return ui(e,1632,1641,!0,r);case 12:case 49:return Ng(e,1,9999,pee,3,r);case 35:return Ng(e,1,9999,pee,3,r).toLowerCase();case 13:return ui(e,2534,2543,!0,r);case 14:case 30:return ui(e,6112,6121,!0,r);case 15:return PA(e,"子丑寅卯辰巳午未申酉戌亥",i);case 16:return PA(e,"甲乙丙丁戊己庚辛壬癸",i);case 17:case 48:return Qu(e,"零一二三四五六七八九",mee,"負",i,hh|fh|vw);case 47:return Qu(e,"零壹貳參肆伍陸柒捌玖",gee,"負",i,Hg|hh|fh|vw);case 42:return Qu(e,"零一二三四五六七八九",mee,"负",i,hh|fh|vw);case 41:return Qu(e,"零壹贰叁肆伍陆柒捌玖",gee,"负",i,Hg|hh|fh|vw);case 26:return Qu(e,"〇一二三四五六七八九","十百千万",yee,i,0);case 25:return Qu(e,"零壱弐参四伍六七八九","拾百千万",yee,i,Hg|hh|fh);case 31:return Qu(e,"영일이삼사오육칠팔구","십백천만",OO,s,Hg|hh|fh);case 33:return Qu(e,"零一二三四五六七八九","十百千萬",OO,s,0);case 32:return Qu(e,"零壹貳參四五六七八九","拾百千",OO,s,Hg|hh|fh);case 18:return ui(e,2406,2415,!0,r);case 20:return Ng(e,1,19999,M5t,3,r);case 21:return ui(e,2790,2799,!0,r);case 22:return ui(e,2662,2671,!0,r);case 22:return Ng(e,1,10999,F5t,3,r);case 23:return PA(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return PA(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return ui(e,3302,3311,!0,r);case 28:return PA(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",i);case 29:return PA(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",i);case 34:return ui(e,3792,3801,!0,r);case 37:return ui(e,6160,6169,!0,r);case 38:return ui(e,4160,4169,!0,r);case 39:return ui(e,2918,2927,!0,r);case 40:return ui(e,1776,1785,!0,r);case 43:return ui(e,3046,3055,!0,r);case 44:return ui(e,3174,3183,!0,r);case 45:return ui(e,3664,3673,!0,r);case 46:return ui(e,3872,3881,!0,r);case 3:default:return ui(e,48,57,!0,r)}},Y0e="data-html2canvas-ignore",vee=function(){function e(t,n,r){if(this.context=t,this.options=r,this.scrolledElements=[],this.referenceElement=n,this.counters=new O5t,this.quoteDepth=0,!n.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(n.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(t,n){var r=this,i=L5t(t,n);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var s=t.defaultView.pageXOffset,a=t.defaultView.pageYOffset,o=i.contentWindow,c=o.document,u=U5t(i).then(function(){return pa(r,void 0,void 0,function(){var d,h;return Ks(this,function(A){switch(A.label){case 0:return this.scrolledElements.forEach(z5t),o&&(o.scrollTo(n.left,n.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(o.scrollY!==n.top||o.scrollX!==n.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(o.scrollX-n.left,o.scrollY-n.top,0,0))),d=this.options.onclone,h=this.clonedReferenceElement,typeof h>"u"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:c.fonts&&c.fonts.ready?[4,c.fonts.ready]:[3,2];case 1:A.sent(),A.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,D5t(c)]:[3,4];case 3:A.sent(),A.label=4;case 4:return typeof d=="function"?[2,Promise.resolve().then(function(){return d(c,h)}).then(function(){return i})]:[2,i]}})})});return c.open(),c.write(Q5t(document.doctype)+"<html></html>"),$5t(this.referenceElement.ownerDocument,s,a),c.replaceChild(c.adoptNode(this.documentElement),c.documentElement),c.close(),u},e.prototype.createElementClone=function(t){if(tD(t,2))debugger;if(K0e(t))return this.createCanvasClone(t);if(dee(t))return this.createVideoClone(t);if(hee(t))return this.createStyleClone(t);var n=t.cloneNode(!1);return sD(n)&&(sD(t)&&t.currentSrc&&t.currentSrc!==t.src&&(n.src=t.currentSrc,n.srcset=""),n.loading==="lazy"&&(n.loading="eager")),fee(n)?this.createCustomElementClone(n):n},e.prototype.createCustomElementClone=function(t){var n=document.createElement("html2canvascustomelement");return FO(t.style,n),n},e.prototype.createStyleClone=function(t){try{var n=t.sheet;if(n&&n.cssRules){var r=[].slice.call(n.cssRules,0).reduce(function(s,a){return a&&typeof a.cssText=="string"?s+a.cssText:s},""),i=t.cloneNode(!1);return i.textContent=r,i}}catch(s){if(this.context.logger.error("Unable to access cssRules property",s),s.name!=="SecurityError")throw s}return t.cloneNode(!1)},e.prototype.createCanvasClone=function(t){var n;if(this.options.inlineImages&&t.ownerDocument){var r=t.ownerDocument.createElement("img");try{return r.src=t.toDataURL(),r}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",t)}}var i=t.cloneNode(!1);try{i.width=t.width,i.height=t.height;var s=t.getContext("2d"),a=i.getContext("2d");if(a)if(!this.options.allowTaint&&s)a.putImageData(s.getImageData(0,0,t.width,t.height),0,0);else{var o=(n=t.getContext("webgl2"))!==null&&n!==void 0?n:t.getContext("webgl");if(o){var c=o.getContextAttributes();(c==null?void 0:c.preserveDrawingBuffer)===!1&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",t)}a.drawImage(t,0,0)}return i}catch{this.context.logger.info("Unable to clone canvas as it is tainted",t)}return i},e.prototype.createVideoClone=function(t){var n=t.ownerDocument.createElement("canvas");n.width=t.offsetWidth,n.height=t.offsetHeight;var r=n.getContext("2d");try{return r&&(r.drawImage(t,0,0,n.width,n.height),this.options.allowTaint||r.getImageData(0,0,n.width,n.height)),n}catch{this.context.logger.info("Unable to clone video as it is tainted",t)}var i=t.ownerDocument.createElement("canvas");return i.width=t.offsetWidth,i.height=t.offsetHeight,i},e.prototype.appendChildNode=function(t,n,r){(!dy(n)||!I5t(n)&&!n.hasAttribute(Y0e)&&(typeof this.options.ignoreElements!="function"||!this.options.ignoreElements(n)))&&(!this.options.copyStyles||!dy(n)||!hee(n))&&t.appendChild(this.cloneNode(n,r))},e.prototype.cloneChildNodes=function(t,n,r){for(var i=this,s=t.shadowRoot?t.shadowRoot.firstChild:t.firstChild;s;s=s.nextSibling)if(dy(s)&&W0e(s)&&typeof s.assignedNodes=="function"){var a=s.assignedNodes();a.length&&a.forEach(function(o){return i.appendChildNode(n,o,r)})}else this.appendChildNode(n,s,r)},e.prototype.cloneNode=function(t,n){if(z0e(t))return document.createTextNode(t.data);if(!t.ownerDocument)return t.cloneNode(!1);var r=t.ownerDocument.defaultView;if(r&&dy(t)&&(iD(t)||O_(t))){var i=this.createElementClone(t);i.style.transitionProperty="none";var s=r.getComputedStyle(t),a=r.getComputedStyle(t,":before"),o=r.getComputedStyle(t,":after");this.referenceElement===t&&iD(i)&&(this.clonedReferenceElement=i),N$(i)&&q5t(i);var c=this.counters.parse(new YZ(this.context,s)),u=this.resolvePseudoContent(t,i,a,fb.BEFORE);fee(t)&&(n=!0),dee(t)||this.cloneChildNodes(t,i,n),u&&i.insertBefore(u,i.firstChild);var d=this.resolvePseudoContent(t,i,o,fb.AFTER);return d&&i.appendChild(d),this.counters.pop(c),(s&&(this.options.copyStyles||O_(t))&&!q0e(t)||n)&&FO(s,i),(t.scrollTop!==0||t.scrollLeft!==0)&&this.scrolledElements.push([i,t.scrollLeft,t.scrollTop]),($N(t)||zN(t))&&($N(i)||zN(i))&&(i.value=t.value),i}return t.cloneNode(!1)},e.prototype.resolvePseudoContent=function(t,n,r,i){var s=this;if(r){var a=r.content,o=n.ownerDocument;if(!(!o||!a||a==="none"||a==="-moz-alt-content"||r.display==="none")){this.counters.parse(new YZ(this.context,r));var c=new NEt(this.context,r),u=o.createElement("html2canvaspseudoelement");FO(r,u),c.content.forEach(function(h){if(h.type===0)u.appendChild(o.createTextNode(h.value));else if(h.type===22){var A=o.createElement("img");A.src=h.value,A.style.opacity="1",u.appendChild(A)}else if(h.type===18){if(h.name==="attr"){var f=h.values.filter(er);f.length&&u.appendChild(o.createTextNode(t.getAttribute(f[0].value)||""))}else if(h.name==="counter"){var p=h.values.filter(Gv),m=p[0],g=p[1];if(m&&er(m)){var y=s.counters.getCounterValue(m.value),v=g&&er(g)?eD.parse(s.context,g.value):3;u.appendChild(o.createTextNode(l2(y,v,!1)))}}else if(h.name==="counters"){var x=h.values.filter(Gv),m=x[0],w=x[1],g=x[2];if(m&&er(m)){var b=s.counters.getCounterValues(m.value),k=g&&er(g)?eD.parse(s.context,g.value):3,j=w&&w.type===0?w.value:"",B=b.map(function(T){return l2(T,k,!1)}).join(j);u.appendChild(o.createTextNode(B))}}}else if(h.type===20)switch(h.value){case"open-quote":u.appendChild(o.createTextNode(GZ(c.quotes,s.quoteDepth++,!0)));break;case"close-quote":u.appendChild(o.createTextNode(GZ(c.quotes,--s.quoteDepth,!1)));break;default:u.appendChild(o.createTextNode(h.value))}}),u.className=aD+" "+oD;var d=i===fb.BEFORE?" "+aD:" "+oD;return O_(n)?n.className.baseValue+=d:n.className+=d,u}}},e.destroy=function(t){return t.parentNode?(t.parentNode.removeChild(t),!0):!1},e}(),fb;(function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"})(fb||(fb={}));var L5t=function(e,t){var n=e.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=t.width.toString(),n.height=t.height.toString(),n.scrolling="no",n.setAttribute(Y0e,"true"),e.body.appendChild(n),n},R5t=function(e){return new Promise(function(t){if(e.complete){t();return}if(!e.src){t();return}e.onload=t,e.onerror=t})},D5t=function(e){return Promise.all([].slice.call(e.images,0).map(R5t))},U5t=function(e){return new Promise(function(t,n){var r=e.contentWindow;if(!r)return n("No window assigned for iframe");var i=r.document;r.onload=e.onload=function(){r.onload=e.onload=null;var s=setInterval(function(){i.body.childNodes.length>0&&i.readyState==="complete"&&(clearInterval(s),t(e))},50)}})},H5t=["all","d","content"],FO=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e.item(n);H5t.indexOf(r)===-1&&t.style.setProperty(r,e.getPropertyValue(r))}return t},Q5t=function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t},$5t=function(e,t,n){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||n!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,n)},z5t=function(e){var t=e[0],n=e[1],r=e[2];t.scrollLeft=n,t.scrollTop=r},V5t=":before",K5t=":after",aD="___html2canvas___pseudoelement_before",oD="___html2canvas___pseudoelement_after",xee=`{
    content: "" !important;
    display: none !important;
}`,q5t=function(e){W5t(e,"."+aD+V5t+xee+`
         .`+oD+K5t+xee)},W5t=function(e,t){var n=e.ownerDocument;if(n){var r=n.createElement("style");r.textContent=t,e.appendChild(r)}},X0e=function(){function e(){}return e.getOrigin=function(t){var n=e._link;return n?(n.href=t,n.href=n.href,n.protocol+n.hostname+n.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e}(),G5t=function(){function e(t,n){this.context=t,this._options=n,this._cache={}}return e.prototype.addImage=function(t){var n=Promise.resolve();return this.has(t)||(LO(t)||Z5t(t))&&(this._cache[t]=this.loadImage(t)).catch(function(){}),n},e.prototype.match=function(t){return this._cache[t]},e.prototype.loadImage=function(t){return pa(this,void 0,void 0,function(){var n,r,i,s,a=this;return Ks(this,function(o){switch(o.label){case 0:return n=X0e.isSameOrigin(t),r=!MO(t)&&this._options.useCORS===!0&&Ss.SUPPORT_CORS_IMAGES&&!n,i=!MO(t)&&!n&&!LO(t)&&typeof this._options.proxy=="string"&&Ss.SUPPORT_CORS_XHR&&!r,!n&&this._options.allowTaint===!1&&!MO(t)&&!LO(t)&&!i&&!r?[2]:(s=t,i?[4,this.proxy(s)]:[3,2]);case 1:s=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+t.substring(0,256)),[4,new Promise(function(c,u){var d=new Image;d.onload=function(){return c(d)},d.onerror=u,(eTt(s)||r)&&(d.crossOrigin="anonymous"),d.src=s,d.complete===!0&&setTimeout(function(){return c(d)},500),a._options.imageTimeout>0&&setTimeout(function(){return u("Timed out ("+a._options.imageTimeout+"ms) loading image")},a._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},e.prototype.has=function(t){return typeof this._cache[t]<"u"},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(t){var n=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var i=t.substring(0,256);return new Promise(function(s,a){var o=Ss.SUPPORT_RESPONSE_TYPE?"blob":"text",c=new XMLHttpRequest;c.onload=function(){if(c.status===200)if(o==="text")s(c.response);else{var h=new FileReader;h.addEventListener("load",function(){return s(h.result)},!1),h.addEventListener("error",function(A){return a(A)},!1),h.readAsDataURL(c.response)}else a("Failed to proxy resource "+i+" with status code "+c.status)},c.onerror=a;var u=r.indexOf("?")>-1?"&":"?";if(c.open("GET",""+r+u+"url="+encodeURIComponent(t)+"&responseType="+o),o!=="text"&&c instanceof XMLHttpRequest&&(c.responseType=o),n._options.imageTimeout){var d=n._options.imageTimeout;c.timeout=d,c.ontimeout=function(){return a("Timed out ("+d+"ms) proxying "+i)}}c.send()})},e}(),Y5t=/^data:image\/svg\+xml/i,X5t=/^data:image\/.*;base64,/i,J5t=/^data:image\/.*/i,Z5t=function(e){return Ss.SUPPORT_SVG_DRAWING||!tTt(e)},MO=function(e){return J5t.test(e)},eTt=function(e){return X5t.test(e)},LO=function(e){return e.substr(0,4)==="blob"},tTt=function(e){return e.substr(-3).toLowerCase()==="svg"||Y5t.test(e)},rt=function(){function e(t,n){this.type=0,this.x=t,this.y=n}return e.prototype.add=function(t,n){return new e(this.x+t,this.y+n)},e}(),Eg=function(e,t,n){return new rt(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},Fk=function(){function e(t,n,r,i){this.type=1,this.start=t,this.startControl=n,this.endControl=r,this.end=i}return e.prototype.subdivide=function(t,n){var r=Eg(this.start,this.startControl,t),i=Eg(this.startControl,this.endControl,t),s=Eg(this.endControl,this.end,t),a=Eg(r,i,t),o=Eg(i,s,t),c=Eg(a,o,t);return n?new e(this.start,r,a,c):new e(c,o,s,this.end)},e.prototype.add=function(t,n){return new e(this.start.add(t,n),this.startControl.add(t,n),this.endControl.add(t,n),this.end.add(t,n))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),cl=function(e){return e.type===1},nTt=function(){function e(t){var n=t.styles,r=t.bounds,i=gw(n.borderTopLeftRadius,r.width,r.height),s=i[0],a=i[1],o=gw(n.borderTopRightRadius,r.width,r.height),c=o[0],u=o[1],d=gw(n.borderBottomRightRadius,r.width,r.height),h=d[0],A=d[1],f=gw(n.borderBottomLeftRadius,r.width,r.height),p=f[0],m=f[1],g=[];g.push((s+c)/r.width),g.push((p+h)/r.width),g.push((a+m)/r.height),g.push((u+A)/r.height);var y=Math.max.apply(Math,g);y>1&&(s/=y,a/=y,c/=y,u/=y,h/=y,A/=y,p/=y,m/=y);var v=r.width-c,x=r.height-A,w=r.width-h,b=r.height-m,k=n.borderTopWidth,j=n.borderRightWidth,B=n.borderBottomWidth,E=n.borderLeftWidth,I=pr(n.paddingTop,t.bounds.width),T=pr(n.paddingRight,t.bounds.width),N=pr(n.paddingBottom,t.bounds.width),F=pr(n.paddingLeft,t.bounds.width);this.topLeftBorderDoubleOuterBox=s>0||a>0?Pr(r.left+E/3,r.top+k/3,s-E/3,a-k/3,zn.TOP_LEFT):new rt(r.left+E/3,r.top+k/3),this.topRightBorderDoubleOuterBox=s>0||a>0?Pr(r.left+v,r.top+k/3,c-j/3,u-k/3,zn.TOP_RIGHT):new rt(r.left+r.width-j/3,r.top+k/3),this.bottomRightBorderDoubleOuterBox=h>0||A>0?Pr(r.left+w,r.top+x,h-j/3,A-B/3,zn.BOTTOM_RIGHT):new rt(r.left+r.width-j/3,r.top+r.height-B/3),this.bottomLeftBorderDoubleOuterBox=p>0||m>0?Pr(r.left+E/3,r.top+b,p-E/3,m-B/3,zn.BOTTOM_LEFT):new rt(r.left+E/3,r.top+r.height-B/3),this.topLeftBorderDoubleInnerBox=s>0||a>0?Pr(r.left+E*2/3,r.top+k*2/3,s-E*2/3,a-k*2/3,zn.TOP_LEFT):new rt(r.left+E*2/3,r.top+k*2/3),this.topRightBorderDoubleInnerBox=s>0||a>0?Pr(r.left+v,r.top+k*2/3,c-j*2/3,u-k*2/3,zn.TOP_RIGHT):new rt(r.left+r.width-j*2/3,r.top+k*2/3),this.bottomRightBorderDoubleInnerBox=h>0||A>0?Pr(r.left+w,r.top+x,h-j*2/3,A-B*2/3,zn.BOTTOM_RIGHT):new rt(r.left+r.width-j*2/3,r.top+r.height-B*2/3),this.bottomLeftBorderDoubleInnerBox=p>0||m>0?Pr(r.left+E*2/3,r.top+b,p-E*2/3,m-B*2/3,zn.BOTTOM_LEFT):new rt(r.left+E*2/3,r.top+r.height-B*2/3),this.topLeftBorderStroke=s>0||a>0?Pr(r.left+E/2,r.top+k/2,s-E/2,a-k/2,zn.TOP_LEFT):new rt(r.left+E/2,r.top+k/2),this.topRightBorderStroke=s>0||a>0?Pr(r.left+v,r.top+k/2,c-j/2,u-k/2,zn.TOP_RIGHT):new rt(r.left+r.width-j/2,r.top+k/2),this.bottomRightBorderStroke=h>0||A>0?Pr(r.left+w,r.top+x,h-j/2,A-B/2,zn.BOTTOM_RIGHT):new rt(r.left+r.width-j/2,r.top+r.height-B/2),this.bottomLeftBorderStroke=p>0||m>0?Pr(r.left+E/2,r.top+b,p-E/2,m-B/2,zn.BOTTOM_LEFT):new rt(r.left+E/2,r.top+r.height-B/2),this.topLeftBorderBox=s>0||a>0?Pr(r.left,r.top,s,a,zn.TOP_LEFT):new rt(r.left,r.top),this.topRightBorderBox=c>0||u>0?Pr(r.left+v,r.top,c,u,zn.TOP_RIGHT):new rt(r.left+r.width,r.top),this.bottomRightBorderBox=h>0||A>0?Pr(r.left+w,r.top+x,h,A,zn.BOTTOM_RIGHT):new rt(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=p>0||m>0?Pr(r.left,r.top+b,p,m,zn.BOTTOM_LEFT):new rt(r.left,r.top+r.height),this.topLeftPaddingBox=s>0||a>0?Pr(r.left+E,r.top+k,Math.max(0,s-E),Math.max(0,a-k),zn.TOP_LEFT):new rt(r.left+E,r.top+k),this.topRightPaddingBox=c>0||u>0?Pr(r.left+Math.min(v,r.width-j),r.top+k,v>r.width+j?0:Math.max(0,c-j),Math.max(0,u-k),zn.TOP_RIGHT):new rt(r.left+r.width-j,r.top+k),this.bottomRightPaddingBox=h>0||A>0?Pr(r.left+Math.min(w,r.width-E),r.top+Math.min(x,r.height-B),Math.max(0,h-j),Math.max(0,A-B),zn.BOTTOM_RIGHT):new rt(r.left+r.width-j,r.top+r.height-B),this.bottomLeftPaddingBox=p>0||m>0?Pr(r.left+E,r.top+Math.min(b,r.height-B),Math.max(0,p-E),Math.max(0,m-B),zn.BOTTOM_LEFT):new rt(r.left+E,r.top+r.height-B),this.topLeftContentBox=s>0||a>0?Pr(r.left+E+F,r.top+k+I,Math.max(0,s-(E+F)),Math.max(0,a-(k+I)),zn.TOP_LEFT):new rt(r.left+E+F,r.top+k+I),this.topRightContentBox=c>0||u>0?Pr(r.left+Math.min(v,r.width+E+F),r.top+k+I,v>r.width+E+F?0:c-E+F,u-(k+I),zn.TOP_RIGHT):new rt(r.left+r.width-(j+T),r.top+k+I),this.bottomRightContentBox=h>0||A>0?Pr(r.left+Math.min(w,r.width-(E+F)),r.top+Math.min(x,r.height+k+I),Math.max(0,h-(j+T)),A-(B+N),zn.BOTTOM_RIGHT):new rt(r.left+r.width-(j+T),r.top+r.height-(B+N)),this.bottomLeftContentBox=p>0||m>0?Pr(r.left+E+F,r.top+b,Math.max(0,p-(E+F)),m-(B+N),zn.BOTTOM_LEFT):new rt(r.left+E+F,r.top+r.height-(B+N))}return e}(),zn;(function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(zn||(zn={}));var Pr=function(e,t,n,r,i){var s=4*((Math.sqrt(2)-1)/3),a=n*s,o=r*s,c=e+n,u=t+r;switch(i){case zn.TOP_LEFT:return new Fk(new rt(e,u),new rt(e,u-o),new rt(c-a,t),new rt(c,t));case zn.TOP_RIGHT:return new Fk(new rt(e,t),new rt(e+a,t),new rt(c,u-o),new rt(c,u));case zn.BOTTOM_RIGHT:return new Fk(new rt(c,t),new rt(c,t+o),new rt(e+a,u),new rt(e,u));case zn.BOTTOM_LEFT:default:return new Fk(new rt(c,u),new rt(c-a,u),new rt(e,t+o),new rt(e,t))}},VN=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},rTt=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},KN=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},iTt=function(){function e(t,n,r){this.offsetX=t,this.offsetY=n,this.matrix=r,this.type=0,this.target=6}return e}(),Mk=function(){function e(t,n){this.path=t,this.target=n,this.type=1}return e}(),sTt=function(){function e(t){this.opacity=t,this.type=2,this.target=6}return e}(),aTt=function(e){return e.type===0},J0e=function(e){return e.type===1},oTt=function(e){return e.type===2},wee=function(e,t){return e.length===t.length?e.some(function(n,r){return n===t[r]}):!1},lTt=function(e,t,n,r,i){return e.map(function(s,a){switch(a){case 0:return s.add(t,n);case 1:return s.add(t+r,n);case 2:return s.add(t+r,n+i);case 3:return s.add(t,n+i)}return s})},Z0e=function(){function e(t){this.element=t,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),exe=function(){function e(t,n){if(this.container=t,this.parent=n,this.effects=[],this.curves=new nTt(this.container),this.container.styles.opacity<1&&this.effects.push(new sTt(this.container.styles.opacity)),this.container.styles.transform!==null){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,s=this.container.styles.transform;this.effects.push(new iTt(r,i,s))}if(this.container.styles.overflowX!==0){var a=VN(this.curves),o=KN(this.curves);wee(a,o)?this.effects.push(new Mk(a,6)):(this.effects.push(new Mk(a,2)),this.effects.push(new Mk(o,4)))}}return e.prototype.getEffects=function(t){for(var n=[2,3].indexOf(this.container.styles.position)===-1,r=this.parent,i=this.effects.slice(0);r;){var s=r.effects.filter(function(c){return!J0e(c)});if(n||r.container.styles.position!==0||!r.parent){if(i.unshift.apply(i,s),n=[2,3].indexOf(r.container.styles.position)===-1,r.container.styles.overflowX!==0){var a=VN(r.curves),o=KN(r.curves);wee(a,o)||i.unshift(new Mk(o,6))}}else i.unshift.apply(i,s);r=r.parent}return i.filter(function(c){return Qi(c.target,t)})},e}(),lD=function(e,t,n,r){e.container.elements.forEach(function(i){var s=Qi(i.flags,4),a=Qi(i.flags,2),o=new exe(i,e);Qi(i.styles.display,2048)&&r.push(o);var c=Qi(i.flags,8)?[]:r;if(s||a){var u=s||i.styles.isPositioned()?n:t,d=new Z0e(o);if(i.styles.isPositioned()||i.styles.opacity<1||i.styles.isTransformed()){var h=i.styles.zIndex.order;if(h<0){var A=0;u.negativeZIndex.some(function(p,m){return h>p.element.container.styles.zIndex.order?(A=m,!1):A>0}),u.negativeZIndex.splice(A,0,d)}else if(h>0){var f=0;u.positiveZIndex.some(function(p,m){return h>=p.element.container.styles.zIndex.order?(f=m+1,!1):f>0}),u.positiveZIndex.splice(f,0,d)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(d)}else i.styles.isFloating()?u.nonPositionedFloats.push(d):u.nonPositionedInlineLevel.push(d);lD(o,d,s?d:n,c)}else i.styles.isInlineLevel()?t.inlineLevel.push(o):t.nonInlineLevel.push(o),lD(o,t,n,c);Qi(i.flags,8)&&txe(i,c)})},txe=function(e,t){for(var n=e instanceof rD?e.start:1,r=e instanceof rD?e.reversed:!1,i=0;i<t.length;i++){var s=t[i];s.container instanceof R0e&&typeof s.container.value=="number"&&s.container.value!==0&&(n=s.container.value),s.listValue=l2(n,s.container.styles.listStyleType,!0),n+=r?-1:1}},cTt=function(e){var t=new exe(e,null),n=new Z0e(t),r=[];return lD(t,n,n,r),txe(t.container,r),n},bee=function(e,t){switch(t){case 0:return ml(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return ml(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return ml(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);case 3:default:return ml(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},uTt=function(e,t){switch(t){case 0:return ml(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return ml(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return ml(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);case 3:default:return ml(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},dTt=function(e,t){switch(t){case 0:return ml(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return ml(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return ml(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);case 3:default:return ml(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},hTt=function(e,t){switch(t){case 0:return Lk(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return Lk(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return Lk(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);case 3:default:return Lk(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},Lk=function(e,t){var n=[];return cl(e)?n.push(e.subdivide(.5,!1)):n.push(e),cl(t)?n.push(t.subdivide(.5,!0)):n.push(t),n},ml=function(e,t,n,r){var i=[];return cl(e)?i.push(e.subdivide(.5,!1)):i.push(e),cl(n)?i.push(n.subdivide(.5,!0)):i.push(n),cl(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),cl(t)?i.push(t.subdivide(.5,!1).reverse()):i.push(t),i},nxe=function(e){var t=e.bounds,n=e.styles;return t.add(n.borderLeftWidth,n.borderTopWidth,-(n.borderRightWidth+n.borderLeftWidth),-(n.borderTopWidth+n.borderBottomWidth))},qN=function(e){var t=e.styles,n=e.bounds,r=pr(t.paddingLeft,n.width),i=pr(t.paddingRight,n.width),s=pr(t.paddingTop,n.width),a=pr(t.paddingBottom,n.width);return n.add(r+t.borderLeftWidth,s+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+r+i),-(t.borderTopWidth+t.borderBottomWidth+s+a))},fTt=function(e,t){return e===0?t.bounds:e===2?qN(t):nxe(t)},ATt=function(e,t){return e===0?t.bounds:e===2?qN(t):nxe(t)},RO=function(e,t,n){var r=fTt(Qg(e.styles.backgroundOrigin,t),e),i=ATt(Qg(e.styles.backgroundClip,t),e),s=pTt(Qg(e.styles.backgroundSize,t),n,r),a=s[0],o=s[1],c=gw(Qg(e.styles.backgroundPosition,t),r.width-a,r.height-o),u=mTt(Qg(e.styles.backgroundRepeat,t),c,s,r,i),d=Math.round(r.left+c[0]),h=Math.round(r.top+c[1]);return[u,d,h,a,o]},Tg=function(e){return er(e)&&e.value===Hy.AUTO},Rk=function(e){return typeof e=="number"},pTt=function(e,t,n){var r=t[0],i=t[1],s=t[2],a=e[0],o=e[1];if(!a)return[0,0];if(ji(a)&&o&&ji(o))return[pr(a,n.width),pr(o,n.height)];var c=Rk(s);if(er(a)&&(a.value===Hy.CONTAIN||a.value===Hy.COVER)){if(Rk(s)){var u=n.width/n.height;return u<s!=(a.value===Hy.COVER)?[n.width,n.width/s]:[n.height*s,n.height]}return[n.width,n.height]}var d=Rk(r),h=Rk(i),A=d||h;if(Tg(a)&&(!o||Tg(o))){if(d&&h)return[r,i];if(!c&&!A)return[n.width,n.height];if(A&&c){var f=d?r:i*s,p=h?i:r/s;return[f,p]}var m=d?r:n.width,g=h?i:n.height;return[m,g]}if(c){var y=0,v=0;return ji(a)?y=pr(a,n.width):ji(o)&&(v=pr(o,n.height)),Tg(a)?y=v*s:(!o||Tg(o))&&(v=y/s),[y,v]}var x=null,w=null;if(ji(a)?x=pr(a,n.width):o&&ji(o)&&(w=pr(o,n.height)),x!==null&&(!o||Tg(o))&&(w=d&&h?x/r*i:n.height),w!==null&&Tg(a)&&(x=d&&h?w/i*r:n.width),x!==null&&w!==null)return[x,w];throw new Error("Unable to calculate background-size for element")},Qg=function(e,t){var n=e[t];return typeof n>"u"?e[0]:n},mTt=function(e,t,n,r,i){var s=t[0],a=t[1],o=n[0],c=n[1];switch(e){case 2:return[new rt(Math.round(r.left),Math.round(r.top+a)),new rt(Math.round(r.left+r.width),Math.round(r.top+a)),new rt(Math.round(r.left+r.width),Math.round(c+r.top+a)),new rt(Math.round(r.left),Math.round(c+r.top+a))];case 3:return[new rt(Math.round(r.left+s),Math.round(r.top)),new rt(Math.round(r.left+s+o),Math.round(r.top)),new rt(Math.round(r.left+s+o),Math.round(r.height+r.top)),new rt(Math.round(r.left+s),Math.round(r.height+r.top))];case 1:return[new rt(Math.round(r.left+s),Math.round(r.top+a)),new rt(Math.round(r.left+s+o),Math.round(r.top+a)),new rt(Math.round(r.left+s+o),Math.round(r.top+a+c)),new rt(Math.round(r.left+s),Math.round(r.top+a+c))];default:return[new rt(Math.round(i.left),Math.round(i.top)),new rt(Math.round(i.left+i.width),Math.round(i.top)),new rt(Math.round(i.left+i.width),Math.round(i.height+i.top)),new rt(Math.round(i.left),Math.round(i.height+i.top))]}},gTt="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Cee="Hidden Text",yTt=function(){function e(t){this._data={},this._document=t}return e.prototype.parseMetrics=function(t,n){var r=this._document.createElement("div"),i=this._document.createElement("img"),s=this._document.createElement("span"),a=this._document.body;r.style.visibility="hidden",r.style.fontFamily=t,r.style.fontSize=n,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",a.appendChild(r),i.src=gTt,i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",s.style.fontFamily=t,s.style.fontSize=n,s.style.margin="0",s.style.padding="0",s.appendChild(this._document.createTextNode(Cee)),r.appendChild(s),r.appendChild(i);var o=i.offsetTop-s.offsetTop+2;r.removeChild(s),r.appendChild(this._document.createTextNode(Cee)),r.style.lineHeight="normal",i.style.verticalAlign="super";var c=i.offsetTop-r.offsetTop+2;return a.removeChild(r),{baseline:o,middle:c}},e.prototype.getMetrics=function(t,n){var r=t+" "+n;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(t,n)),this._data[r]},e}(),rxe=function(){function e(t,n){this.context=t,this.options=n}return e}(),vTt=1e4,xTt=function(e){jc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i._activeEffects=[],i.canvas=r.canvas?r.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),r.canvas||(i.canvas.width=Math.floor(r.width*r.scale),i.canvas.height=Math.floor(r.height*r.scale),i.canvas.style.width=r.width+"px",i.canvas.style.height=r.height+"px"),i.fontMetrics=new yTt(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-r.x,-r.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),i}return t.prototype.applyEffects=function(n){for(var r=this;this._activeEffects.length;)this.popEffect();n.forEach(function(i){return r.applyEffect(i)})},t.prototype.applyEffect=function(n){this.ctx.save(),oTt(n)&&(this.ctx.globalAlpha=n.opacity),aTt(n)&&(this.ctx.translate(n.offsetX,n.offsetY),this.ctx.transform(n.matrix[0],n.matrix[1],n.matrix[2],n.matrix[3],n.matrix[4],n.matrix[5]),this.ctx.translate(-n.offsetX,-n.offsetY)),J0e(n)&&(this.path(n.path),this.ctx.clip()),this._activeEffects.push(n)},t.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},t.prototype.renderStack=function(n){return pa(this,void 0,void 0,function(){var r;return Ks(this,function(i){switch(i.label){case 0:return r=n.element.container.styles,r.isVisible()?[4,this.renderStackContent(n)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}})})},t.prototype.renderNode=function(n){return pa(this,void 0,void 0,function(){return Ks(this,function(r){switch(r.label){case 0:if(Qi(n.container.flags,16))debugger;return n.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(n)]:[3,3];case 1:return r.sent(),[4,this.renderNodeContent(n)];case 2:r.sent(),r.label=3;case 3:return[2]}})})},t.prototype.renderTextWithLetterSpacing=function(n,r,i){var s=this;if(r===0)this.ctx.fillText(n.text,n.bounds.left,n.bounds.top+i);else{var a=j$(n.text);a.reduce(function(o,c){return s.ctx.fillText(c,o,n.bounds.top+i),o+s.ctx.measureText(c).width},n.bounds.left)}},t.prototype.createFontStyle=function(n){var r=n.fontVariant.filter(function(a){return a==="normal"||a==="small-caps"}).join(""),i=kTt(n.fontFamily).join(", "),s=oC(n.fontSize)?""+n.fontSize.number+n.fontSize.unit:n.fontSize.number+"px";return[[n.fontStyle,r,n.fontWeight,s,i].join(" "),i,s]},t.prototype.renderTextNode=function(n,r){return pa(this,void 0,void 0,function(){var i,s,a,o,c,u,d,h,A=this;return Ks(this,function(f){return i=this.createFontStyle(r),s=i[0],a=i[1],o=i[2],this.ctx.font=s,this.ctx.direction=r.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",c=this.fontMetrics.getMetrics(a,o),u=c.baseline,d=c.middle,h=r.paintOrder,n.textBounds.forEach(function(p){h.forEach(function(m){switch(m){case 0:A.ctx.fillStyle=Zi(r.color),A.renderTextWithLetterSpacing(p,r.letterSpacing,u);var g=r.textShadow;g.length&&p.text.trim().length&&(g.slice(0).reverse().forEach(function(y){A.ctx.shadowColor=Zi(y.color),A.ctx.shadowOffsetX=y.offsetX.number*A.options.scale,A.ctx.shadowOffsetY=y.offsetY.number*A.options.scale,A.ctx.shadowBlur=y.blur.number,A.renderTextWithLetterSpacing(p,r.letterSpacing,u)}),A.ctx.shadowColor="",A.ctx.shadowOffsetX=0,A.ctx.shadowOffsetY=0,A.ctx.shadowBlur=0),r.textDecorationLine.length&&(A.ctx.fillStyle=Zi(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(y){switch(y){case 1:A.ctx.fillRect(p.bounds.left,Math.round(p.bounds.top+u),p.bounds.width,1);break;case 2:A.ctx.fillRect(p.bounds.left,Math.round(p.bounds.top),p.bounds.width,1);break;case 3:A.ctx.fillRect(p.bounds.left,Math.ceil(p.bounds.top+d),p.bounds.width,1);break}}));break;case 1:r.webkitTextStrokeWidth&&p.text.trim().length&&(A.ctx.strokeStyle=Zi(r.webkitTextStrokeColor),A.ctx.lineWidth=r.webkitTextStrokeWidth,A.ctx.lineJoin=window.chrome?"miter":"round",A.ctx.strokeText(p.text,p.bounds.left,p.bounds.top+u)),A.ctx.strokeStyle="",A.ctx.lineWidth=0,A.ctx.lineJoin="miter";break}})}),[2]})})},t.prototype.renderReplacedElement=function(n,r,i){if(i&&n.intrinsicWidth>0&&n.intrinsicHeight>0){var s=qN(n),a=KN(r);this.path(a),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(i,0,0,n.intrinsicWidth,n.intrinsicHeight,s.left,s.top,s.width,s.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(n){return pa(this,void 0,void 0,function(){var r,i,s,a,o,c,v,v,u,d,h,A,w,f,p,b,m,g,y,v,x,w,b;return Ks(this,function(k){switch(k.label){case 0:this.applyEffects(n.getEffects(4)),r=n.container,i=n.curves,s=r.styles,a=0,o=r.textNodes,k.label=1;case 1:return a<o.length?(c=o[a],[4,this.renderTextNode(c,s)]):[3,4];case 2:k.sent(),k.label=3;case 3:return a++,[3,1];case 4:if(!(r instanceof F0e))return[3,8];k.label=5;case 5:return k.trys.push([5,7,,8]),[4,this.context.cache.match(r.src)];case 6:return v=k.sent(),this.renderReplacedElement(r,i,v),[3,8];case 7:return k.sent(),this.context.logger.error("Error loading image "+r.src),[3,8];case 8:if(r instanceof M0e&&this.renderReplacedElement(r,i,r.canvas),!(r instanceof L0e))return[3,12];k.label=9;case 9:return k.trys.push([9,11,,12]),[4,this.context.cache.match(r.svg)];case 10:return v=k.sent(),this.renderReplacedElement(r,i,v),[3,12];case 11:return k.sent(),this.context.logger.error("Error loading svg "+r.svg.substring(0,255)),[3,12];case 12:return r instanceof H0e&&r.tree?(u=new t(this.context,{scale:this.options.scale,backgroundColor:r.backgroundColor,x:0,y:0,width:r.width,height:r.height}),[4,u.render(r.tree)]):[3,14];case 13:d=k.sent(),r.width&&r.height&&this.ctx.drawImage(d,0,0,r.width,r.height,r.bounds.left,r.bounds.top,r.bounds.width,r.bounds.height),k.label=14;case 14:if(r instanceof B$&&(h=Math.min(r.bounds.width,r.bounds.height),r.type===HN?r.checked&&(this.ctx.save(),this.path([new rt(r.bounds.left+h*.39363,r.bounds.top+h*.79),new rt(r.bounds.left+h*.16,r.bounds.top+h*.5549),new rt(r.bounds.left+h*.27347,r.bounds.top+h*.44071),new rt(r.bounds.left+h*.39694,r.bounds.top+h*.5649),new rt(r.bounds.left+h*.72983,r.bounds.top+h*.23),new rt(r.bounds.left+h*.84,r.bounds.top+h*.34085),new rt(r.bounds.left+h*.39363,r.bounds.top+h*.79)]),this.ctx.fillStyle=Zi(uee),this.ctx.fill(),this.ctx.restore()):r.type===QN&&r.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(r.bounds.left+h/2,r.bounds.top+h/2,h/4,0,Math.PI*2,!0),this.ctx.fillStyle=Zi(uee),this.ctx.fill(),this.ctx.restore())),wTt(r)&&r.value.length){switch(A=this.createFontStyle(s),w=A[0],f=A[1],p=this.fontMetrics.getMetrics(w,f).baseline,this.ctx.font=w,this.ctx.fillStyle=Zi(s.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=CTt(r.styles.textAlign),b=qN(r),m=0,r.styles.textAlign){case 1:m+=b.width/2;break;case 2:m+=b.width;break}g=b.add(m,0,0,-b.height/2+1),this.ctx.save(),this.path([new rt(b.left,b.top),new rt(b.left+b.width,b.top),new rt(b.left+b.width,b.top+b.height),new rt(b.left,b.top+b.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new hb(r.value,g),s.letterSpacing,p),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!Qi(r.styles.display,2048))return[3,20];if(r.styles.listStyleImage===null)return[3,19];if(y=r.styles.listStyleImage,y.type!==0)return[3,18];v=void 0,x=y.url,k.label=15;case 15:return k.trys.push([15,17,,18]),[4,this.context.cache.match(x)];case 16:return v=k.sent(),this.ctx.drawImage(v,r.bounds.left-(v.width+10),r.bounds.top),[3,18];case 17:return k.sent(),this.context.logger.error("Error loading list-style-image "+x),[3,18];case 18:return[3,20];case 19:n.listValue&&r.styles.listStyleType!==-1&&(w=this.createFontStyle(s)[0],this.ctx.font=w,this.ctx.fillStyle=Zi(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",b=new _d(r.bounds.left,r.bounds.top+pr(r.styles.paddingTop,r.bounds.width),r.bounds.width,qZ(s.lineHeight,s.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new hb(n.listValue,b),s.letterSpacing,qZ(s.lineHeight,s.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),k.label=20;case 20:return[2]}})})},t.prototype.renderStackContent=function(n){return pa(this,void 0,void 0,function(){var r,i,y,s,a,y,o,c,y,u,d,y,h,A,y,f,p,y,m,g,y;return Ks(this,function(v){switch(v.label){case 0:if(Qi(n.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(n.element)];case 1:v.sent(),r=0,i=n.negativeZIndex,v.label=2;case 2:return r<i.length?(y=i[r],[4,this.renderStack(y)]):[3,5];case 3:v.sent(),v.label=4;case 4:return r++,[3,2];case 5:return[4,this.renderNodeContent(n.element)];case 6:v.sent(),s=0,a=n.nonInlineLevel,v.label=7;case 7:return s<a.length?(y=a[s],[4,this.renderNode(y)]):[3,10];case 8:v.sent(),v.label=9;case 9:return s++,[3,7];case 10:o=0,c=n.nonPositionedFloats,v.label=11;case 11:return o<c.length?(y=c[o],[4,this.renderStack(y)]):[3,14];case 12:v.sent(),v.label=13;case 13:return o++,[3,11];case 14:u=0,d=n.nonPositionedInlineLevel,v.label=15;case 15:return u<d.length?(y=d[u],[4,this.renderStack(y)]):[3,18];case 16:v.sent(),v.label=17;case 17:return u++,[3,15];case 18:h=0,A=n.inlineLevel,v.label=19;case 19:return h<A.length?(y=A[h],[4,this.renderNode(y)]):[3,22];case 20:v.sent(),v.label=21;case 21:return h++,[3,19];case 22:f=0,p=n.zeroOrAutoZIndexOrTransformedOrOpacity,v.label=23;case 23:return f<p.length?(y=p[f],[4,this.renderStack(y)]):[3,26];case 24:v.sent(),v.label=25;case 25:return f++,[3,23];case 26:m=0,g=n.positiveZIndex,v.label=27;case 27:return m<g.length?(y=g[m],[4,this.renderStack(y)]):[3,30];case 28:v.sent(),v.label=29;case 29:return m++,[3,27];case 30:return[2]}})})},t.prototype.mask=function(n){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(n.slice(0).reverse()),this.ctx.closePath()},t.prototype.path=function(n){this.ctx.beginPath(),this.formatPath(n),this.ctx.closePath()},t.prototype.formatPath=function(n){var r=this;n.forEach(function(i,s){var a=cl(i)?i.start:i;s===0?r.ctx.moveTo(a.x,a.y):r.ctx.lineTo(a.x,a.y),cl(i)&&r.ctx.bezierCurveTo(i.startControl.x,i.startControl.y,i.endControl.x,i.endControl.y,i.end.x,i.end.y)})},t.prototype.renderRepeat=function(n,r,i,s){this.path(n),this.ctx.fillStyle=r,this.ctx.translate(i,s),this.ctx.fill(),this.ctx.translate(-i,-s)},t.prototype.resizeImage=function(n,r,i){var s;if(n.width===r&&n.height===i)return n;var a=(s=this.canvas.ownerDocument)!==null&&s!==void 0?s:document,o=a.createElement("canvas");o.width=Math.max(1,r),o.height=Math.max(1,i);var c=o.getContext("2d");return c.drawImage(n,0,0,n.width,n.height,0,0,r,i),o},t.prototype.renderBackgroundImage=function(n){return pa(this,void 0,void 0,function(){var r,i,s,a,o,c;return Ks(this,function(u){switch(u.label){case 0:r=n.styles.backgroundImage.length-1,i=function(d){var h,A,f,I,H,K,F,L,B,p,I,H,K,F,L,m,g,y,v,x,w,b,k,j,B,E,I,T,N,F,L,U,H,K,$,z,Q,oe,R,M,Y,X;return Ks(this,function(q){switch(q.label){case 0:if(d.type!==0)return[3,5];h=void 0,A=d.url,q.label=1;case 1:return q.trys.push([1,3,,4]),[4,s.context.cache.match(A)];case 2:return h=q.sent(),[3,4];case 3:return q.sent(),s.context.logger.error("Error loading background-image "+A),[3,4];case 4:return h&&(f=RO(n,r,[h.width,h.height,h.width/h.height]),I=f[0],H=f[1],K=f[2],F=f[3],L=f[4],B=s.ctx.createPattern(s.resizeImage(h,F,L),"repeat"),s.renderRepeat(I,B,H,K)),[3,6];case 5:aNt(d)?(p=RO(n,r,[null,null,null]),I=p[0],H=p[1],K=p[2],F=p[3],L=p[4],m=tNt(d.angle,F,L),g=m[0],y=m[1],v=m[2],x=m[3],w=m[4],b=document.createElement("canvas"),b.width=F,b.height=L,k=b.getContext("2d"),j=k.createLinearGradient(y,x,v,w),VZ(d.stops,g).forEach(function(Z){return j.addColorStop(Z.stop,Zi(Z.color))}),k.fillStyle=j,k.fillRect(0,0,F,L),F>0&&L>0&&(B=s.ctx.createPattern(b,"repeat"),s.renderRepeat(I,B,H,K))):oNt(d)&&(E=RO(n,r,[null,null,null]),I=E[0],T=E[1],N=E[2],F=E[3],L=E[4],U=d.position.length===0?[S$]:d.position,H=pr(U[0],F),K=pr(U[U.length-1],L),$=nNt(d,H,K,F,L),z=$[0],Q=$[1],z>0&&Q>0&&(oe=s.ctx.createRadialGradient(T+H,N+K,0,T+H,N+K,z),VZ(d.stops,z*2).forEach(function(Z){return oe.addColorStop(Z.stop,Zi(Z.color))}),s.path(I),s.ctx.fillStyle=oe,z!==Q?(R=n.bounds.left+.5*n.bounds.width,M=n.bounds.top+.5*n.bounds.height,Y=Q/z,X=1/Y,s.ctx.save(),s.ctx.translate(R,M),s.ctx.transform(1,0,0,Y,0,0),s.ctx.translate(-R,-M),s.ctx.fillRect(T,X*(N-M)+M,F,L*X),s.ctx.restore()):s.ctx.fill())),q.label=6;case 6:return r--,[2]}})},s=this,a=0,o=n.styles.backgroundImage.slice(0).reverse(),u.label=1;case 1:return a<o.length?(c=o[a],[5,i(c)]):[3,4];case 2:u.sent(),u.label=3;case 3:return a++,[3,1];case 4:return[2]}})})},t.prototype.renderSolidBorder=function(n,r,i){return pa(this,void 0,void 0,function(){return Ks(this,function(s){return this.path(bee(i,r)),this.ctx.fillStyle=Zi(n),this.ctx.fill(),[2]})})},t.prototype.renderDoubleBorder=function(n,r,i,s){return pa(this,void 0,void 0,function(){var a,o;return Ks(this,function(c){switch(c.label){case 0:return r<3?[4,this.renderSolidBorder(n,i,s)]:[3,2];case 1:return c.sent(),[2];case 2:return a=uTt(s,i),this.path(a),this.ctx.fillStyle=Zi(n),this.ctx.fill(),o=dTt(s,i),this.path(o),this.ctx.fill(),[2]}})})},t.prototype.renderNodeBackgroundAndBorders=function(n){return pa(this,void 0,void 0,function(){var r,i,s,a,o,c,u,d,h=this;return Ks(this,function(A){switch(A.label){case 0:return this.applyEffects(n.getEffects(2)),r=n.container.styles,i=!Cf(r.backgroundColor)||r.backgroundImage.length,s=[{style:r.borderTopStyle,color:r.borderTopColor,width:r.borderTopWidth},{style:r.borderRightStyle,color:r.borderRightColor,width:r.borderRightWidth},{style:r.borderBottomStyle,color:r.borderBottomColor,width:r.borderBottomWidth},{style:r.borderLeftStyle,color:r.borderLeftColor,width:r.borderLeftWidth}],a=bTt(Qg(r.backgroundClip,0),n.curves),i||r.boxShadow.length?(this.ctx.save(),this.path(a),this.ctx.clip(),Cf(r.backgroundColor)||(this.ctx.fillStyle=Zi(r.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(n.container)]):[3,2];case 1:A.sent(),this.ctx.restore(),r.boxShadow.slice(0).reverse().forEach(function(f){h.ctx.save();var p=VN(n.curves),m=f.inset?0:vTt,g=lTt(p,-m+(f.inset?1:-1)*f.spread.number,(f.inset?1:-1)*f.spread.number,f.spread.number*(f.inset?-2:2),f.spread.number*(f.inset?-2:2));f.inset?(h.path(p),h.ctx.clip(),h.mask(g)):(h.mask(p),h.ctx.clip(),h.path(g)),h.ctx.shadowOffsetX=f.offsetX.number+m,h.ctx.shadowOffsetY=f.offsetY.number,h.ctx.shadowColor=Zi(f.color),h.ctx.shadowBlur=f.blur.number,h.ctx.fillStyle=f.inset?Zi(f.color):"rgba(0,0,0,1)",h.ctx.fill(),h.ctx.restore()}),A.label=2;case 2:o=0,c=0,u=s,A.label=3;case 3:return c<u.length?(d=u[c],d.style!==0&&!Cf(d.color)&&d.width>0?d.style!==2?[3,5]:[4,this.renderDashedDottedBorder(d.color,d.width,o,n.curves,2)]:[3,11]):[3,13];case 4:return A.sent(),[3,11];case 5:return d.style!==3?[3,7]:[4,this.renderDashedDottedBorder(d.color,d.width,o,n.curves,3)];case 6:return A.sent(),[3,11];case 7:return d.style!==4?[3,9]:[4,this.renderDoubleBorder(d.color,d.width,o,n.curves)];case 8:return A.sent(),[3,11];case 9:return[4,this.renderSolidBorder(d.color,o,n.curves)];case 10:A.sent(),A.label=11;case 11:o++,A.label=12;case 12:return c++,[3,3];case 13:return[2]}})})},t.prototype.renderDashedDottedBorder=function(n,r,i,s,a){return pa(this,void 0,void 0,function(){var o,c,u,d,h,A,f,p,m,g,y,v,x,w,b,k,b,k;return Ks(this,function(j){return this.ctx.save(),o=hTt(s,i),c=bee(s,i),a===2&&(this.path(c),this.ctx.clip()),cl(c[0])?(u=c[0].start.x,d=c[0].start.y):(u=c[0].x,d=c[0].y),cl(c[1])?(h=c[1].end.x,A=c[1].end.y):(h=c[1].x,A=c[1].y),i===0||i===2?f=Math.abs(u-h):f=Math.abs(d-A),this.ctx.beginPath(),a===3?this.formatPath(o):this.formatPath(c.slice(0,2)),p=r<3?r*3:r*2,m=r<3?r*2:r,a===3&&(p=r,m=r),g=!0,f<=p*2?g=!1:f<=p*2+m?(y=f/(2*p+m),p*=y,m*=y):(v=Math.floor((f+m)/(p+m)),x=(f-v*p)/(v-1),w=(f-(v+1)*p)/v,m=w<=0||Math.abs(m-x)<Math.abs(m-w)?x:w),g&&(a===3?this.ctx.setLineDash([0,p+m]):this.ctx.setLineDash([p,m])),a===3?(this.ctx.lineCap="round",this.ctx.lineWidth=r):this.ctx.lineWidth=r*2+1.1,this.ctx.strokeStyle=Zi(n),this.ctx.stroke(),this.ctx.setLineDash([]),a===2&&(cl(c[0])&&(b=c[3],k=c[0],this.ctx.beginPath(),this.formatPath([new rt(b.end.x,b.end.y),new rt(k.start.x,k.start.y)]),this.ctx.stroke()),cl(c[1])&&(b=c[1],k=c[2],this.ctx.beginPath(),this.formatPath([new rt(b.end.x,b.end.y),new rt(k.start.x,k.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},t.prototype.render=function(n){return pa(this,void 0,void 0,function(){var r;return Ks(this,function(i){switch(i.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=Zi(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),r=cTt(n),[4,this.renderStack(r)];case 1:return i.sent(),this.applyEffects([]),[2,this.canvas]}})})},t}(rxe),wTt=function(e){return e instanceof U0e||e instanceof D0e?!0:e instanceof B$&&e.type!==QN&&e.type!==HN},bTt=function(e,t){switch(e){case 0:return VN(t);case 2:return rTt(t);case 1:default:return KN(t)}},CTt=function(e){switch(e){case 1:return"center";case 2:return"right";case 0:default:return"left"}},STt=["-apple-system","system-ui"],kTt=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter(function(t){return STt.indexOf(t)===-1}):e},_Tt=function(e){jc(t,e);function t(n,r){var i=e.call(this,n,r)||this;return i.canvas=r.canvas?r.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=r,i.canvas.width=Math.floor(r.width*r.scale),i.canvas.height=Math.floor(r.height*r.scale),i.canvas.style.width=r.width+"px",i.canvas.style.height=r.height+"px",i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-r.x,-r.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),i}return t.prototype.render=function(n){return pa(this,void 0,void 0,function(){var r,i;return Ks(this,function(s){switch(s.label){case 0:return r=nD(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,n),[4,jTt(r)];case 1:return i=s.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=Zi(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(i,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},t}(rxe),jTt=function(e){return new Promise(function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=n,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(e))})},BTt=function(){function e(t){var n=t.id,r=t.enabled;this.id=n,this.enabled=r,this.start=Date.now()}return e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.enabled&&(typeof window<"u"&&window.console&&typeof console.debug=="function"?console.debug.apply(console,mk([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.enabled&&typeof window<"u"&&window.console&&typeof console.info=="function"&&console.info.apply(console,mk([this.id,this.getTime()+"ms"],t))},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.enabled&&(typeof window<"u"&&window.console&&typeof console.warn=="function"?console.warn.apply(console,mk([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.enabled&&(typeof window<"u"&&window.console&&typeof console.error=="function"?console.error.apply(console,mk([this.id,this.getTime()+"ms"],t)):this.info.apply(this,t))},e.instances={},e}(),NTt=function(){function e(t,n){var r;this.windowBounds=n,this.instanceName="#"+e.instanceCount++,this.logger=new BTt({id:this.instanceName,enabled:t.logging}),this.cache=(r=t.cache)!==null&&r!==void 0?r:new G5t(this,t)}return e.instanceCount=1,e}(),ixe=function(e,t){return t===void 0&&(t={}),ETt(e,t)};typeof window<"u"&&X0e.setContext(window);var ETt=function(e,t){return pa(void 0,void 0,void 0,function(){var n,r,i,s,a,o,c,u,d,h,A,f,p,m,g,y,v,x,w,b,j,k,j,B,E,I,T,N,F,L,U,H,K,$,z,Q,oe,R,M,Y;return Ks(this,function(X){switch(X.label){case 0:if(!e||typeof e!="object")return[2,Promise.reject("Invalid element provided as first argument")];if(n=e.ownerDocument,!n)throw new Error("Element is not attached to a Document");if(r=n.defaultView,!r)throw new Error("Document is not attached to a Window");return i={allowTaint:(B=t.allowTaint)!==null&&B!==void 0?B:!1,imageTimeout:(E=t.imageTimeout)!==null&&E!==void 0?E:15e3,proxy:t.proxy,useCORS:(I=t.useCORS)!==null&&I!==void 0?I:!1},s=HR({logging:(T=t.logging)!==null&&T!==void 0?T:!0,cache:t.cache},i),a={windowWidth:(N=t.windowWidth)!==null&&N!==void 0?N:r.innerWidth,windowHeight:(F=t.windowHeight)!==null&&F!==void 0?F:r.innerHeight,scrollX:(L=t.scrollX)!==null&&L!==void 0?L:r.pageXOffset,scrollY:(U=t.scrollY)!==null&&U!==void 0?U:r.pageYOffset},o=new _d(a.scrollX,a.scrollY,a.windowWidth,a.windowHeight),c=new NTt(s,o),u=(H=t.foreignObjectRendering)!==null&&H!==void 0?H:!1,d={allowTaint:(K=t.allowTaint)!==null&&K!==void 0?K:!1,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:u,copyStyles:u},c.logger.debug("Starting document clone with size "+o.width+"x"+o.height+" scrolled to "+-o.left+","+-o.top),h=new vee(c,e,d),A=h.clonedReferenceElement,A?[4,h.toIFrame(n,o)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return f=X.sent(),p=N$(A)||P5t(A)?ljt(A.ownerDocument):yT(c,A),m=p.width,g=p.height,y=p.left,v=p.top,x=TTt(c,A,t.backgroundColor),w={canvas:t.canvas,backgroundColor:x,scale:(z=($=t.scale)!==null&&$!==void 0?$:r.devicePixelRatio)!==null&&z!==void 0?z:1,x:((Q=t.x)!==null&&Q!==void 0?Q:0)+y,y:((oe=t.y)!==null&&oe!==void 0?oe:0)+v,width:(R=t.width)!==null&&R!==void 0?R:Math.ceil(m),height:(M=t.height)!==null&&M!==void 0?M:Math.ceil(g)},u?(c.logger.debug("Document cloned, using foreign object rendering"),j=new _Tt(c,w),[4,j.render(A)]):[3,3];case 2:return b=X.sent(),[3,5];case 3:return c.logger.debug("Document cloned, element located at "+y+","+v+" with size "+m+"x"+g+" using computed rendering"),c.logger.debug("Starting DOM parsing"),k=$0e(c,A),x===k.styles.backgroundColor&&(k.styles.backgroundColor=hd.TRANSPARENT),c.logger.debug("Starting renderer for element at "+w.x+","+w.y+" with size "+w.width+"x"+w.height),j=new xTt(c,w),[4,j.render(k)];case 4:b=X.sent(),X.label=5;case 5:return(!((Y=t.removeContainer)!==null&&Y!==void 0)||Y)&&(vee.destroy(f)||c.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),c.logger.debug("Finished rendering"),[2,b]}})})},TTt=function(e,t,n){var r=t.ownerDocument,i=r.documentElement?ub(e,getComputedStyle(r.documentElement).backgroundColor):hd.TRANSPARENT,s=r.body?ub(e,getComputedStyle(r.body).backgroundColor):hd.TRANSPARENT,a=typeof n=="string"?ub(e,n):n===null?hd.TRANSPARENT:4294967295;return t===r.documentElement?Cf(i)?Cf(s)?a:s:i:a};const PTt=Object.freeze(Object.defineProperty({__proto__:null,default:ixe},Symbol.toStringTag,{value:"Module"}));function ITt({payload:e,targetId:t}){const[n,r]=C.useState(!1),[i,s]=C.useState(!1),a=async()=>{r(!0);try{const c=document.getElementById(t);if(!c)throw new Error("Report container not found");const u=await ixe(c,{scale:2,useCORS:!0,backgroundColor:"#ffffff",windowWidth:c.scrollWidth}),d=u.toDataURL("image/png"),h=new It({unit:"px",format:[u.width,u.height]});h.addImage(d,"PNG",0,0,u.width,u.height),h.save(`Holden_MarketPulse_${e.zip}_${new Date().toISOString().slice(0,10)}.pdf`)}catch(c){console.error(c),alert("Could not generate PDF. Try the HTML download instead.")}finally{r(!1)}},o=async()=>{s(!0);try{const{data:c,error:u}=await Me.functions.invoke("generate-market-pulse-html",{body:{payload:e}});if(u)throw u;const d=c==null?void 0:c.html;if(!d)throw new Error("No HTML returned");const h=new Blob([d],{type:"text/html"}),A=URL.createObjectURL(h),f=document.createElement("a");f.href=A,f.download=`Holden_MarketPulse_${e.zip}_${new Date().toISOString().slice(0,10)}.html`,f.click(),URL.revokeObjectURL(A)}catch(c){console.error(c),alert("Could not generate HTML. Please try again.")}finally{s(!1)}};return l.jsxs("div",{className:"flex flex-wrap gap-3",children:[l.jsxs("button",{onClick:a,disabled:n,className:"inline-flex items-center gap-2 px-4 py-2.5 bg-foreground text-background text-[11px] uppercase tracking-[0.2em] font-medium hover:opacity-90 disabled:opacity-50",children:[n?l.jsx(Ba,{size:14,className:"animate-spin"}):l.jsx(S2e,{size:14})," Download PDF"]}),l.jsxs("button",{onClick:o,disabled:i,className:"inline-flex items-center gap-2 px-4 py-2.5 border border-border text-foreground text-[11px] uppercase tracking-[0.2em] font-medium hover:bg-muted disabled:opacity-50",children:[i?l.jsx(Ba,{size:14,className:"animate-spin"}):l.jsx($p,{size:14})," Download HTML"]})]})}function OTt({role:e,content:t}){const n=e==="user";return l.jsx("div",{className:`flex ${n?"justify-end":"justify-start"}`,children:l.jsx("div",{className:`max-w-[85%] px-3.5 py-2.5 text-sm leading-relaxed ${n?"bg-primary text-primary-foreground":"bg-muted text-foreground"}`,children:n?l.jsx("p",{className:"whitespace-pre-wrap",children:t}):l.jsx("div",{className:"prose prose-sm max-w-none prose-p:my-1.5 prose-p:text-foreground prose-strong:text-foreground prose-ul:my-1.5 prose-ol:my-1.5 prose-li:my-0",children:l.jsx(q6,{children:t||"…"})})})})}function FTt({chips:e,onPick:t}){return l.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(n=>l.jsx("button",{onClick:()=>t(n),className:"text-[11px] px-3 py-1.5 bg-background border border-border text-foreground/80 hover:bg-muted transition-colors text-left",children:n},n))})}function MTt({zip:e,lens:t,onDismiss:n}){const[r,i]=C.useState(""),[s,a]=C.useState(""),[o,c]=C.useState(""),[u,d]=C.useState(!1),[h,A]=C.useState(!1),f=async()=>{if(!(!r||!o)){d(!0);try{await Me.functions.invoke("aeo-lead-capture",{body:{name:r,phone:s,email:o,question:`Market Pulse chat — ${t} lens for ${e}`,source_page:`/market-pulse/${e}?lens=${t}`}}),A(!0)}catch(p){console.error(p),alert("Something went wrong sending your info. Please text Holden directly at (616) 403-6393.")}finally{d(!1)}}};return h?l.jsx("div",{className:"bg-muted border border-border p-4 my-2",children:l.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[l.jsx(Fo,{size:16})," Thanks — Holden will reach out shortly."]})}):l.jsxs("div",{className:"bg-muted border border-border p-4 my-2 space-y-2",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground",children:"Want Holden to follow up personally?"}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsx("input",{value:r,onChange:p=>i(p.target.value),placeholder:"Name",className:"bg-background border border-border px-2.5 py-1.5 text-sm"}),l.jsx("input",{value:s,onChange:p=>a(p.target.value),placeholder:"Phone",className:"bg-background border border-border px-2.5 py-1.5 text-sm"})]}),l.jsx("input",{value:o,onChange:p=>c(p.target.value),placeholder:"Email",type:"email",className:"w-full bg-background border border-border px-2.5 py-1.5 text-sm"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("button",{onClick:f,disabled:u||!r||!o,className:"flex-1 inline-flex items-center justify-center gap-2 px-3 py-2 bg-primary text-primary-foreground text-[11px] uppercase tracking-[0.2em] font-medium disabled:opacity-50",children:[u?l.jsx(Ba,{size:14,className:"animate-spin"}):null," Send"]}),l.jsx("button",{onClick:n,className:"px-3 py-2 text-[11px] uppercase tracking-[0.2em] text-muted-foreground hover:text-foreground",children:"Dismiss"})]})]})}const LTt=/\b(tour|visit|see it|list|sell my|pre.?approval|preapproval|ready to buy|let.?s do|set up|book|schedule)\b/i;function RTt(e,t){const n=`mp_session_${e}_${t}`;let r=localStorage.getItem(n);return r||(r=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`,localStorage.setItem(n,r)),r}function DTt({payload:e,rates:t}){const[n,r]=C.useState(!1),[i,s]=C.useState([]),[a,o]=C.useState(""),[c,u]=C.useState(!1),[d,h]=C.useState(!1),[A,f]=C.useState(!1),p=C.useRef(null),m=RTt(e.zip,e.lens);C.useEffect(()=>{(async()=>{const{data:v}=await Me.from("market_pulse_chats").select("role, content").eq("session_id",m).eq("zip",e.zip).eq("lens",e.lens).order("created_at",{ascending:!0});v&&v.length&&s(v.map(x=>({role:x.role,content:x.content})))})()},[m,e.zip,e.lens]),C.useEffect(()=>{var v;(v=p.current)==null||v.scrollTo({top:p.current.scrollHeight,behavior:"smooth"})},[i,n]);const g=e.lens==="seller"?[`Why is ${e.zip} ${e.heat_index>=60?"a strong":"this kind of"} market right now?`,`What would my net be at $${Math.round(e.snapshot.median_sale_price/1e3)}k?`,`How does ${e.zip} compare to nearby zips?`,"Should I list now or wait until spring?"]:[`Is now a good time to buy in ${e.zip}?`,`What does a $${Math.round(e.snapshot.median_sale_price/1e3)}k home cost monthly?`,`Where can I find more inventory near ${e.zip}?`,"What should my offer strategy be here?"];async function y(v){var B,E,I;const x=v.trim();if(!x||c)return;o("");const w={role:"user",content:x},b=[...i,w,{role:"assistant",content:""}];s(b),u(!0),Me.from("market_pulse_chats").insert({session_id:m,zip:e.zip,lens:e.lens,role:"user",content:x}).then(()=>{});const k=b.filter(T=>T.role==="user").length;!A&&(LTt.test(x)||k>0&&k%4===0)&&h(!0);let j="";try{const N=await fetch("https://khmmwvmdbhaplcfcndjx.supabase.co/functions/v1/market-pulse-chat",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImtobW13dm1kYmhhcGxjZmNuZGp4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzcwNTQ1MDcsImV4cCI6MjA5MjYzMDUwN30.c5aUVQ4shbnMOIIkDZRP7geMUb64HPKYg4jQFuBH52Q"},body:JSON.stringify({payload:e,rates:t,messages:[...i,w].map(K=>({role:K.role,content:K.content}))})});if(N.status===429)throw new Error("Too many requests — please wait a moment and try again.");if(N.status===402)throw new Error("AI credits exhausted. Please contact Holden directly.");if(!N.ok||!N.body)throw new Error(`Chat failed (${N.status})`);const F=N.body.getReader(),L=new TextDecoder;let U="",H=!1;for(;!H;){const{done:K,value:$}=await F.read();if(K)break;U+=L.decode($,{stream:!0});let z;for(;(z=U.indexOf(`
`))!==-1;){let Q=U.slice(0,z);if(U=U.slice(z+1),Q.endsWith("\r")&&(Q=Q.slice(0,-1)),!Q.startsWith("data: "))continue;const oe=Q.slice(6).trim();if(oe==="[DONE]"){H=!0;break}try{const M=(I=(E=(B=JSON.parse(oe).choices)==null?void 0:B[0])==null?void 0:E.delta)==null?void 0:I.content;M&&(j+=M,s(Y=>{const X=[...Y];return X[X.length-1]={role:"assistant",content:j},X}))}catch{U=Q+`
`+U;break}}}}catch(T){j=`_${T.message||"Sorry — something went wrong. Please try again."}_`,s(N=>{const F=[...N];return F[F.length-1]={role:"assistant",content:j},F})}finally{u(!1),j&&Me.from("market_pulse_chats").insert({session_id:m,zip:e.zip,lens:e.lens,role:"assistant",content:j}).then(()=>{})}}return l.jsxs(l.Fragment,{children:[!n&&l.jsxs("button",{onClick:()=>r(!0),className:"fixed bottom-20 right-4 md:bottom-24 md:right-6 z-50 inline-flex items-center gap-2 px-4 py-3 bg-primary text-primary-foreground shadow-2xl hover:bg-primary/90","aria-label":"Ask Holden's AI about this report",children:[l.jsx(ad,{size:16}),l.jsxs("span",{className:"text-[11px] uppercase tracking-[0.2em] font-medium",children:["Ask About ",e.zip]})]}),n&&l.jsxs("div",{className:"fixed inset-x-0 bottom-0 md:inset-auto md:bottom-20 md:right-6 z-50 md:w-[400px] md:h-[560px] bg-card border border-border shadow-2xl flex flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-primary text-primary-foreground",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] uppercase tracking-[0.25em] opacity-80",children:"Ask Holden's AI"}),l.jsxs("div",{className:"text-sm font-semibold",children:["About ",e.zip," · ",e.area]})]}),l.jsx("button",{onClick:()=>r(!1),className:"p-1 hover:opacity-80","aria-label":"Close chat",children:l.jsx(ta,{size:18})})]}),l.jsxs("div",{ref:p,className:"flex-1 overflow-y-auto p-4 space-y-3",children:[i.length===0&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"text-sm text-muted-foreground",children:["Hey — I'm Holden's AI. Ask me anything about this report and I'll answer with what I'm seeing in ",e.zip,"."]}),l.jsx(FTt,{chips:g,onPick:y})]}),i.map((v,x)=>l.jsx(OTt,{role:v.role,content:v.content},x)),d&&!A&&l.jsx(MTt,{zip:e.zip,lens:e.lens,onDismiss:()=>{h(!1),f(!0)}})]}),l.jsxs("form",{onSubmit:v=>{v.preventDefault(),y(a)},className:"border-t border-border p-3 flex items-center gap-2",children:[l.jsx("input",{value:a,onChange:v=>o(v.target.value),placeholder:`Ask about ${e.zip}…`,className:"flex-1 bg-background border border-border px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary",disabled:c}),l.jsx("button",{type:"submit",disabled:c||!a.trim(),className:"inline-flex items-center justify-center w-9 h-9 bg-primary text-primary-foreground disabled:opacity-50","aria-label":"Send",children:c?l.jsx(Ba,{size:14,className:"animate-spin"}):l.jsx(Mre,{size:14})})]}),l.jsx("div",{className:"px-3 pb-2 text-[9px] uppercase tracking-[0.2em] text-muted-foreground/60 text-center",children:"AI assistant · Not a contractual response"})]})]})}function UTt(){var v,x;const{zip:e=""}=mm(),[t]=Yie(),n=t.get("lens")==="buyer"?"buyer":"seller",r=t.get("run")==="1",i=t.get("t")||"",[s,a]=C.useState(null),[o,c]=C.useState(null),[u,d]=C.useState(!1),[h,A]=C.useState(null),[f,p]=C.useState(!1),m=soe(e),g=m?((v=O4e(e))==null?void 0:v.city)||"Grand Rapids area":"",y=async()=>{if(!m){A("Invalid ZIP code");return}p(!0),d(!0),A(null),a(null);try{Me.functions.invoke("market-pulse-rates",{body:{}}).catch(()=>{});const{data:w,error:b}=await Me.functions.invoke("market-pulse-report",{body:{zip:e,lens:n}});if(b)throw new Error(b.message);if(w!=null&&w.error)throw new Error(w.error);const k=w==null?void 0:w.payload;if(!k)throw new Error("No report returned");a(k);const{data:j}=await Me.from("market_pulse_rates").select("rates, source, fetched_at").order("fetched_at",{ascending:!1}).limit(1).maybeSingle();j&&c({rates:j.rates,source:j.source,fetched_at:j.fetched_at})}catch(w){A(w.message||"Failed to generate report")}finally{d(!1)}};return C.useEffect(()=>{r&&m&&y()},[e,n,i,r]),l.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[l.jsxs(Ln,{children:[l.jsx("title",{children:`Market Pulse · ZIP ${e} · ${n==="seller"?"Seller":"Buyer"} Report · HoldenGR`}),l.jsx("meta",{name:"description",content:`Live market report for ZIP ${e} from Grand Rapids REALTOR® Holden Richardson. Heat index, price trends, mortgage rates, MI net sheet calculator, and personal AI chat.`}),l.jsx("link",{rel:"canonical",href:`https://www.holdengr.com/market-pulse/${e}`}),l.jsx("meta",{property:"og:title",content:`Market Pulse · ZIP ${e} · ${n==="seller"?"Seller":"Buyer"} Report`}),l.jsx("meta",{property:"og:description",content:`Live market report for ZIP ${e} from Grand Rapids REALTOR® Holden Richardson — heat index, price trends, rates, and AI chat.`}),l.jsx("meta",{property:"og:url",content:`https://www.holdengr.com/market-pulse/${e}`}),l.jsx("meta",{property:"og:type",content:"article"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:`Market Pulse · ZIP ${e}`}),l.jsx("meta",{name:"twitter:description",content:`Live ${e} Grand Rapids market report from Holden Richardson.`}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx(IE,{}),l.jsx("main",{className:"flex-1 pt-20 pb-24",children:l.jsxs("div",{className:"container-page",children:[l.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4 py-6 border-b border-border",children:[l.jsxs("div",{children:[l.jsxs(At,{to:"/",className:"inline-flex items-center gap-1 text-[10px] uppercase tracking-[0.25em] text-muted-foreground hover:text-foreground",children:[l.jsx(pm,{size:12})," Home"]}),l.jsxs("h1",{className:"text-3xl md:text-4xl font-bold mt-2",children:["Market Pulse · ZIP ",e]}),l.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[n==="seller"?"Seller report":"Buyer report"," · ",s?`${s.city} — ${s.area}`:g]})]}),l.jsx("div",{className:"w-full md:w-auto md:max-w-sm",children:l.jsx(v6,{compact:!0})})]}),!f&&!u&&!s&&!h&&l.jsxs("div",{className:"py-10 md:py-14 space-y-12",children:[l.jsxs("div",{className:"bg-card border border-border p-6 md:p-10 text-center max-w-3xl mx-auto",children:[l.jsxs("div",{className:"inline-flex items-center gap-2 mb-4 px-3 py-1 bg-primary/10 text-primary text-[10px] uppercase tracking-[0.25em] font-medium",children:[l.jsx(sj,{size:12})," Live Report Ready"]}),l.jsxs("h2",{className:"text-2xl md:text-3xl font-bold mb-3",children:["Generate your ",n==="seller"?"seller":"buyer"," report for ZIP ",e]}),l.jsxs("p",{className:"text-sm md:text-base text-foreground/75 max-w-xl mx-auto mb-6 leading-relaxed",children:["I'll research ",l.jsx("span",{className:"font-medium text-foreground",children:g})," live — pulling current price trends, days on market, today's mortgage rates, and Michigan-specific closing costs. Takes about 20–40 seconds."]}),l.jsxs("button",{onClick:y,disabled:!m,className:"inline-flex items-center gap-2 px-6 py-3 bg-primary text-primary-foreground text-[11px] uppercase tracking-[0.25em] font-medium hover:bg-primary/90 transition-colors disabled:opacity-40",children:[l.jsx(Ts,{size:14})," Run Report"]}),l.jsx("p",{className:"text-[10px] text-muted-foreground mt-4",children:"Free · No login · You can switch ZIP or buyer/seller anytime"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"text-center mb-6",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-[0.3em] text-primary font-semibold mb-2",children:"What's Inside"}),l.jsx("h3",{className:"text-xl md:text-2xl font-bold",children:"A snapshot of what you'll get"})]}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:[{icon:Nre,title:"Heat Index",body:"0–100 score telling you if this ZIP is a seller's, balanced, or buyer's market right now."},{icon:kre,title:"Price & Velocity Trends",body:"24 months of median price + 12 months of days-on-market and list-to-sale ratio."},{icon:sj,title:"Today's Mortgage Rates",body:"Live 30-yr, 15-yr, FHA, VA, and 7/1 ARM rates from FRED + Mortgage News Daily."},{icon:Cre,title:n==="seller"?"MI Net Sheet":"PITI Calculator",body:n==="seller"?"Michigan transfer tax + Kent County + tiered title — see your net proceeds at the median price.":"Principal, interest, taxes, insurance, and auto-tiered PMI for the median home."},{icon:ad,title:"Chat With The Report",body:"Ask follow-up questions like 'what about ZIP 49503?' or 'should I list in March?' — context stays."},{icon:Bre,title:"PDF + Standalone HTML",body:"Download the full report to share with your spouse, lender, or just keep for reference."}].map(({icon:w,title:b,body:k})=>l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsx(w,{size:18,className:"text-primary mb-3"}),l.jsx("div",{className:"text-sm font-semibold mb-1.5",children:b}),l.jsx("div",{className:"text-xs text-foreground/70 leading-relaxed",children:k})]},b))})]}),l.jsxs("div",{className:"bg-muted/30 border border-border p-6 md:p-8",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground mb-3",children:"Sample · Holden's Take"}),l.jsx("p",{className:"text-base md:text-lg leading-snug font-medium mb-4 italic text-foreground/85",children:`"Heritage Hill is still firmly a seller's market — homes are moving in 14 days at 99% of list, but new listings ticked up 18% this month. If you're selling, list before May. If you're buying, watch for price reductions on anything sitting over 21 days."`}),l.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mt-5",children:[{l:"Median Price",v:"$385K",s:"+6.2% YoY"},{l:"Days on Market",v:"14",s:"vs 21 last yr"},{l:"List-to-Sale",v:"99.2%",s:"Strong"},{l:"Heat Index",v:"78/100",s:"Seller's market"}].map(({l:w,v:b,s:k})=>l.jsxs("div",{className:"bg-background border border-border p-3",children:[l.jsx("div",{className:"text-[9px] uppercase tracking-[0.2em] text-muted-foreground mb-1",children:w}),l.jsx("div",{className:"text-lg font-bold tabular-nums",children:b}),l.jsx("div",{className:"text-[10px] text-foreground/60",children:k})]},w))}),l.jsxs("p",{className:"text-[10px] text-muted-foreground/70 mt-4",children:["Sample only · Your report uses live data for ZIP ",e]})]})]}),u&&l.jsxs("div",{className:"py-24 flex flex-col items-center text-center",children:[l.jsx(Ba,{size:32,className:"animate-spin text-primary mb-4"}),l.jsxs("p",{className:"text-sm text-muted-foreground max-w-md",children:["Researching ",e," live — gathering market data, mortgage rates, and Holden's take. This takes 20–40 seconds for fresh reports."]})]}),h&&!u&&l.jsxs("div",{className:"py-16 max-w-md mx-auto text-center",children:[l.jsx(x2e,{size:32,className:"text-destructive mx-auto mb-3"}),l.jsx("p",{className:"text-sm text-foreground/80 mb-4",children:h}),l.jsx("button",{onClick:y,className:"inline-flex items-center gap-2 px-4 py-2 bg-primary text-primary-foreground text-[11px] uppercase tracking-[0.2em]",children:"Try Again"})]}),s&&!u&&l.jsxs("div",{id:"market-pulse-report",className:"py-8 space-y-8",children:[l.jsxs("div",{className:"bg-primary text-primary-foreground p-5 md:p-6",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-[0.25em] opacity-70 mb-1",children:"Holden's Take"}),l.jsx("p",{className:"text-lg md:text-xl leading-snug",children:s.holdens_take})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[l.jsx("div",{className:"lg:col-span-1",children:l.jsx(H2t,{value:s.heat_index,label:s.heat_label,lens:n})}),l.jsx("div",{className:"lg:col-span-2",children:l.jsx(z2t,{snapshot:s.snapshot,lens:n})})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[l.jsx(V2t,{data:s.price_trend_24mo}),l.jsx(K2t,{data:s.velocity_trend_12mo})]}),l.jsx(q2t,{percentile:s.metro_score_percentile,comps:s.metro_comps,zip:s.zip}),l.jsxs("div",{className:"bg-card border border-border p-6",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-2",children:n==="seller"?"Sell Now or Wait?":"Buy Now or Wait?"}),l.jsx("p",{className:"text-lg font-semibold mb-2",children:s.now_or_wait.verdict}),l.jsx("p",{className:"text-sm text-foreground/80 leading-relaxed",children:s.now_or_wait.reasoning})]}),l.jsx(J2t,{md:s.writeup_md,area:s.area}),l.jsx(W2t,{}),n==="seller"?l.jsx(Y2t,{defaultPrice:s.snapshot.median_sale_price}):l.jsx(X2t,{defaultPrice:s.snapshot.median_sale_price}),l.jsx(tCt,{lens:n}),((x=s.sources)==null?void 0:x.length)>0&&l.jsxs("div",{className:"bg-card border border-border p-5",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-3",children:"Sources"}),l.jsx("ul",{className:"space-y-1.5 text-sm",children:s.sources.map((w,b)=>l.jsx("li",{children:l.jsx("a",{href:w.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:w.title})},b))}),l.jsx("p",{className:"text-[10px] text-muted-foreground/70 mt-3",children:"AI-researched · Not MLS-verified · Confirm with your agent before decisions."})]}),l.jsxs("div",{className:"bg-muted/30 border border-border p-5",children:[l.jsx("h3",{className:"text-[10px] uppercase tracking-[0.25em] text-muted-foreground font-medium mb-3",children:"Take This Report With You"}),l.jsx(ITt,{payload:s,targetId:"market-pulse-report"})]})]})]})}),s&&l.jsx(nCt,{}),s&&l.jsx(DTt,{payload:s,rates:o}),l.jsx(y6,{})]})}const HTt=[{icon:Nre,title:"Heat Index",desc:"Instant read on whether your ZIP is a buyer's, seller's, or balanced market."},{icon:kre,title:"Price & Velocity Trends",desc:"12-month median price and days-on-market charts pulled live."},{icon:sj,title:"Live Mortgage Rates",desc:"Today's 30-yr, 15-yr, and FHA rates refreshed daily."},{icon:Cre,title:"Net Sheet & PITI Calculators",desc:"Michigan-accurate seller proceeds and buyer payment math."},{icon:ad,title:"AI Chat with Holden's Take",desc:"Ask questions about your ZIP and get answers grounded in the report."},{icon:Bre,title:"Downloadable Report",desc:"Save or share a clean PDF of your full market snapshot."}];function QTt(){return l.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[l.jsxs(Ln,{children:[l.jsx("title",{children:"Market Pulse · Live Grand Rapids ZIP Reports · HoldenGR"}),l.jsx("meta",{name:"description",content:"Get a live, ZIP-specific Grand Rapids real estate market report. Heat index, price trends, mortgage rates, Michigan net sheet, and AI chat — free, no login."}),l.jsx("link",{rel:"canonical",href:"https://www.holdengr.com/market-pulse"}),l.jsx("meta",{property:"og:title",content:"Market Pulse · Live Grand Rapids ZIP Reports"}),l.jsx("meta",{property:"og:description",content:"Get a live, ZIP-specific Grand Rapids real estate market report. Heat index, price trends, mortgage rates, Michigan net sheet, and AI chat — free, no login."}),l.jsx("meta",{property:"og:url",content:"https://www.holdengr.com/market-pulse"}),l.jsx("meta",{property:"og:type",content:"website"}),l.jsx("meta",{property:"og:image",content:"https://www.holdengr.com/og-image-1200x630.png"}),l.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),l.jsx("meta",{name:"twitter:title",content:"Market Pulse · Live Grand Rapids ZIP Reports"}),l.jsx("meta",{name:"twitter:description",content:"Get a live, ZIP-specific Grand Rapids real estate market report — heat index, price trends, rates, and AI chat."}),l.jsx("meta",{name:"twitter:image",content:"https://www.holdengr.com/og-image-1200x630.png"})]}),l.jsx(IE,{}),l.jsxs("main",{className:"flex-1 pt-20",children:[l.jsx("section",{className:"border-b border-border bg-muted/30",children:l.jsx("div",{className:"container-page py-16 md:py-24",children:l.jsxs("div",{className:"grid md:grid-cols-2 gap-12 items-center",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(Ts,{size:14,className:"text-primary"}),l.jsx("span",{className:"text-[10px] uppercase tracking-[0.3em] font-semibold text-primary",children:"Market Pulse"})]}),l.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-semibold tracking-tight mb-6",children:"Your ZIP. My take. Real numbers."}),l.jsx("p",{className:"text-lg text-foreground/70 mb-8 max-w-xl",children:"Drop your Grand Rapids ZIP and get an instant market report — heat index, price trends, live mortgage rates, a Michigan-accurate net sheet, and an AI chat that answers questions about your specific neighborhood."}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Free · No login · Built and personally tuned by Holden Richardson, REALTOR®"})]}),l.jsx("div",{children:l.jsx(v6,{})})]})})}),l.jsxs("section",{className:"container-page py-16 md:py-24",children:[l.jsxs("div",{className:"max-w-2xl mb-12",children:[l.jsx("h2",{className:"text-2xl md:text-3xl font-semibold tracking-tight mb-3",children:"What you get"}),l.jsx("p",{className:"text-foreground/70",children:"Every Market Pulse report pulls live data for your specific ZIP, then layers Holden's local context on top so the numbers actually mean something."})]}),l.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-6",children:HTt.map(({icon:e,title:t,desc:n})=>l.jsxs("div",{className:"border border-border p-6 bg-background hover:border-primary/40 transition-colors",children:[l.jsx(e,{size:20,className:"text-primary mb-4"}),l.jsx("h3",{className:"font-semibold mb-2",children:t}),l.jsx("p",{className:"text-sm text-foreground/70",children:n})]},t))})]}),l.jsx("section",{className:"border-t border-border bg-muted/30",children:l.jsx("div",{className:"container-page py-16 md:pt-20 md:pb-28",children:l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-[0.3em] font-semibold text-foreground/60 mr-2",children:"Popular ZIPs"}),[{zip:"49506",label:"East Grand Rapids / Eastown"},{zip:"49503",label:"Heritage Hill / Downtown"},{zip:"49504",label:"West Side"},{zip:"49505",label:"Creston / NE GR"},{zip:"49508",label:"Alger Heights"},{zip:"49546",label:"Forest Hills / Cascade"}].map(e=>l.jsxs("a",{href:`/market-pulse/${e.zip}?run=1`,className:"inline-flex items-center gap-2 px-3 py-1.5 border border-border bg-background text-xs hover:border-primary/40 hover:text-primary transition-colors",children:[l.jsx("span",{className:"tabular-nums font-semibold",children:e.zip}),l.jsxs("span",{className:"text-foreground/60",children:["· ",e.label]})]},e.zip))]})})})]}),l.jsx(y6,{})]})}const sxe=Object.assign({"../pages/groovy.html":()=>C_(()=>import("./groovy-C3QU58Km.js"),[]).then(e=>e.default)});function $Tt(e){const t=`../pages/${e}.html`;return Object.prototype.hasOwnProperty.call(sxe,t)?t:null}function zTt({slug:e}={}){const{slug:t}=mm(),n=e??t??null,[r,i]=C.useState(null),[s,a]=C.useState(!1);if(C.useEffect(()=>{if(!n){a(!0);return}const u=$Tt(n);if(!u){a(!0);return}const d=sxe[u];d().then(i).catch(()=>a(!0))},[n]),s||!n)return l.jsx(SE,{to:"/",replace:!0});if(r===null)return l.jsx("div",{className:"p-8 text-center",children:"Loading…"});const o=r.match(/<body[^>]*>([\s\S]*)<\/body>/i),c=o?o[1].trim():r;return l.jsx("div",{className:"migration-page-contents",dangerouslySetInnerHTML:{__html:c}})}const VTt=l.jsx(l.Fragment,{children:l.jsx(Nt,{path:"groovy",element:l.jsx(zTt,{slug:"groovy"})})}),KTt=new h_e,qTt=()=>{const e=ro();return C.useEffect(()=>{iBe()},[e.pathname]),null},WTt=()=>{const t=ro().pathname.replace(/^\/about\/news\//,"");return l.jsx(SE,{to:`/news/${t}`,replace:!0})},GTt=()=>l.jsx(rse,{children:l.jsx(g_e,{client:KTt,children:l.jsxs(jU,{children:[l.jsx(ICe,{}),l.jsx(dSe,{}),l.jsxs(kje,{children:[l.jsx(sBe,{}),l.jsx(qTt,{}),l.jsxs(gje,{children:[l.jsx(Nt,{path:"/",element:l.jsx(pOe,{})}),l.jsx(Nt,{path:"/properties",element:l.jsx(DOe,{})}),l.jsx(Nt,{path:"/properties/:id",element:l.jsx(UOe,{})}),l.jsx(Nt,{path:"/about",element:l.jsx(qOe,{})}),l.jsx(Nt,{path:"/about/testimonials",element:l.jsx(ZOe,{})}),l.jsx(Nt,{path:"/about/news",element:l.jsx(SE,{to:"/news",replace:!0})}),l.jsx(Nt,{path:"/about/news/:slug",element:l.jsx(WTt,{})}),l.jsx(Nt,{path:"/about/:slug",element:l.jsx(b_,{})}),l.jsx(Nt,{path:"/contact",element:l.jsx(s3e,{})}),l.jsx(Nt,{path:"/home-valuation",element:l.jsx(o3e,{})}),l.jsx(Nt,{path:"/idx",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/idx/:a",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/idx/:a/:b",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/idx/:a/:b/:c",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/idx/:a/:b/:c/:d",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/idx/*",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/client",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/client/:a",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/client/:a/:b",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/client/:a/:b/:c",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/client/:a/:b/:c/:d",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/r",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/r/:a",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/r/:a/:b",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/r/:a/:b/:c",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/search",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/search/:a",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/search/:a/:b",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/search/:a/:b/:c",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/preview-property",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/preview-property/:a",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/preview-property/:a/:b",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/magic-redirect",element:l.jsx(Ur,{})}),l.jsx(Nt,{path:"/auth",element:l.jsx(m3e,{})}),l.jsx(Nt,{path:"/blog",element:l.jsx(b3e,{})}),l.jsx(Nt,{path:"/blog/:slug",element:l.jsx(C3e,{})}),l.jsx(Nt,{path:"/faq",element:l.jsx(j6e,{})}),l.jsx(Nt,{path:"/news",element:l.jsx(N6e,{})}),l.jsx(Nt,{path:"/news/:slug",element:l.jsx(b_,{})}),l.jsx(Nt,{path:"/admin",element:l.jsx(D1t,{})}),l.jsx(Nt,{path:"/admin/blog",element:l.jsx(Qqe,{})}),l.jsx(Nt,{path:"/admin/profile",element:l.jsx($qe,{})}),l.jsx(Nt,{path:"/admin/aeo",element:l.jsx(f1t,{})}),l.jsx(Nt,{path:"/admin/list",element:l.jsx(E1t,{})}),l.jsx(Nt,{path:"/list",element:l.jsx(r2t,{})}),l.jsx(Nt,{path:"/list/benefits",element:l.jsx(l2t,{})}),l.jsx(Nt,{path:"/list/new-intent",element:l.jsx(c2t,{})}),l.jsx(Nt,{path:"/savings-program",element:l.jsx(JX,{})}),l.jsx(Nt,{path:"/1-percent",element:l.jsx(JX,{})}),l.jsx(Nt,{path:"/reset-password",element:l.jsx(B2t,{})}),l.jsx(Nt,{path:"/privacy-policy",element:l.jsx(N2t,{})}),l.jsx(Nt,{path:"/terms-of-service",element:l.jsx(E2t,{})}),l.jsx(Nt,{path:"/accessibility",element:l.jsx(T2t,{})}),l.jsx(Nt,{path:"/market-pulse",element:l.jsx(QTt,{})}),l.jsx(Nt,{path:"/market-pulse/:zip",element:l.jsx(UTt,{})}),VTt,l.jsx(Nt,{path:"/:category",element:l.jsx(zye,{})}),l.jsx(Nt,{path:"/:category/:slug",element:l.jsx(U2t,{})}),l.jsx(Nt,{path:"/:category/:subcategory/:slug",element:l.jsx(b_,{})}),l.jsx(Nt,{path:"*",element:l.jsx(P2t,{})})]})]})]})})});Kne(document.getElementById("root")).render(l.jsx(GTt,{}));export{Dh as c,In as g};